File tree Expand file tree Collapse file tree 1 file changed +1
-31
lines changed Expand file tree Collapse file tree 1 file changed +1
-31
lines changed Original file line number Diff line number Diff line change @@ -57,37 +57,7 @@ public function __construct(
57
57
*/
58
58
public function getRows (MenuStyle $ style , bool $ selected = false ) : array
59
59
{
60
- $ marker = sprintf ("%s " , $ this ->style ->getMarker ($ this , $ selected ));
61
-
62
- $ length = $ this ->style ->getDisplaysExtra ()
63
- ? $ style ->getContentWidth () - (mb_strlen ($ this ->style ->getItemExtra ()) + 2 )
64
- : $ style ->getContentWidth ();
65
-
66
- $ rows = explode (
67
- "\n" ,
68
- StringUtil::wordwrap (
69
- sprintf ('%s%s ' , $ marker , $ this ->text ),
70
- $ length ,
71
- sprintf ("\n%s " , str_repeat (' ' , mb_strlen ($ marker )))
72
- )
73
- );
74
-
75
- return mapWithKeys ($ rows , function (int $ key , string $ row ) use ($ style , $ length ) {
76
- $ text = $ this ->disabled ? $ style ->getDisabledItemText ($ row ) : $ row ;
77
-
78
- if ($ key === 0 ) {
79
- return $ this ->showItemExtra
80
- ? sprintf (
81
- '%s%s %s ' ,
82
- $ text ,
83
- str_repeat (' ' , $ length - mb_strlen ($ row )),
84
- $ this ->style ->getItemExtra ()
85
- )
86
- : $ text ;
87
- }
88
-
89
- return $ text ;
90
- });
60
+ return (new SelectableItemRenderer ())->render ($ style , $ this , $ selected , $ this ->disabled );
91
61
}
92
62
93
63
/**
You can’t perform that action at this time.
0 commit comments