]> git.proxmox.com Git - ui/proxmox-yew-widget-toolkit.git/log
ui/proxmox-yew-widget-toolkit.git
7 weeks agodocs: improve list tile example
Dietmar Maurer [Sat, 30 Nov 2024 08:39:33 +0000 (09:39 +0100)]
docs: improve list tile example

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 weeks agolist: use grid layout and allow to set grid-template-columns
Dietmar Maurer [Thu, 28 Nov 2024 13:25:46 +0000 (14:25 +0100)]
list: use grid layout and allow to set grid-template-columns

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 weeks agoadd new list tile widget
Dietmar Maurer [Wed, 27 Nov 2024 11:56:51 +0000 (12:56 +0100)]
add new list tile widget

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 weeks agoadd new list widget with virtual scrolling
Dietmar Maurer [Wed, 27 Nov 2024 08:39:48 +0000 (09:39 +0100)]
add new list widget with virtual scrolling

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 weeks agodocs: fix typo
Dietmar Maurer [Wed, 27 Nov 2024 08:16:29 +0000 (09:16 +0100)]
docs: fix typo

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 weeks agocleanup: remove unused size observer from data table
Dietmar Maurer [Tue, 26 Nov 2024 11:32:06 +0000 (12:32 +0100)]
cleanup: remove unused size observer from data table

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 weeks agocleanup: use style helper
Dietmar Maurer [Tue, 26 Nov 2024 11:18:33 +0000 (12:18 +0100)]
cleanup: use style helper

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 weeks agowidget: selector: limit error messages to width of input
Dominik Csapak [Fri, 22 Nov 2024 08:14:22 +0000 (09:14 +0100)]
widget: selector: limit error messages to width of input

but no less than 400px. Otherwise the error message is not bound
in widht, and can take up a very large amount of space horizontally.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 weeks agowidget: selector: show load mask when loading
Dominik Csapak [Fri, 22 Nov 2024 08:14:21 +0000 (09:14 +0100)]
widget: selector: show load mask when loading

so the user knows what is happening

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 weeks agocleanup: use IntoOptionalKey trait
Dietmar Maurer [Thu, 21 Nov 2024 09:53:19 +0000 (10:53 +0100)]
cleanup: use IntoOptionalKey trait

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
8 weeks agofix doc tests
Dietmar Maurer [Thu, 21 Nov 2024 08:38:52 +0000 (09:38 +0100)]
fix doc tests

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
8 weeks agocombine storage location and state_id
Dietmar Maurer [Wed, 20 Nov 2024 09:31:31 +0000 (10:31 +0100)]
combine storage location and state_id

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
8 weeks agowidget: dropdown: remove unnecessary style
Dominik Csapak [Mon, 18 Nov 2024 12:02:35 +0000 (13:02 +0100)]
widget: dropdown: remove unnecessary style

this did not work anyway because our aligning code removed the overflow
property.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 weeks agowidget: dropdown: make popover behavior manual
Dominik Csapak [Mon, 18 Nov 2024 12:02:34 +0000 (13:02 +0100)]
widget: dropdown: make popover behavior manual

otherwise the popover is dismissed by e.g. clicking in the field
when it's editable, which produces an undesired effect.
(It's then "closed" but still visible because of our css classes, and
now our aligning logic is wrong because popovers behave differently when
open vs closed)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 weeks agowidget: dropdown: mark non-editable dropdowns with 'readonly' attribute
Dominik Csapak [Mon, 18 Nov 2024 12:02:33 +0000 (13:02 +0100)]
widget: dropdown: mark non-editable dropdowns with 'readonly' attribute

