@lowdefy/docs-content 0.0.0-experimental-20260710073520
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +20 -0
- package/content/actions/callapi.md +66 -0
- package/content/actions/callmethod.md +41 -0
- package/content/actions/copytoclipboard.md +32 -0
- package/content/actions/displaymessage.md +53 -0
- package/content/actions/downloadcsv.md +89 -0
- package/content/actions/fetch.md +50 -0
- package/content/actions/geolocationcurrentposition.md +56 -0
- package/content/actions/link.md +104 -0
- package/content/actions/login.md +85 -0
- package/content/actions/logout.md +56 -0
- package/content/actions/pdfmake.md +304 -0
- package/content/actions/request.md +67 -0
- package/content/actions/reset.md +27 -0
- package/content/actions/resetvalidation.md +85 -0
- package/content/actions/scrollto.md +85 -0
- package/content/actions/setdarkmode.md +62 -0
- package/content/actions/setfocus.md +33 -0
- package/content/actions/setglobal.md +63 -0
- package/content/actions/setlocale.md +69 -0
- package/content/actions/setstate.md +70 -0
- package/content/actions/throw.md +72 -0
- package/content/actions/validate.md +87 -0
- package/content/actions/wait.md +24 -0
- package/content/agents/agent-endpoint-tools.md +190 -0
- package/content/agents/agent-mcp-tools.md +124 -0
- package/content/agents/agent-multi-agent.md +136 -0
- package/content/agents/agent-properties.md +174 -0
- package/content/agents/agent-server-hooks.md +336 -0
- package/content/agents/agentchat.md +515 -0
- package/content/agents/agentconversations.md +148 -0
- package/content/concepts/ai-agent-docs.md +190 -0
- package/content/concepts/cli.md +213 -0
- package/content/concepts/connections-and-requests.md +7 -0
- package/content/concepts/custom-html.md +3 -0
- package/content/concepts/custom-styling.md +161 -0
- package/content/concepts/events-and-actions.md +271 -0
- package/content/concepts/hosting-files.md +18 -0
- package/content/concepts/i18n.md +320 -0
- package/content/concepts/keyboard-shortcuts.md +218 -0
- package/content/concepts/layout-overview.md +478 -0
- package/content/concepts/lists.md +144 -0
- package/content/concepts/logger.md +43 -0
- package/content/concepts/lowdefy-schema.md +365 -0
- package/content/concepts/menus.md +144 -0
- package/content/concepts/module-authoring.md +564 -0
- package/content/concepts/modules.md +338 -0
- package/content/concepts/operators.md +45 -0
- package/content/concepts/overview.md +19 -0
- package/content/concepts/references-and-templates.md +207 -0
- package/content/concepts/secrets.md +24 -0
- package/content/concepts/selectors.md +143 -0
- package/content/connections/amazonredshift.md +176 -0
- package/content/connections/anthropic.md +232 -0
- package/content/connections/awss3.md +313 -0
- package/content/connections/azureblobstorage.md +133 -0
- package/content/connections/elasticsearch.md +371 -0
- package/content/connections/google.md +228 -0
- package/content/connections/googlecloudstorage.md +139 -0
- package/content/connections/googlesheet.md +313 -0
- package/content/connections/knex.md +206 -0
- package/content/connections/mariadb.md +177 -0
- package/content/connections/mcp.md +134 -0
- package/content/connections/mongodb.md +739 -0
- package/content/connections/mssql.md +191 -0
- package/content/connections/mysql.md +192 -0
- package/content/connections/openai-connection.md +228 -0
- package/content/connections/postgresql.md +200 -0
- package/content/connections/redis.md +116 -0
- package/content/connections/sendgridmail.md +94 -0
- package/content/connections/smtp.md +149 -0
- package/content/connections/sqlite.md +187 -0
- package/content/connections/stripe.md +115 -0
- package/content/container-blocks/affix.md +413 -0
- package/content/container-blocks/alert.md +937 -0
- package/content/container-blocks/badge.md +1222 -0
- package/content/container-blocks/box.md +1453 -0
- package/content/container-blocks/card.md +1200 -0
- package/content/container-blocks/carousel.md +2247 -0
- package/content/container-blocks/collapse.md +1335 -0
- package/content/container-blocks/configprovider.md +1070 -0
- package/content/container-blocks/confirmmodal.md +1159 -0
- package/content/container-blocks/content.md +597 -0
- package/content/container-blocks/descriptions.md +870 -0
- package/content/container-blocks/drawer.md +1379 -0
- package/content/container-blocks/dropdownmenu.md +643 -0
- package/content/container-blocks/flex.md +1510 -0
- package/content/container-blocks/footer.md +380 -0
- package/content/container-blocks/googlemaps.md +546 -0
- package/content/container-blocks/googlemapsheatmap.md +607 -0
- package/content/container-blocks/googlemapsscript.md +61 -0
- package/content/container-blocks/header.md +302 -0
- package/content/container-blocks/label.md +739 -0
- package/content/container-blocks/layout.md +604 -0
- package/content/container-blocks/masonry.md +1090 -0
- package/content/container-blocks/mobilemenu.md +1244 -0
- package/content/container-blocks/modal.md +1180 -0
- package/content/container-blocks/pageheadermenu.md +614 -0
- package/content/container-blocks/pagesidebarlayout.md +438 -0
- package/content/container-blocks/pagesidermenu.md +651 -0
- package/content/container-blocks/popover.md +1421 -0
- package/content/container-blocks/result.md +972 -0
- package/content/container-blocks/sider.md +1064 -0
- package/content/container-blocks/span.md +747 -0
- package/content/container-blocks/spinner.md +267 -0
- package/content/container-blocks/splitter.md +1735 -0
- package/content/container-blocks/tabs.md +1718 -0
- package/content/container-blocks/tooltip.md +1274 -0
- package/content/container-blocks/watermark.md +515 -0
- package/content/controls/for.md +103 -0
- package/content/controls/if.md +107 -0
- package/content/controls/log.md +50 -0
- package/content/controls/parallel.md +71 -0
- package/content/controls/parallel_for.md +36 -0
- package/content/controls/reject.md +56 -0
- package/content/controls/return.md +66 -0
- package/content/controls/set_state.md +98 -0
- package/content/controls/switch.md +90 -0
- package/content/controls/throw.md +79 -0
- package/content/controls/try.md +88 -0
- package/content/deployment/docker.md +149 -0
- package/content/deployment/node-server.md +27 -0
- package/content/deployment/vercel.md +101 -0
- package/content/display-blocks/aggrid.md +1459 -0
- package/content/display-blocks/anchor.md +336 -0
- package/content/display-blocks/avatar.md +1154 -0
- package/content/display-blocks/breadcrumb.md +517 -0
- package/content/display-blocks/button.md +758 -0
- package/content/display-blocks/calendar.md +156 -0
- package/content/display-blocks/dangeroushtml.md +314 -0
- package/content/display-blocks/dangerousmarkdown.md +423 -0
- package/content/display-blocks/diffgit.md +44 -0
- package/content/display-blocks/difflist.md +225 -0
- package/content/display-blocks/diffsidebyside.md +56 -0
- package/content/display-blocks/difftimeline.md +94 -0
- package/content/display-blocks/divider.md +406 -0
- package/content/display-blocks/download.md +60 -0
- package/content/display-blocks/dropdownbutton.md +661 -0
- package/content/display-blocks/echart.md +418 -0
- package/content/display-blocks/floatbutton.md +545 -0
- package/content/display-blocks/html.md +311 -0
- package/content/display-blocks/icon.md +717 -0
- package/content/display-blocks/img.md +479 -0
- package/content/display-blocks/markdown.md +520 -0
- package/content/display-blocks/markdownwithcode.md +730 -0
- package/content/display-blocks/menu.md +1123 -0
- package/content/display-blocks/message.md +941 -0
- package/content/display-blocks/notification.md +1410 -0
- package/content/display-blocks/paragraph.md +643 -0
- package/content/display-blocks/progress.md +818 -0
- package/content/display-blocks/qrcode.md +519 -0
- package/content/display-blocks/s3download.md +240 -0
- package/content/display-blocks/search.md +360 -0
- package/content/display-blocks/skeleton.md +272 -0
- package/content/display-blocks/skeletonavatar.md +222 -0
- package/content/display-blocks/skeletonbutton.md +245 -0
- package/content/display-blocks/skeletoninput.md +223 -0
- package/content/display-blocks/skeletonparagraph.md +201 -0
- package/content/display-blocks/statistic.md +485 -0
- package/content/display-blocks/steps.md +585 -0
- package/content/display-blocks/tag.md +620 -0
- package/content/display-blocks/title.md +654 -0
- package/content/display-blocks/tour.md +2359 -0
- package/content/input-blocks/autocomplete.md +786 -0
- package/content/input-blocks/buttonselector.md +964 -0
- package/content/input-blocks/checkboxselector.md +765 -0
- package/content/input-blocks/checkboxswitch.md +497 -0
- package/content/input-blocks/colorselector.md +884 -0
- package/content/input-blocks/daterangeselector.md +777 -0
- package/content/input-blocks/dateselector.md +693 -0
- package/content/input-blocks/datetimeselector.md +791 -0
- package/content/input-blocks/inputgallery.md +528 -0
- package/content/input-blocks/monthselector.md +717 -0
- package/content/input-blocks/multipleselector.md +1337 -0
- package/content/input-blocks/numberinput.md +855 -0
- package/content/input-blocks/pagination.md +679 -0
- package/content/input-blocks/paragraphinput.md +1664 -0
- package/content/input-blocks/passwordinput.md +480 -0
- package/content/input-blocks/phonenumberinput.md +688 -0
- package/content/input-blocks/radioselector.md +820 -0
- package/content/input-blocks/ratingslider.md +684 -0
- package/content/input-blocks/s3uploadbutton.md +384 -0
- package/content/input-blocks/s3uploaddragger.md +305 -0
- package/content/input-blocks/s3uploadphoto.md +288 -0
- package/content/input-blocks/segmentedselector.md +782 -0
- package/content/input-blocks/selector.md +1162 -0
- package/content/input-blocks/switch.md +552 -0
- package/content/input-blocks/textarea.md +714 -0
- package/content/input-blocks/textinput.md +639 -0
- package/content/input-blocks/tiptapinput.md +226 -0
- package/content/input-blocks/tiptapmentioninput.md +471 -0
- package/content/input-blocks/titleinput.md +1094 -0
- package/content/input-blocks/treeinput.md +144 -0
- package/content/input-blocks/treemultipleselector.md +162 -0
- package/content/input-blocks/treeselector.md +185 -0
- package/content/input-blocks/upload.md +149 -0
- package/content/input-blocks/uploaddragger.md +85 -0
- package/content/input-blocks/uploadphoto.md +84 -0
- package/content/input-blocks/weekselector.md +630 -0
- package/content/list-blocks/controlledlist.md +498 -0
- package/content/list-blocks/list.md +529 -0
- package/content/list-blocks/listselector.md +301 -0
- package/content/list-blocks/masonrylist.md +230 -0
- package/content/migration/upgrade-guide.md +106 -0
- package/content/migration/v4-to-v5.md +589 -0
- package/content/migration/v5-to-v6.md +36 -0
- package/content/operators/_actions.md +58 -0
- package/content/operators/_and.md +76 -0
- package/content/operators/_api.md +254 -0
- package/content/operators/_app.md +114 -0
- package/content/operators/_args.md +65 -0
- package/content/operators/_array.md +331 -0
- package/content/operators/_base64.md +49 -0
- package/content/operators/_boolean.md +33 -0
- package/content/operators/_build.md +166 -0
- package/content/operators/_change_case.md +357 -0
- package/content/operators/_date.md +415 -0
- package/content/operators/_dayjs.md +128 -0
- package/content/operators/_diff.md +61 -0
- package/content/operators/_divide.md +32 -0
- package/content/operators/_eq.md +52 -0
- package/content/operators/_event.md +86 -0
- package/content/operators/_function.md +52 -0
- package/content/operators/_get.md +92 -0
- package/content/operators/_global.md +86 -0
- package/content/operators/_gt.md +50 -0
- package/content/operators/_gte.md +50 -0
- package/content/operators/_hash.md +112 -0
- package/content/operators/_if.md +30 -0
- package/content/operators/_if_none.md +47 -0
- package/content/operators/_index.md +48 -0
- package/content/operators/_input.md +86 -0
- package/content/operators/_intl.md +135 -0
- package/content/operators/_item.md +166 -0
- package/content/operators/_js.md +113 -0
- package/content/operators/_json.md +120 -0
- package/content/operators/_jsonata.md +152 -0
- package/content/operators/_locale.md +65 -0
- package/content/operators/_location.md +40 -0
- package/content/operators/_log.md +22 -0
- package/content/operators/_lt.md +50 -0
- package/content/operators/_lte.md +50 -0
- package/content/operators/_math.md +407 -0
- package/content/operators/_media.md +83 -0
- package/content/operators/_menu.md +62 -0
- package/content/operators/_module.md +340 -0
- package/content/operators/_mql.md +95 -0
- package/content/operators/_ne.md +62 -0
- package/content/operators/_not.md +33 -0
- package/content/operators/_number.md +159 -0
- package/content/operators/_nunjucks.md +117 -0
- package/content/operators/_object.md +253 -0
- package/content/operators/_operator.md +33 -0
- package/content/operators/_or.md +67 -0
- package/content/operators/_product.md +45 -0
- package/content/operators/_random.md +90 -0
- package/content/operators/_ref.md +80 -0
- package/content/operators/_regex.md +69 -0
- package/content/operators/_request.md +35 -0
- package/content/operators/_request_details.md +29 -0
- package/content/operators/_secret.md +56 -0
- package/content/operators/_state.md +134 -0
- package/content/operators/_step.md +98 -0
- package/content/operators/_string.md +327 -0
- package/content/operators/_subtract.md +24 -0
- package/content/operators/_sum.md +45 -0
- package/content/operators/_switch.md +37 -0
- package/content/operators/_t.md +96 -0
- package/content/operators/_theme.md +65 -0
- package/content/operators/_type.md +78 -0
- package/content/operators/_uri.md +49 -0
- package/content/operators/_url_query.md +92 -0
- package/content/operators/_user.md +154 -0
- package/content/operators/_uuid.md +118 -0
- package/content/operators/_var.md +88 -0
- package/content/operators/_yaml.md +96 -0
- package/content/other/introduction.md +39 -0
- package/content/other/next-auth-providers.md +3 -0
- package/content/other/updatesession.md +26 -0
- package/content/plugins/plugins-actions.md +80 -0
- package/content/plugins/plugins-connections.md +98 -0
- package/content/plugins/plugins-dev.md +138 -0
- package/content/plugins/plugins-introduction.md +29 -0
- package/content/plugins/plugins-operators.md +71 -0
- package/content/testing/e2e-auth.md +108 -0
- package/content/testing/e2e-configuration.md +107 -0
- package/content/testing/e2e-getting-started.md +96 -0
- package/content/testing/e2e-introduction.md +53 -0
- package/content/testing/e2e-mocking.md +155 -0
- package/content/testing/e2e-writing-tests.md +214 -0
- package/content/tutorial/tutorial-actions-operators.md +222 -0
- package/content/tutorial/tutorial-add-blocks.md +86 -0
- package/content/tutorial/tutorial-create-page.md +57 -0
- package/content/tutorial/tutorial-display-data-page.md +181 -0
- package/content/tutorial/tutorial-next-steps.md +53 -0
- package/content/tutorial/tutorial-requests-sql.md +22 -0
- package/content/tutorial/tutorial-start.md +71 -0
- package/content/user-authentication/auth-providers.md +15 -0
- package/content/user-authentication/login-and-logout.md +122 -0
- package/content/user-authentication/users-introduction.md +31 -0
- package/index.json +2281 -0
- package/package.json +34 -0
- package/scripts/extractAgentDocs.js +130 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# ResetValidation
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(void): void
|
|
5
|
+
(blockId: string): void
|
|
6
|
+
(blockIds: string[]): void
|
|
7
|
+
(params: {
|
|
8
|
+
blockId?: string|string[],
|
|
9
|
+
regex?: string|string[],
|
|
10
|
+
}): void
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The `ResetValidation` action is used to reset validation flags on input fields.
|
|
14
|
+
|
|
15
|
+
By default when a page is opened, no validation flags are set on any input fields. When the `Validate` is called, a validation flag is set on input fields matching the validation params. To reset the validation flags, use the `ResetValidation` action.
|
|
16
|
+
|
|
17
|
+
The `ResetValidation` action `blockIds` or `regex` params are used to limit which blocks validation errors and warnings should be reset.
|
|
18
|
+
|
|
19
|
+
#### Parameters
|
|
20
|
+
|
|
21
|
+
###### void
|
|
22
|
+
The `ResetValidation` action lowers validation flags on all blocks on the page if called without params.
|
|
23
|
+
|
|
24
|
+
###### string
|
|
25
|
+
A blockId of the block for which to lower validation flags.
|
|
26
|
+
|
|
27
|
+
###### string[]
|
|
28
|
+
An array of blockIds of the blocks for which to lower validation flags.
|
|
29
|
+
|
|
30
|
+
###### object
|
|
31
|
+
- `blockId?: string|string[]`: A blockId or an array of the blockIds of the blocks for which to lower validation flags
|
|
32
|
+
- `regex?: string|string[]`: A regex string pattern or an array of regex string patterns to match the blockIds for which to lower validation flags.
|
|
33
|
+
|
|
34
|
+
#### Examples
|
|
35
|
+
|
|
36
|
+
###### Lower validation flags for all inputs on the page:
|
|
37
|
+
```yaml
|
|
38
|
+
- id: reset_all
|
|
39
|
+
type: ResetValidation
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
###### Lower validation flags for a single input:
|
|
43
|
+
```yaml
|
|
44
|
+
- id: reset_my_input
|
|
45
|
+
type: ResetValidation
|
|
46
|
+
params: my_input
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
###### Lower validation flags for a list of inputs:
|
|
50
|
+
```yaml
|
|
51
|
+
- id: reset_input_a_and_b
|
|
52
|
+
type: ResetValidation
|
|
53
|
+
params:
|
|
54
|
+
- my_input_a
|
|
55
|
+
- my_input_b
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
###### Lower validation flags for all inputs matching a regex pattern:
|
|
59
|
+
```yaml
|
|
60
|
+
- id: reset_foo
|
|
61
|
+
type: ResetValidation
|
|
62
|
+
params:
|
|
63
|
+
regex: ^foo\.
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
###### Lower validation flags for all inputs matching a list of regex patterns:
|
|
67
|
+
```yaml
|
|
68
|
+
- id: reset_foo_and_price
|
|
69
|
+
type: ResetValidation
|
|
70
|
+
params:
|
|
71
|
+
regex:
|
|
72
|
+
- ^foo\.
|
|
73
|
+
- ^.*price.*$
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
###### Lower validation flags for all inputs matching a list of regex patterns and a blockId:
|
|
77
|
+
```yaml
|
|
78
|
+
- id: reset_foo_price_and_my_input
|
|
79
|
+
type: ResetValidation
|
|
80
|
+
params:
|
|
81
|
+
blockId: my_input
|
|
82
|
+
regex:
|
|
83
|
+
- ^foo\.
|
|
84
|
+
- ^.*price.*$
|
|
85
|
+
```
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# ScrollTo
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(params: {
|
|
5
|
+
top?: number,
|
|
6
|
+
left?: number,
|
|
7
|
+
behavior?: enum
|
|
8
|
+
}): void
|
|
9
|
+
|
|
10
|
+
(params: {
|
|
11
|
+
blockId: string,
|
|
12
|
+
options: {
|
|
13
|
+
behavior?: enum,
|
|
14
|
+
block? enum,
|
|
15
|
+
inline?: enum
|
|
16
|
+
}
|
|
17
|
+
}): void
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The `ScrollTo` action is used to scroll the users browser. It is often used to scroll back to the top
|
|
21
|
+
of a long form after resetting the form, or to scroll the user to the top of a page after linking to a new page.
|
|
22
|
+
|
|
23
|
+
The `ScrollTo` action has two modes - scrolling to a block and scrolling to x and y coordinates on a page.
|
|
24
|
+
|
|
25
|
+
> When scrolling to a block, `ScrollTo` implements [`Element.scrollIntoView()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView), while
|
|
26
|
+
when scrolling to coordinates, it implements [`Window.scrollTo()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo).
|
|
27
|
+
|
|
28
|
+
#### Parameters
|
|
29
|
+
|
|
30
|
+
###### Scroll to coordinates
|
|
31
|
+
- `top: number`: Specifies the number of pixels along the Y axis to scroll the window.
|
|
32
|
+
- `left: number`: Specifies the number of pixels along the X axis to scroll the window.
|
|
33
|
+
- `behavior: enum`: Defines the transition animation. One of `auto` or `smooth`.
|
|
34
|
+
|
|
35
|
+
###### Scroll to a block
|
|
36
|
+
- `blockId: string`: __Required__ - The blockId of a block to scroll to.
|
|
37
|
+
- `options: object`: _Object_
|
|
38
|
+
- `behavior: enum`: Defines the transition animation. One of `auto` or `smooth`. Defaults to `auto`.
|
|
39
|
+
- `block: enum`: Defines vertical alignment. One of `start`, `center`, `end`, or `nearest`. Defaults to `start`.
|
|
40
|
+
- `inline: enum`: Defines horizontal alignment. One of `start`, `center`, `end`, or `nearest`. Defaults to `nearest`.
|
|
41
|
+
|
|
42
|
+
#### Examples
|
|
43
|
+
|
|
44
|
+
###### Scroll to a block:
|
|
45
|
+
```yaml
|
|
46
|
+
- id: scroll_to_block
|
|
47
|
+
type: ScrollTo
|
|
48
|
+
params:
|
|
49
|
+
blockId: my_block
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
###### Scroll to the top of the page:
|
|
53
|
+
```yaml
|
|
54
|
+
- id: scroll_to_top
|
|
55
|
+
type: ScrollTo
|
|
56
|
+
params:
|
|
57
|
+
top: 0
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
###### Scroll to the top of the page after linking from a previous page:
|
|
61
|
+
```yaml
|
|
62
|
+
- id: link_button
|
|
63
|
+
type: Button
|
|
64
|
+
events:
|
|
65
|
+
onClick:
|
|
66
|
+
- id: link_
|
|
67
|
+
type: Link
|
|
68
|
+
params:
|
|
69
|
+
pageId: next_page
|
|
70
|
+
- id: scroll_to_top
|
|
71
|
+
type: ScrollTo
|
|
72
|
+
params:
|
|
73
|
+
top: 0
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
###### Scroll to the centre of a block:
|
|
77
|
+
```yaml
|
|
78
|
+
- id: scroll_to_block
|
|
79
|
+
type: ScrollTo
|
|
80
|
+
params:
|
|
81
|
+
blockId: my_block
|
|
82
|
+
options:
|
|
83
|
+
block: center
|
|
84
|
+
inline: center
|
|
85
|
+
```
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# SetDarkMode
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(params?: {
|
|
5
|
+
darkMode?: 'system' | 'light' | 'dark'
|
|
6
|
+
}): void
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The `SetDarkMode` action sets the user's dark mode preference. When called without params, it cycles through `light`, `dark`, and `system`. When `darkMode` is provided, it sets the preference to that value.
|
|
10
|
+
|
|
11
|
+
- `'system'`: Follow the operating system's dark mode preference (and update live when the OS setting changes).
|
|
12
|
+
- `'light'`: Force light mode.
|
|
13
|
+
- `'dark'`: Force dark mode.
|
|
14
|
+
|
|
15
|
+
The preference is persisted to `localStorage` and triggers re-rendering of the root Ant Design `ConfigProvider`. All blocks and `_media: darkMode` expressions update automatically.
|
|
16
|
+
|
|
17
|
+
> **Note:** If the app's `theme.darkMode` config is set to `'light'` or `'dark'`, the developer has locked the mode. `SetDarkMode` still stores the user's preference, but it won't take visual effect until the config is changed to `'system'`.
|
|
18
|
+
|
|
19
|
+
#### Parameters
|
|
20
|
+
|
|
21
|
+
###### object (optional)
|
|
22
|
+
- `darkMode: 'system' | 'light' | 'dark'`: Set the dark mode preference. When omitted, cycles through light, dark, and system.
|
|
23
|
+
|
|
24
|
+
#### Examples
|
|
25
|
+
|
|
26
|
+
###### Cycle dark mode preference:
|
|
27
|
+
```yaml
|
|
28
|
+
- id: toggle_button
|
|
29
|
+
type: Button
|
|
30
|
+
properties:
|
|
31
|
+
title: Toggle Dark Mode
|
|
32
|
+
icon:
|
|
33
|
+
_if:
|
|
34
|
+
test:
|
|
35
|
+
_media: darkMode
|
|
36
|
+
then: AiOutlineSun
|
|
37
|
+
else: AiOutlineMoon
|
|
38
|
+
events:
|
|
39
|
+
onClick:
|
|
40
|
+
- id: toggle
|
|
41
|
+
type: SetDarkMode
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
###### Set dark mode to follow system preference:
|
|
45
|
+
```yaml
|
|
46
|
+
events:
|
|
47
|
+
onClick:
|
|
48
|
+
- id: use_system
|
|
49
|
+
type: SetDarkMode
|
|
50
|
+
params:
|
|
51
|
+
darkMode: system
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
###### Force dark mode:
|
|
55
|
+
```yaml
|
|
56
|
+
events:
|
|
57
|
+
onClick:
|
|
58
|
+
- id: enable_dark
|
|
59
|
+
type: SetDarkMode
|
|
60
|
+
params:
|
|
61
|
+
darkMode: dark
|
|
62
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# SetFocus
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(params: string): void
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
This action implements the [HTMLElement.focus()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) method.
|
|
8
|
+
|
|
9
|
+
The `SetFocus` action sets focus on the specified HTML element, provided it can receive focus. It takes an id of the HTML element as a parameter.
|
|
10
|
+
By default, when focusing an element, the browser will scroll it into view and may provide visible indication of the focus, typically by displaying a "focus ring" around the element.
|
|
11
|
+
|
|
12
|
+
Note that for blocks like `TextInput`, the id of the HTML input element is not equal to the block id, since the block includes other HTML elements like the label, extra text and icons. You can inspect the HTML elements in the browser to find the correct element id.
|
|
13
|
+
|
|
14
|
+
#### Parameters
|
|
15
|
+
|
|
16
|
+
###### string
|
|
17
|
+
String that is the ID of the HTML element to focus.
|
|
18
|
+
|
|
19
|
+
#### Examples
|
|
20
|
+
|
|
21
|
+
###### Set a TextInput block in focus when another TextInput's value changes:
|
|
22
|
+
```yaml
|
|
23
|
+
- id: text_input_1
|
|
24
|
+
type: TextInput
|
|
25
|
+
events:
|
|
26
|
+
onChange:
|
|
27
|
+
- id: set_focus
|
|
28
|
+
type: SetFocus
|
|
29
|
+
# Note that the params is an HTML element ID, and not a Block ID.
|
|
30
|
+
params: text_input_2_input
|
|
31
|
+
- id: text_input_2
|
|
32
|
+
type: TextInput
|
|
33
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# SetGlobal
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(toSet: object): void
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `SetGlobal` action sets values to the `global` object. It takes an object as parameters, and sets each of those values to the `global` object.
|
|
8
|
+
This is useful if you need to set a value that needs to be available across multiple pages in the app, like the id of a currently selected
|
|
9
|
+
object. `SetGlobal` works just like [`SetState`](/SetState), except it sets to the `global` object and not `state`.
|
|
10
|
+
|
|
11
|
+
#### Parameters
|
|
12
|
+
|
|
13
|
+
###### object
|
|
14
|
+
Object with key value pairs to set in `global`.
|
|
15
|
+
|
|
16
|
+
#### Examples
|
|
17
|
+
|
|
18
|
+
###### Set a single value to global:
|
|
19
|
+
```yaml
|
|
20
|
+
- id: set_selected_company
|
|
21
|
+
type: SetGlobal
|
|
22
|
+
params:
|
|
23
|
+
selected_selected_company:
|
|
24
|
+
_state: company.id
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
###### Set multiple values to state:
|
|
28
|
+
```yaml
|
|
29
|
+
- id: multiple_values
|
|
30
|
+
type: SetGlobal
|
|
31
|
+
params:
|
|
32
|
+
firstName: Monica
|
|
33
|
+
lastName: Geller
|
|
34
|
+
address:
|
|
35
|
+
street: 90 Bedford St
|
|
36
|
+
city: New York
|
|
37
|
+
zipCode: '10014'
|
|
38
|
+
country: US
|
|
39
|
+
friends:
|
|
40
|
+
- Ross Geller
|
|
41
|
+
- Rachel Green
|
|
42
|
+
- Chandler Bing
|
|
43
|
+
- Phoebe Buffay
|
|
44
|
+
- Joey Tribbiani
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
###### Using dot notation:
|
|
48
|
+
```yaml
|
|
49
|
+
- id: dot_notation
|
|
50
|
+
type: SetGlobal
|
|
51
|
+
params:
|
|
52
|
+
firstName: Monica
|
|
53
|
+
lastName: Geller
|
|
54
|
+
address.street: 90 Bedford St
|
|
55
|
+
address.city: New York
|
|
56
|
+
address.zipCode: '10014'
|
|
57
|
+
address.country: US
|
|
58
|
+
friends.0: Ross Geller
|
|
59
|
+
friends.1: Rachel Green
|
|
60
|
+
friends.2: Chandler Bing
|
|
61
|
+
friends.3: Phoebe Buffay
|
|
62
|
+
friends.5: Joey Tribbiani
|
|
63
|
+
```
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# SetLocale
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(params?: {
|
|
5
|
+
locale?: string
|
|
6
|
+
}): void
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The `SetLocale` action sets the user's active locale preference for the app. The preference is persisted to `localStorage` (`lowdefy_locale`) and triggers re-rendering of the root Ant Design `ConfigProvider`. All blocks, `_t` translations, `_locale` operators, antd-built-in strings (date pickers, modals, validation), and dayjs date formatting update automatically.
|
|
10
|
+
|
|
11
|
+
- `locale`: A BCP 47 code declared in `config.i18n.locales` (e.g. `'en-US'`, `'de-DE'`).
|
|
12
|
+
- `'auto'` (or no params): Clears the user preference. The app falls back to the browser language best-fit, then to `config.i18n.defaultLocale`.
|
|
13
|
+
|
|
14
|
+
`SetLocale` is a no-op when `config.i18n` is not configured.
|
|
15
|
+
|
|
16
|
+
#### Parameters
|
|
17
|
+
|
|
18
|
+
###### object (optional)
|
|
19
|
+
- `locale: string`: A BCP 47 locale code declared in `config.i18n.locales`, or `'auto'` to clear the preference.
|
|
20
|
+
|
|
21
|
+
#### Examples
|
|
22
|
+
|
|
23
|
+
###### Switch to German:
|
|
24
|
+
```yaml
|
|
25
|
+
events:
|
|
26
|
+
onClick:
|
|
27
|
+
- id: switch_de
|
|
28
|
+
type: SetLocale
|
|
29
|
+
params:
|
|
30
|
+
locale: de-DE
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
###### Wire a language picker:
|
|
34
|
+
|
|
35
|
+
`_locale: supported` returns an array of locale descriptors `{ code, label, antd, dayjs }`. Selector options must be `{ value, label }` pairs, so map each descriptor onto that shape:
|
|
36
|
+
```yaml
|
|
37
|
+
- id: lang_picker
|
|
38
|
+
type: Selector
|
|
39
|
+
properties:
|
|
40
|
+
options:
|
|
41
|
+
_array.map:
|
|
42
|
+
on:
|
|
43
|
+
_locale: supported
|
|
44
|
+
callback:
|
|
45
|
+
_function:
|
|
46
|
+
value:
|
|
47
|
+
__args: 0.code
|
|
48
|
+
label:
|
|
49
|
+
__args: 0.label
|
|
50
|
+
value:
|
|
51
|
+
_locale: active
|
|
52
|
+
events:
|
|
53
|
+
onChange:
|
|
54
|
+
- id: set_locale
|
|
55
|
+
type: SetLocale
|
|
56
|
+
params:
|
|
57
|
+
locale:
|
|
58
|
+
_state: lang_picker
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
###### Reset to browser/default:
|
|
62
|
+
```yaml
|
|
63
|
+
events:
|
|
64
|
+
onClick:
|
|
65
|
+
- id: reset_locale
|
|
66
|
+
type: SetLocale
|
|
67
|
+
params:
|
|
68
|
+
locale: auto
|
|
69
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# SetState
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(toSet: object): void
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `SetState` action sets values in `state`. It takes an object as parameters, and sets each of those values to the `state` object.
|
|
8
|
+
This is useful if you want to initialize `state`, set a flag after an action has executed (eg. to disable a button), or to set the result
|
|
9
|
+
of a request to state.
|
|
10
|
+
|
|
11
|
+
#### Parameters
|
|
12
|
+
|
|
13
|
+
###### object
|
|
14
|
+
Object with key value pairs to set in `state`.
|
|
15
|
+
|
|
16
|
+
#### Examples
|
|
17
|
+
|
|
18
|
+
###### Set a single value to state:
|
|
19
|
+
```yaml
|
|
20
|
+
- id: single_value
|
|
21
|
+
type: SetState
|
|
22
|
+
params:
|
|
23
|
+
message: Hello
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
###### Set multiple values to state:
|
|
27
|
+
```yaml
|
|
28
|
+
- id: multiple_values
|
|
29
|
+
type: SetState
|
|
30
|
+
params:
|
|
31
|
+
firstName: Monica
|
|
32
|
+
lastName: Geller
|
|
33
|
+
address:
|
|
34
|
+
street: 90 Bedford St
|
|
35
|
+
city: New York
|
|
36
|
+
zipCode: '10014'
|
|
37
|
+
country: US
|
|
38
|
+
friends:
|
|
39
|
+
- Ross Geller
|
|
40
|
+
- Rachel Green
|
|
41
|
+
- Chandler Bing
|
|
42
|
+
- Phoebe Buffay
|
|
43
|
+
- Joey Tribbiani
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
###### Using dot notation:
|
|
47
|
+
```yaml
|
|
48
|
+
- id: dot_notation
|
|
49
|
+
type: SetState
|
|
50
|
+
params:
|
|
51
|
+
firstName: Monica
|
|
52
|
+
lastName: Geller
|
|
53
|
+
address.street: 90 Bedford St
|
|
54
|
+
address.city: New York
|
|
55
|
+
address.zipCode: '10014'
|
|
56
|
+
address.country: US
|
|
57
|
+
friends.0: Ross Geller
|
|
58
|
+
friends.1: Rachel Green
|
|
59
|
+
friends.2: Chandler Bing
|
|
60
|
+
friends.3: Phoebe Buffay
|
|
61
|
+
friends.5: Joey Tribbiani
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
###### Initialize state with the value of a request:
|
|
65
|
+
```yaml
|
|
66
|
+
- id: initialize
|
|
67
|
+
type: SetState
|
|
68
|
+
params:
|
|
69
|
+
_request: getUser
|
|
70
|
+
```
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Throw
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(params: {
|
|
5
|
+
throw?: boolean,
|
|
6
|
+
message?: string,
|
|
7
|
+
metaData?: any
|
|
8
|
+
}): void
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The `Throw` action is used throw an error to the user and log to the console. If `throw: true`, the `Throw`
|
|
12
|
+
action will throw an error, and this will stop the execution of actions that are defined after it. If the action does not thrown, the `Throw` action will do nothing and the actions defined after it will be executed.
|
|
13
|
+
|
|
14
|
+
#### Parameters
|
|
15
|
+
|
|
16
|
+
- `throw: boolean`: Throws an error and stops the action chain when `true` or continues the action chain when `false` or undefined.
|
|
17
|
+
- `message: string`: The error message to show to the user and log to the console if `throw: true`. This message can be overridden by setting the action's `messages.error`.
|
|
18
|
+
- `metaData: any`: Data to log to the console if `throw: true`.
|
|
19
|
+
|
|
20
|
+
#### Examples
|
|
21
|
+
|
|
22
|
+
###### Throw with custom message:
|
|
23
|
+
```yaml
|
|
24
|
+
- id: foo_throw
|
|
25
|
+
type: Throw
|
|
26
|
+
params:
|
|
27
|
+
throw:
|
|
28
|
+
_eq:
|
|
29
|
+
- _state: lukes_father
|
|
30
|
+
- Darth Vader
|
|
31
|
+
message: Nooooooooooooooooo
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
###### Throw with metaData:
|
|
35
|
+
```yaml
|
|
36
|
+
- id: foo_throw
|
|
37
|
+
type: Throw
|
|
38
|
+
params:
|
|
39
|
+
throw:
|
|
40
|
+
_eq:
|
|
41
|
+
- _state: lukes_father
|
|
42
|
+
- Darth Vader
|
|
43
|
+
message: Nooooooooooooooooo
|
|
44
|
+
metaData:
|
|
45
|
+
realisation: Luke kissed his sister
|
|
46
|
+
```
|
|
47
|
+
###### Override custom message:
|
|
48
|
+
```yaml
|
|
49
|
+
- id: foo_throw
|
|
50
|
+
type: Throw
|
|
51
|
+
messages:
|
|
52
|
+
error: Meh.
|
|
53
|
+
params:
|
|
54
|
+
throw:
|
|
55
|
+
_eq:
|
|
56
|
+
- _state: lukes_father
|
|
57
|
+
- Darth Vader
|
|
58
|
+
message: Nooooooooooooooooo
|
|
59
|
+
```
|
|
60
|
+
###### Fail silently:
|
|
61
|
+
```yaml
|
|
62
|
+
- id: foo_throw
|
|
63
|
+
type: Throw
|
|
64
|
+
messages:
|
|
65
|
+
error: false
|
|
66
|
+
params:
|
|
67
|
+
throw:
|
|
68
|
+
_eq:
|
|
69
|
+
- _state: lukes_father
|
|
70
|
+
- Darth Vader
|
|
71
|
+
message: Nooooooooooooooooo
|
|
72
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Validate
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(void): void
|
|
5
|
+
(blockId: string): void
|
|
6
|
+
(blockIds: string[]): void
|
|
7
|
+
(blockIds: string[]): void
|
|
8
|
+
(params: {
|
|
9
|
+
blockId?: string|string[],
|
|
10
|
+
regex?: string|string[],
|
|
11
|
+
}): void
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The `Validate` action is used to validate a users input, usually before information is inserted into a database using a request.
|
|
15
|
+
It is used in conjunction with the `required` and `validate` fields on input blocks. If the validation fails, the `Validate` action will fail, and this will stop the execution of actions that are defined after it.
|
|
16
|
+
|
|
17
|
+
The first time a `Validate` action is called, validation errors and warnings are shown to the user. The [`Reset`](/Reset) action resets the validation status and the page `state`. The [`ResetValidation`](/ResetValidation) action resets only the validation status.
|
|
18
|
+
|
|
19
|
+
The `Validate` action `blockIds` or `regex` params are used to limit which blocks are validated. Only the matched blocks will be validated, and validation results are shown for only those matched blocks.
|
|
20
|
+
|
|
21
|
+
#### Parameters
|
|
22
|
+
|
|
23
|
+
###### void
|
|
24
|
+
The `Validate` action validates all blocks on the page if called without params.
|
|
25
|
+
|
|
26
|
+
###### string
|
|
27
|
+
A blockId of the block to validate.
|
|
28
|
+
|
|
29
|
+
###### string[]
|
|
30
|
+
An array of blockIds of the blocks to validate.
|
|
31
|
+
|
|
32
|
+
###### object
|
|
33
|
+
- `blockId?: string|string[]`: A blockId or an array of the blockIds of the blocks to validate.
|
|
34
|
+
- `regex?: string|string[]`: A regex string pattern or an array of regex string patterns to match the blockIds to validate.
|
|
35
|
+
|
|
36
|
+
#### Examples
|
|
37
|
+
|
|
38
|
+
###### Validate all inputs on the page:
|
|
39
|
+
```yaml
|
|
40
|
+
- id: validate_all
|
|
41
|
+
type: Validate
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
###### Validate a single input:
|
|
45
|
+
```yaml
|
|
46
|
+
- id: validate_my_input
|
|
47
|
+
type: Validate
|
|
48
|
+
params: my_input
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
###### Validate a list of inputs:
|
|
52
|
+
```yaml
|
|
53
|
+
- id: validate_input_a_and_b
|
|
54
|
+
type: Validate
|
|
55
|
+
params:
|
|
56
|
+
- my_input_a
|
|
57
|
+
- my_input_b
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
###### Validate all inputs matching a regex pattern:
|
|
61
|
+
```yaml
|
|
62
|
+
- id: validate_foo
|
|
63
|
+
type: Validate
|
|
64
|
+
params:
|
|
65
|
+
regex: ^foo\.
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
###### Validate all inputs matching a list of regex patterns:
|
|
69
|
+
```yaml
|
|
70
|
+
- id: validate_foo_and_price
|
|
71
|
+
type: Validate
|
|
72
|
+
params:
|
|
73
|
+
regex:
|
|
74
|
+
- ^foo\.
|
|
75
|
+
- ^.*price.*$
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
###### Validate all inputs matching a list of regex patterns and a blockId:
|
|
79
|
+
```yaml
|
|
80
|
+
- id: validate_foo_price_and_my_input
|
|
81
|
+
type: Validate
|
|
82
|
+
params:
|
|
83
|
+
blockId: my_input
|
|
84
|
+
regex:
|
|
85
|
+
- ^foo\.
|
|
86
|
+
- ^.*price.*$
|
|
87
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Wait
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(params: {
|
|
5
|
+
ms: integer,
|
|
6
|
+
}): void
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The `Wait` waits for the set number of milliseconds before returning.
|
|
10
|
+
|
|
11
|
+
#### Parameters
|
|
12
|
+
|
|
13
|
+
###### object
|
|
14
|
+
- `ms: integer`: __Required__ - The number of milliseconds to wait.
|
|
15
|
+
|
|
16
|
+
#### Examples
|
|
17
|
+
|
|
18
|
+
###### Wait for 500 milliseconds:
|
|
19
|
+
```yaml
|
|
20
|
+
- id: wait
|
|
21
|
+
type: Wait
|
|
22
|
+
params:
|
|
23
|
+
ms: 500
|
|
24
|
+
```
|