]>
git.proxmox.com Git - ui/proxmox-yew-widget-toolkit.git/log
Dietmar Maurer [Sun, 22 Oct 2023 13:51:02 +0000 (15:51 +0200)]
FormContext: replace submit_converter with SubmitValidateFn
Simply let the validation function return the value to be submitted.
Dietmar Maurer [Sun, 22 Oct 2023 09:56:25 +0000 (11:56 +0200)]
ValidateFn: cleanup
Dietmar Maurer [Sun, 22 Oct 2023 09:38:43 +0000 (11:38 +0200)]
static_validation_fn: simplify
Dietmar Maurer [Sun, 22 Oct 2023 09:31:40 +0000 (11:31 +0200)]
ValidateFn: rename valaidate to apply
Dietmar Maurer [Sun, 22 Oct 2023 09:24:52 +0000 (11:24 +0200)]
IntoOptionalRenderFn: cleanup
Dietmar Maurer [Sat, 21 Oct 2023 13:21:48 +0000 (15:21 +0200)]
avoid compiler warning
Dietmar Maurer [Sat, 21 Oct 2023 12:56:55 +0000 (14:56 +0200)]
Meter: use TextRenderFn instead of show_text bool.
Dietmar Maurer [Sat, 21 Oct 2023 12:51:43 +0000 (14:51 +0200)]
impl IntoOptionalTextRenderFn<T> for bool
Dietmar Maurer [Sat, 21 Oct 2023 09:03:04 +0000 (11:03 +0200)]
Hidden: new hidden form field
Dietmar Maurer [Thu, 19 Oct 2023 16:38:46 +0000 (18:38 +0200)]
parse_float: return localized error message.
Dietmar Maurer [Thu, 19 Oct 2023 12:19:22 +0000 (14:19 +0200)]
Number: impl Up/Down with Arrow keys
Dietmar Maurer [Thu, 19 Oct 2023 10:09:48 +0000 (12:09 +0200)]
Number: simplify code
Dietmar Maurer [Thu, 19 Oct 2023 09:05:40 +0000 (11:05 +0200)]
move LocaleInfo to dom
Dietmar Maurer [Thu, 19 Oct 2023 08:56:22 +0000 (10:56 +0200)]
new crate::dom module (moved from crate::widget::dom)
Dietmar Maurer [Thu, 19 Oct 2023 08:38:25 +0000 (10:38 +0200)]
FormContext::is_dirty: compare value after calling submit_converter
We need this for fields which stores transient state during editing, i.e.
Number<f64> with localized decimal point.
Dietmar Maurer [Wed, 18 Oct 2023 13:00:07 +0000 (15:00 +0200)]
Number: improve docs
Dietmar Maurer [Wed, 18 Oct 2023 12:56:12 +0000 (14:56 +0200)]
Number: support locale setting.
Dietmar Maurer [Tue, 17 Oct 2023 16:51:41 +0000 (18:51 +0200)]
Number: handle localized numbers
Dietmar Maurer [Tue, 17 Oct 2023 16:20:26 +0000 (18:20 +0200)]
Number: use input-type text (instead of number)
Dietmar Maurer [Tue, 17 Oct 2023 09:28:19 +0000 (11:28 +0200)]
Number: force value as string
To avoid conversion problems.
Dietmar Maurer [Tue, 17 Oct 2023 09:19:17 +0000 (11:19 +0200)]
MenuCheckbox: format, remove debug log
Dietmar Maurer [Tue, 17 Oct 2023 09:18:09 +0000 (11:18 +0200)]
ManagedField: improve force_value
Alliow to force value and valid separtately.
Dominik Csapak [Mon, 16 Oct 2023 14:01:43 +0000 (16:01 +0200)]
data_table: use configured column width as initial values
instead of using no widths at all. This fixes an issue when the width
of a column influeces the height of the whole data_table, e.g. when
there is a column with text wrap and the data_table is free standing
(like it is in a grid picker)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dietmar Maurer [Mon, 16 Oct 2023 15:34:50 +0000 (17:34 +0200)]
Number: fix forced value/valid
Dominik Csapak [Mon, 16 Oct 2023 10:34:07 +0000 (12:34 +0200)]
grid_picker: remove manual selection, instead call on_select manually
the selection itself is handled by the DataTable, but we want to
manually call 'on_select' every time, otherwise we don't close the
picker when selecting an already selected element
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Mon, 16 Oct 2023 08:22:07 +0000 (10:22 +0200)]
data_table/resizable_header: change from mouse to pointer events
so it works with a touchscreen too
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Mon, 16 Oct 2023 08:18:39 +0000 (10:18 +0200)]
data_table/resizable_header: stop propagation for click event
this prevents changing the sort order when resizing the column
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Fri, 13 Oct 2023 14:40:05 +0000 (16:40 +0200)]
widget/tristate_boolean: set selection to default
otherwise there is no initial selection, which would make this a
4-state boolean (nothing, "", "yes" and "no")
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Fri, 13 Oct 2023 14:02:13 +0000 (16:02 +0200)]
state/selection: rustfmt
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dietmar Maurer [Sat, 14 Oct 2023 07:13:24 +0000 (09:13 +0200)]
Selector: delete item with "Delete" and "Backspace"
Dietmar Maurer [Fri, 13 Oct 2023 15:40:46 +0000 (17:40 +0200)]
Mask: transition opacity to reduce flickering
Dominik Csapak [Fri, 13 Oct 2023 13:31:35 +0000 (15:31 +0200)]
widget/dropdown: prevent picker from being shown while disabled
also rustfmt
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Fri, 13 Oct 2023 13:26:59 +0000 (15:26 +0200)]
widget/grid_picker: add pointer class to cells
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Fri, 13 Oct 2023 13:26:48 +0000 (15:26 +0200)]
widget/grid_picker: rustfmt
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Fri, 13 Oct 2023 13:17:36 +0000 (15:17 +0200)]
widget/dropdown: add pointer class to dropdown handle
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Fri, 13 Oct 2023 13:15:42 +0000 (15:15 +0200)]
widget/field: add InputType enum
in place of strings for 'input_type'
this way we can guarantee its a valid value
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Fri, 13 Oct 2023 13:16:47 +0000 (15:16 +0200)]
widget/form: rustfmt
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Fri, 13 Oct 2023 10:52:56 +0000 (12:52 +0200)]
button: add ButtonType
and use it for the button_type property
instead of a string, so that the valid variants are forced
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dietmar Maurer [Fri, 13 Oct 2023 10:23:01 +0000 (12:23 +0200)]
cleanup: remove unused files
Dietmar Maurer [Fri, 13 Oct 2023 10:13:45 +0000 (12:13 +0200)]
Tooltip: use Into<Html> for rich_tip (revert to previous behavior)
Dietmar Maurer [Fri, 13 Oct 2023 06:53:02 +0000 (08:53 +0200)]
Field: only show tooltips if field is enabled
Dietmar Maurer [Fri, 13 Oct 2023 06:21:48 +0000 (08:21 +0200)]
Field: allow to set tooltip
Dietmar Maurer [Thu, 12 Oct 2023 15:21:43 +0000 (17:21 +0200)]
FormContext: format cleanup, add reset_field
Dominik Csapak [Thu, 12 Oct 2023 12:04:56 +0000 (14:04 +0200)]
input_panel: use 'add_custom_child_impl' for add_spacer
does exactly what we want here: correct count tracking, setting style, etc.
fixes an issue when the last item before the spacer was on the right
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dietmar Maurer [Thu, 12 Oct 2023 11:48:47 +0000 (13:48 +0200)]
Button: use builder macro
Dietmar Maurer [Thu, 12 Oct 2023 11:44:41 +0000 (13:44 +0200)]
Button: add button_type property
Dietmar Maurer [Thu, 12 Oct 2023 10:09:26 +0000 (12:09 +0200)]
ResetButton: cleanup, use real Button
Dietmar Maurer [Thu, 12 Oct 2023 10:00:07 +0000 (12:00 +0200)]
SubmitButton: cleanup, add check_dirty property
Dietmar Maurer [Thu, 12 Oct 2023 05:16:49 +0000 (07:16 +0200)]
Dropdown: set valid to true by default
Dominik Csapak [Wed, 11 Oct 2023 12:53:18 +0000 (14:53 +0200)]
input_panel: use Html instead of VNode
it's an alias but we want to use Html instead
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Wed, 11 Oct 2023 11:51:08 +0000 (13:51 +0200)]
ManagedField: improve validator trait method signature
instead of having a `create_validation_fn` in the trait, make it
`validator` and use that function to create the ValidateFn outside
this way an implementer of this does only have to create the validator
and does not have to create the ValidateFn (since thats always the same
anyway)
This makes it necessary that the validate closure is given as a
reference instead of moving it in (otherwise it couldn't be called
more than once).
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Wed, 11 Oct 2023 10:55:54 +0000 (12:55 +0200)]
widget/focus: refactor calculate_next
reuse calculate_next from roving_tabindex_next_el
but fix the clamping of the iniital index value
this was found by the tests added
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Wed, 11 Oct 2023 10:54:31 +0000 (12:54 +0200)]
widget/focus: clippy fixes
* looks like `matches!`
* use `is_empty`
* iter over list instead of index range
* use `as_deref`
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Wed, 11 Oct 2023 10:53:09 +0000 (12:53 +0200)]
touch/slidable: rustfmt + clippy fixes
clippy:
* use range instead of multiple ifs (circumvented by using variables,
this makes the code clearer too)
* nested if
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Tue, 10 Oct 2023 12:20:54 +0000 (14:20 +0200)]
clippy: fix statics have by default a `'static` lifetime
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Tue, 10 Oct 2023 12:20:24 +0000 (14:20 +0200)]
touch/material_app: rustfmt
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Tue, 10 Oct 2023 12:17:43 +0000 (14:17 +0200)]
clippy: fix redundant field names in struct initialization
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Tue, 10 Oct 2023 12:17:23 +0000 (14:17 +0200)]
state/slab_tree_serde: rustfmt
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Tue, 10 Oct 2023 12:16:38 +0000 (14:16 +0200)]
state/keyed_slab_tree: rustfmt
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Tue, 10 Oct 2023 11:54:59 +0000 (13:54 +0200)]
pwt-macros: widget: change Into<VNode> impl to From<X> for VNode
rustdocs recommend implementing From<X> for Y instead of Into<Y> for X
because the former provides the latter automatically
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dietmar Maurer [Wed, 11 Oct 2023 07:39:44 +0000 (09:39 +0200)]
Dropdown: replace input_class with valid flag, correctly set disabled class
And add a disabled combobox to the demo.
Dietmar Maurer [Tue, 10 Oct 2023 15:51:02 +0000 (17:51 +0200)]
Dropdown: add input_class property
Dietmar Maurer [Tue, 10 Oct 2023 15:32:03 +0000 (17:32 +0200)]
ManagedFieldMaster: also update self.validate
Dietmar Maurer [Tue, 10 Oct 2023 14:55:14 +0000 (16:55 +0200)]
ManagedField: extract validation args
to simplify change tracking
Dietmar Maurer [Tue, 10 Oct 2023 12:11:29 +0000 (14:11 +0200)]
Revert "cargo: update indexmap to version 2"
This reverts commit
ebd44c8f3edbb131c05c79ebf8e6d2b8136f9137 .
Dietmar Maurer [Tue, 10 Oct 2023 12:10:35 +0000 (14:10 +0200)]
Revert "cargo: update serde-wasm-bindgen"
This reverts commit
a80ca6c830ea592ddc65e8773c1de33bdb999353 .
Those packages are not packaged for debian, so I will revert thos for now
Maximiliano Sandoval R [Tue, 10 Oct 2023 11:42:06 +0000 (13:42 +0200)]
cargo: update serde-wasm-bindgen
This is listed as outdated by `cargo outdated`.
Signed-off-by: Maximiliano Sandoval R <m.sandoval@proxmox.com>
Maximiliano Sandoval R [Tue, 10 Oct 2023 11:42:05 +0000 (13:42 +0200)]
cargo: update indexmap to version 2
Signed-off-by: Maximiliano Sandoval R <m.sandoval@proxmox.com>
Maximiliano Sandoval R [Tue, 10 Oct 2023 11:38:35 +0000 (13:38 +0200)]
gettext_wrapper: Add test for gettext functions
Signed-off-by: Maximiliano Sandoval R <m.sandoval@proxmox.com>
Maximiliano Sandoval R [Tue, 10 Oct 2023 11:38:34 +0000 (13:38 +0200)]
tr: Add tests
Many of these are tested in gettext_wrapper, since these are the public
facing api makes sense to test them again.
Signed-off-by: Maximiliano Sandoval R <m.sandoval@proxmox.com>
Maximiliano Sandoval R [Tue, 10 Oct 2023 11:38:33 +0000 (13:38 +0200)]
tr: Move context argument in pgettext macro
This way it matches gettext-rs and the pgettext function in
gettext_wrapper.rs.
Signed-off-by: Maximiliano Sandoval R <m.sandoval@proxmox.com>
Dominik Csapak [Tue, 10 Oct 2023 11:42:55 +0000 (13:42 +0200)]
remove leftover RtlChangeObserver
was never committed
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Tue, 10 Oct 2023 11:05:24 +0000 (13:05 +0200)]
widget/tab_bar: improve rtl behavior for active indicator
by using 'inset-inline-start' instead of left, and using the correct
sides when it's rtl
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Tue, 10 Oct 2023 10:06:21 +0000 (12:06 +0200)]
widget/tab_bar: don't show active indicator when none are active
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dietmar Maurer [Tue, 10 Oct 2023 10:39:19 +0000 (12:39 +0200)]
static_validation_fn: new helper macro
Dietmar Maurer [Tue, 10 Oct 2023 09:46:36 +0000 (11:46 +0200)]
fix previous commit
Dietmar Maurer [Tue, 10 Oct 2023 09:36:37 +0000 (11:36 +0200)]
ManagedFiled: add validation_fn_need_update
Clumsy way to avoid frequent/useless validation function updates...
Maximiliano Sandoval R [Mon, 9 Oct 2023 14:06:17 +0000 (16:06 +0200)]
README: Fix typo
Signed-off-by: Maximiliano Sandoval R <m.sandoval@proxmox.com>
Maximiliano Sandoval R [Mon, 9 Oct 2023 14:06:16 +0000 (16:06 +0200)]
README: Use 4 spaces for code
Markup supports code block as 4 space indentated text.
Signed-off-by: Maximiliano Sandoval R <m.sandoval@proxmox.com>
Dietmar Maurer [Mon, 9 Oct 2023 16:30:42 +0000 (18:30 +0200)]
ManagedField: improve docs
Dietmar Maurer [Mon, 9 Oct 2023 16:15:29 +0000 (18:15 +0200)]
ManagedField: add create_validation_fn
We need to update the validation function whenever component properties changes,
i.e. things like 'required'
Dominik Csapak [Mon, 9 Oct 2023 13:26:05 +0000 (15:26 +0200)]
input_panel: extend custom_child support
by supporting left,right and large ones
advanced support is prepared, not yet implemented
(but shouldn't be hard)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dietmar Maurer [Mon, 9 Oct 2023 13:42:36 +0000 (15:42 +0200)]
SubmitCallback: return ()
Dominik Csapak [Mon, 9 Oct 2023 11:51:15 +0000 (13:51 +0200)]
pwt-macros: add tests for widget macro
some "mocking" is required, but thats mostly copy & paste
also adds failing tests to test the macro span output
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Mon, 9 Oct 2023 11:35:47 +0000 (13:35 +0200)]
pwt-macros: widget: add macro documentation
needs yew as dev-dependency
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Mon, 9 Oct 2023 09:22:27 +0000 (11:22 +0200)]
widget: nav: readd links in docs, but without the warnings
it was just the 'Self' in the link that was missing
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Mon, 9 Oct 2023 09:12:01 +0000 (11:12 +0200)]
gettext: log error when using multiple anonymous format parameters
in translations, using anonymous parameters is almost always wrong,
since there is no guarantee that the parameter order is the same in
other languages.
Also add a test for that.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Mon, 9 Oct 2023 09:09:38 +0000 (11:09 +0200)]
pwt-macros: widget: use absolute paths to traits
This improves the generated error messages.
Also add a short comment what we do here
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dominik Csapak [Mon, 9 Oct 2023 09:09:06 +0000 (11:09 +0200)]
pwt-macros: builder: improve link text for autogenerated docs
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Dietmar Maurer [Sun, 8 Oct 2023 14:44:34 +0000 (16:44 +0200)]
persistent_state: add suport for session storage
Note: State IDs starting with "*" use session storage!
Dietmar Maurer [Sun, 8 Oct 2023 12:51:05 +0000 (14:51 +0200)]
TabBar: impl state cache
Dietmar Maurer [Sun, 8 Oct 2023 08:36:30 +0000 (10:36 +0200)]
Loader: add ability to cache data.
Dietmar Maurer [Fri, 6 Oct 2023 16:51:03 +0000 (18:51 +0200)]
cleanup: avoid doc warnings
Dietmar Maurer [Fri, 6 Oct 2023 16:46:27 +0000 (18:46 +0200)]
gettext improve docs
Dietmar Maurer [Fri, 6 Oct 2023 16:32:07 +0000 (18:32 +0200)]
tr: improve docs
Dietmar Maurer [Fri, 6 Oct 2023 16:19:02 +0000 (18:19 +0200)]
improve gettext docs
Dietmar Maurer [Fri, 6 Oct 2023 13:32:23 +0000 (15:32 +0200)]
gettext_runtime_format.rs: improve docs and format
Dietmar Maurer [Fri, 6 Oct 2023 13:12:43 +0000 (15:12 +0200)]
improve gettext docs
Dietmar Maurer [Fri, 6 Oct 2023 12:31:21 +0000 (14:31 +0200)]
rename runtime_fmt to gettext_runtime_format
Dietmar Maurer [Fri, 6 Oct 2023 09:43:27 +0000 (11:43 +0200)]
improve gettext macros