Commit Graph

40 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
6f3f28973e [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-02-02 17:35:59 +00:00
Fabio Pliger
e0ee871261 lint 2024-02-02 11:35:36 -06:00
Fabio Pliger
e75625f165 add attributes to all classes in elements 2024-02-02 11:35:21 -06:00
Fabio Pliger
6436df2dfa fix image instantiation on card since the API has changed 2024-02-02 11:35:07 -06:00
Fabio Pliger
fe420be776 Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc_ui_blocks 2024-02-02 09:38:48 -06:00
Fabio Pliger
7036008e02 lint 2024-02-02 09:36:12 -06:00
Fabio Pliger
05a5fb7ff2 add global JS attributes to elements and improve demos 2024-02-02 09:00:47 -06:00
Fabio Pliger
fb584c3984 add text attribute to pydom Elements 2024-02-02 08:58:55 -06:00
pre-commit-ci[bot]
77c8b5d82c [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-02-01 18:59:36 +00:00
Fabio Pliger
f6b7660ff6 Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc_ui_blocks 2024-02-01 12:16:08 -06:00
Fabio Pliger
316652a61d refactor gallary to simplify codebase 2024-02-01 12:13:52 -06:00
Fabio Pliger
3f19695704 fix type that lead using the the JSDescriptor directly instead of the factory method 2024-02-01 12:12:08 -06:00
Askat
9edb3185f2 Add shoelace radio component (#1961)
* add shoelace radio component

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-02-01 09:48:18 -08:00
Fabio Pliger
3b8745e875 Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc_ui_blocks 2024-02-01 10:16:26 -06:00
Fabio Pliger
5c6de9b05a add global attributes and dynamic property assignment 2024-02-01 10:14:56 -06:00
pre-commit-ci[bot]
c559d8b321 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-02-01 00:02:24 +00:00
Fabio Pliger
1cca5f057a precommit 2024-01-31 18:02:12 -06:00
Fabio Pliger
e7160496f5 add showlace extra style dynamically 2024-01-31 18:01:48 -06:00
Fabio Pliger
f37048f09e add load_resources to markdown 2024-01-31 17:56:41 -06:00
pre-commit-ci[bot]
dbc4db48e6 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-01-31 23:31:47 +00:00
Fabio Pliger
cffee1d680 precommit fixes 2024-01-31 17:31:11 -06:00
pre-commit-ci[bot]
a702518cda [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-01-31 23:04:44 +00:00
Fabio Pliger
f5857ba2cc move examples section out of stdlib pyweb to examples.py in the demo itself 2024-01-31 17:03:38 -06:00
Fabio Pliger
8ade988e82 add markdown suppport 2024-01-31 16:51:58 -06:00
Fabio Pliger
a5c3fc62c6 Merge branch 'poc_ui_blocks' of github.com:pyscript/pyscript into poc_ui_blocks 2024-01-31 16:38:43 -06:00
Fabio Pliger
e3e669ccdd use html property rather than accessing _js directly 2024-01-31 16:38:39 -06:00
pre-commit-ci[bot]
6c5052221e [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-01-31 22:27:15 +00:00
Fabio Pliger
a9057e4cea add Icon to shoelace components 2024-01-31 16:24:51 -06:00
Fabio Pliger
ff19d637ec remove comments 2024-01-30 19:05:36 -06:00
Fabio Pliger
73745a0e95 fix imports and add initialization to load resources to shoelace module 2024-01-30 19:00:50 -06:00
Fabio Pliger
5c5c6e3f7f fix link and a elements and add a script element 2024-01-30 19:00:20 -06:00
Fabio Pliger
e4d5b6641d fix pyweb imports 2024-01-30 18:59:38 -06:00
Fabio Pliger
25e1b0647e add pyweb.ui 2024-01-30 17:31:49 -06:00
Fabio Pliger
bdce19714a add JSProperty to pydom so it can be used to create descriptors mapping to specific JS attributes 2024-01-30 17:30:56 -06:00
Fabio Pliger
bcaab0eb93 PyDom compatibility with MicroPython (#1954)
* fix pydom example

* fix the pydom test example to use a python syntax that works with MicroPython by replacing datetime

* add note about capturing errors importing when

* patch event_handler to handle compat with micropython

* turn pyweb into a package and remove hack to make pydom a sort of module with an ugly hack

* add pydom example using micropython

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix select element test

* change pydom test page to let pytest tests load it properly

* add missing folders to test dev server so it can run examples in the manual tests folder

* add pydom tests to the test suite as integration tests

* lint

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* improve fixes in event_handling

* change when decorator to actually dynamically fail in micropython and support handlers with or without arguments

* simplify when decorator code

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add type declaration back for the MP use case

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* removed code to access pydom get index as I can't think of any proper use case

* remove old commented hack to replace pydom module with class

* fix examples title

* precommit checks

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-30 11:30:16 -08:00
Fabio Pliger
2128572ce5 pyweb camera support (#1901)
* add media module

* add Device class to media

* add camera test example

* add snap, download and other convenience methods

* load devices automagically

* add draw method to canvas

* add docstring for download

* add docstrings to draw method

* add docstrings to snap

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* load devices as soon as the page loads

* solve conflict

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove display calls listing devices in camera example

* fix typos and other small errors

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix typo in docstring

* fix error message typo

* replace setAttribute on JS properties with accessors

* remove debug statement

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add docstrings

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add docstrings to camera example

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-26 14:33:02 -08:00
Fabio Pliger
c0d45d368b Pydom add better support for select element (#1887)
* add tests for select options

* add classes to support select and options management

* fix add methond and implement clear on options

* fix optionsproxy.add

* fix select.add method

* add test adding a second option to select

* add tests around adding options in multiple flavors

* add test to add an option by passing the option it wants to be added before

* complete test around adding options

* add select to add test on remove

* add tests and support for selected item

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andrea Giammarchi <andrea.giammarchi@gmail.com>
2023-12-06 15:56:14 -08:00
Fabio Pliger
1801472fc4 Remove when from pydom (#1850)
* bye bye when

* fix create to drop parent and actually pass the other arguments through

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update types

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-11-08 09:28:58 -08:00
Fabio Pliger
e81830a2ea Value property to PyDom.Element and ElementCollection (#1828)
* add base test for input value field

* add value property to Element

* add test for non supported element

* prevent users to set value attribute on elements that do not support it

* add test for setting value on collections

* add value property to collection and add more tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-11-01 08:33:38 -07:00
Fabio Pliger
00fdc73015 [NEXT] Pydom (#1681)
* add pyweb

* build

* add test file

* fix pydom example code

* remove old reference to js

* temporarily comment out query functions on BaseElement while rearranging code to reuse the same underlying logic accross PyDom and other elements

* add temp TODO comment to content as it breaks with template elements

* update pydom example to define code on external file

* fix name type while renaming document -> dom

* add real pydom test files

* add classes to dom scope

* __len__ to ElementCollection

* fix some of the old tests

* rename test from test_query_by_class to test_getitem_by_class

* change test for read and write multiple elements

* add find method to BaseElement

* fix remaining tests

* add Collection Tests

* add equality to Collection

* add test for collection style manipulation

* fix getter for style property and rename style related attribute from pop to remove

* add single element creation test

* remove append on BaseElement and add body and head to dom

* add test_create_element_child to verify child creation

* add children getter property to Element

* remove old code

* remove more old code, change style attribute from visibility to visible and now default getters on collection to return a list with the value of an attribute for every element in the collection

* remove more old code and add possibility to customize test flags via url

* add support to pass Js and pydom.Element elements to when decorator

* remove methods related to input type of elements until we have a better design for it

* rename _element to _js

* add test_when decorator with a ElementCollection input

* when decorator now supporte pydom.ElementCollection as input

* update pyscript.js

* remove useless variable from when decorator

* remove base.py from pyweb

* add nodes for append collection test and add better feedback on successes vs failure

* add tests and fix code for support of append Element and ElementCollection

* manage access to content attribute when tagname is template

* fix comment

---------

Co-authored-by: Fabio Pliger <fpliger@anaconda.com>
2023-09-14 13:31:23 -07:00