Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove vertical scroll overflow in todo example #1680

Merged
merged 4 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions py/examples/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def blocking_function(secs) -> str:
@app('/demo')
async def serve(q: Q):
if q.args.start:
q.page['form'] = ui.form_card(box='1 1 12 10', items=[ui.progress('Running...')])
q.page['form'] = ui.form_card(box='1 1 6 2', items=[ui.progress('Running...')])
await q.page.save()

seconds = random.randint(1, 6)
Expand All @@ -27,8 +27,8 @@ async def serve(q: Q):
# Do this instead:
message = await q.run(blocking_function, seconds)

q.page['form'] = ui.form_card(box='1 1 12 10', items=[ui.message_bar('info', message)])
q.page['form'] = ui.form_card(box='1 1 6 1', items=[ui.message_bar('info', message)])
await q.page.save()
else:
q.page['form'] = ui.form_card(box='1 1 12 10', items=[ui.button(name='start', label='Start')])
q.page['form'] = ui.form_card(box='1 1 2 1', items=[ui.button(name='start', label='Start')])
await q.page.save()
6 changes: 3 additions & 3 deletions py/examples/background_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def blocking_function(secs) -> str:
@app('/demo')
async def serve(q: Q):
if q.args.start:
q.page['form'] = ui.form_card(box='1 1 12 10', items=[ui.progress('Running...')])
q.page['form'] = ui.form_card(box='1 1 6 2', items=[ui.progress('Running...')])
await q.page.save()

seconds = random.randint(1, 6)
Expand All @@ -33,8 +33,8 @@ async def serve(q: Q):
# with concurrent.futures.ProcessPoolExecutor() as pool:
# message = await q.exec(pool, blocking_function, seconds)

