@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,104 @@
|
|
|
1
|
+
# Link
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(pageId: string): void
|
|
5
|
+
(params: {
|
|
6
|
+
back?: boolean,
|
|
7
|
+
home?: boolean,
|
|
8
|
+
input?: object,
|
|
9
|
+
newTab?:boolean,
|
|
10
|
+
pageId?: string,
|
|
11
|
+
url?: string,
|
|
12
|
+
urlQuery? object
|
|
13
|
+
}): void
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The `Link` action is used to link a user to another page. An input can be passed to the next page using either the
|
|
17
|
+
`urlQuery`, which is visible to the user, but persists if the browser is refreshed, or by using the `input` object, which is not
|
|
18
|
+
visible to the user.
|
|
19
|
+
|
|
20
|
+
#### Parameters
|
|
21
|
+
|
|
22
|
+
###### string
|
|
23
|
+
The pageId of a page in the app to link to.
|
|
24
|
+
|
|
25
|
+
###### object
|
|
26
|
+
- `back: boolean`: Go to the previous page if true (has the same effect as using the browser back button).
|
|
27
|
+
- `home: boolean`: Link to the home page. This is either the configured public or authenticated homepage, or the first page in the default menu visible to the user.
|
|
28
|
+
- `input: object`: Object to set as the input for the linked page.
|
|
29
|
+
- `newTab: boolean`: Open the link in a new tab.
|
|
30
|
+
- `pageId: string`: The pageId of a page in the app to link to.
|
|
31
|
+
- `url: string`: Link to an external url.
|
|
32
|
+
- `urlQuery: object`: Object to set as the urlQuery for the linked page.
|
|
33
|
+
|
|
34
|
+
#### Examples
|
|
35
|
+
|
|
36
|
+
###### Shorthand, only specify pageId as string:
|
|
37
|
+
```yaml
|
|
38
|
+
- id: shorthand
|
|
39
|
+
type: Link
|
|
40
|
+
params: my_page_id
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
###### Specify pageId:
|
|
44
|
+
```yaml
|
|
45
|
+
- id: link_page_id
|
|
46
|
+
type: Link
|
|
47
|
+
params:
|
|
48
|
+
pageId: myPageId
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
###### Link to home page:
|
|
52
|
+
```yaml
|
|
53
|
+
- id: link_home
|
|
54
|
+
type: Link
|
|
55
|
+
params:
|
|
56
|
+
home: true
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
###### Link to an external url:
|
|
60
|
+
```yaml
|
|
61
|
+
- id: link_url
|
|
62
|
+
type: Link
|
|
63
|
+
params:
|
|
64
|
+
url: www.lowdefy.com
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
###### Open a link in a new tab:
|
|
68
|
+
```yaml
|
|
69
|
+
- id: link_new_tab
|
|
70
|
+
type: Link
|
|
71
|
+
params:
|
|
72
|
+
pageId: my_page_id
|
|
73
|
+
newTab: true
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
###### Set the urlQuery of the page that is linked to:
|
|
77
|
+
```yaml
|
|
78
|
+
- id: link_url_query
|
|
79
|
+
type: Link
|
|
80
|
+
params:
|
|
81
|
+
pageId: my_page_id
|
|
82
|
+
urlQuery:
|
|
83
|
+
id:
|
|
84
|
+
_state: id
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
###### Set the input of the page that is linked to:
|
|
88
|
+
```yaml
|
|
89
|
+
- id: link_input
|
|
90
|
+
type: Link
|
|
91
|
+
params:
|
|
92
|
+
pageId: my_page_id
|
|
93
|
+
input:
|
|
94
|
+
id:
|
|
95
|
+
_args: row.id
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
###### Go to the previous page:
|
|
99
|
+
```yaml
|
|
100
|
+
- id: link_back
|
|
101
|
+
type: Link
|
|
102
|
+
params:
|
|
103
|
+
back: true
|
|
104
|
+
```
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Login
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(params: {
|
|
5
|
+
authUrl?: {
|
|
6
|
+
urlQuery?: object,
|
|
7
|
+
}
|
|
8
|
+
callbackUrl?: {
|
|
9
|
+
home?: boolean
|
|
10
|
+
pageId?: string
|
|
11
|
+
url?: string
|
|
12
|
+
urlQuery?: object
|
|
13
|
+
}
|
|
14
|
+
providerId?: string,
|
|
15
|
+
}): void
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The `Login` action is used to start the user login flow. If only one provider is configured, or the `Login` action is called with a `providerId`, the `Login` action requests the Provider's authorization URL from the Lowdefy server, and redirects the user to this URL. Otherwise, the action redirects the user to a page where the user can choose which provider to use to sign in.
|
|
19
|
+
|
|
20
|
+
The authorization url usually hosts a page where the user can input their credentials. After the user has logged in successfully, the user is redirected to the `api/auth/callback/[provider_id]` route in the Lowdefy app, where the rest of the authorization code flow is completed.
|
|
21
|
+
|
|
22
|
+
The `callbackUrl` parameters of the Login action specify where the user is redirected after login is complete. If `callbackUrl` parameters not set, the user will return to the page from which the action was called.
|
|
23
|
+
|
|
24
|
+
#### Parameters
|
|
25
|
+
|
|
26
|
+
###### object
|
|
27
|
+
- `authUrl: object`:
|
|
28
|
+
- `urlQuery: object`: Query parameters to set for the authorization URL.
|
|
29
|
+
- `callbackUrl: object`:
|
|
30
|
+
- `home: boolean`: Redirect to the home page after the login flow is complete.
|
|
31
|
+
- `pageId: string`: The pageId of the page to redirect to after the login flow is complete.
|
|
32
|
+
- `url: string`: The URL to redirect to after the login flow is complete.
|
|
33
|
+
- `urlQuery: object`: The urlQuery to set for the page the user is redirected to after login.
|
|
34
|
+
- `providerId: string`: The ID of the provider that should be used for login. If not set and only one provider is configured the configured provider will be used. Else the user will be redirected to a sign in page where they can choose a provider.
|
|
35
|
+
|
|
36
|
+
#### Examples
|
|
37
|
+
|
|
38
|
+
###### Login and return to the same page:
|
|
39
|
+
```yaml
|
|
40
|
+
- id: login
|
|
41
|
+
type: Login
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
###### Login with the google provider:
|
|
45
|
+
```yaml
|
|
46
|
+
- id: login_with_google
|
|
47
|
+
type: Login
|
|
48
|
+
params:
|
|
49
|
+
providerId: google
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
###### Login, with pageId and urlQuery:
|
|
53
|
+
```yaml
|
|
54
|
+
- id: login
|
|
55
|
+
type: Login
|
|
56
|
+
params:
|
|
57
|
+
callbackUrl:
|
|
58
|
+
pageId: page1
|
|
59
|
+
urlQuery:
|
|
60
|
+
url1: value
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
###### Only login if user is not logged in:
|
|
64
|
+
```yaml
|
|
65
|
+
- id: login
|
|
66
|
+
type: Login
|
|
67
|
+
skip:
|
|
68
|
+
_ne:
|
|
69
|
+
- _user: sub
|
|
70
|
+
- null
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
###### Request the signup page from the provider:
|
|
74
|
+
```yaml
|
|
75
|
+
- id: Signup
|
|
76
|
+
type: Button
|
|
77
|
+
events:
|
|
78
|
+
onClick:
|
|
79
|
+
- id: login
|
|
80
|
+
type: Login
|
|
81
|
+
params:
|
|
82
|
+
authUrl:
|
|
83
|
+
urlQuery:
|
|
84
|
+
screen_hint: signup
|
|
85
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Logout
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(params: {
|
|
5
|
+
callbackUrl?: {
|
|
6
|
+
home?: boolean
|
|
7
|
+
pageId?: string
|
|
8
|
+
url?: string
|
|
9
|
+
urlQuery?: object
|
|
10
|
+
}
|
|
11
|
+
redirect?: boolean,
|
|
12
|
+
}): void
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
When the `Logout` action is called, the user data and authorization cookies are cleared by the app.
|
|
16
|
+
|
|
17
|
+
The `callbackUrl` parameters of the Logout action specify where the user is redirected after logout is complete. If `callbackUrl` parameters not set, the user will return to the page from which the action was called.
|
|
18
|
+
|
|
19
|
+
#### Parameters
|
|
20
|
+
|
|
21
|
+
###### object
|
|
22
|
+
- `callbackUrl: object`:
|
|
23
|
+
- `home: boolean`: Redirect to the home page after the login flow is complete.
|
|
24
|
+
- `pageId: string`: The pageId of the page to redirect to after the login flow is complete.
|
|
25
|
+
- `url: string`: The URL to redirect to after the login flow is complete.
|
|
26
|
+
- `urlQuery: object`: The urlQuery to set for the page the user is redirected to after login.
|
|
27
|
+
- `redirect: boolean`: If set to `false` the user session will be cleared, but the page will not be reloaded.
|
|
28
|
+
|
|
29
|
+
#### Examples
|
|
30
|
+
|
|
31
|
+
###### A logout button:
|
|
32
|
+
```yaml
|
|
33
|
+
- id: logout_button
|
|
34
|
+
type: Logout
|
|
35
|
+
properties:
|
|
36
|
+
title: Logout
|
|
37
|
+
events:
|
|
38
|
+
onClick:
|
|
39
|
+
- id: logout
|
|
40
|
+
type: Logout
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
###### Redirect to the `logged-out` page in the app after logout:
|
|
44
|
+
```yaml
|
|
45
|
+
- id: logout_button
|
|
46
|
+
type: Logout
|
|
47
|
+
properties:
|
|
48
|
+
title: Logout
|
|
49
|
+
events:
|
|
50
|
+
onClick:
|
|
51
|
+
- id: logout
|
|
52
|
+
type: Logout
|
|
53
|
+
params:
|
|
54
|
+
callbackUrl:
|
|
55
|
+
pageId: logged-out
|
|
56
|
+
```
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
# PdfMake
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(params: {
|
|
5
|
+
docDefinition: object,
|
|
6
|
+
tableLayouts?: object,
|
|
7
|
+
filename: string,
|
|
8
|
+
fonts?: object,
|
|
9
|
+
}): void
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The `PdfMake` action is used to generate and download a PDF file from a set of defined content using the [pdfMake](https://github.com/bpampuch/pdfmake) open-source library.
|
|
13
|
+
|
|
14
|
+
#### Parameters
|
|
15
|
+
|
|
16
|
+
###### object
|
|
17
|
+
- `docDefinition: object`: __Required__ - The document definition object which includes styling, columns, tables etc.
|
|
18
|
+
- `tableLayouts: object`: The table layouts for the generated PDF file.
|
|
19
|
+
- `filename: string`: __Required__ - The name for the generated PDF file.
|
|
20
|
+
- `fonts: object`: The fonts for the generated PDF file.
|
|
21
|
+
###### See the [pdfMake docs](https://pdfmake.github.io/docs) for more info on these properties.
|
|
22
|
+
|
|
23
|
+
#### Examples
|
|
24
|
+
|
|
25
|
+
###### Generate a PDF (simple example):
|
|
26
|
+
```yaml
|
|
27
|
+
- id: generate_pdf_button
|
|
28
|
+
type: Button
|
|
29
|
+
properties:
|
|
30
|
+
title: Download PDF
|
|
31
|
+
icon: AiOutlineDownload
|
|
32
|
+
events:
|
|
33
|
+
onClick:
|
|
34
|
+
- id: make_pdf
|
|
35
|
+
type: PdfMake
|
|
36
|
+
params:
|
|
37
|
+
filename:
|
|
38
|
+
my_file_name.pdf
|
|
39
|
+
docDefinition:
|
|
40
|
+
pageMargins: 50
|
|
41
|
+
defaultStyle:
|
|
42
|
+
fontSize: 10
|
|
43
|
+
content:
|
|
44
|
+
- text: This pdf has been generated with Lowdefy and pdfMake.
|
|
45
|
+
bold: true
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
###### Generate a PDF (detailed example):
|
|
49
|
+
```yaml
|
|
50
|
+
- id: pdf_generate_button
|
|
51
|
+
type: Button
|
|
52
|
+
style:
|
|
53
|
+
textAlign: center
|
|
54
|
+
properties:
|
|
55
|
+
title: Generate & Download PDF
|
|
56
|
+
icon: AiOutlineDownload
|
|
57
|
+
color: '#6293F8'
|
|
58
|
+
events:
|
|
59
|
+
onMount:
|
|
60
|
+
- id: init_data
|
|
61
|
+
type: SetState
|
|
62
|
+
params:
|
|
63
|
+
invoice:
|
|
64
|
+
id: '0030135'
|
|
65
|
+
account_id: 'A-11344'
|
|
66
|
+
inv_date:
|
|
67
|
+
_date: now
|
|
68
|
+
subtotal: 397.034
|
|
69
|
+
discount: -19.8517
|
|
70
|
+
vat: 59.5551
|
|
71
|
+
total: 436.7374
|
|
72
|
+
balance: 413.2330
|
|
73
|
+
customer:
|
|
74
|
+
name: Service Center
|
|
75
|
+
phone: +123-456-7890
|
|
76
|
+
vat_nmr: 12-333-4567
|
|
77
|
+
address: |
|
|
78
|
+
123 Main St.
|
|
79
|
+
Anytown
|
|
80
|
+
CA
|
|
81
|
+
US
|
|
82
|
+
9999
|
|
83
|
+
services:
|
|
84
|
+
- name: Hosting and Maintannce
|
|
85
|
+
qty: 1
|
|
86
|
+
price: 235.90
|
|
87
|
+
code: X12-33C
|
|
88
|
+
- name: Developer Hours
|
|
89
|
+
qty: 16
|
|
90
|
+
price: 60.345
|
|
91
|
+
code: X12-39A
|
|
92
|
+
- name: Designer Hours
|
|
93
|
+
qty: 4
|
|
94
|
+
price: 40.122
|
|
95
|
+
code: X12-21A
|
|
96
|
+
- name: Project Management
|
|
97
|
+
qty: 2
|
|
98
|
+
price: 60.667
|
|
99
|
+
code: X12-49A
|
|
100
|
+
onClick:
|
|
101
|
+
- id: generate_pdf
|
|
102
|
+
type: PdfMake
|
|
103
|
+
params:
|
|
104
|
+
_ref: inv_template.yaml
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
###### `/inv_template.yaml`
|
|
108
|
+
```yaml
|
|
109
|
+
filename:
|
|
110
|
+
_nunjucks:
|
|
111
|
+
on:
|
|
112
|
+
_state: invoice
|
|
113
|
+
template: 'INV-{{ id }}-{{ inv_date | date("DD-MM-YYYY") }}.pdf'
|
|
114
|
+
docDefinition:
|
|
115
|
+
pageMargins: [50, 25, 50, 70]
|
|
116
|
+
defaultStyle:
|
|
117
|
+
fontSize: 10
|
|
118
|
+
footer:
|
|
119
|
+
_function:
|
|
120
|
+
- columns:
|
|
121
|
+
- qr:
|
|
122
|
+
_string.concat:
|
|
123
|
+
- _location: origin
|
|
124
|
+
- /invoice?id="
|
|
125
|
+
- _state: invoice.id
|
|
126
|
+
- '"'
|
|
127
|
+
margin: [50, 0, 0, 0]
|
|
128
|
+
fit: '64'
|
|
129
|
+
- alignment: 'right'
|
|
130
|
+
fontSize: 7
|
|
131
|
+
margin: [0, 0, 50, 0]
|
|
132
|
+
text:
|
|
133
|
+
__nunjucks:
|
|
134
|
+
template: 'Page {{ page }} of {{ total }}'
|
|
135
|
+
on:
|
|
136
|
+
page:
|
|
137
|
+
__args: 0
|
|
138
|
+
total:
|
|
139
|
+
__args: 1
|
|
140
|
+
content:
|
|
141
|
+
- columns:
|
|
142
|
+
- width: 'auto'
|
|
143
|
+
margin: [0, 20, 0, 0]
|
|
144
|
+
stack:
|
|
145
|
+
- fontSize: 9
|
|
146
|
+
text: |
|
|
147
|
+
|
|
148
|
+
- fontSize: 7
|
|
149
|
+
text: |
|
|
150
|
+
Example Services Ltd.
|
|
151
|
+
112 Street Name
|
|
152
|
+
City, State 12345
|
|
153
|
+
Country
|
|
154
|
+
001-AB
|
|
155
|
+
|
|
156
|
+
+00-1234-5566
|
|
157
|
+
info@example.com
|
|
158
|
+
|
|
159
|
+
Vat Number: 444 5555 0000
|
|
160
|
+
|
|
161
|
+
- width: '*'
|
|
162
|
+
text: ' '
|
|
163
|
+
- width: 110
|
|
164
|
+
stack:
|
|
165
|
+
- margin: [0, 5, 0, 0]
|
|
166
|
+
alignment: right
|
|
167
|
+
fontSize: 7
|
|
168
|
+
text: |
|
|
169
|
+
Example Services Ltd.
|
|
170
|
+
Reg Number: 2001/22224/09
|
|
171
|
+
|
|
172
|
+
- margin: [0, 20, 0, 20]
|
|
173
|
+
text: Customer Invoice
|
|
174
|
+
bold: true
|
|
175
|
+
alignment: center
|
|
176
|
+
fontSize: 14
|
|
177
|
+
- columns:
|
|
178
|
+
- width: 150
|
|
179
|
+
bold: true
|
|
180
|
+
text: |
|
|
181
|
+
INVOICE NUMBER:
|
|
182
|
+
DATE ISSUED:
|
|
183
|
+
ACCOUNT NUMBER:
|
|
184
|
+
- width: '*'
|
|
185
|
+
text:
|
|
186
|
+
_nunjucks:
|
|
187
|
+
template: |
|
|
188
|
+
{{ id }}
|
|
189
|
+
{{ inv_date | date("YYYY/MM/DD") }}
|
|
190
|
+
{{ account_id }}
|
|
191
|
+
on:
|
|
192
|
+
_state: invoice
|
|
193
|
+
- width: 150
|
|
194
|
+
bold: true
|
|
195
|
+
text: |
|
|
196
|
+
CUSTOMER:
|
|
197
|
+
ADDRESS:
|
|
198
|
+
- width: '*'
|
|
199
|
+
text:
|
|
200
|
+
_nunjucks:
|
|
201
|
+
template: |
|
|
202
|
+
{{ customer.name }}
|
|
203
|
+
{{ customer.address }}
|
|
204
|
+
on:
|
|
205
|
+
_state: invoice
|
|
206
|
+
|
|
207
|
+
- layout: 'lightHorizontalLines'
|
|
208
|
+
margin: [0, 10, 0, 0]
|
|
209
|
+
table:
|
|
210
|
+
widths: [70, '*', 70, 70, 70]
|
|
211
|
+
headerRows: 1
|
|
212
|
+
body:
|
|
213
|
+
_json.parse:
|
|
214
|
+
_nunjucks:
|
|
215
|
+
on:
|
|
216
|
+
services:
|
|
217
|
+
_state: invoice.services
|
|
218
|
+
template: |
|
|
219
|
+
[
|
|
220
|
+
[
|
|
221
|
+
{ "text": "ITEM CODE", "bold": true },
|
|
222
|
+
{ "text": "SERVICE", "bold": true },
|
|
223
|
+
{ "text": "UNIT PRICE", "bold": true, "alignment": "right" },
|
|
224
|
+
{ "text": "QTY", "bold": true, "alignment": "right" },
|
|
225
|
+
{ "text": "COST", "bold": true, "alignment": "right" }
|
|
226
|
+
],
|
|
227
|
+
{% for item in services %}
|
|
228
|
+
[
|
|
229
|
+
"{{ loop.index }}: {{ item.code }}",
|
|
230
|
+
"{{ item.name | safe }}",
|
|
231
|
+
{ "text": "{{ ( item.price / item.qty ).toFixed(2) }}", "alignment": "right"},
|
|
232
|
+
{ "text": "{{ item.qty }}", "alignment": "right"},
|
|
233
|
+
{ "text": "{{ item.price.toFixed(2) }}", "alignment": "right"}
|
|
234
|
+
{% if loop.last %} ] {% else %} ], {% endif %}
|
|
235
|
+
{% endfor %}
|
|
236
|
+
]
|
|
237
|
+
- layout: 'headerLineOnly'
|
|
238
|
+
margin: [0, -5, 0, 0]
|
|
239
|
+
table:
|
|
240
|
+
widths: ['*', 70, 70, 70]
|
|
241
|
+
headerRows: 1
|
|
242
|
+
body:
|
|
243
|
+
- - ''
|
|
244
|
+
- ''
|
|
245
|
+
- ''
|
|
246
|
+
- ''
|
|
247
|
+
- - ''
|
|
248
|
+
- alignment: right
|
|
249
|
+
text: 'Subtotal:'
|
|
250
|
+
- ''
|
|
251
|
+
- alignment: right
|
|
252
|
+
text:
|
|
253
|
+
_number.toFixed:
|
|
254
|
+
- _state: invoice.subtotal
|
|
255
|
+
- 2
|
|
256
|
+
- - ''
|
|
257
|
+
- alignment: right
|
|
258
|
+
text: 'Discount (5%):'
|
|
259
|
+
- ''
|
|
260
|
+
- alignment: right
|
|
261
|
+
text:
|
|
262
|
+
_number.toFixed:
|
|
263
|
+
- _state: invoice.discount
|
|
264
|
+
- 2
|
|
265
|
+
- - ''
|
|
266
|
+
- alignment: right
|
|
267
|
+
text: 'VAT (15%):'
|
|
268
|
+
- ''
|
|
269
|
+
- alignment: right
|
|
270
|
+
text:
|
|
271
|
+
_number.toFixed:
|
|
272
|
+
- _state: invoice.vat
|
|
273
|
+
- 2
|
|
274
|
+
- - ''
|
|
275
|
+
- alignment: right
|
|
276
|
+
text: 'Total:'
|
|
277
|
+
- ''
|
|
278
|
+
- alignment: right
|
|
279
|
+
text:
|
|
280
|
+
_number.toFixed:
|
|
281
|
+
- _state: invoice.total
|
|
282
|
+
- 2
|
|
283
|
+
- layout: 'headerLineOnly'
|
|
284
|
+
margin: [0, -5, 0, 0]
|
|
285
|
+
table:
|
|
286
|
+
widths: ['*', 70, 70, 70]
|
|
287
|
+
headerRows: 1
|
|
288
|
+
body:
|
|
289
|
+
- - ''
|
|
290
|
+
- ''
|
|
291
|
+
- ''
|
|
292
|
+
- ''
|
|
293
|
+
- - ''
|
|
294
|
+
- alignment: right
|
|
295
|
+
bold: true
|
|
296
|
+
text: 'BALANCE DUE:'
|
|
297
|
+
- ''
|
|
298
|
+
- alignment: right
|
|
299
|
+
bold: true
|
|
300
|
+
text:
|
|
301
|
+
_number.toFixed:
|
|
302
|
+
- _state: invoice.balance
|
|
303
|
+
- 2
|
|
304
|
+
```
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Request
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(params: { all: boolean, holdValue?: boolean }): void
|
|
5
|
+
(params: { requestId: string, holdValue?: boolean }): void
|
|
6
|
+
(params: { requestIds: string[], holdValue?: boolean }): void
|
|
7
|
+
(params: { requestId: string }): void
|
|
8
|
+
(params: { requestIds: string[] }): void
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The `Request` action calls a request, or if used during an `onInit` event, calls those requests while a page loads.
|
|
12
|
+
`Request` can be used to call all requests on a page, a list of requests, or a single request. The `Request` action is synchronous, actions defined after
|
|
13
|
+
it will only run once all the called requests have returned.
|
|
14
|
+
|
|
15
|
+
To call requests that load data, the `onInitAsync`, `onMount` and `onMountAsync` events can be used. These will execute the actions while the page begins to render. If the `onInit` event is used, the page will only start rendering after the actions have completed.
|
|
16
|
+
|
|
17
|
+
`Request` can be called without any parameters to call all requests in the page. It can also be called with a list of requestIds or a single requestId to call.
|
|
18
|
+
|
|
19
|
+
#### Parameters
|
|
20
|
+
|
|
21
|
+
###### object
|
|
22
|
+
- `all: boolean`: All requests in the page are called if `all` is set to true.
|
|
23
|
+
- `requestId: string`: A single requestId to call. Use this object form when you also want to set `holdValue`.
|
|
24
|
+
- `requestIds: string[]`: An array of requestIds to call. Use this object form when you also want to set `holdValue`.
|
|
25
|
+
- `holdValue: boolean`: Optional. When `true`, the previous response value is retained on `requests[id][0].response` while the new request is loading. UI bound to `_request: <id>` continues to display the previous response instead of going to `null`. The previous response is also retained if the new request errors out — inspect `_request_details: <id>.error` to detect failures. Defaults to `false`.
|
|
26
|
+
|
|
27
|
+
###### string
|
|
28
|
+
A requestId of the request to call.
|
|
29
|
+
|
|
30
|
+
###### string[]
|
|
31
|
+
An array of requestIds of the requests to call.
|
|
32
|
+
|
|
33
|
+
#### Examples
|
|
34
|
+
|
|
35
|
+
###### Call a single request:
|
|
36
|
+
```yaml
|
|
37
|
+
- id: call_one_request
|
|
38
|
+
type: Request
|
|
39
|
+
params: my_request_id
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
###### Call a list of requests:
|
|
43
|
+
```yaml
|
|
44
|
+
- id: call_many_requests
|
|
45
|
+
type: Request
|
|
46
|
+
params:
|
|
47
|
+
- my_request_id_1
|
|
48
|
+
- my_request_id_2
|
|
49
|
+
- my_request_id_3
|
|
50
|
+
```
|
|
51
|
+
###### Call all requests:
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
- id: call_all
|
|
55
|
+
type: Request
|
|
56
|
+
params:
|
|
57
|
+
all: true
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
###### Refresh a table without flashing the previous data:
|
|
61
|
+
```yaml
|
|
62
|
+
- id: refresh_table
|
|
63
|
+
type: Request
|
|
64
|
+
params:
|
|
65
|
+
requestId: my_table_request
|
|
66
|
+
holdValue: true
|
|
67
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Reset
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(void): void
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `Reset` actions resets a page to the state it was in just after the `onInit` event was executed. This clears the user's inputs.
|
|
8
|
+
|
|
9
|
+
> The `Reset` action resets the state to the state after the `onInit` event was executed, and the `onMount` events are not executed after the reset happens. This might cause unexpected behavior if you used an `onInitAsync`, `onMount` or `onMountAsync` event to initialize the state.
|
|
10
|
+
|
|
11
|
+
#### Parameters
|
|
12
|
+
|
|
13
|
+
The `Reset` action does not take any parameters.
|
|
14
|
+
|
|
15
|
+
#### Examples
|
|
16
|
+
|
|
17
|
+
###### A reset button:
|
|
18
|
+
```yaml
|
|
19
|
+
- id: reset_button
|
|
20
|
+
type: Button
|
|
21
|
+
properties:
|
|
22
|
+
title: Reset
|
|
23
|
+
events:
|
|
24
|
+
onClick:
|
|
25
|
+
- id: reset
|
|
26
|
+
type: Reset
|
|
27
|
+
```
|