@lowdefy/docs 4.0.0-alpha.7 → 4.0.0-alpha.8

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.
Files changed (275) hide show
  1. package/dist/operators/client/filter_default_value.js +55 -0
  2. package/{public/modules/connectDocsearch.js → dist/operatorsClient.js} +1 -19
  3. package/{templates/blocks/schemaTransformer.js → dist/types.js} +5 -10
  4. package/package.json +19 -3
  5. package/404.yaml +0 -26
  6. package/CHANGELOG.md +0 -697
  7. package/actions/CallMethod.yaml +0 -57
  8. package/actions/JsAction.yaml +0 -281
  9. package/actions/Link.yaml +0 -120
  10. package/actions/Login.yaml +0 -123
  11. package/actions/Logout.yaml +0 -44
  12. package/actions/Message.yaml +0 -68
  13. package/actions/Notification.yaml +0 -84
  14. package/actions/Request.yaml +0 -70
  15. package/actions/Reset.yaml +0 -42
  16. package/actions/ResetValidation.yaml +0 -102
  17. package/actions/ScrollTo.yaml +0 -100
  18. package/actions/SetGlobal.yaml +0 -78
  19. package/actions/SetState.yaml +0 -85
  20. package/actions/Throw.yaml +0 -89
  21. package/actions/Validate.yaml +0 -104
  22. package/actions/Wait.yaml +0 -40
  23. package/blocks/all_icons.yaml +0 -803
  24. package/blocks/container/Affix.yaml +0 -26
  25. package/blocks/container/Alert.yaml +0 -27
  26. package/blocks/container/Badge.yaml +0 -27
  27. package/blocks/container/Box.yaml +0 -27
  28. package/blocks/container/Card.yaml +0 -29
  29. package/blocks/container/Collapse.yaml +0 -38
  30. package/blocks/container/Comment.yaml +0 -43
  31. package/blocks/container/ConfirmModal.yaml +0 -36
  32. package/blocks/container/Descriptions.yaml +0 -51
  33. package/blocks/container/Drawer.yaml +0 -46
  34. package/blocks/container/Label.yaml +0 -28
  35. package/blocks/container/Modal.yaml +0 -46
  36. package/blocks/container/PageHCF.yaml +0 -28
  37. package/blocks/container/PageHCSF.yaml +0 -29
  38. package/blocks/container/PageHSCF.yaml +0 -29
  39. package/blocks/container/PageHeaderMenu.yaml +0 -52
  40. package/blocks/container/PageSHCF.yaml +0 -29
  41. package/blocks/container/PageSiderMenu.yaml +0 -53
  42. package/blocks/container/Result.yaml +0 -34
  43. package/blocks/container/Span.yaml +0 -27
  44. package/blocks/container/Spin.yaml +0 -27
  45. package/blocks/container/Tabs.yaml +0 -41
  46. package/blocks/container/Tooltip.yaml +0 -38
  47. package/blocks/display/Anchor.yaml +0 -25
  48. package/blocks/display/Avatar.yaml +0 -23
  49. package/blocks/display/Breadcrumb.yaml +0 -28
  50. package/blocks/display/Button.yaml +0 -43
  51. package/blocks/display/DangerousHtml.yaml +0 -62
  52. package/blocks/display/DangerousMarkdown.yaml +0 -46
  53. package/blocks/display/Divider.yaml +0 -23
  54. package/blocks/display/EChart.yaml +0 -53
  55. package/blocks/display/Html.yaml +0 -50
  56. package/blocks/display/Icon.yaml +0 -23
  57. package/blocks/display/Img.yaml +0 -40
  58. package/blocks/display/Markdown.yaml +0 -31
  59. package/blocks/display/MarkdownWithCode.yaml +0 -46
  60. package/blocks/display/Menu.yaml +0 -48
  61. package/blocks/display/Message.yaml +0 -34
  62. package/blocks/display/MobileMenu.yaml +0 -47
  63. package/blocks/display/Notification.yaml +0 -34
  64. package/blocks/display/Paragraph.yaml +0 -30
  65. package/blocks/display/Progress.yaml +0 -52
  66. package/blocks/display/Skeleton.yaml +0 -27
  67. package/blocks/display/Statistic.yaml +0 -35
  68. package/blocks/display/Title.yaml +0 -32
  69. package/blocks/input/AutoComplete.yaml +0 -30
  70. package/blocks/input/ButtonSelector.yaml +0 -36
  71. package/blocks/input/CheckboxSelector.yaml +0 -36
  72. package/blocks/input/CheckboxSwitch.yaml +0 -56
  73. package/blocks/input/ChromeColorSelector.yaml +0 -24
  74. package/blocks/input/CircleColorSelector.yaml +0 -24
  75. package/blocks/input/ColorSelector.yaml +0 -24
  76. package/blocks/input/CompactColorSelector.yaml +0 -24
  77. package/blocks/input/DateRangeSelector.yaml +0 -26
  78. package/blocks/input/DateSelector.yaml +0 -26
  79. package/blocks/input/DateTimeSelector.yaml +0 -28
  80. package/blocks/input/GithubColorSelector.yaml +0 -24
  81. package/blocks/input/MonthSelector.yaml +0 -26
  82. package/blocks/input/MultipleSelector.yaml +0 -117
  83. package/blocks/input/NumberInput.yaml +0 -24
  84. package/blocks/input/Pagination.yaml +0 -33
  85. package/blocks/input/ParagraphInput.yaml +0 -32
  86. package/blocks/input/PasswordInput.yaml +0 -48
  87. package/blocks/input/RadioSelector.yaml +0 -36
  88. package/blocks/input/RatingSlider.yaml +0 -24
  89. package/blocks/input/S3UploadButton.yaml +0 -28
  90. package/blocks/input/Selector.yaml +0 -98
  91. package/blocks/input/SliderColorSelector.yaml +0 -24
  92. package/blocks/input/SwatchesColorSelector.yaml +0 -24
  93. package/blocks/input/Switch.yaml +0 -24
  94. package/blocks/input/TextArea.yaml +0 -27
  95. package/blocks/input/TextInput.yaml +0 -59
  96. package/blocks/input/TitleInput.yaml +0 -32
  97. package/blocks/input/TwitterColorSelector.yaml +0 -24
  98. package/blocks/input/WeekSelector.yaml +0 -26
  99. package/blocks/list/ControlledList.yaml +0 -191
  100. package/blocks/list/List.yaml +0 -157
  101. package/blocks/list/TimelineList.yaml +0 -136
  102. package/body.html +0 -1
  103. package/concepts/blocks.yaml +0 -249
  104. package/concepts/cli.yaml +0 -173
  105. package/concepts/connections-and-requests.yaml +0 -114
  106. package/concepts/context-and-state.yaml +0 -82
  107. package/concepts/custom-blocks.yaml +0 -190
  108. package/concepts/custom-code.yaml +0 -197
  109. package/concepts/events-and-actions.yaml +0 -224
  110. package/concepts/hosting-files.yaml +0 -50
  111. package/concepts/layout.yaml +0 -1464
  112. package/concepts/lists.yaml +0 -162
  113. package/concepts/lowdefy-schema.yaml +0 -245
  114. package/concepts/operators.yaml +0 -66
  115. package/concepts/overview.yaml +0 -48
  116. package/concepts/secrets.yaml +0 -56
  117. package/connections/AWSS3.yaml +0 -228
  118. package/connections/AmazonRedshift.yaml +0 -75
  119. package/connections/AxiosHttp.yaml +0 -194
  120. package/connections/Elasticsearch.yaml +0 -378
  121. package/connections/GoogleSheet.yaml +0 -332
  122. package/connections/Knex.yaml +0 -181
  123. package/connections/KnexRequests.md +0 -121
  124. package/connections/MSSQL.yaml +0 -90
  125. package/connections/MariaDB.yaml +0 -77
  126. package/connections/MongoDB.yaml +0 -581
  127. package/connections/MySQL.yaml +0 -92
  128. package/connections/OracleDB.yaml +0 -73
  129. package/connections/PostgreSQL.yaml +0 -99
  130. package/connections/Redis.yaml +0 -147
  131. package/connections/SQLite.yaml +0 -94
  132. package/connections/SendGridMail.yaml +0 -113
  133. package/connections/Stripe.yaml +0 -139
  134. package/deployment/aws-lambda.yaml +0 -128
  135. package/deployment/docker.yaml +0 -118
  136. package/deployment/netlify.yaml +0 -69
  137. package/deployment/node-server.yaml +0 -111
  138. package/head.html +0 -7
  139. package/howto/generate-csv.yaml.njk +0 -252
  140. package/howto/generate-pdf.yaml.njk +0 -651
  141. package/howto/generateCsv/lowdefy.yaml +0 -64
  142. package/howto/generateCsv/public/csvMake.js +0 -27
  143. package/howto/generatePdf/inv_template.yaml +0 -200
  144. package/howto/generatePdf/lowdefy.yaml +0 -117
  145. package/howto/generatePdf/my_header.html +0 -1
  146. package/howto/generatePdf/public/logo_example.png +0 -0
  147. package/howto/generatePdf/public/modules/importUmd.js +0 -7
  148. package/howto/generatePdf/public/modules/pdfMake.js +0 -7
  149. package/howto/generatePdf/public/modules/vfs_fonts.js +0 -12
  150. package/howto/use-refrences.md +0 -5
  151. package/introduction.yaml +0 -100
  152. package/lowdefy.yaml +0 -66
  153. package/menus.yaml +0 -832
  154. package/operators/_actions.yaml +0 -123
  155. package/operators/_and.yaml +0 -90
  156. package/operators/_args.yaml +0 -79
  157. package/operators/_array.yaml +0 -326
  158. package/operators/_base64.yaml +0 -56
  159. package/operators/_change_case.yaml +0 -347
  160. package/operators/_date.yaml +0 -71
  161. package/operators/_diff.yaml +0 -75
  162. package/operators/_divide.yaml +0 -46
  163. package/operators/_eq.yaml +0 -67
  164. package/operators/_event.yaml +0 -103
  165. package/operators/_format.yaml +0 -209
  166. package/operators/_function.yaml +0 -66
  167. package/operators/_get.yaml +0 -108
  168. package/operators/_global.yaml +0 -107
  169. package/operators/_gt.yaml +0 -65
  170. package/operators/_gte.yaml +0 -65
  171. package/operators/_hash.yaml +0 -109
  172. package/operators/_if.yaml +0 -44
  173. package/operators/_if_none.yaml +0 -61
  174. package/operators/_index.yaml +0 -65
  175. package/operators/_input.yaml +0 -114
  176. package/operators/_js.yaml +0 -189
  177. package/operators/_json.yaml +0 -128
  178. package/operators/_list_contexts.yaml +0 -37
  179. package/operators/_location.yaml +0 -59
  180. package/operators/_log.yaml +0 -36
  181. package/operators/_lt.yaml +0 -65
  182. package/operators/_lte.yaml +0 -65
  183. package/operators/_math.yaml +0 -374
  184. package/operators/_media.yaml +0 -86
  185. package/operators/_menu.yaml +0 -81
  186. package/operators/_mql.yaml +0 -101
  187. package/operators/_ne.yaml +0 -77
  188. package/operators/_not.yaml +0 -47
  189. package/operators/_number.yaml +0 -157
  190. package/operators/_nunjucks.yaml +0 -73
  191. package/operators/_object.yaml +0 -193
  192. package/operators/_operator.yaml +0 -47
  193. package/operators/_or.yaml +0 -81
  194. package/operators/_product.yaml +0 -59
  195. package/operators/_random.yaml +0 -104
  196. package/operators/_ref.yaml +0 -266
  197. package/operators/_regex.yaml +0 -83
  198. package/operators/_request.yaml +0 -50
  199. package/operators/_secret.yaml +0 -74
  200. package/operators/_state.yaml +0 -114
  201. package/operators/_string.yaml +0 -283
  202. package/operators/_subtract.yaml +0 -38
  203. package/operators/_sum.yaml +0 -59
  204. package/operators/_switch.yaml +0 -51
  205. package/operators/_type.yaml +0 -92
  206. package/operators/_uri.yaml +0 -56
  207. package/operators/_url_query.yaml +0 -120
  208. package/operators/_user.yaml +0 -107
  209. package/operators/_uuid.yaml +0 -114
  210. package/operators/_var.yaml +0 -105
  211. package/operators/_yaml.yaml +0 -107
  212. package/pages.yaml +0 -227
  213. package/public/images/authors/gervwyk.jpeg +0 -0
  214. package/public/images/authors/sandile.jpeg +0 -0
  215. package/public/images/howto/header_generate_csv.jpg +0 -0
  216. package/public/images/howto/header_generate_pdf.jpg +0 -0
  217. package/public/logo_example.png +0 -0
  218. package/public/lowdefy_app_schema.png +0 -0
  219. package/public/modules/csvMake.js +0 -27
  220. package/public/modules/filterDefaultValue.js +0 -48
  221. package/public/modules/importUmd.js +0 -7
  222. package/public/modules/index.js +0 -5
  223. package/public/modules/pdfMake.js +0 -7
  224. package/public/modules/test/filterDefaultValue.test.js +0 -91
  225. package/public/modules/vfs_fonts.js +0 -12
  226. package/public/sitemap.xml +0 -1024
  227. package/templates/actions.yaml.njk +0 -68
  228. package/templates/blocks/defaultValueTransformer.js +0 -53
  229. package/templates/blocks/exampleTransformer.js +0 -81
  230. package/templates/blocks/layout.yaml +0 -114
  231. package/templates/blocks/propertiesFormTransformer.js +0 -419
  232. package/templates/blocks/propertiesGetterTransformer.js +0 -132
  233. package/templates/blocks/schema.yaml.njk +0 -42
  234. package/templates/blocks/style.yaml +0 -26
  235. package/templates/blocks/template.yaml.njk +0 -495
  236. package/templates/blog.yaml.njk +0 -221
  237. package/templates/cli_command.yaml.njk +0 -37
  238. package/templates/footer.yaml.njk +0 -604
  239. package/templates/general.yaml.njk +0 -124
  240. package/templates/generateSitemap.js +0 -41
  241. package/templates/header.yaml +0 -138
  242. package/templates/navigation_buttons.yaml +0 -68
  243. package/templates/operators.yaml.njk +0 -82
  244. package/templates/operatorsMethodTransformer.js +0 -119
  245. package/templates/test/array.test.js +0 -1335
  246. package/templates/test/boolean.test.js +0 -98
  247. package/templates/test/button.test.js +0 -166
  248. package/templates/test/color.test.js +0 -126
  249. package/templates/test/enum.test.js +0 -105
  250. package/templates/test/icon.test.js +0 -109
  251. package/templates/test/integer.test.js +0 -99
  252. package/templates/test/manual.test.js +0 -238
  253. package/templates/test/number.test.js +0 -99
  254. package/templates/test/object.test.js +0 -434
  255. package/templates/test/oneOf.test.js +0 -794
  256. package/templates/test/string.test.js +0 -98
  257. package/templates/test/yaml.test.js +0 -605
  258. package/tutorial/next-steps.yaml +0 -83
  259. package/tutorial/tutorial-actions-operators-config.yaml +0 -142
  260. package/tutorial/tutorial-actions-operators.yaml +0 -436
  261. package/tutorial/tutorial-add-blocks-config.yaml +0 -109
  262. package/tutorial/tutorial-add-blocks.yaml +0 -195
  263. package/tutorial/tutorial-create-page-config.yaml +0 -77
  264. package/tutorial/tutorial-create-page.yaml +0 -196
  265. package/tutorial/tutorial-deploy.yaml +0 -146
  266. package/tutorial/tutorial-requests-config.yaml +0 -186
  267. package/tutorial/tutorial-requests.yaml +0 -338
  268. package/tutorial/tutorial-start.yaml +0 -282
  269. package/users/login-and-logout.yaml +0 -164
  270. package/users/openid-connect.yaml +0 -84
  271. package/users/protected-pages.yaml +0 -67
  272. package/users/roles.yaml +0 -70
  273. package/users/user-object.yaml +0 -73
  274. package/users/users-introduction.yaml +0 -80
  275. package/version.yaml +0 -1
