Skip to content

Commit

Permalink
input paddin in prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan committed Apr 14, 2024
1 parent f15ea7f commit bd67a75
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion htagui/basics/bases/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def call(dico):
return caller( cb, dico["promptvalue"])
with Form(onsubmit=call) as f:
f+=Tag.div( title )
f+=Tag.div( Input(_value=value,_name="promptvalue",js="self.focus();self.select()", _autofocus=True) )
f+=Tag.div( Input(_value=value,_name="promptvalue",js="self.focus();self.select()", _autofocus=True) ,_style="padding:4px 0")
f+=Button("Ok" )
f+=Button("Cancel",_type="button",_onclick=main.stepevent())
Modal.__init__(self,main,f)
Expand Down
2 changes: 1 addition & 1 deletion htagui/bulma/bases/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def call(dico):

with Form(onsubmit=call) as f:
f+=Tag.div( title )
f+=Tag.div( Input(_value=value,_name="promptvalue",js="self.focus();self.select()", _autofocus=True) )
f+=Tag.div( Input(_value=value,_name="promptvalue",js="self.focus();self.select()", _autofocus=True) ,_style="padding:4px 0")
f+=Button("Ok" )
f+=Button("Cancel",_type="button",_onclick=main.stepevent())
Modal.__init__(self,main,f)
Expand Down
6 changes: 0 additions & 6 deletions htagui/shoelace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
# dialog.box et dialog.drawer are cata
# dialog.box et dialog.drawer are cata
# dialog.box et dialog.drawer are cata
# & dialog.block doesn't block
# & dialog.block doesn't block
# & dialog.block doesn't block
# & dialog.block doesn't block
# & dialog.block doesn't block
# & dialog.block doesn't block
########################################################################################
from .bases import Button,Input,Menu,Spinner,Select
########################################################################################
Expand Down
5 changes: 3 additions & 2 deletions htagui/shoelace/bases/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,13 @@ def init(self,main,obj,trbl:tuple=("30%","30%","","30%"),closable=True,radius=6)
# self["open"]=True
self["no-header"]=True
t,r,b,l = trbl
self.js = "window.customElements.whenDefined('sl-dialog').then( function() { document.getElementById('%s').show() });" % id(self)
if closable:
bc=Tag.button("X",_onclick=main.stepevent(),_style="float:right;border-radius:50%;border:0px;cursor:pointer;background:white")
self <= [bc,obj]
else:
self <= obj
self.js = "window.customElements.whenDefined('sl-dialog').then( function() { document.getElementById('%s').show() })" % id(self)
self.js += "self.addEventListener( 'sl-request-close', function(ev) { ev.preventDefault() });"


class Drawer(Tag.sl_drawer):
Expand Down Expand Up @@ -161,7 +162,7 @@ def call(dico):
return caller(cb,dico["promptvalue"])
with Form(onsubmit=call) as f:
f+=Tag.div( title )
f+=Tag.div( Input(_value=value,_name="promptvalue", _autofocus=True) )
f+=Tag.div( Input(_value=value,_name="promptvalue", _autofocus=True), _style="padding:4px 0" )
# f+=Tag.div( Input(_value=value,_name="promptvalue",js="self.focus();self.select()", _autofocus=True) )
f+=Button("Ok" ,_type="submit")
f+=Button("Cancel",_type="button",_onclick=main.stepevent())
Expand Down
4 changes: 2 additions & 2 deletions manual_tests.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
from htag import Tag,expose,Runner
import htagui.basics as ui
# import htagui.basics as ui
# import htagui.bulma as ui
# import htagui.shoelace as ui
import htagui.shoelace as ui

class App(ui.App):
imports=ui.ALL
Expand Down

0 comments on commit bd67a75

Please sign in to comment.