this way some browser behaviors change, like e.g. the text is
not spell-checked (which makes no sense for a non-editable value)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agofix previous commit: correctly set focus on the .selected element (not on the picker...
Dietmar Maurer [Mon, 18 Nov 2024 10:22:25 +0000 (11:22 +0100)]
fix previous commit: correctly set focus on the .selected element (not on the picker itself)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agowidget: dropdown: properly focus the selected element
Dominik Csapak [Thu, 14 Nov 2024 14:36:48 +0000 (15:36 +0100)]
widget: dropdown: properly focus the selected element

we currently always have a datatable as a picker, so the selected
element must be the cell, as the row (which gets the 'selected' class)
is not selectable (it has no tabindex)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agowidget: dropdown: use popover instead of a dialog
Dominik Csapak [Thu, 14 Nov 2024 14:36:47 +0000 (15:36 +0100)]
widget: dropdown: use popover instead of a dialog

by using popovers, we don't have get the messy focus behaviour of
dialogs, for example those focus the first element when the dialog is
opened, which often is the header menu of a datatable.

This also makes the code a bit shorter, since we can restore the focus
before the popover is fully closed (and simply hide it as soon as
possible).

for now we have to use our own bindings to show/hide/togglePopover, but
this can be removed with a later web-sys version.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agoasync_pool: implement send_future
Dietmar Maurer [Fri, 8 Nov 2024 09:17:14 +0000 (10:17 +0100)]
async_pool: implement send_future

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agoasync pool: add 'send_future' wrapper
Dominik Csapak [Fri, 8 Nov 2024 08:51:59 +0000 (09:51 +0100)]
async pool: add 'send_future' wrapper

a wrapper for `Context::send_future` since this is useful sometimes.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agoAsyncPool: simplify atomic counter usage
Dietmar Maurer [Fri, 25 Oct 2024 14:26:09 +0000 (16:26 +0200)]
AsyncPool: simplify atomic counter usage

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agowidget: remove useless `try_from` call in theme density selector
Shannon Sterz [Wed, 23 Oct 2024 12:52:56 +0000 (14:52 +0200)]
widget: remove useless `try_from` call in theme density selector

the enum member `SetThemeDensity` already only takes values of type
`ThemeDensity`. so the `try_from` here converts from `ThemeDensity`
to `ThemeDensity` which is pointless and trivially must always
succeed. remove it so that the compiler stops complaining about
irrefutable patterns.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2 months agoAsyncPool: impl Clone and PartialEq
Dietmar Maurer [Wed, 23 Oct 2024 12:00:54 +0000 (14:00 +0200)]
AsyncPool: impl Clone and PartialEq

So that we can use it inside callbacks (and maybe use it
as Component properties).

2 months agoadd new AsyncPool class
Dietmar Maurer [Wed, 23 Oct 2024 10:27:27 +0000 (12:27 +0200)]
add new AsyncPool class

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agoSearchDropdown: use async abort guard
Dietmar Maurer [Wed, 23 Oct 2024 10:22:00 +0000 (12:22 +0200)]
SearchDropdown: use async abort guard

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agomove WebSysAbortGuard to separate file
Dietmar Maurer [Wed, 23 Oct 2024 10:14:05 +0000 (12:14 +0200)]
move WebSysAbortGuard to separate file

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agocleanup: move AsyncAbortGuard to top level
Dietmar Maurer [Wed, 23 Oct 2024 10:07:33 +0000 (12:07 +0200)]
cleanup: move AsyncAbortGuard to top level

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agomake fetch_catalog abortable
Dietmar Maurer [Wed, 23 Oct 2024 09:47:11 +0000 (11:47 +0200)]
make fetch_catalog abortable

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agoSelector: use async abort guard
Dietmar Maurer [Wed, 23 Oct 2024 09:26:20 +0000 (11:26 +0200)]
Selector: use async abort guard

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agoLoader: use AsyncAbortGuard
Dietmar Maurer [Wed, 23 Oct 2024 09:08:08 +0000 (11:08 +0200)]
Loader: use AsyncAbortGuard

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agoadd async abort guard
Dietmar Maurer [Wed, 23 Oct 2024 08:58:54 +0000 (10:58 +0200)]
add async abort guard

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agomake default http_get method abortable
Dietmar Maurer [Wed, 23 Oct 2024 08:22:49 +0000 (10:22 +0200)]
make default http_get method abortable

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agocss: add `Opacity` class helper
Dominik Csapak [Wed, 16 Oct 2024 10:06:57 +0000 (12:06 +0200)]
css: add `Opacity` class helper

for our pwt-opacity-X classes

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget style builder: add `opacity` helper
Dominik Csapak [Wed, 16 Oct 2024 10:06:56 +0000 (12:06 +0200)]
widget style builder: add `opacity` helper

to set the opacity of an element

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget style builder: add `flex` helper
Dominik Csapak [Wed, 16 Oct 2024 10:06:55 +0000 (12:06 +0200)]
widget style builder: add `flex` helper

so instead of setting the flex property via style, we have
a way to do it in a more controlled way that's similar to how it's done
in extjs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agotab bar: remove unnecessary and unused format! macro
Shannon Sterz [Tue, 15 Oct 2024 15:24:19 +0000 (17:24 +0200)]
tab bar: remove unnecessary and unused format! macro

this looks like it was accidentally added as it does nothing but
generate a compiler warning now. so remove it.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
3 months agoInputPanel: add code to add hidden fields
Dietmar Maurer [Thu, 10 Oct 2024 08:22:18 +0000 (10:22 +0200)]
InputPanel: add code to add hidden fields

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoadd a contributions section to the readme
Dietmar Maurer [Wed, 9 Oct 2024 09:49:12 +0000 (11:49 +0200)]
add a contributions section to the readme

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agowidget: form: make selector load only when enabled
Shannon Sterz [Tue, 8 Oct 2024 09:02:19 +0000 (11:02 +0200)]
widget: form: make selector load only when enabled

loading when a selector is disabled doesn't serve any purpose as users
can't select the loaded entries anyway. so only load when the
selector is enabled. also makes sure that the selector loads if it
was previously disabled and is now enabled.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
3 months agowidget: data table: extend fixme comment
Dominik Csapak [Tue, 8 Oct 2024 11:16:00 +0000 (13:16 +0200)]
widget: data table: extend fixme comment

so we know later what we wanted to change here without diving into the
git log

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget: data table: react to column changes
Dominik Csapak [Tue, 8 Oct 2024 10:31:33 +0000 (12:31 +0200)]
widget: data table: react to column changes

the headers are part of the properties, so if they change, we should
react to that. Until now, we only accepted them at the first 'create'
call, which meant that when the columns changed afterwards (e.g. when we
want to pass different data to the renderer) it did not get rerendered
with the new information.

To do this, refactor the header processing code from 'create' into it's
own function, and call it also when the headers changed in the 'changed'
method.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget: input panel: fix key generation for labels
Dominik Csapak [Mon, 7 Oct 2024 10:25:53 +0000 (12:25 +0200)]
widget: input panel: fix key generation for labels

yews key mechanism does not work on markup level, but on component
level. So the attempt to auto-generate keys for FieldLabels in the view
method instead of the input panel was misguided, since that does not
actually give the label itself a key.

This was noticed on all input panels where we dynamically added/removed
fields, since then the whole form was reset because of the missing keys.
(E.g. the ACME DNS plugin panel)

Instead generate the label key like before in the input panel itself,
but only when the FieldLabel itself does not already have one set.
(so users can manually override that if they want)

Fixes: bd58deb (widget: input panel: use FieldLabel instead of just text)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget: input panel: adapt to recent grid column change
Dominik Csapak [Thu, 3 Oct 2024 13:24:50 +0000 (15:24 +0200)]
widget: input panel: adapt to recent grid column change

we changed the layout to a 5 column grid (one spacer in the middle),
but forgot to add the middle column when we set the label_width or
field_width manually.

add the same middle column as in the css here

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agocss: allow custom css lengths
Dominik Csapak [Thu, 3 Oct 2024 13:24:49 +0000 (15:24 +0200)]
css: allow custom css lengths

when they're &'static str. This allows us to write things like:

```
Foo::new()
    .width("auto")
```

instead of

```
Foo::new()
    .style("width", "auto")
```

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agomove SubmitCallback to props folder
Dietmar Maurer [Wed, 2 Oct 2024 07:20:13 +0000 (09:20 +0200)]
move SubmitCallback to props folder

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agomake SubmitCallback generic
Dietmar Maurer [Wed, 2 Oct 2024 07:17:09 +0000 (09:17 +0200)]
make SubmitCallback generic

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agodoc: adapt to recent checkbox/radio button changes
Dominik Csapak [Mon, 30 Sep 2024 12:52:08 +0000 (14:52 +0200)]
doc: adapt to recent checkbox/radio button changes

by replacing references to the `Boolean` component with `Checkbox`
and adding the RadioButton reference

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget: radio button: fix doc tests
Dominik Csapak [Mon, 30 Sep 2024 12:52:07 +0000 (14:52 +0200)]
widget: radio button: fix doc tests

and improve the example text slightly (so it makes more sense)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget: align: fix doc references
Dominik Csapak [Mon, 30 Sep 2024 12:52:06 +0000 (14:52 +0200)]
widget: align: fix doc references

change to 'crate' and make the relevant functions public (for wasm32 and
non wasm32)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget: rtl switcher: expose std/input props
Dominik Csapak [Mon, 30 Sep 2024 12:52:05 +0000 (14:52 +0200)]
widget: rtl switcher: expose std/input props

so that users can e.g. set the id for a label

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget: form: rename Boolean to Checkbox
Dominik Csapak [Mon, 30 Sep 2024 11:22:41 +0000 (13:22 +0200)]
widget: form: rename Boolean to Checkbox

and remove old `Checkbox` implementation. Since we now have a separate
RadioButton component and the Boolean one has more features that should
cover all use cases of the old Checkbox field, simply rename the Boolean
to Checkbox.

Also having only one Checkbox component  instead of two separate ones is
less confusing and less error prone.

This makes it necessary to adapt all code paths using either Checkbox or
Boolean, but these changes should be rather trivial:
* either changing the submit_on/off_values where we used a checkbox
  previously
* or rename Boolean to Checkbox

If we missed some use case for the Checkbox, we can either simply add it
again, or use a more generic Field with input_type 'checkbox' instead.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget: form: add RadioButton component
Dominik Csapak [Mon, 30 Sep 2024 11:22:40 +0000 (13:22 +0200)]
widget: form: add RadioButton component

instead of reusing the Checkbox component for creating radio buttons,
have a separate component for that. This makes it easier to specialize
the code for that use case.

The code is mostly a mix of Checkbox and Boolean (for some of the newer
features), with the irrelevant portions stripped out.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget: boolean: implement custom on/off values
Dominik Csapak [Mon, 30 Sep 2024 11:22:39 +0000 (13:22 +0200)]
widget: boolean: implement custom on/off values

sometimes it's useful to map the checked/unchecked state to different
submit values than true/false, e.g. for inverted checkboxes or if the
api does not accept true/false but e.g. 1/0 instead.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agodocs: further improve toplevel docu
Dietmar Maurer [Mon, 30 Sep 2024 08:24:06 +0000 (10:24 +0200)]
docs: further improve toplevel docu

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agodocs: list all input elements on the start page
Dietmar Maurer [Sun, 29 Sep 2024 14:06:33 +0000 (16:06 +0200)]
docs: list all input elements on the start page

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agocleanup: fix links inside doc comments
Dietmar Maurer [Sun, 29 Sep 2024 10:50:23 +0000 (12:50 +0200)]
cleanup: fix links inside doc comments

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agodocs: update readme, mention the new examples repository
Dietmar Maurer [Sun, 29 Sep 2024 10:29:08 +0000 (12:29 +0200)]
docs: update readme, mention the new examples repository

3 months agominor doc cleanups
Dietmar Maurer [Sun, 29 Sep 2024 08:19:18 +0000 (10:19 +0200)]
minor doc cleanups

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agobump version to 0.3.0, prepare for public release
Dietmar Maurer [Fri, 27 Sep 2024 15:24:30 +0000 (17:24 +0200)]
bump version to 0.3.0, prepare for public release

We moved the examples code into a sparate git repository using:

 git filter-repo --subdirectory-filter examples
 git filter-repo --path tauri-example --invert-paths

The repository is called: proxmox-widget-toolkit-examples.

Then used the following command to cleanup this repository:

 git filter-repo --invert-paths --path examples --path .gitmodules --path www --path scss --path assets

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoimpl WidgetStyleBuilder for NavigationDrawer
Dietmar Maurer [Thu, 26 Sep 2024 10:06:58 +0000 (12:06 +0200)]
impl WidgetStyleBuilder for NavigationDrawer

3 months agowidget: input panel: use FieldLabel instead of just text
Dominik Csapak [Wed, 25 Sep 2024 13:11:08 +0000 (15:11 +0200)]
widget: input panel: use FieldLabel instead of just text

this simplifies the code here a bit, and makes it possible to give
each label separate classes and styles (such as alignment for example)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget: move FieldLabel functionality into Boolean
Dominik Csapak [Wed, 25 Sep 2024 13:11:07 +0000 (15:11 +0200)]
widget: move FieldLabel functionality into Boolean

We only ever need labels on the right side (called box label now), only
on checkboxes, so it does not really make sense to have a separate
widget for that.

For now we only accept text as the label, but we could change that
later if we need that.

This makes the 'FieldLabel' available and ready to use elsewhere, e.g.
the input panel.

For convenience, we implement some From traits for it, so one can use a
bare string to create such a field label.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget: boolean: improve html markup to be more sensible
Dominik Csapak [Wed, 25 Sep 2024 13:11:06 +0000 (15:11 +0200)]
widget: boolean: improve html markup to be more sensible

Currently we "misused" the tooltip as part of the markup, but put a
container around for css purposes.

Instead make the actual checkbox/switch markup completely independent
from the tooltip and only move the onclick handler there.

This way it's more easy to add other things like a 'boxLabel' later.

While we're changing the markup anyway, remove the use of the html!
macro and use our builtin builder classes for containers and icons.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget: input panel: remove gap configuration
Dominik Csapak [Wed, 25 Sep 2024 13:07:05 +0000 (15:07 +0200)]
widget: input panel: remove gap configuration

it was only a single class, that can also added directly, no use in
having a specialized option for it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget: boolean: make clickable area react to clicks
Dominik Csapak [Tue, 24 Sep 2024 13:14:45 +0000 (15:14 +0200)]
widget: boolean: make clickable area react to clicks

same as for the checkbox field in commit:
a3361fc (widget: checkbox: make clickable area react to clicks)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agowidget: checkbox: make clickable area react to clicks
Dominik Csapak [Mon, 23 Sep 2024 12:28:31 +0000 (14:28 +0200)]
widget: checkbox: make clickable area react to clicks

the outer container contains the visual cues for clicking the checkbox,
but only the inner actual checkbox reacted to clicks. Move the onclick
handler to the outer container so the click behavior matches the
visuals.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agocss: add `FontColor` enum
Dominik Csapak [Thu, 12 Sep 2024 12:05:00 +0000 (14:05 +0200)]
css: add `FontColor` enum

so we can refer to the `pwt-color-XXX` classes without using the bare
class names.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agocss: add `FlexFit` struct
Dominik Csapak [Thu, 12 Sep 2024 12:04:59 +0000 (14:04 +0200)]
css: add `FlexFit` struct

so to use the `pwt-flex-fit` class without having to rely on the bare
css class name.

I did not put it in the `Flex` enum, since it does not only change the
flex value, but also the over flow auto.

It's a shorthand for using Flex::Fill + Overflow::Auto, but since we use
that often, this could come in handy

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agocss: add `Custom` color scheme variant
Dominik Csapak [Thu, 12 Sep 2024 12:04:58 +0000 (14:04 +0200)]
css: add `Custom` color scheme variant

this can be useful if the theme or project defines it's own color
schemes, but still want to refer to them in the code without having to
use bare css classes

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agocss: add `DarkSurface` color scheme to enum
Dominik Csapak [Thu, 12 Sep 2024 12:04:57 +0000 (14:04 +0200)]
css: add `DarkSurface` color scheme to enum

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agocss: add `Shadow` utility struct for css
Dominik Csapak [Thu, 12 Sep 2024 12:04:56 +0000 (14:04 +0200)]
css: add `Shadow` utility struct for css

so one can use the pwt-shadowX classes without having to use a string
in the code

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agonavigation_drawer: update route even if the current key is selected
Shannon Sterz [Wed, 4 Sep 2024 13:08:18 +0000 (15:08 +0200)]
navigation_drawer: update route even if the current key is selected

this is necessary so a user can use the parent's navigation elements to
navigate back to parent of the current child too. otherwise, only other
elements on the same level as the parent are usable.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
4 months agouse timeout for search dropdown to reduce number of loads
Dietmar Maurer [Sat, 7 Sep 2024 07:42:49 +0000 (09:42 +0200)]
use timeout for search dropdown to reduce number of loads

4 months agoimprove docs
Dietmar Maurer [Fri, 6 Sep 2024 07:26:52 +0000 (09:26 +0200)]
improve docs

4 months agoimprove docs
Dietmar Maurer [Fri, 6 Sep 2024 06:34:37 +0000 (08:34 +0200)]
improve docs

4 months agoadd search dropdown widget
Dietmar Maurer [Fri, 6 Sep 2024 06:09:02 +0000 (08:09 +0200)]
add search dropdown widget

4 months agodropdown: fix picker not closing on first select after input
Dominik Csapak [Tue, 3 Sep 2024 13:54:46 +0000 (15:54 +0200)]
dropdown: fix picker not closing on first select after input

we don't want to close the picker when we change the value via keyboard
input, so we save that info in `change_from_input`.

Since we only handle that flag when the picker is open, we must only set
it when the picker is open too. Otherwise we possibly set it while the
picker is closed, having the wrong behavior when the picker gets opened
afterwards.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agocss: fix class for InverseSurface variant
Dominik Csapak [Tue, 3 Sep 2024 13:54:37 +0000 (15:54 +0200)]
css: fix class for InverseSurface variant

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agodropdown: replace on_select callback with DropdownController
Dietmar Maurer [Tue, 3 Sep 2024 11:23:44 +0000 (13:23 +0200)]
dropdown: replace on_select callback with DropdownController

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agowidget: data table: simplify cursor selection
Dominik Csapak [Tue, 13 Aug 2024 11:42:11 +0000 (13:42 +0200)]
widget: data table: simplify cursor selection

we don't have to check for ctrl here, since just before we clear the
selection if we didn't have ctrl pressed, so `toggle` does the
same as `select` here in that case. Also, this makes it possible
to deselect rows with the simple selection mode.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agowidget: data table: selection column: always use 'pointer' cursor
Dominik Csapak [Tue, 13 Aug 2024 11:42:15 +0000 (13:42 +0200)]
widget: data table: selection column: always use 'pointer' cursor

to indicate it can be clicked

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agowidget: data table: add 'simple' multiselect mode
Dominik Csapak [Tue, 13 Aug 2024 11:42:14 +0000 (13:42 +0200)]
widget: data table: add 'simple' multiselect mode

akin to what extjs does:

clicking a row toggles it instead of deselecting all other keys

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agowidget: data table: improve checkbox clicking in selection column
Dominik Csapak [Tue, 13 Aug 2024 11:42:13 +0000 (13:42 +0200)]
widget: data table: improve checkbox clicking in selection column

by;
* moving the click handler on the whole cell instead of the tiny
  checkbox icon
* stopping propagation, this makes it actually work, since otherwise
  the row would get clicked and it resulted in the usual 'select only
  this row' behavior

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agowidget: data table: column: fix useless code
Dominik Csapak [Tue, 13 Aug 2024 11:42:12 +0000 (13:42 +0200)]
widget: data table: column: fix useless code

it's a noop, so remove it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agostate: selection: handle multiselect change more gracefully
Dominik Csapak [Tue, 13 Aug 2024 11:42:10 +0000 (13:42 +0200)]
state: selection: handle multiselect change more gracefully

instead of keeping the respective state, try to be smart about it:
* when changing to multiselect, keep the selection
* when changing from multiselect, clear the map, but keep the selection
  if there was only one

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agopwt-macros: drop unused dependency on lazy_static
Wolfgang Bumiller [Wed, 14 Aug 2024 09:22:28 +0000 (11:22 +0200)]
pwt-macros: drop unused dependency on lazy_static

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agosilence another warning
Wolfgang Bumiller [Mon, 12 Aug 2024 13:34:30 +0000 (15:34 +0200)]
silence another warning

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agosilence warnings
Wolfgang Bumiller [Mon, 12 Aug 2024 12:58:57 +0000 (14:58 +0200)]
silence warnings

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoadd .cargo/config.toml to build from debian packages
Wolfgang Bumiller [Mon, 12 Aug 2024 08:12:54 +0000 (10:12 +0200)]
add .cargo/config.toml to build from debian packages

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoexamples/counter2 was never checked in, drop it from workspace members
Wolfgang Bumiller [Mon, 12 Aug 2024 07:36:58 +0000 (09:36 +0200)]
examples/counter2 was never checked in, drop it from workspace members

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoupdate for theme rename
Dietmar Maurer [Fri, 2 Aug 2024 09:07:27 +0000 (11:07 +0200)]
update for theme rename

Theme Proxmox is now called Crisp.

5 months agoFormContext: trigger onchange after field registration
Dietmar Maurer [Tue, 30 Jul 2024 06:55:29 +0000 (08:55 +0200)]
FormContext: trigger onchange after field registration

6 months agowidget: number field: stop spinner on pointerout
Dominik Csapak [Wed, 17 Jul 2024 13:06:58 +0000 (15:06 +0200)]
widget: number field: stop spinner on pointerout

otherwise it's possible to let the spinner running by
* pressing the mouse button on the spinner
* moving the cursor outside of the spinner
* letting go

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agowidget: number field: let MIN/MAX be settable by step-up/down
Dominik Csapak [Wed, 17 Jul 2024 12:22:44 +0000 (14:22 +0200)]
widget: number field: let MIN/MAX be settable by step-up/down

when stepping up or down for signed numbers (e.g. i64)
the MIN/MAX value was not allowed. Fix the check to allow that.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agowidget: introduce FocusTracker
Dominik Csapak [Wed, 17 Jul 2024 10:25:02 +0000 (12:25 +0200)]
widget: introduce FocusTracker

this is a helper struct to better handle focusin/out events.
We had the pattern with DelayedFocusChange in a few components, and they
were basically all doing the same.

To factor out, we have to use a bit of a different approach (see the
comment on the struct itself), since we don't want to introduce an extra
component in the component tree for this (since nothing is really
rendered for that).

It's not saving us much code for now, but with every new component
needing that, we can make sure we have the same behavior.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agowidget: number field: set/keep focus when using spinner
Dominik Csapak [Wed, 17 Jul 2024 10:24:10 +0000 (12:24 +0200)]
widget: number field: set/keep focus when using spinner

by using 'prevent_default' and setting focus manually from the
pointerdown event.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agowidget: number field: add spinner repeat behaviour
Dominik Csapak [Wed, 17 Jul 2024 10:24:09 +0000 (12:24 +0200)]
widget: number field: add spinner repeat behaviour

instead of reacting to each click, react to pointerdown/up
and implement a very basic repeat logic, so that the value
de/increments repeatedly when keep pressing the up/down buttons

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agowidget: number field: add spinner elements
Dominik Csapak [Tue, 16 Jul 2024 12:48:04 +0000 (14:48 +0200)]
widget: number field: add spinner elements

we want that as that is expected ux, but since the underlying input
field is of type text, the browser does not show it.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agowidget: number field: prevent scrolling of container
Dominik Csapak [Tue, 16 Jul 2024 12:48:03 +0000 (14:48 +0200)]
widget: number field: prevent scrolling of container

if we react to the wheel event of the in input, we don't want to let
the browser scroll any outer container, so prevent that.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agowidget: menu: radio button: use dot-circle
Dominik Csapak [Tue, 16 Jul 2024 12:45:08 +0000 (14:45 +0200)]
widget: menu: radio button: use dot-circle

instead of check-cirlce. This is more idiomatic for radio buttons.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>