 
 PRIVATE>
 
-: (selected-rows) ( table -- {row} )
-    [ selected-indices>> keys natural-sort ] keep
-    '[ _ nth-row [ 1array ] [ drop { } ] if ] map concat ;
-
-: selected-rows ( table -- {value} )
-    [ (selected-rows) ] [ renderer>> ] bi '[ _ row-value ] map ;
+: (selected-rows) ( table -- assoc )
+    [ selected-indices>> ] keep
+    '[ _ nth-row drop ] assoc-map ;
+
+: selected-rows ( table -- assoc )
+    [ selected-indices>> ] [ ] [ renderer>> ] tri
+    '[ _ nth-row drop _ row-value ] assoc-map ;
 
 : (selected-row) ( table -- value/f ? ) (selected-rows) multiple>single ;
 


: (update-selected-indices) ( table -- set )
    [ selection>> value>> dup array? [ 1array ] unless ] keep
    [ find-row-index ] curry map sift unique f like ;

: initial-selected-indices ( table -- set )
    {

    over selected-indices>> conjoin ;

: multiple>single ( values -- value/f ? )
    dup assoc-empty? [ drop f f ] [ values first t ] if ;

: selected-index ( table -- n )
    selected-indices>> multiple>single drop ;
