@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,327 @@
|
|
|
1
|
+
# _string
|
|
2
|
+
|
|
3
|
+
The `_string` operator can be used to run javascript [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) methods.
|
|
4
|
+
|
|
5
|
+
> This operator can be used as a [`_build`](/_build) operator method.
|
|
6
|
+
|
|
7
|
+
# Operator methods:
|
|
8
|
+
|
|
9
|
+
## _string.charAt
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
(arguments: {on: string, index: number}): string
|
|
13
|
+
(arguments: [on: string, index: number]): string
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The `_string.charAt` method returns a string consisting of [the single UTF-16 code (character) unit located at the specified offset](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt) into the string.
|
|
17
|
+
|
|
18
|
+
## _string.concat
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
(strings: string[]): string
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The `_string.concat` method [concatenates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) strings.
|
|
25
|
+
|
|
26
|
+
For label-style interpolation (`"Updates (5)"`), prefer [`_string.format`](#format) — it's more concise and renders `null`/`undefined` values as empty strings.
|
|
27
|
+
|
|
28
|
+
## _string.format
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
(template: string, ...values: any[]): string
|
|
32
|
+
(arguments: { template: string, on?: object }): string
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The `_string.format` method substitutes placeholders in a template string with values. Two input forms are supported:
|
|
36
|
+
|
|
37
|
+
**Positional (array form)** — `{0}`, `{1}`, ... refer to elements after the template:
|
|
38
|
+
```yaml
|
|
39
|
+
_string.format:
|
|
40
|
+
- 'Updates ({0})'
|
|
41
|
+
- _request: get_counts.0.update
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Named (object form)** — `{name}` placeholders are looked up in `on`:
|
|
45
|
+
```yaml
|
|
46
|
+
_string.format:
|
|
47
|
+
template: 'Updates ({count}) since {date}'
|
|
48
|
+
on:
|
|
49
|
+
count:
|
|
50
|
+
_request: get_counts.0.update
|
|
51
|
+
date:
|
|
52
|
+
_date.format:
|
|
53
|
+
- YYYY-MM-DD
|
|
54
|
+
- _state: lastSync
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Behavior**:
|
|
58
|
+
- `null` and `undefined` values render as an empty string. This often makes `_if_none` unnecessary — `_string.format: ['Updates ({0})', null]` produces `'Updates ()'` directly.
|
|
59
|
+
- Missing positional indexes or named keys render as an empty string.
|
|
60
|
+
- Non-string values are coerced via `String(v)`. For object/array values, use [`_json.stringify`](/_json) first.
|
|
61
|
+
- To include a literal `{` or `}`, use `{{` or `}}`.
|
|
62
|
+
- Use [`_nunjucks`](/_nunjucks) when you need conditionals, loops, or filters.
|
|
63
|
+
|
|
64
|
+
## _string.endsWith
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
(arguments: {
|
|
68
|
+
on: string,
|
|
69
|
+
searchString: string,
|
|
70
|
+
length?: number
|
|
71
|
+
}): boolean
|
|
72
|
+
(arguments: [
|
|
73
|
+
on: string,
|
|
74
|
+
searchString: string,
|
|
75
|
+
length?: number
|
|
76
|
+
]): boolean
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The `_string.endsWith` method determines whether a string [ends with the characters of a specified string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith), returning `true` or `false` as appropriate.
|
|
80
|
+
|
|
81
|
+
## _string.includes
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
(arguments: {
|
|
85
|
+
on: string,
|
|
86
|
+
searchString: string,
|
|
87
|
+
position?: number
|
|
88
|
+
}): boolean
|
|
89
|
+
(arguments: [
|
|
90
|
+
on: string,
|
|
91
|
+
searchString: string,
|
|
92
|
+
position?: number
|
|
93
|
+
]): boolean
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The `_string.includes` method determines whether [one string may be found within another string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes), returning `true` or `false` as appropriate.
|
|
97
|
+
|
|
98
|
+
## _string.indexOf
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
(arguments: {
|
|
102
|
+
on: string,
|
|
103
|
+
searchValue: string,
|
|
104
|
+
fromIndex?: number
|
|
105
|
+
}): number
|
|
106
|
+
(arguments: [
|
|
107
|
+
on: string,
|
|
108
|
+
searchValue: string,
|
|
109
|
+
fromIndex?: number
|
|
110
|
+
]): number
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The `_string.indexOf` method returns the index within string of the [first occurrence of the specified value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf), starting the search at `fromIndex`. Returns `-1` if the value is not found.
|
|
114
|
+
|
|
115
|
+
## _string.length
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
(string: string): number
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
The `_string.length` method returns the [length](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length) of a string.
|
|
122
|
+
|
|
123
|
+
## _string.lastIndexOf
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
(arguments: {
|
|
127
|
+
on: string,
|
|
128
|
+
searchValue: string,
|
|
129
|
+
fromIndex?: number
|
|
130
|
+
}): number
|
|
131
|
+
(arguments: [
|
|
132
|
+
on: string,
|
|
133
|
+
searchValue: string,
|
|
134
|
+
fromIndex?: number
|
|
135
|
+
]): number
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
The `_string.lastIndexOf` method returns the index within string of the [last occurrence of the specified value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf), searching backwards from `fromIndex`. Returns `-1` if the value is not found.
|
|
139
|
+
|
|
140
|
+
## _string.match
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
(arguments: {
|
|
144
|
+
on: string,
|
|
145
|
+
regex: string,
|
|
146
|
+
regexFlags?: string
|
|
147
|
+
}): string[]
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
The `_string.match` method returns the [result of matching a string against a regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match).
|
|
151
|
+
|
|
152
|
+
## _string.normalize
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
(arguments: {on: string, form?: enum}): string
|
|
156
|
+
(arguments: [on: string, form?: enum]): string
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
The `_string.normalize` method returns the [Unicode Normalization Form](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) of the string.
|
|
160
|
+
|
|
161
|
+
## _string.padEnd
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
(arguments: {
|
|
165
|
+
on: string,
|
|
166
|
+
targetLength: number,
|
|
167
|
+
padString?: string
|
|
168
|
+
}): string
|
|
169
|
+
(arguments: [
|
|
170
|
+
on: string,
|
|
171
|
+
targetLength: number,
|
|
172
|
+
padString?: string
|
|
173
|
+
]): string
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
The `_string.padEnd` method [pads the string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd) with a given string (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end of the string.
|
|
177
|
+
|
|
178
|
+
## _string.padStart
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
(arguments: {
|
|
182
|
+
on: string,
|
|
183
|
+
targetLength: number,
|
|
184
|
+
padString?: string
|
|
185
|
+
}): string
|
|
186
|
+
(arguments: [
|
|
187
|
+
on: string,
|
|
188
|
+
targetLength: number,
|
|
189
|
+
padString?: string
|
|
190
|
+
]): string
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
The `_string.padStart` method [pads the string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd) with a given string (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the start of the string.
|
|
194
|
+
|
|
195
|
+
## _string.repeat
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
(arguments: {on: string, count: number}): string
|
|
199
|
+
(arguments: [on: string, count: number]): string
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The `_string.repeat` method returns a string which contains [the specified number of copies of the string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat) on which it was called, concatenated together.
|
|
203
|
+
|
|
204
|
+
## _string.replace
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
(arguments: {
|
|
208
|
+
on: string,
|
|
209
|
+
regex: string,
|
|
210
|
+
newSubstr: string,
|
|
211
|
+
regexFlags?: string
|
|
212
|
+
}): string
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
The `_string.replace` method returns a string with [some or all matches of a pattern replaced by a replacement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace).
|
|
216
|
+
|
|
217
|
+
## _string.search
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
(arguments: {
|
|
221
|
+
on: string,
|
|
222
|
+
regex: string,
|
|
223
|
+
regexFlags?: string
|
|
224
|
+
}): number
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
The `_string.search` method executes a [search for a match between a regular expression and a string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search). It returns the index of the first match between the regular expression and the given string, or `-1` if no match was found.
|
|
228
|
+
|
|
229
|
+
## _string.slice
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
(arguments: {
|
|
233
|
+
on: string,
|
|
234
|
+
start: number,
|
|
235
|
+
end?: number
|
|
236
|
+
}): string
|
|
237
|
+
(arguments: [
|
|
238
|
+
on: string,
|
|
239
|
+
start: number,
|
|
240
|
+
end?: number
|
|
241
|
+
]): string
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
The `_string.slice` method [extracts a section](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) of a string.
|
|
245
|
+
|
|
246
|
+
## _string.split
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
(arguments: {on: string, separator?: string}): string[]
|
|
250
|
+
(arguments: [on: string, separator?: string]): string[]
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
The `_string.split` method [divides a string into an array of substrings](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split), splitting on the provided separator.
|
|
254
|
+
|
|
255
|
+
## _string.startsWith
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
(arguments: {
|
|
259
|
+
on: string,
|
|
260
|
+
searchString: string,
|
|
261
|
+
position?: number
|
|
262
|
+
}): boolean
|
|
263
|
+
(arguments: [
|
|
264
|
+
on: string,
|
|
265
|
+
searchString: string,
|
|
266
|
+
position?: number
|
|
267
|
+
]): boolean
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
The `_string.startsWith` method determines whether a string [starts with the characters of a specified string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith), returning `true` or `false` as appropriate.
|
|
271
|
+
|
|
272
|
+
## _string.substring
|
|
273
|
+
|
|
274
|
+
```
|
|
275
|
+
(arguments: {
|
|
276
|
+
on: string,
|
|
277
|
+
start: number,
|
|
278
|
+
end?: number
|
|
279
|
+
}): string
|
|
280
|
+
(arguments: [
|
|
281
|
+
on: string,
|
|
282
|
+
start: number,
|
|
283
|
+
end?: number
|
|
284
|
+
]): string
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
The `_string.startsWith` method returns [the part of the string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) between the `start` and `end` indexes, or to the end of the string.
|
|
288
|
+
|
|
289
|
+
## _string.toLowerCase
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
(string: string): string
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
The `_string.toLowerCase` method converts the string to [lower case](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase).
|
|
296
|
+
|
|
297
|
+
## _string.toUpperCase
|
|
298
|
+
|
|
299
|
+
```
|
|
300
|
+
(string: string): string
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
The `_string.toUpperCase` method converts the string to [upper case](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase).
|
|
304
|
+
|
|
305
|
+
## _string.trim
|
|
306
|
+
|
|
307
|
+
```
|
|
308
|
+
(string: string): string
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
The `_string.trim` method [removes whitespace from both ends](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) of a string.
|
|
312
|
+
|
|
313
|
+
## _string.trimEnd
|
|
314
|
+
|
|
315
|
+
```
|
|
316
|
+
(string: string): string
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
The `_string.trimEnd` method [removes whitespace from the end](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd) of a string.
|
|
320
|
+
|
|
321
|
+
## _string.trimStart
|
|
322
|
+
|
|
323
|
+
```
|
|
324
|
+
(string: string): string
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
The `_string.trimStart` method [removes whitespace from the start](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart) of a string.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# _subtract
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
([minuend: number, subtrahend: number]): number
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `_subtract` operator takes an array of two numbers as input and returns the second number subtracted from the first.
|
|
8
|
+
|
|
9
|
+
> This operator can be used as a [`_build`](/_build) operator method.
|
|
10
|
+
|
|
11
|
+
#### Arguments
|
|
12
|
+
|
|
13
|
+
###### array
|
|
14
|
+
An array of two numbers.
|
|
15
|
+
|
|
16
|
+
#### Examples
|
|
17
|
+
|
|
18
|
+
###### Subtract a number:
|
|
19
|
+
```yaml
|
|
20
|
+
_subtract:
|
|
21
|
+
- 12
|
|
22
|
+
- 4
|
|
23
|
+
```
|
|
24
|
+
Returns: `8`
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# _sum
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(values: any[]): number
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `_sum` operator takes the sum of the values given as input. If a value is not a number, the value is skipped.
|
|
8
|
+
|
|
9
|
+
> This operator can be used as a [`_build`](/_build) operator method.
|
|
10
|
+
|
|
11
|
+
#### Arguments
|
|
12
|
+
|
|
13
|
+
#### array
|
|
14
|
+
An array of values to add.
|
|
15
|
+
|
|
16
|
+
#### Examples
|
|
17
|
+
|
|
18
|
+
###### Two numbers:
|
|
19
|
+
```yaml
|
|
20
|
+
_sum:
|
|
21
|
+
- 3
|
|
22
|
+
- 4
|
|
23
|
+
```
|
|
24
|
+
Returns: `7`
|
|
25
|
+
|
|
26
|
+
###### Array of numbers:
|
|
27
|
+
```yaml
|
|
28
|
+
_sum:
|
|
29
|
+
- 1
|
|
30
|
+
- 2
|
|
31
|
+
- 3
|
|
32
|
+
- 4
|
|
33
|
+
```
|
|
34
|
+
Returns: `10`
|
|
35
|
+
|
|
36
|
+
###### Non-numbers are skipped:
|
|
37
|
+
```yaml
|
|
38
|
+
_sum:
|
|
39
|
+
- 1
|
|
40
|
+
- null
|
|
41
|
+
- 3
|
|
42
|
+
- "four"
|
|
43
|
+
- 5
|
|
44
|
+
```
|
|
45
|
+
Returns: `9`
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# _switch
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(arguments: {branches: {if: boolean, then: any}[], default: any}): any
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `_switch` operator evaluates an array of conditions and returns the `then` argument of the first item for which the `if` argument evaluates to `true`. If no condition evaluates to `true`, the value of the `default` argument is returned.
|
|
8
|
+
|
|
9
|
+
> This operator can be used as a [`_build`](/_build) operator method.
|
|
10
|
+
|
|
11
|
+
#### Arguments
|
|
12
|
+
|
|
13
|
+
###### object
|
|
14
|
+
- `branches:`
|
|
15
|
+
`if: boolean`: The boolean result of a test.
|
|
16
|
+
`then: any`: The value to return if the test is `true`.
|
|
17
|
+
- `default: any`: The value to return if all the `if` tests are `false`.
|
|
18
|
+
|
|
19
|
+
#### Examples
|
|
20
|
+
|
|
21
|
+
###### Return a value based on a series of conditions:
|
|
22
|
+
```yaml
|
|
23
|
+
_switch:
|
|
24
|
+
branches:
|
|
25
|
+
- if:
|
|
26
|
+
_eq:
|
|
27
|
+
- x
|
|
28
|
+
- y
|
|
29
|
+
then: A
|
|
30
|
+
- if:
|
|
31
|
+
_eq:
|
|
32
|
+
- x
|
|
33
|
+
- z
|
|
34
|
+
then: B
|
|
35
|
+
default: C
|
|
36
|
+
```
|
|
37
|
+
Returns: `"C"` since both of the `if` tests are `false`.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# _t
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(key: string): string
|
|
5
|
+
(arguments: {
|
|
6
|
+
key: string,
|
|
7
|
+
values?: object,
|
|
8
|
+
locale?: string,
|
|
9
|
+
}): string
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The `_t` operator translates a string key against the app's `config.i18n` message catalogs, with [ICU MessageFormat](https://formatjs.io/docs/core-concepts/icu-syntax/) interpolation. It's the primary way app authors localize their own strings.
|
|
13
|
+
|
|
14
|
+
Resolution order: the active locale's messages → `en-US` messages → built-in framework messages → the key itself. The active locale is resolved from the user's preference (`SetLocale`/`localStorage`), then the browser's `navigator.languages` best-fit, then `config.i18n.defaultLocale`. Lowdefy always uses `en-US` as the missing-key fallback, so plugin and module authors should ship `en-US` translations as a baseline.
|
|
15
|
+
|
|
16
|
+
Configure messages on `config.i18n.messages.{locale}`:
|
|
17
|
+
|
|
18
|
+
```yaml
|
|
19
|
+
config:
|
|
20
|
+
i18n:
|
|
21
|
+
defaultLocale: en-US
|
|
22
|
+
locales:
|
|
23
|
+
- { code: en-US, label: English, antd: en_US, dayjs: en }
|
|
24
|
+
- { code: de-DE, label: Deutsch, antd: de_DE, dayjs: de }
|
|
25
|
+
messages:
|
|
26
|
+
en-US:
|
|
27
|
+
greeting: 'Hello, {name}!'
|
|
28
|
+
cart.items: '{count, plural, one {# item} other {# items}}'
|
|
29
|
+
de-DE:
|
|
30
|
+
greeting: 'Hallo, {name}!'
|
|
31
|
+
cart.items: '{count, plural, one {# Artikel} other {# Artikel}}'
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`_t` is also used by the engine for built-in framework strings (e.g. `engine.action.loading`, `engine.validation.fieldRequired`). Override any built-in by adding the same key under `config.i18n.messages.{locale}`.
|
|
35
|
+
|
|
36
|
+
**Inside plugin code:** the runtime equivalent for custom block and action plugins is `methods.translate(key, values)`. Same lookup chain, same overrides — see the [i18n concept page](/i18n) for plugin authoring patterns and the `./messages` manifest format.
|
|
37
|
+
|
|
38
|
+
#### Arguments
|
|
39
|
+
|
|
40
|
+
###### string
|
|
41
|
+
The translation key to look up.
|
|
42
|
+
|
|
43
|
+
###### object
|
|
44
|
+
- `key: string`: The translation key.
|
|
45
|
+
- `values: object`: Values to interpolate into the message via ICU MessageFormat.
|
|
46
|
+
- `locale: string`: BCP 47 locale code to force this lookup into a specific locale, regardless of the user's active locale.
|
|
47
|
+
|
|
48
|
+
#### Examples
|
|
49
|
+
|
|
50
|
+
###### Translate a simple key:
|
|
51
|
+
```yaml
|
|
52
|
+
_t: greeting
|
|
53
|
+
```
|
|
54
|
+
Returns: the active-locale message at `messages.{active}.greeting`, or the `en-US` message, or the key.
|
|
55
|
+
|
|
56
|
+
###### Interpolate values:
|
|
57
|
+
```yaml
|
|
58
|
+
_t:
|
|
59
|
+
key: greeting
|
|
60
|
+
values:
|
|
61
|
+
name:
|
|
62
|
+
_user: name
|
|
63
|
+
```
|
|
64
|
+
Returns: e.g. `"Hallo, Ada!"` when active is `de-DE`.
|
|
65
|
+
|
|
66
|
+
###### Pluralize via ICU MessageFormat:
|
|
67
|
+
```yaml
|
|
68
|
+
_t:
|
|
69
|
+
key: cart.items
|
|
70
|
+
values:
|
|
71
|
+
count:
|
|
72
|
+
_state: itemCount
|
|
73
|
+
```
|
|
74
|
+
Returns: `"3 items"` / `"3 Artikel"` etc., respecting the locale's plural rules.
|
|
75
|
+
|
|
76
|
+
###### Force a specific locale:
|
|
77
|
+
```yaml
|
|
78
|
+
_t:
|
|
79
|
+
key: greeting
|
|
80
|
+
locale: en-US
|
|
81
|
+
```
|
|
82
|
+
Returns: the en-US message regardless of the active locale.
|
|
83
|
+
|
|
84
|
+
###### Override a built-in framework string:
|
|
85
|
+
```yaml
|
|
86
|
+
config:
|
|
87
|
+
i18n:
|
|
88
|
+
defaultLocale: de-DE
|
|
89
|
+
locales:
|
|
90
|
+
- { code: de-DE, label: Deutsch, antd: de_DE, dayjs: de }
|
|
91
|
+
messages:
|
|
92
|
+
de-DE:
|
|
93
|
+
engine.validation.fieldRequired: 'Pflichtfeld'
|
|
94
|
+
engine.action.loading: 'Laden'
|
|
95
|
+
```
|
|
96
|
+
The engine's built-in messages (used by `Validate`, `Request`, etc.) now render in German.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# _theme
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(key: string): any
|
|
5
|
+
(all: boolean): any
|
|
6
|
+
(arguments: {
|
|
7
|
+
all?: boolean,
|
|
8
|
+
key?: string,
|
|
9
|
+
default?: any,
|
|
10
|
+
}): any
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The `_theme` operator gets a value from the app's antd theme seed tokens, as configured in `theme.antd.token` in `lowdefy.yaml`. This is useful for accessing theme values in expressions, such as setting colors or sizes dynamically based on the app's theme.
|
|
14
|
+
|
|
15
|
+
> The `_theme` operator is **client-side only**. It accesses seed tokens only — for derived tokens (like hover/active color variants), use CSS variables instead: `var(--ant-color-primary-hover)`.
|
|
16
|
+
|
|
17
|
+
See the [Theming](/theming) concept page for details on configuring your app's theme.
|
|
18
|
+
|
|
19
|
+
#### Arguments
|
|
20
|
+
|
|
21
|
+
###### string
|
|
22
|
+
If the `_theme` operator is called with a string argument, the value of that token key from `theme.antd.token` is returned. If the token is not found, `null` is returned.
|
|
23
|
+
|
|
24
|
+
###### boolean
|
|
25
|
+
If the `_theme` operator is called with boolean argument `true`, the entire seed token object is returned.
|
|
26
|
+
|
|
27
|
+
###### object
|
|
28
|
+
- `all: boolean`: If `all` is set to `true`, the entire seed token object is returned. One of `all` or `key` are required.
|
|
29
|
+
- `key: string`: The value of the specified token is returned. If not found, `null` or the specified default value is returned. One of `all` or `key` are required.
|
|
30
|
+
- `default: any`: A value to return if the token key is not found. By default, `null` is returned.
|
|
31
|
+
|
|
32
|
+
#### Examples
|
|
33
|
+
|
|
34
|
+
###### Get the primary color token:
|
|
35
|
+
```yaml
|
|
36
|
+
_theme: colorPrimary
|
|
37
|
+
```
|
|
38
|
+
Returns: `"#1677ff"` (or whatever `colorPrimary` is set to in your theme config).
|
|
39
|
+
|
|
40
|
+
###### Get a token with a default value:
|
|
41
|
+
```yaml
|
|
42
|
+
_theme:
|
|
43
|
+
key: colorBgContainer
|
|
44
|
+
default: '#ffffff'
|
|
45
|
+
```
|
|
46
|
+
Returns the value of `colorBgContainer` from the theme, or `"#ffffff"` if not set.
|
|
47
|
+
|
|
48
|
+
###### Get all seed tokens:
|
|
49
|
+
```yaml
|
|
50
|
+
_theme:
|
|
51
|
+
all: true
|
|
52
|
+
```
|
|
53
|
+
Returns the entire `theme.antd.token` object.
|
|
54
|
+
|
|
55
|
+
###### Use in a block property:
|
|
56
|
+
```yaml
|
|
57
|
+
- id: my_paragraph
|
|
58
|
+
type: Paragraph
|
|
59
|
+
properties:
|
|
60
|
+
content: The theme's primary color is set to...
|
|
61
|
+
style:
|
|
62
|
+
.element:
|
|
63
|
+
color:
|
|
64
|
+
_theme: colorPrimary
|
|
65
|
+
```
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# _type
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
(type: enum): boolean
|
|
5
|
+
(arguments: {
|
|
6
|
+
type: string,
|
|
7
|
+
on?: any,
|
|
8
|
+
key?: string
|
|
9
|
+
}): boolean
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The `_type` operator performs a type test on an object, and returns true if the object is of the specified type.
|
|
13
|
+
|
|
14
|
+
The regex operator has shorthand argument definitions that can be used on web client.
|
|
15
|
+
|
|
16
|
+
> This operator can be used as a [`_build`](/_build) operator method.
|
|
17
|
+
|
|
18
|
+
#### Arguments
|
|
19
|
+
|
|
20
|
+
###### object
|
|
21
|
+
- `type: enum`: __Required__ - The type to test. Can be one of:
|
|
22
|
+
- `string`
|
|
23
|
+
- `array`
|
|
24
|
+
- `date`
|
|
25
|
+
- `object`
|
|
26
|
+
- `boolean`
|
|
27
|
+
- `number`
|
|
28
|
+
- `integer`
|
|
29
|
+
- `null`
|
|
30
|
+
- `undefined`
|
|
31
|
+
- `none` (`null` or `undefined`)
|
|
32
|
+
- `primitive` (`undefined`, `null`, `string`, `number`, `boolean`, or `date`)
|
|
33
|
+
- `on: any`: The value to test. One of `on` or `key` must be specified unless the operator is used in an input block.
|
|
34
|
+
- `key: string`: The key of a value in `state` to test. One of `on` or `key` must be specified unless the operator is used in an input block.
|
|
35
|
+
|
|
36
|
+
###### string
|
|
37
|
+
The type to test. The string shorthand can only be used in an input block, and the tested value will be the block's value.
|
|
38
|
+
|
|
39
|
+
#### Examples
|
|
40
|
+
|
|
41
|
+
###### Check if a value is a number:
|
|
42
|
+
```yaml
|
|
43
|
+
_type:
|
|
44
|
+
type: number
|
|
45
|
+
on:
|
|
46
|
+
_state: input
|
|
47
|
+
```
|
|
48
|
+
Returns: `true` if a number.
|
|
49
|
+
|
|
50
|
+
###### Using the key of the value in `state`:
|
|
51
|
+
```yaml
|
|
52
|
+
_type:
|
|
53
|
+
type: number
|
|
54
|
+
key: input
|
|
55
|
+
```
|
|
56
|
+
Returns: `true` if a number.
|
|
57
|
+
|
|
58
|
+
###### Using the value of the block in which the operator is evaluated:
|
|
59
|
+
```yaml
|
|
60
|
+
id: input
|
|
61
|
+
type: TextInput
|
|
62
|
+
validate:
|
|
63
|
+
- message: This field id required.
|
|
64
|
+
status: error
|
|
65
|
+
pass:
|
|
66
|
+
_not:
|
|
67
|
+
_type: none
|
|
68
|
+
```
|
|
69
|
+
Returns: `true` if the input is none.
|
|
70
|
+
|
|
71
|
+
###### Test if an id in the `urlQuery` is undefined or null:
|
|
72
|
+
```yaml
|
|
73
|
+
_type:
|
|
74
|
+
type: none
|
|
75
|
+
on:
|
|
76
|
+
_url_query: id
|
|
77
|
+
```
|
|
78
|
+
Returns: `true` if the id is none,
|