viur-framework / flare Goto Github PK
View Code? Open in Web Editor NEWPython framework to create web-apps on top of Pyodide
Home Page: https://flare.docs.viur.dev
License: MIT License
Python framework to create web-apps on top of Pyodide
Home Page: https://flare.docs.viur.dev
License: MIT License
There used to be a gen-files-json.py utility script in the bin folder, which was removed, and the functionality moved over to the tools/flare.py script. However, this functionality is not directly exposed yet.
Please make the files.json generation available again.
Currently, when html5.Widget.hide()
or html5.Widget.show()
is used, the display-state is changed as inline-CSS.
This is not wanted in a pure ignire/flare setup, where only a CSS-class "is-hidden" should be added, but may be wanted in a setup without using ignite as CSS. The html5 library on its own should be usable out-of-the-box without having to use pre-defined CSS-classes.
Because html5.Widget is the ultimate base class of ALL HTML-Widgets, we cannot directly subclass it in flare, so we have 3 options:
a) Hard-code the "is-hidden" class into html5.Widget.hide()
, html5.Widget.show()
, html5.Widget.isHidden()
b) Monkey patch html5.Widget.hide()
, html5.Widget.show()
, html5.Widget.isHidden()
inside flare
c) Make the behavior configurable via flare.conf
. This one would have much unnecessary runtime overhead to check for and add or remove various classes, or fallback to the inline style.
Likewise v-for in Vue.js, flare should allow for a list-rendering method flare-for
. This can only be achieved properly when fromHTML.replaceVars() provides a way to access sub-classing elements, delimited by the dot notation, like
<ul flare-for="animal in animals">
<li class="animal-{{animal.livingspace}}">{{animal.name}}</li>
</ul>
This ViUR bone definition
entry_id = numericBone(
descr="Nummer",
unique=UniqueValue(UniqueLockMethod.SameValue, True, "Nummer muss eindeutig sein!"),
indexed=True,
searchable=True,
defaultValue=None,
min=0
)
is not required, and therefore should accept nothing as valid value. But the widget always resets the number to "0", which is invalid:
This is a feature-request for implementing slots.
To implement such components
<popout icon="icon-arrowhead-down">
<popout-item @click="onEdit">edit</popout-item>
<popout-item @click="onLeave">leave</popout-item>
<popout-item @click="onDelete">delete</popout-item>
</popout>
It would be nice to have slots, where the content of the popout will be inserted, like this:
<flare-icon [name]="icon" hidden></flare-icon>
<span [name]="text" hidden></span>
<div class="popout">
<div [name]="popoutItemList" class="list">
<slot><!-- Default Content --></slot>
</div>
</div>
From Vue.js there is also an extension for named slots. These should be considered as well.
A special <widget>
-Tag could be used to identify the current html5.Widget-subclass.
class MyText(html5.Span):
def __init__(self):
super().__init__(
"""
<widget class="big" title="Hahaha">
Hello My Text
</widget>
"""
would result in
<span class="big" title="Hahaha">
Hello My Text
</span>
The special <widget>
-Tag should only be allowed at top-level of the Template.
This is very dangerous: https://github.com/mausbrand/flare/blob/df94e1d448d9280a40048c1d3d4974929dcc7485/flare/forms/formatString.py#L110
As it's currently used (.textContent i'd guess) that will lead to invisible text after an < in a stringBone; if it's ever used with .innerHtml etc. you have an xss injection in the vi. Better strip format tags from textBones instead.
details and summary are currently not implemented as widgets.
When a template is rendered by flare, it is being parsed into an object tree. The corresponding class for SVG paths is this one which only supports the two attributes d
and pathLength
. The standard lists quite a lot more attributes, but they all get discarded by this parsing process, resulting in visually broken SVG being rendered.
While working with flare on master feauture/next branches it is not evident, which type parameters should have in several methods / cases. I would be proud to work on that topic.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.