-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates the Wing docs. See details in [workflow run]. [Workflow Run]: https://github.com/winglang/docsite/actions/runs/10881267657 ------ *Automatically created via the "update-docs" workflow* Signed-off-by: monabot <[email protected]>
- Loading branch information
Showing
13 changed files
with
78 additions
and
14 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
api_versioned_docs/version-latest/04-standard-library/aws/api-reference.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
api_versioned_docs/version-latest/04-standard-library/expect/api-reference.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
api_versioned_docs/version-latest/04-standard-library/fs/api-reference.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
api_versioned_docs/version-latest/04-standard-library/http/api-reference.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
api_versioned_docs/version-latest/04-standard-library/math/api-reference.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
api_versioned_docs/version-latest/04-standard-library/sim/api-reference.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
api_versioned_docs/version-latest/04-standard-library/ui/_category_.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
label: ui | ||
collapsible: true | ||
collapsed: true | ||
link: | ||
type: generated-index |
2 changes: 1 addition & 1 deletion
2
api_versioned_docs/version-latest/04-standard-library/ui/api-reference.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
api_versioned_docs/version-latest/04-standard-library/ui/index.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
title: "ui module" | ||
id: ui | ||
--- | ||
|
||
The `ui` module lets you create tools for interacting with resources in the Wing Console. | ||
|
||
Using components like `ui.Button`, `ui.Field`, or `ui.Table`, it's possible to trigger actions in Wing apps or display important information to the user. | ||
|
||
Here's an example of a class which has a button and field showing the internal state of the resource: | ||
|
||
```js playground example | ||
bring cloud; | ||
bring ui; | ||
|
||
class WidgetService { | ||
data: cloud.Bucket; | ||
counter: cloud.Counter; | ||
new() { | ||
this.data = new cloud.Bucket(); | ||
this.counter = new cloud.Counter(); | ||
|
||
// a button lets you invoke any inflight function | ||
new ui.Button("Add widget", inflight () => { this.addWidget(); }); | ||
|
||
// a field displays a labeled value | ||
new ui.Field( | ||
"Total widgets", | ||
inflight () => { return this.countWidgets(); }, | ||
refreshRate: 5s, | ||
); | ||
} | ||
|
||
inflight addWidget() { | ||
let id = this.counter.inc(); | ||
this.data.put("widget-{id}", "my data"); | ||
} | ||
|
||
inflight countWidgets(): str { | ||
return "{this.data.list().length}"; | ||
} | ||
} | ||
|
||
new WidgetService(); | ||
``` | ||
|
||
Here is what the UI looks like in the Wing Console: | ||
|
||
![](./widget-service-example.png) | ||
|
||
--- | ||
|
||
```mdx-code-block | ||
import DocCardList from '@theme/DocCardList'; | ||
<DocCardList /> | ||
``` |
Binary file added
BIN
+129 KB
...versioned_docs/version-latest/04-standard-library/ui/widget-service-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
api_versioned_docs/version-latest/04-standard-library/util/api-reference.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters