Browse Source

cdb: Display list formatting in "minor text" color. Always display sub-tables content in cells

trethaller 4 years ago
parent
commit
1f38533582
3 changed files with 15 additions and 11 deletions
  1. 3 0
      bin/cdb.css
  2. 4 0
      bin/cdb.less
  3. 8 11
      hide/comp/cdb/Cell.hx

+ 3 - 0
bin/cdb.css

@@ -289,6 +289,9 @@
 .cdb .cdb-sheet span.error {
   color: #C44;
 }
+.cdb .cdb-sheet span.minor {
+  color: #666;
+}
 .cdb .cdb-sheet tr.props {
   background-color: #111;
 }

+ 4 - 0
bin/cdb.less

@@ -323,6 +323,10 @@
 			color : #C44;
 		}
 
+		span.minor {
+			color: #666;
+		}
+
 		tr.props {
 			background-color: #111;
 			&> td {

+ 8 - 11
hide/comp/cdb/Cell.hx

@@ -262,17 +262,14 @@ class Cell extends Component {
 			scope.push({ s : sheet, obj : obj });
 			for( v in a ) {
 				var vals = [];
-				for( c in ps.columns )
-					switch( c.type ) {
-					case TList, TProperties if( c != ps.columns[0] ):
-						continue;
-					default:
-						if( !canViewSubColumn(ps, c.name) ) continue;
-						var h = valueHtml(c, Reflect.field(v, c.name), ps, v, scope);
-						if( h != "" && h != " " )
-							vals.push(h);
-					}
-				var v = vals.length == 1 ? vals[0] : ""+vals;
+				for( c in ps.columns ) {
+					if( !canViewSubColumn(ps, c.name) ) continue;
+					var h = valueHtml(c, Reflect.field(v, c.name), ps, v, scope);
+					if( h != "" && h != " " )
+						vals.push(h);
+				}
+				inline function char(s) return '<span class="minor">$s</span>';
+				var v = vals.length == 1 ? vals[0] : (char('[') + vals.join(char(',')) + char(']'));
 				if( size > 200 ) {
 					out.push("...");
 					break;