q.page['form'] = ui.form_card(box='1 1 12 10', items=[ui.message_bar('info', message)])
q.page['form'] = ui.form_card(box='1 1 6 1', items=[ui.message_bar('info', message)])
await q.page.save()
else:
q.page['form'] = ui.form_card(box='1 1 12 10', items=[ui.button(name='start', label='Start')])
q.page['form'] = ui.form_card(box='1 1 2 1', items=[ui.button(name='start', label='Start')])
await q.page.save()
2 changes: 1 addition & 1 deletion py/examples/background_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ async def serve(q: Q):
form.items = [ui.message_bar('info', message)]
await q.page.save()
else:
q.page['form'] = ui.form_card(box='1 1 12 10', items=[ui.button(name='start', label='Start')])
q.page['form'] = ui.form_card(box='1 1 2 2', items=[ui.button(name='start', label='Start')])
await q.page.save()
2 changes: 1 addition & 1 deletion py/examples/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async def serve(q: Q):
ui.button(name='show_form', label='Back', primary=True),
]
else:
q.page['example'] = ui.form_card(box='1 1 4 10', items=[
q.page['example'] = ui.form_card(box='1 1 4 8', items=[
ui.button(name='basic_button', label='Basic'),
ui.button(name='primary_button', label='Primary', primary=True),
ui.button(name='link_button', label='Link', link=True),
Expand Down
2 changes: 1 addition & 1 deletion py/examples/buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async def serve(q: Q):
ui.button(name='show_form', label='Back', primary=True),
]
else:
q.page['example'] = ui.form_card(box='1 1 4 10', items=[
q.page['example'] = ui.form_card(box='1 1 4 5', items=[
ui.buttons([
ui.button(name='primary_button', label='Primary', primary=True),
ui.button(name='standard_button', label='Standard'),
Expand Down
2 changes: 1 addition & 1 deletion py/examples/checkbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async def serve(q: Q):
ui.button(name='show_form', label='Back', primary=True),
]
else:
q.page['example'] = ui.form_card(box='1 1 4 10', items=[
q.page['example'] = ui.form_card(box='1 1 4 7', items=[
ui.checkbox(name='checkbox_unchecked', label='Not checked'),
ui.checkbox(name='checkbox_checked', label='Checked', value=True),
ui.checkbox(name='checkbox_indeterminate', label='Indeterminate', indeterminate=True),
Expand Down
2 changes: 1 addition & 1 deletion py/examples/checklist.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async def serve(q: Q):
ui.button(name='show_form', label='Back', primary=True),
]
else:
q.page['example'] = ui.form_card(box='1 1 4 10', items=[
q.page['example'] = ui.form_card(box='1 1 4 7', items=[
ui.checklist(name='checklist', label='Choices',
choices=[ui.choice(name=x, label=x) for x in ['Egg', 'Bacon', 'Spam']]),
ui.button(name='show_inputs', label='Submit', primary=True),
Expand Down
2 changes: 1 addition & 1 deletion py/examples/choice_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async def serve(q: Q):
ui.button(name='show_form', label='Back', primary=True),
]
else:
q.page['example'] = ui.form_card(box='1 1 4 10', items=[
q.page['example'] = ui.form_card(box='1 1 4 7', items=[
ui.choice_group(name='choice_group', label='Pick one', value='B', required=True, choices=choices),
ui.button(name='show_inputs', label='Submit', primary=True),
])
Expand Down
2 changes: 1 addition & 1 deletion py/examples/color_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async def serve(q: Q):
ui.button(name='show_form', label='Back', primary=True),
]
else:
q.page['example'] = ui.form_card(box='1 1 4 10', items=[
q.page['example'] = ui.form_card(box='1 1 4 7', items=[
ui.color_picker(name='color', label='Pick a color', value='#F25F5C'),
ui.button(name='show_inputs', label='Submit', primary=True),
])
Expand Down
2 changes: 1 addition & 1 deletion py/examples/combobox.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async def serve(q: Q):
ui.button(name='show_form', label='Back', primary=True),
]
else:
q.page['example'] = ui.form_card(box='1 1 4 10', items=[
q.page['example'] = ui.form_card(box='1 1 4 7', items=[
ui.combobox(name='combobox', label='Enter or choose a color', placeholder='Color...', value='Blue',
choices=combobox_choices),
ui.combobox(name='combobox_required', label='Enter or choose a color', placeholder='Color...', value='Blue',
Expand Down
2 changes: 1 addition & 1 deletion py/examples/counter_broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ async def serve(q: Q):
form = q.page['example']
form.items = items
else:
q.page['example'] = ui.form_card(box='1 1 12 10', items=items)
q.page['example'] = ui.form_card(box='1 1 2 1', items=items)

await q.page.save()
2 changes: 1 addition & 1 deletion py/examples/counter_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ async def serve(q: Q):
form = q.page['example']
form.items = items
else:
q.page['example'] = ui.form_card(box='1 1 12 10', items=items)
q.page['example'] = ui.form_card(box='1 1 2 1', items=items)

await q.page.save()
2 changes: 1 addition & 1 deletion py/examples/counter_multicast.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ async def serve(q: Q):
form = q.page['example']
form.items = items
else:
q.page['example'] = ui.form_card(box='1 1 12 10', items=items)
q.page['example'] = ui.form_card(box='1 1 2 1', items=items)

await q.page.save()
2 changes: 1 addition & 1 deletion py/examples/counter_unicast.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async def serve(q: Q):
count = q.client.count or 0

if not q.client.initialized:
q.page['example'] = ui.form_card(box='1 1 12 10', items=[
q.page['example'] = ui.form_card(box='1 1 2 1', items=[
ui.button(name='increment', label=f'Count={count}')
])
q.client.initialized = True
Expand Down
2 changes: 1 addition & 1 deletion py/examples/date_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async def serve(q: Q):
ui.button(name='show_form', label='Back', primary=True),
]
else:
q.page['example'] = ui.form_card(box='1 1 4 10', items=[
q.page['example'] = ui.form_card(box='1 1 4 7', items=[
ui.date_picker(name='date', label='Standard date picker', value='2017-10-19'),
ui.date_picker(name='date_placeholder', label='Date picker with placeholder', placeholder='Pick a date'),
ui.date_picker(name='date_disabled', label='Disabled date picker', value='2017-10-19', disabled=True),
Expand Down
2 changes: 1 addition & 1 deletion py/examples/date_picker_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def get_form_items(value: Optional[str]):
@app('/demo')
async def serve(q: Q):
if not q.client.initialized:
q.page['example'] = ui.form_card(box='1 1 4 10', items=get_form_items(None))
q.page['example'] = ui.form_card(box='1 1 4 5', items=get_form_items(None))
q.client.initialized = True
else:
q.page['example'].items = get_form_items(q.args.date_trigger)
Expand Down
2 changes: 1 addition & 1 deletion py/examples/dropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def serve(q: Q):
ui.button(name='show_form', label='Back', primary=True),
]
else:
q.page['example'] = ui.form_card(box='1 1 4 10', items=[
q.page['example'] = ui.form_card(box='1 1 4 7', items=[
ui.dropdown(name='dropdown', label='Pick one', value='B', required=True, choices=choices),
ui.dropdown(name='dropdown_multi', label='Pick multiple', values=['B', 'D'], required=True,
choices=choices),
Expand Down
2 changes: 1 addition & 1 deletion py/examples/file_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async def serve(q: Q):
])
else:
q.page['example'] = ui.form_card(
box='1 1 4 10',
box='1 1 4 7',
items=[
ui.file_upload(name='file_upload', label='Upload!', multiple=True,
file_extensions=['csv', 'gz'], max_file_size=10, max_size=15)
Expand Down
2 changes: 1 addition & 1 deletion py/examples/file_upload_compact.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async def serve(q: Q):
])
else:
q.page['example'] = ui.form_card(
box='1 1 4 10',
box='1 1 4 7',
items=[
ui.file_upload(name='file_upload', label='Select one or more files to upload', compact=True,
multiple=True, file_extensions=['jpg', 'png'], max_file_size=1, max_size=15),
Expand Down
2 changes: 1 addition & 1 deletion py/examples/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def rnd():

@app('/demo')
async def serve(q: Q):
q.page['example'] = ui.form_card(box='1 1 4 10', items=[
q.page['example'] = ui.form_card(box='1 1 -1 -1', items=[
ui.text_xl(content='Extra-large text, for headings.'),
ui.text_l(content='Large text, for sub-headings.'),
ui.text_m(content='Body text, for paragraphs and other content.'),
Expand Down
4 changes: 2 additions & 2 deletions py/examples/form_frame_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
page = site['/demo']

page['example'] = ui.form_card(
box='1 1 6 5',
box='1 1 -1 -1',
items=[
ui.frame(path='https://example.com', height='400px')
ui.frame(path='https://example.com', height='450px')
]
)

Expand Down
2 changes: 1 addition & 1 deletion py/examples/form_visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@app('/demo')
async def serve(q: Q):
if not q.client.initialized:
q.page['example'] = ui.form_card(box='1 1 4 10', items=[
q.page['example'] = ui.form_card(box='1 1 4 7', items=[
ui.text_xl(content='First text'),
ui.text_l(content='Second text'),
ui.text_m(content='Third text'),
Expand Down
2 changes: 1 addition & 1 deletion py/examples/frame_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
page = site['/demo']

page['example'] = ui.frame_card(
box='1 1 6 5',
box='1 1 -1 -1',
title='Example',
path='https://example.com',
)
Expand Down
4 changes: 2 additions & 2 deletions py/examples/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

page = site['/demo']
page['example1'] = ui.image_card(
box='1 1 3 5',
box='1 1 2 4',
title='An image',
type='png',
image=image,
Expand All @@ -51,7 +51,7 @@
# The example below constructs the data URL from the base64-encoded
# used in the previous example.
page['example2'] = ui.image_card(
box='1 6 3 5',
box='3 1 2 4',
title='An image',
path=f"data:image/png;base64,{image}",
)
Expand Down
4 changes: 2 additions & 2 deletions py/examples/image_annotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ async def serve(q: Q):
ui.button(name='back', label='Back', primary=True),
]
else:
q.page['example'] = ui.form_card(box='1 1 9 -1', items=[
q.page['example'] = ui.form_card(box='1 1 -1 -1', items=[
ui.image_annotator(
name='annotator',
title='Drag to annotate',
image='https://images.pexels.com/photos/2696064/pexels-photo-2696064.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',
image_height='700px',
image_height='280px',
tags=[
ui.image_annotator_tag(name='p', label='Person', color='$cyan'),
ui.image_annotator_tag(name='f', label='Food', color='$blue'),
Expand Down
6 changes: 3 additions & 3 deletions py/examples/issue_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def make_issue_table(allow_multiple_selection=False):

async def edit_multiple(q: Q):
q.page['form'] = ui.form_card(
box='1 1 4 10',
box='1 1 6 7',
items=[
make_issue_table(allow_multiple_selection=True), # This time, allow multiple selections
ui.buttons([
Expand All @@ -59,7 +59,7 @@ async def edit_multiple(q: Q):

async def show_issues(q: Q):
q.page['form'] = ui.form_card(
box='1 1 4 10',
box='1 1 4 7',
items=[
make_issue_table(),
ui.buttons([ui.button(name='edit_multiple', label='Edit Multiple...', primary=True)]),
Expand All @@ -75,7 +75,7 @@ async def show_issue(q: Q, issue_id: str):
q.client.active_issue_id = issue_id

q.page['form'] = ui.form_card(
box='1 1 4 10',
box='1 1 4 4',
items=[
ui.text_xl(f'Issue {issue.id}'),
ui.text(issue.text),
Expand Down
2 changes: 1 addition & 1 deletion py/examples/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
page = site['/demo']

page['example'] = ui.form_card(
box='1 1 4 10',
box='1 1 4 7',
items=[
ui.label(label='Standard Label'),
ui.label(label='Required Label', required=True),
Expand Down
2 changes: 1 addition & 1 deletion py/examples/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
page = site['/demo']

page['example'] = ui.form_card(
box='1 1 4 10',
box='1 1 4 7',
items=[
ui.link(label='Internal link', path='/starred'),
ui.link(label='Internal link, new tab', path='/starred', target=''),
Expand Down
2 changes: 1 addition & 1 deletion py/examples/markdown_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def make_markdown_table(fields, rows):
page = site['/demo']

v = page.add('example', ui.form_card(
box='1 1 4 5',
box='1 1 4 8',
items=[
ui.text(make_markdown_table(
fields=air_passengers_fields,
Expand Down
2 changes: 1 addition & 1 deletion py/examples/message_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
page = site['/demo']

page['example'] = ui.form_card(
box='1 1 3 10',
box='1 1 3 7',
items=[
ui.message_bar(type='blocked', text='This action is blocked.'),
ui.message_bar(type='error', text='This is an error message'),
Expand Down
2 changes: 1 addition & 1 deletion py/examples/meta_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
async def serve(q: Q):
if not q.client.initialized:
q.page['meta'] = ui.meta_card(box='')
q.page['example'] = ui.form_card(box='1 1 12 10', items=[
q.page['example'] = ui.form_card(box='1 1 2 1', items=[
ui.button(name='show_dialog', label='Order donuts', primary=True)
])
q.client.initialized = True
Expand Down
2 changes: 1 addition & 1 deletion py/examples/meta_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

# Add a placeholder for the animation.
page['example'] = ui.markup_card(
box='1 1 10 8',
box='1 1 6 8',
title='Animation',
content=html,
)
Expand Down
2 changes: 1 addition & 1 deletion py/examples/meta_side_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
async def serve(q: Q):
if not q.client.initialized:
q.page['meta'] = ui.meta_card(box='')
q.page['example'] = ui.form_card(box='1 1 11 10', items=[
q.page['example'] = ui.form_card(box='1 1 2 1', items=[
ui.button(name='show_side_panel', label='Order donuts', primary=True)
])
q.client.initialized = True
Expand Down
2 changes: 1 addition & 1 deletion py/examples/meta_side_panel_closable.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async def serve(q: Q):
# Create an empty meta_card to hold the side panel
q.page['meta'] = ui.meta_card(box='')
# Display a button to show the side panel
q.page['example'] = ui.form_card(box='1 1 11 10', items=[
q.page['example'] = ui.form_card(box='1 1 2 1', items=[
ui.button(name='show_side_panel', label='Open side panel', primary=True)
])
q.client.initialized = True
Expand Down
2 changes: 1 addition & 1 deletion py/examples/meta_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async def serve(q: Q):
# That's all you need to do - set up a tracker.
# The rest of this example does not do anything special related to tracking.

q.page['example'] = ui.form_card(box='1 1 12 10', items=[
q.page['example'] = ui.form_card(box='1 1 2 1', items=[
ui.button(name='increment', label=f'Count={count}')
])
q.client.initialized = True
Expand Down
2 changes: 1 addition & 1 deletion py/examples/picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async def serve(q: Q):
ui.button(name='show_form', label='Back', primary=True),
]
else:
q.page['example'] = ui.form_card(box='1 1 4 10', items=[
q.page['example'] = ui.form_card(box='1 1 4 5', items=[
ui.picker(name='picker', label='Place an order (try Spam, Eggs or Ham):', choices=[
ui.choice(name='spam', label='Spam'),
ui.choice(name='eggs', label='Eggs'),
Expand Down
2 changes: 1 addition & 1 deletion py/examples/picker_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async def serve(q: Q):
ui.button(name='show_form', label='Back', primary=True),
]
else:
q.page['example'] = ui.form_card(box='1 1 4 10', items=[
q.page['example'] = ui.form_card(box='1 1 4 5', items=[
ui.picker(name='picker', label='Picker with initial values', choices=[
ui.choice(name='spam', label='Spam'),
ui.choice(name='eggs', label='Eggs'),
Expand Down
2 changes: 1 addition & 1 deletion py/examples/plot_bokeh.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

page = site['/demo']
page['example'] = ui.frame_card(
box='1 1 5 8',
box='1 1 -1 -1',
title='Hexbin for 500 points',
content=html,
)
Expand Down
Loading