Commit Graph

6304 Commits

Author SHA1 Message Date
darrenburns
62fcefbd2d Validation (#2600)
* A few different types of validation

* Rename

* Fix test

* Updating validation framework

* Update lockfile

* Ensure validators can be None

* Reworking the API a little

* Convert Input.Changed to dataclass

* Add utility for getting failures as strings

* Update an example in Validator docstring

* Remove some redundant `pass`es

* Renaming variables

* Validating Input on submit, attaching result to Submitted event

* Testing various validation features

* Update snapshots and deps

* Styling unfocused -invalid Input differently

* Add snapshot test around input validation and associated styles

* Validation docs

* Tidying validation docs in Input widget reference

* Fix mypy issues

* Remove __bool__ from Failure, make validator field required

* Code review changes

* Improving error messages in Validators
2023-05-25 13:29:33 +01:00
Rodrigo Girão Serrão
5cb30b5ecc Merge pull request #2628 from Textualize/auto-focus-improv
Add auto focus to app.
2023-05-25 11:59:54 +01:00
Rodrigo Girão Serrão
afbf52d8f5 Merge pull request #2654 from Textualize/progressbar-docs
Fix progress bar docs issue.
2023-05-25 11:59:37 +01:00
Rodrigo Girão Serrão
08eb1f1fab Remove invalid ref. 2023-05-25 11:01:47 +01:00
Will McGugan
8151946f38 add blur (#2645)
* add blur

* docstring

* blur on disabled

* snapshot test

* Add test
2023-05-24 20:16:11 +01:00
Dave Pearson
a89c199409 Merge pull request #2646 from davep/fix-broken-xrefs
Fix some assorted documentation cross-references
2023-05-24 16:37:01 +01:00
Dave Pearson
bad2a5a064 Merge pull request #2647 from davep/fix-set-classes-docstring
Fix docstring for `DOMNode.set_classes`
2023-05-24 16:24:20 +01:00
Dave Pearson
2c184caa2a Fix docstring for DOMNode.set_classes
The argument in the Args list was missing its name; also fixes a typo too.
2023-05-24 16:16:15 +01:00
Dave Pearson
718760dcb1 Fix some assorted documentation cross-references
Couple or so things I noticed while working on docs.
2023-05-24 15:53:56 +01:00
Dave Pearson
fb82564858 Merge pull request #2643 from davep/include-more-option-stuff-in-docs
Include more missing things from the OptionList
2023-05-24 15:28:52 +01:00
Dave Pearson
09c6ea9911 Include more missing things from the OptionList
While working on the SelectionList documentation I've noticed that even more
things have got lost from the docs relating to OptionList, likely lost when
widgets were removed from the API section of the docs.

This drags more OptionList-related types into the docs, thus providing more
links.
2023-05-24 15:21:41 +01:00
Dave Pearson
78980670da Merge pull request #2640 from davep/include-option-in-docs
Include `widgets.option_list.Option` in the docs
2023-05-24 14:31:27 +01:00
Dave Pearson
7c9b3f4cd6 Include widgets.option_list.Option in the docs
Noticed this in passing; possibly dropped by accident when the widgets were
removed form the API section of the docs?
2023-05-24 14:13:17 +01:00
Dave Pearson
9459a4efd7 Merge pull request #2636 from davep/select-reactive-table-fix 2023-05-24 10:52:29 +01:00
Dave Pearson
ed0aa78f22 Merge pull request #2637 from davep/option-list-docs-typo-fix 2023-05-24 10:47:25 +01:00
Dave Pearson
7f3efcf6ed Fix a typo in the OptionList messages list 2023-05-24 10:41:55 +01:00
Dave Pearson
7d635915fa Fix Select reactives table layout
The escaped | wasn't being rendered correctly as it was inside back-ticks.
2023-05-24 10:31:34 +01:00
Rodrigo Girão Serrão
bc92cf57e7 Add auto focus to app.
Related issues: #2594.
2023-05-23 11:32:40 +01:00
Dave Pearson
607939e41d Merge pull request #2626 from davep/option-list-typo-fix
Fix a copy/pasteo in an option list docstring
2023-05-23 09:45:37 +01:00
Dave Pearson
10bccfd9ee Fix a copy/pasteo in an option list docstring 2023-05-23 09:27:40 +01:00
Will McGugan
be49aabefe remove markup, simplify repr (#2623)
* remove markup, simplify repr

* changelog

* remove rendundant repr (thanks Paul)

* changelog
2023-05-22 20:26:37 +01:00
Dave Pearson
55f887e66e Merge pull request #2610 from davep/directory-tree-alt-path
Let child classes of DirectoryTree override Path creation
2023-05-22 15:56:50 +01:00
Rodrigo Girão Serrão
724fedc442 Merge pull request #2621 from Textualize/leave-footer-push-modal-screen
Leave footer when pushing modal screen
2023-05-22 14:43:05 +01:00
Rodrigo Girão Serrão
d48a127ffe Merge pull request #2540 from Textualize/screen-modes
Implements screen modes
2023-05-22 14:27:35 +01:00
Rodrigo Girão Serrão
c64111bcb5 Add property alias.
Related comment: https://github.com/Textualize/textual/pull/2540\#discussion_r1196634789
2023-05-22 14:21:11 +01:00
Rodrigo Girão Serrão
c32d5d3c25 Add regression test for #2606. 2023-05-22 13:53:58 +01:00
Rodrigo Girão Serrão
33a470f569 Fix footer highlight when pushing modal. 2023-05-22 11:45:40 +01:00
Rodrigo Girão Serrão
5c1c62edd0 Merge pull request #2607 from Textualize/placeholder-cycle
Placeholder color cycle
2023-05-22 10:50:11 +01:00
Rodrigo Girão Serrão
4e86e655d6 Merge branch 'main' into placeholder-cycle 2023-05-22 10:43:12 +01:00
Rodrigo Girão Serrão
5e04a4d4de Add description to work decorator. (#2605)
* Add description to work decorator.

* Fix stutter.
2023-05-22 10:32:23 +01:00
Luper Rouch
33da5c1afc Fix App.BINDINGS type (#2620)
The implicit type was creating mypy errors when defining bindings with
tuples. For example:

    class MyApp(App):
        BINDINGS = [("q", "quit", "Quit")]

Would give the error:

    error: List item 0 has incompatible type "Tuple[str, str, str]"; expected "Binding"  [list-item]
2023-05-22 10:27:31 +01:00
Will McGugan
7d0d1ac5c8 Bump0260 (#2617)
* full map

* docstring changelog

* changelog

* simplify, add comment
v0.26.0
2023-05-20 11:30:42 +01:00
Dave Pearson
7dd05e3ec0 Let child classes of DirectoryTree override Path creation
With #1719 in mind, and as an alternative to #2608, this allows for a child
class of DirectoryTree to specify how a fresh `Path` should be created. The
idea here being that whatever is created should be of the `Path` type, but
can have other abilities.
2023-05-19 10:15:04 +01:00
Rodrigo Girão Serrão
6523fbaff1 Fix tests. 2023-05-18 16:27:09 +01:00
Rodrigo Girão Serrão
c85e428228 Fix placeholder color cycling. 2023-05-18 16:24:07 +01:00
Rodrigo Girão Serrão
ad986b127d Merge branch 'main' into screen-modes 2023-05-18 15:11:21 +01:00
Rodrigo Girão Serrão
d65daf81c0 Address review comments. 2023-05-18 15:07:52 +01:00
Will McGugan
49e1080279 update howto 2023-05-18 10:03:26 +01:00
Will McGugan
8fd5aec454 fix layout 2023-05-18 09:28:33 +01:00
Will McGugan
ff5665051b Release0250 (#2598)
* version bump

* changelog
v0.25.0
2023-05-17 16:30:36 +01:00
Rodrigo Girão Serrão
a9c8b59df5 Use default string on error inside work. (#2595)
Related issues #2588.
2023-05-17 16:27:32 +01:00
Dave Pearson
84de8a8949 Typo fix (#2596) 2023-05-17 16:26:33 +01:00
darrenburns
e25c6290ba Add classes to Tab widget (#2589)
* Add classes to Tab widget

* Update CHANGELOG
2023-05-17 16:21:32 +01:00
Dave Pearson
7ff205bc29 Merge pull request #2545 from davep/directory-tree-work-in-worker
Load `DirectoryTree` contents in a worker
2023-05-17 15:42:51 +01:00
Rodrigo Girão Serrão
179a85058e Merge pull request #2581 from Textualize/auto-focus-improv
AUTO_FOCUS targets first focusable widget.
2023-05-17 15:32:08 +01:00
Will McGugan
f820598846 How to (#2592)
* words

* how to

* Apply suggestions from code review

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-05-17 15:30:31 +01:00
Dave Pearson
abbffbfa6a Code tidy
As per https://github.com/Textualize/textual/pull/2545#discussion_r1196591147
2023-05-17 15:30:13 +01:00
Dave Pearson
e381c26165 Create a single method for adding a node to the load queue
In doing so fix an issue where, after the previous change, I wasn't marking
the root of the tree as loaded.
2023-05-17 15:27:01 +01:00
Dave Pearson
522d56c601 Be more optimistic about when the node content is loaded
As per https://github.com/Textualize/textual/pull/2545#discussion_r1196589864
2023-05-17 15:21:38 +01:00
Dave Pearson
86bee6c495 Rename _to_load to _load_queue
As per https://github.com/Textualize/textual/pull/2545#discussion_r1196580316
2023-05-17 15:17:05 +01:00