@@ -1,65 +0,0 @@
1
- # Copyright 2020-2021 Lowdefy, Inc
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
-
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- _ref:
16
- path: templates/operators.yaml.njk
17
- transformer: templates/operatorsMethodTransformer.js
18
- vars:
19
- pageId: _gte
20
- pageTitle: _gte
21
- filePath: operators/_gte.yaml
22
- types: |
23
- ```
24
- ([value1: any, value2: any]): boolean
25
- ```
26
- description: |
27
- The `_gte` operator tests if the first value is greater than or equal to the second equal. It takes an array of two values to test.
28
-
29
- > The `_gte` operator tests using the javascript greater than or equal operator. You can find a description of the algorithm used to compare two values [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Less_than).
30
-
31
- arguments: |
32
- ###### array
33
- An array of two values to compare.
34
- examples: |
35
- ###### Two numbers:
36
- ```yaml
37
- _gte:
38
- - 4
39
- - 3
40
- ```
41
- Returns: `true`
42
-
43
- ```yaml
44
- _gte:
45
- - 1
46
- - 1
47
- ```
48
- Returns: `true`
49
-
50
- ```yaml
51
- _gte:
52
- - _sum:
53
- - 3
54
- - 4
55
- - 8
56
- ```
57
- Returns: `false`
58
-
59
- ###### Two strings:
60
- ```yaml
61
- _gte:
62
- - "a"
63
- - "b"
64
- ```
65
- Returns: `false`
@@ -1,109 +0,0 @@
1
- # Copyright 2020-2021 Lowdefy, Inc
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
-
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- _ref:
16
- path: templates/operators.yaml.njk
17
- transformer: templates/operatorsMethodTransformer.js
18
- vars:
19
- pageId: _hash
20
- pageTitle: _hash
21
- filePath: operators/_hash.yaml
22
- env: Server Only
23
- description: |
24
- The `_hash` operator generates hashes using various algorithms.
25
- methods:
26
- - name: md5
27
- types: |
28
- ```
29
- (value: string): string
30
- ```
31
- description: |
32
- The `_hash.md5` method generates the [MD5](https://en.wikipedia.org/wiki/MD5) hash of the input value.
33
- arguments: |
34
- ###### string
35
- The string to hash.
36
- examples: |
37
- ###### Hash a string:
38
- ```yaml
39
- _hash.md5: Hello World!
40
- ```
41
- Returns: `"ed076287532e86365e841e92bfc50d8c"`.
42
-
43
- - name: sha1
44
- types: |
45
- ```
46
- (value: string): string
47
- ```
48
- description: |
49
- The `_hash.sha1` method generates the [SHA1](https://en.wikipedia.org/wiki/SHA1) hash of the input value.
50
- arguments: |
51
- ###### string
52
- The string to hash.
53
- examples: |
54
- ###### Hash a string:
55
- ```yaml
56
- _hash.sha1: Hello World!
57
- ```
58
- Returns: `"2ef7bde608ce5404e97d5f042f95f89f1c232871"`.
59
-
60
- - name: sha256
61
- types: |
62
- ```
63
- (value: string): string
64
- ```
65
- description: |
66
- The `_hash.sha256` method generates the [SHA256](https://en.wikipedia.org/wiki/SHA256) hash of the input value.
67
- arguments: |
68
- ###### string
69
- The string to hash.
70
- examples: |
71
- ###### Hash a string:
72
- ```yaml
73
- _hash.sha256: Hello World!
74
- ```
75
- Returns: `"7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069"`.
76
-
77
- - name: sha512
78
- types: |
79
- ```
80
- (value: string): string
81
- ```
82
- description: |
83
- The `_hash.sha512` method generates the [SHA512](https://en.wikipedia.org/wiki/SHA512) hash of the input value.
84
- arguments: |
85
- ###### string
86
- The string to hash.
87
- examples: |
88
- ###### Hash a string:
89
- ```yaml
90
- _hash.sha512: Hello World!
91
- ```
92
- Returns: `"861844d6704e8573fec34d967e20bcfef3d424cf48be04e6dc08f2bd58c729743371015ead891cc3cf1c9d34b49264b510751b1ff9e537937bc46b5d6ff4ecc8"`.
93
-
94
- - name: ripemd160
95
- types: |
96
- ```
97
- (value: string): string
98
- ```
99
- description: |
100
- The `_hash.ripemd160` method generates the [RIPEMD-160](https://en.wikipedia.org/wiki/RIPEMD160) hash of the input value.
101
- arguments: |
102
- ###### string
103
- The string to hash.
104
- examples: |
105
- ###### Hash a string:
106
- ```yaml
107
- _hash.ripemd160: Hello World!
108
- ```
109
- Returns: `"8476ee4631b9b30ac2754b0ee0c47e161d3f724c"`.
@@ -1,44 +0,0 @@
1
- # Copyright 2020-2021 Lowdefy, Inc
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
-
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- _ref:
16
- path: templates/operators.yaml.njk
17
- transformer: templates/operatorsMethodTransformer.js
18
- vars:
19
- pageId: _if
20
- pageTitle: _if
21
- filePath: operators/_if.yaml
22
- types: |
23
- ```
24
- (arguments: {test: boolean, then: any, else: any}): any
25
- ```
26
- description: |
27
- The `_if` operator returns the `then` argument if it's `test` argument is `true`, and it's `else` argument if it is `false`. Generally other operators are used to evaluate the `test` argument.
28
- arguments: |
29
- ###### object
30
- - `test: boolean`: The boolean result of a test.
31
- - `then: any`: The value to return if the test is `true`.
32
- - `else: any`: The value to return if the test is `false`.
33
- examples: |
34
- ###### Return a value based on a user input:
35
- ```yaml
36
- _if:
37
- test:
38
- _eq:
39
- - _state: text_input
40
- - The password
41
- then: The user entered the password
42
- else: Access denied
43
- ```
44
- Returns: `"The user entered the password"` if the text input's value is `"The password"`, else `"Access denied"`
@@ -1,61 +0,0 @@
1
- # Copyright 2020-2021 Lowdefy, Inc
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
-
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- _ref:
16
- path: templates/operators.yaml.njk
17
- transformer: templates/operatorsMethodTransformer.js
18
- vars:
19
- pageId: _if_none
20
- pageTitle: _if_none
21
- filePath: operators/_if_none.yaml
22
- types: |
23
- ```
24
- ([value: any, replacement: any]): any
25
- ```
26
- description: |
27
- The `_if_none` operator replaces the input value with an alternative if the value is of a "none-type" like `null` or `undefined`.
28
- arguments: |
29
- ###### array
30
- - First value: The value to test.
31
- - Second value: The replacement.
32
- examples: |
33
- ###### The value is not replaced if it is not of a none-type:
34
- ```yaml
35
- _if_none:
36
- - Value
37
- - Replacement
38
- ```
39
- Returns: `Value`
40
-
41
- ###### The value is replaced if it is of a none-type:
42
- ```yaml
43
- _if_none:
44
- - null
45
- - "Replacement"
46
- ```
47
- Returns: `"Replacement"`
48
-
49
- ```yaml
50
- _if_none:
51
- - _state: does_not_exist # Value in state that does not exist
52
- - "Replacement"
53
- ```
54
- Returns: `"Replacement"`
55
-
56
- ```yaml
57
- _if_none:
58
- - _request: still_loading # _request returns null if the request is loading
59
- - []
60
- ```
61
- Returns: `[]`
@@ -1,65 +0,0 @@
1
- # Copyright 2020-2021 Lowdefy, Inc
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
-
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- _ref:
16
- path: templates/operators.yaml.njk
17
- transformer: templates/operatorsMethodTransformer.js
18
- vars:
19
- pageId: _index
20
- pageTitle: _index
21
- filePath: operators/_index.yaml
22
- env: Client Only
23
- types: |
24
- ```
25
- (key: string): any
26
- (key: integer): any
27
- (all: boolean): any
28
- (arguments: {
29
- all?: boolean,
30
- key?: string | integer,
31
- default?: any
32
- }): any
33
- ```
34
- description: |
35
- The `_index` operator gets a value from the `list indices` array of a block. The `list indices` array is an array of the indices of all [`list`](/lists) block areas which the block is a part of.
36
- arguments: |
37
- ###### integer
38
- If the `_index` operator is called with a integer argument, the value at that index in the `indices` array is returned. If the value is not found, `null` is returned..
39
-
40
- ###### string
41
- If the `_args` operator is called with a string argument, the value at that index in the `indices` array is returned. If the value is not found, `null` is returned.
42
-
43
- ###### boolean
44
- If the `_index` operator is called with boolean argument `true`, the entire `indices` array is returned.
45
-
46
- ###### object
47
- - `all: boolean`: If `all` is set to `true`, the entire `indices` array is returned. One of `all` or `key` are required.
48
- - `key: string | integer`: The value of the index in the `indices` array is returned. If the value is not found, `null`, or the specified default value is returned. One of `all` or `key` are required.
49
- - `default: any`: A value to return if the `key` is not found in `arguments`. By default, `null` is returned if a value is not found.
50
- examples: |
51
- ###### Get a index:
52
-
53
- Assuming the block is in the fourth content area of a `list` block.
54
- ```yaml
55
- _index: 0
56
- ```
57
- Returns: `3`
58
-
59
- ###### Get all indices:
60
-
61
- Assuming two nested list blocks, with the block in the fourth content area of the first `list` block, and the first content area of the nested `list` block.
62
- ```yaml
63
- _index: true
64
- ```
65
- Returns: `[3, 0]`
@@ -1,114 +0,0 @@
1
- # Copyright 2020-2021 Lowdefy, Inc
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
-
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- _ref:
16
- path: templates/operators.yaml.njk
17
- transformer: templates/operatorsMethodTransformer.js
18
- vars:
19
- pageId: _input
20
- pageTitle: _input
21
- filePath: operators/_input.yaml
22
- env: Client Only
23
- types: |
24
- ```
25
- (key: string): any
26
- (all: boolean): any
27
- (arguments: {
28
- all?: boolean,
29
- key?: string,
30
- default?: any,
31
- contextId?: string
32
- }): any
33
- ```
34
- description: |
35
- The `_input` operator gets a value from the [`input`](/context-and-state) object. The `input` is a data object that can be set when linking to a new page using the [`Link`](/link) action, and can be used to set data like a `id` when switching to a new page. Unlike `urlQuery`, the `input` is not visible, and cannot be changed by the user, but if the page is reloaded, the `input` is lost. By default, `_input` accesses the `input` object from the [`context`](/context-and-state) the operator is used in, but a different context can be specified.
36
-
37
- arguments: |
38
- ###### string
39
- If the `_input` operator is called with a string argument, the value of the key in the `input` object is returned. If the value is not found, `null` is returned. Dot notation and [block list indexes](/lists) are supported.
40
-
41
- ###### boolean
42
- If the `_input` operator is called with boolean argument `true`, the entire `input` object is returned.
43
-
44
- ###### object
45
- - `all: boolean`: If `all` is set to `true`, the entire `input` object is returned. One of `all` or `key` are required.
46
- - `key: string`: The value of the key in the `input` object is returned. If the value is not found, `null`, or the specified default value is returned. Dot notation and [block list indexes](/lists) are supported. One of `all` or `key` are required.
47
- - `default: any`: A value to return if the `key` is not found in `input`. By default, `null` is returned if a value is not found.
48
- - `contextId: string`: The id of a `context`. Setting this will get the value from the `input` of the specified context. A list of `contexts` that exist are returned by the [`_list_contexts`](/_list_contexts) operator. Cannot be used in `connections` or `requests`.
49
- examples: |
50
- ###### Get the value of `my_key` from `input`:
51
- ```yaml
52
- _input: my_key
53
- ```
54
- ```yaml
55
- _input:
56
- key: my_key
57
- ```
58
- Returns: The value of `my_key` in `input`.
59
-
60
- ###### Get the entire `input` object:
61
- ```yaml
62
- _input: true
63
- ```
64
- ```yaml
65
- _input:
66
- all: true
67
- ```
68
- Returns: The entire `input` object.
69
-
70
- ###### Dot notation:
71
- Assuming input:
72
- ```yaml
73
- my_object:
74
- subfield: 'Value'
75
- ```
76
- then:
77
- ```yaml
78
- _input: my_object.subfield
79
- ```
80
- ```yaml
81
- _input:
82
- key: my_object.subfield
83
- ```
84
- Returns: `"Value"`.
85
-
86
- ###### Return a default value if the value is not found:
87
- ```yaml
88
- _input:
89
- key: might_not_exist
90
- default: Default value
91
- ```
92
- Returns: The value of `might_not_exist`, or `"Default value"`.
93
-
94
- ###### Block list indices:
95
- Assuming `input`:
96
- ```yaml
97
- my_array:
98
- - value: 0
99
- - value: 1
100
- - value: 2
101
- ```
102
- then:
103
- ```yaml
104
- _input: my_array.$.value
105
- ```
106
- Returns: `0` when used from the first block (0th index) in a list.
107
-
108
- ###### Get a value from another `context`:
109
- ```yaml
110
- _input:
111
- key: my_key
112
- contextId: 'pageId:contextId:{}'
113
- ```
114
- Returns: The value of `my_key` in `input` in context `contextId` on page `pageId`.
@@ -1,189 +0,0 @@
1
- # Copyright 2020-2021 Lowdefy, Inc
2
-
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
-
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- _ref:
16
- path: templates/operators.yaml.njk
17
- transformer: templates/operatorsMethodTransformer.js
18
- vars:
19
- pageId: _js
20
- pageTitle: _js
21
- filePath: operators/_js.yaml
22
- env: Client Only
23
- warning: |
24
- SECURITY WARNING: The _js operator executes JavaScript inside your Lowdefy app. Insecure code can expose your app or data. Since Lowdefy doesn't validate your JavaScript, make sure that you only load trusted code.
25
- types: |
26
- ```
27
- (args: any[]): any
28
- ```
29
- description: |
30
- The `_js` operator executes a JavaScript function when the operator is evaluated. If used in a block, this function is called every time the Lowdefy engine checks if any block on the page should be updated. This function must be synchronous, and it is highly recommended that it is a pure function (it always returns the same result for the same input, and does not have side effects). Since it is called often it should also execute quickly, a slow operator will slow down the entire app. The [`JsAction`](/JsAction) action can be used to execute asynchronous code when an event is triggered.
31
-
32
- To use the `_js` operator the following is needed:
33
-
34
- - Load the custom JavaScript into the app `head` tag. See the [Custom Code](/custom-code) section for more details.
35
- - In the custom JavaScript, pass the JavaScript operator function to the app using the `window.lowdefy.registerJsOperator(name: string, operatorFunction: function)` method.
36
- - A list of arguments can be passed to the JavaScript function which will be spread as function parameters.
37
- - The returned value of the custom JavaScript function will be the operator result.
38
-
39
- methods:
40
- - name: '{{ method_name }}'
41
- types: |
42
- ```
43
- (args?: any[]): any
44
- ```
45
- description: |
46
- The `_js.{{ method_name }}` method evaluates the JavaScript function as registered using `window.lowdefy.registerJsOperator(method_name: string, method: function)`. When passing a list of arguments to the JavaScript function, then list of arguments will be spread as function parameters.
47
-
48
- The loaded JavaScript function must be a synchronous pure function. See the [Custom JavaScript](/custom-javascript) section for more detail on how to load custom JavaScript operators.
49
- examples: |
50
- ##### A custom JavaScript operator to calculate primes:
51
- ```yaml
52
- # lowdefy.yaml
53
- name: make-me-primes
54
- lowdefy: '3.23.2'
55
- app:
56
- html:
57
- # This HTML will be appended to the head HTML tag in the Lowdefy app
58
- appendHead: |
59
- <script type="text/javascript">
60
- // Define the JavaScript function.
61
- function makePrimes(to) {
62
- return [...Array((to || 1)-1).keys()].map(i=>i+2).filter(n =>
63
- [...Array(n-2).keys()].map(i=>i+2).reduce((acc,x)=> acc && n % x !== 0, true));
64
- }
65
- // Register the JavaScript operator function.
66
- window.lowdefy.registerJsOperator('makePrimes', makePrimes);
67
- </script>
68
- pages:
69
- - id: home
70
- type: PageHeaderMenu
71
- blocks:
72
- - id: num_of_primes
73
- type: NumberInput
74
- properties:
75
- title: Give me all the primes below?
76
- - id: primes
77
- type: Markdown
78
- properties:
79
- content:
80
- _nunjucks:
81
- template: |
82
- All primes below {{ num_of_primes }} is: {{ primes }}
83
- on:
84
- num_of_primes:
85
- _state: num_of_primes
86
- primes:
87
- # Use the custom JavaScript operator.
88
- _js.makePrimes:
89
- - _state: num_of_primes
90
- ````
91
-
92
- ##### _js.function to create a label.formatter function for an EChart block:
93
-
94
- Create a JavaScript file which are hosted publicly. The `public` folder in your Lowdefy app makes this easy. Also check to register the custom operator using `window.lowdefy.registerJsOperator`.
95
- ```js
96
- // file: /public/getLabel.js
97
- const getLabel = (levelTwo, levelThree, levelFour) => (param) => {
98
- var depth = param.treePathInfo.length;
99
- if (depth === 2) {
100
- return levelTwo;
101
- }
102
- else if (depth === 3) {
103
- return levelThree;
104
- }
105
- else if (depth === 4) {
106
- return levelFour;
107
- }
108
- }
109
- window.lowdefy.registerJsOperator('getLabel', getLabel);
110
- ```
111
-
112
- Load the JavaScript by referencing it into the Lowdefy application HTML `head` tag.
113
- ```html
114
- // file: imports.html
115
- <script type="text/javascript" src="/public/getLabel.js"></script>
116
- ```
117
-
118
- Use the `_js.getLabel` operator
119
- ```yaml
120
- # file: lowdefy.yaml
121
- name: my-chart
122
- lowdefy: '3.23.2'
123
- app:
124
- html:
125
- appendHead:
126
- _ref: imports.html # Loading html content into the application head tag.
127
- pages:
128
- - id: home
129
- type: PageHeaderMenu
130
- blocks:
131
- - id: chart
132
- type: EChart
133
- properties:
134
- height: 600
135
- option:
136
- series:
137
- - radius:
138
- - '15%'
139
- - '80%'
140
- type: 'sunburst'
141
- sort: null
142
- emphasis:
143
- focus: 'ancestor'
144
- data:
145
- - value: 8,
146
- children:
147
- - value: 4,
148
- children:
149
- - value: 2
150
- - value: 1
151
- - value: 1
152
- - value: 0.5
153
- - value: 2
154
- - value: 4
155
- children:
156
- - children:
157
- - value: 2
158
- - value: 4
159
- children:
160
- - children:
161
- - value: 2
162
- - value: 3
163
- children:
164
- - children:
165
- - value: 1
166
- label:
167
- color: '#000'
168
- textBorderColor: '#fff'
169
- textBorderWidth: 2
170
- formatter:
171
- _js.getLabel: # Use the getLabel function
172
- - 'radial'
173
- - 'tangential'
174
- - 'other'
175
- levels:
176
- - {}
177
- - itemStyle:
178
- color: '#CD4949'
179
- label:
180
- rotate: 'radial'
181
- - itemStyle:
182
- color: '#F47251'
183
- label:
184
- rotate: 'tangential'
185
- - itemStyle:
186
- color: '#FFC75F'
187
- label:
188
- rotate: 0
189
- ````