@@ -27,7 +27,7 @@ def search_as_you_type():
2727 ]
2828 ui .select (options = continents , with_input = True ,
2929 on_change = lambda e : ui .notify (e .value )).classes ('w-40' )
30-
30+
3131
3232@doc .demo ('New value mode' , '''
3333 You can add new options by providing a `new_value_mode` and
@@ -36,12 +36,12 @@ def search_as_you_type():
3636def new_value_mode ():
3737 def event_to_option (v : str ) -> ui .option [int , int ]:
3838 return ui .to_option (int (v ))
39-
39+
4040 ui .select (
41- [1 ,2 ,3 ,4 ,5 ],
41+ [1 ,2 ,3 ,4 ,5 ],
4242 with_input = True ,
4343 on_change = lambda e : ui .notify (e .value ),
44- new_value_mode = " add-unique" ,
44+ new_value_mode = ' add-unique' ,
4545 new_value_to_option = event_to_option
4646 ).classes ('w-40' )
4747
@@ -83,21 +83,21 @@ class Person(ui.option[str, int]):
8383 caption : str
8484
8585 def __repr__ (self ) -> str :
86- return f" Person({ self .label } , { self .value } )"
86+ return f' Person({ self .label } , { self .value } )'
8787
8888 select_people = (
8989 ui .select (
9090 options = [
9191 Person (
92- label = 'Joe' , value = 0 , icon = 'person' ,
92+ label = 'Joe' , value = 0 , icon = 'person' ,
9393 caption = 'Company: Trilliant Health'
9494 ),
9595 Person (
96- label = 'Rodja' , value = 1 , icon = 'person' ,
96+ label = 'Rodja' , value = 1 , icon = 'person' ,
9797 caption = 'Company: Zauberzeug GmbH'
9898 ),
9999 Person (
100- label = 'Darth Vader' , value = 2 , icon = 'person_off' ,
100+ label = 'Darth Vader' , value = 2 , icon = 'person_off' ,
101101 caption = 'Fired for being evil'
102102 ),
103103 ],
0 commit comments