From f654dd25886d5ae75ea2827bcf00cbcbb2fc723b Mon Sep 17 00:00:00 2001 From: Stephanie Leary Date: Tue, 14 Mar 2023 21:09:45 +0000 Subject: [PATCH] Fix and Signed-off-by: Stephanie Leary --- .../src/app/share/grid/grid-header.component.html | 42 +++---- .../src/eg2/src/app/share/grid/grid.component.css | 138 +++++++++++++++------ .../src/eg2/src/app/share/grid/grid.component.html | 41 +++--- 3 files changed, 139 insertions(+), 82 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-header.component.html b/Open-ILS/src/eg2/src/app/share/grid/grid-header.component.html index 982104933d..a5f8c3b196 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-header.component.html +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-header.component.html @@ -1,65 +1,53 @@ - - - - - - - - - - + - + - + # notifications - + class="eg-grid-cell eg-grid-header-cell eg-grid-col-{{col.name}} eg-grid-type-{{col.datatype}} eg-grid-class-{{context.idlClass}} {{context.cellClassCallback(row, col)}}"> {{col.headerLabel}} +
+ - +
- + - + + class="eg-grid-cell eg-grid-header-cell {{context.idlFieldDef}} eg-grid-class-{{context.idlClass}}"> + class="eg-grid-cell eg-grid-filter-control-cell eg-grid-col-{{col.name}} eg-grid-type-{{col.datatype}} eg-grid-class-{{context.idlClass}}"> diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.component.css b/Open-ILS/src/eg2/src/app/share/grid/grid.component.css index 33239d44b5..a0a664b994 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.component.css +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.component.css @@ -1,7 +1,9 @@ .eg-grid { width: 100%; - color: rgba(0,0,0,.87); + color: rgba(0,0,0,.87); + table-layout: auto; + white-space: normal; } .eg-grid-row { @@ -31,16 +33,6 @@ border-color: #b8daff; } -.eg-grid-cell { - padding: 6px 1rem 6px 2px; - /* - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - /**/ - vertical-align: top; -} - /* allow tooltips to be wider than the default 200px */ .eg-grid-cell .tooltip-inner { max-width: 400px; @@ -64,6 +56,10 @@ white-space: normal; } +.eg-grid-header-cell[draggable=true] { + cursor: grab; +} + .eg-grid-header-cell.dragover { background-color: #cce5ff; border-color: #b8daff; @@ -98,34 +94,6 @@ padding-bottom: 11px; } -.eg-grid-cell-skinny { - width: 2em; - text-align: center; - flex: none; -} - -.eg-grid-cell-skinny-2 { - width: 2.6em; - flex: none; -} - -.eg-grid-flair-cell { - /* mat icons currently 22px, unclear why it needs this much space */ - width: 34px; - text-align: center; - flex: none; -} - -/* depends on width of .eg-grid-cell-skinny */ -.eg-grid-column-width-header { - width: 4.6em; - text-align: center; - flex: none; - display: inline-flex; - vertical-align: middle; - align-items: center; -} - .eg-grid-column-width-config .eg-grid-cell { border-left: 2px dashed grey; } @@ -177,3 +145,95 @@ .popover { max-width: initial; } + +/* GRID COLUMN WIDTHS */ +/* +Sets up column widths and text alignment for eg-grid tables according to +datatype, column name, and IDL class. Use more specific combinations in +components' CSS to override the default width. +/**/ + +/* override Bootstrap's table settings */ +.table > :not(caption) > * > * { + padding: revert; +} + +.eg-grid th, +.eg-grid td { + padding: .2rem .5rem; + /* + width: min-content; + /**/ +} + +.eg-grid.compact th, +.eg-grid.compact td { + line-height: 1.4; + padding: .1rem .5rem .1rem .1rem; +} + +.eg-grid.wide th, +.eg-grid.wide td { + padding: .5rem; +} + +.eg-grid th { + vertical-align: bottom; +} + +.eg-grid td { + vertical-align: top; + /* + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + /**/ +} + +.eg-grid-col-utilities col { + min-width: 2em; + max-width: 8ch; +} + +.eg-grid-checkbox-cell, +.eg-grid-flair-cell { + text-align: center; +} + +.eg-grid-number-cell, +.eg-grid-type-id, +.eg-grid-type-number, +.eg-grid-type-money { + font-variant-numeric: tabular-nums lining-nums; + text-align: right; +} + +.compact .eg-grid-type-id, +.compact .eg-grid-type-number, +.compact .eg-grid-type-money { + padding: .1rem .25rem .1rem .4rem; +} + +.eg-grid-col-name { + min-width: 10ch; + white-space: nowrap; + /* use with before periods: */ + /* + overflow-wrap: break-word; + word-wrap: break-word; + -ms-word-break: break-all; + word-break: break-all; + word-break: break-word; + /**/ +} + +.eg-grid-col-description, +.eg-grid-col-label { + min-width: 20ch; +} + +/* only, not the headers */ +td.eg-grid-col-datatype { + font-family: monospace; + font-size: .85rem; +} \ No newline at end of file diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.component.html b/Open-ILS/src/eg2/src/app/share/grid/grid.component.html index d91110890b..a24c15457e 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.component.html +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.component.html @@ -10,31 +10,40 @@ - - - +
+ - + -
+
-
- Error Retrieving Results -
-
- Nothing to Display -
+
+ - - - - + + + + + + + + + + + + +
- + + Error Retrieving Results + + Nothing to Display +
\ No newline at end of file -- 2.11.0