@lowdefy/docs 3.23.2 → 4.0.0-alpha.10

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 (274) hide show
  1. package/dist/operators/client/filter_default_value.js +55 -0
  2. package/{public/modules/connectDocsearch.js → dist/operatorsClient.js} +2 -20
  3. package/{templates/blocks/schemaTransformer.js → dist/types.js} +6 -11
  4. package/package.json +23 -8
  5. package/404.yaml +0 -26
  6. package/CHANGELOG.md +0 -659
  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 -802
  24. package/blocks/container/Affix.yaml +0 -26
  25. package/blocks/container/Badge.yaml +0 -27
  26. package/blocks/container/Box.yaml +0 -27
  27. package/blocks/container/Card.yaml +0 -29
  28. package/blocks/container/Collapse.yaml +0 -38
  29. package/blocks/container/Comment.yaml +0 -43
  30. package/blocks/container/ConfirmModal.yaml +0 -36
  31. package/blocks/container/Drawer.yaml +0 -45
  32. package/blocks/container/Label.yaml +0 -29
  33. package/blocks/container/Modal.yaml +0 -46
  34. package/blocks/container/Result.yaml +0 -34
  35. package/blocks/container/Span.yaml +0 -27
  36. package/blocks/container/Spin.yaml +0 -27
  37. package/blocks/container/Tabs.yaml +0 -41
  38. package/blocks/container/Tooltip.yaml +0 -38
  39. package/blocks/context/Context.yaml +0 -27
  40. package/blocks/context/PageHCF.yaml +0 -28
  41. package/blocks/context/PageHCSF.yaml +0 -29
  42. package/blocks/context/PageHSCF.yaml +0 -29
  43. package/blocks/context/PageHeaderMenu.yaml +0 -52
  44. package/blocks/context/PageSHCF.yaml +0 -29
  45. package/blocks/context/PageSiderMenu.yaml +0 -53
  46. package/blocks/display/Alert.yaml +0 -26
  47. package/blocks/display/Anchor.yaml +0 -26
  48. package/blocks/display/Avatar.yaml +0 -24
  49. package/blocks/display/Breadcrumb.yaml +0 -29
  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/Descriptions.yaml +0 -49
  54. package/blocks/display/Divider.yaml +0 -25
  55. package/blocks/display/EChart.yaml +0 -53
  56. package/blocks/display/Html.yaml +0 -50
  57. package/blocks/display/Icon.yaml +0 -25
  58. package/blocks/display/Img.yaml +0 -40
  59. package/blocks/display/Markdown.yaml +0 -32
  60. package/blocks/display/MarkdownWithCode.yaml +0 -48
  61. package/blocks/display/Menu.yaml +0 -48
  62. package/blocks/display/Message.yaml +0 -34
  63. package/blocks/display/MobileMenu.yaml +0 -48
  64. package/blocks/display/Notification.yaml +0 -34
  65. package/blocks/display/Paragraph.yaml +0 -32
  66. package/blocks/display/Progress.yaml +0 -53
  67. package/blocks/display/Skeleton.yaml +0 -28
  68. package/blocks/display/Statistic.yaml +0 -37
  69. package/blocks/display/Title.yaml +0 -32
  70. package/blocks/input/AutoComplete.yaml +0 -31
  71. package/blocks/input/ButtonSelector.yaml +0 -37
  72. package/blocks/input/CheckboxSelector.yaml +0 -37
  73. package/blocks/input/CheckboxSwitch.yaml +0 -56
  74. package/blocks/input/ChromeColorSelector.yaml +0 -25
  75. package/blocks/input/CircleColorSelector.yaml +0 -25
  76. package/blocks/input/ColorSelector.yaml +0 -25
  77. package/blocks/input/CompactColorSelector.yaml +0 -25
  78. package/blocks/input/DateRangeSelector.yaml +0 -27
  79. package/blocks/input/DateSelector.yaml +0 -27
  80. package/blocks/input/DateTimeSelector.yaml +0 -29
  81. package/blocks/input/GithubColorSelector.yaml +0 -25
  82. package/blocks/input/MonthSelector.yaml +0 -27
  83. package/blocks/input/MultipleSelector.yaml +0 -117
  84. package/blocks/input/NumberInput.yaml +0 -24
  85. package/blocks/input/Pagination.yaml +0 -33
  86. package/blocks/input/ParagraphInput.yaml +0 -32
  87. package/blocks/input/PasswordInput.yaml +0 -48
  88. package/blocks/input/RadioSelector.yaml +0 -36
  89. package/blocks/input/RatingSlider.yaml +0 -24
  90. package/blocks/input/S3UploadButton.yaml +0 -28
  91. package/blocks/input/Selector.yaml +0 -98
  92. package/blocks/input/SliderColorSelector.yaml +0 -24
  93. package/blocks/input/SwatchesColorSelector.yaml +0 -24
  94. package/blocks/input/Switch.yaml +0 -24
  95. package/blocks/input/TextArea.yaml +0 -28
  96. package/blocks/input/TextInput.yaml +0 -59
  97. package/blocks/input/TitleInput.yaml +0 -32
  98. package/blocks/input/TwitterColorSelector.yaml +0 -24
  99. package/blocks/input/WeekSelector.yaml +0 -26
  100. package/blocks/list/ControlledList.yaml +0 -191
  101. package/blocks/list/List.yaml +0 -158
  102. package/blocks/list/TimelineList.yaml +0 -135
  103. package/body.html +0 -1
  104. package/concepts/blocks.yaml +0 -249
  105. package/concepts/cli.yaml +0 -173
  106. package/concepts/connections-and-requests.yaml +0 -114
  107. package/concepts/context-and-state.yaml +0 -82
  108. package/concepts/custom-blocks.yaml +0 -176
  109. package/concepts/custom-code.yaml +0 -196
  110. package/concepts/events-and-actions.yaml +0 -224
  111. package/concepts/hosting-files.yaml +0 -50
  112. package/concepts/layout.yaml +0 -1464
  113. package/concepts/lists.yaml +0 -162
  114. package/concepts/lowdefy-schema.yaml +0 -244
  115. package/concepts/operators.yaml +0 -66
  116. package/concepts/overview.yaml +0 -48
  117. package/concepts/secrets.yaml +0 -56
  118. package/connections/AWSS3.yaml +0 -228
  119. package/connections/AmazonRedshift.yaml +0 -75
  120. package/connections/AxiosHttp.yaml +0 -194
  121. package/connections/Elasticsearch.yaml +0 -378
  122. package/connections/GoogleSheet.yaml +0 -332
  123. package/connections/Knex.yaml +0 -181
  124. package/connections/KnexRequests.md +0 -121
  125. package/connections/MSSQL.yaml +0 -90
  126. package/connections/MariaDB.yaml +0 -77
  127. package/connections/MongoDB.yaml +0 -452
  128. package/connections/MySQL.yaml +0 -92
  129. package/connections/OracleDB.yaml +0 -73
  130. package/connections/PostgreSQL.yaml +0 -99
  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 -251
  140. package/howto/generate-pdf.yaml.njk +0 -651
  141. package/howto/generateCsv/lowdefy.yaml +0 -63
  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 -116
  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/introduction.yaml +0 -100
  151. package/lowdefy.yaml +0 -66
  152. package/menus.yaml +0 -841
  153. package/operators/_actions.yaml +0 -123
  154. package/operators/_and.yaml +0 -90
  155. package/operators/_args.yaml +0 -79
  156. package/operators/_array.yaml +0 -326
  157. package/operators/_base64.yaml +0 -56
  158. package/operators/_change_case.yaml +0 -347
  159. package/operators/_date.yaml +0 -71
  160. package/operators/_diff.yaml +0 -76
  161. package/operators/_divide.yaml +0 -46
  162. package/operators/_eq.yaml +0 -67
  163. package/operators/_event.yaml +0 -102
  164. package/operators/_format.yaml +0 -209
  165. package/operators/_function.yaml +0 -66
  166. package/operators/_get.yaml +0 -108
  167. package/operators/_global.yaml +0 -106
  168. package/operators/_gt.yaml +0 -65
  169. package/operators/_gte.yaml +0 -65
  170. package/operators/_hash.yaml +0 -109
  171. package/operators/_if.yaml +0 -44
  172. package/operators/_if_none.yaml +0 -61
  173. package/operators/_index.yaml +0 -64
  174. package/operators/_input.yaml +0 -113
  175. package/operators/_js.yaml +0 -189
  176. package/operators/_json.yaml +0 -128
  177. package/operators/_list_contexts.yaml +0 -37
  178. package/operators/_location.yaml +0 -59
  179. package/operators/_log.yaml +0 -36
  180. package/operators/_lt.yaml +0 -65
  181. package/operators/_lte.yaml +0 -65
  182. package/operators/_math.yaml +0 -374
  183. package/operators/_media.yaml +0 -86
  184. package/operators/_menu.yaml +0 -81
  185. package/operators/_mql.yaml +0 -101
  186. package/operators/_ne.yaml +0 -77
  187. package/operators/_not.yaml +0 -47
  188. package/operators/_number.yaml +0 -157
  189. package/operators/_nunjucks.yaml +0 -73
  190. package/operators/_object.yaml +0 -193
  191. package/operators/_operator.yaml +0 -47
  192. package/operators/_or.yaml +0 -81
  193. package/operators/_product.yaml +0 -59
  194. package/operators/_random.yaml +0 -104
  195. package/operators/_ref.yaml +0 -232
  196. package/operators/_regex.yaml +0 -83
  197. package/operators/_request.yaml +0 -50
  198. package/operators/_secret.yaml +0 -74
  199. package/operators/_state.yaml +0 -113
  200. package/operators/_string.yaml +0 -283
  201. package/operators/_subtract.yaml +0 -38
  202. package/operators/_sum.yaml +0 -59
  203. package/operators/_switch.yaml +0 -51
  204. package/operators/_type.yaml +0 -92
  205. package/operators/_uri.yaml +0 -56
  206. package/operators/_url_query.yaml +0 -119
  207. package/operators/_user.yaml +0 -107
  208. package/operators/_uuid.yaml +0 -114
  209. package/operators/_var.yaml +0 -105
  210. package/operators/_yaml.yaml +0 -83
  211. package/pages.yaml +0 -228
  212. package/public/images/authors/gervwyk.jpeg +0 -0
  213. package/public/images/authors/sandile.jpeg +0 -0
  214. package/public/images/howto/header_generate_csv.jpg +0 -0
  215. package/public/images/howto/header_generate_pdf.jpg +0 -0
  216. package/public/logo_example.png +0 -0
  217. package/public/lowdefy_app_schema.png +0 -0
  218. package/public/modules/csvMake.js +0 -27
  219. package/public/modules/filterDefaultValue.js +0 -48
  220. package/public/modules/importUmd.js +0 -7
  221. package/public/modules/index.js +0 -5
  222. package/public/modules/pdfMake.js +0 -7
  223. package/public/modules/test/filterDefaultValue.test.js +0 -91
  224. package/public/modules/vfs_fonts.js +0 -12
  225. package/public/sitemap.xml +0 -1024
  226. package/templates/actions.yaml.njk +0 -68
  227. package/templates/blocks/defaultValueTransformer.js +0 -51
  228. package/templates/blocks/exampleTransformer.js +0 -81
  229. package/templates/blocks/layout.yaml +0 -114
  230. package/templates/blocks/propertiesFormTransformer.js +0 -419
  231. package/templates/blocks/propertiesGetterTransformer.js +0 -132
  232. package/templates/blocks/schema.yaml.njk +0 -42
  233. package/templates/blocks/style.yaml +0 -26
  234. package/templates/blocks/template.yaml.njk +0 -496
  235. package/templates/blog.yaml.njk +0 -221
  236. package/templates/cli_command.yaml.njk +0 -37
  237. package/templates/footer.yaml.njk +0 -604
  238. package/templates/general.yaml.njk +0 -124
  239. package/templates/generateSitemap.js +0 -42
  240. package/templates/header.yaml +0 -138
  241. package/templates/navigation_buttons.yaml +0 -68
  242. package/templates/operators.yaml.njk +0 -82
  243. package/templates/operatorsMethodTransformer.js +0 -119
  244. package/templates/test/array.test.js +0 -1355
  245. package/templates/test/boolean.test.js +0 -102
  246. package/templates/test/button.test.js +0 -170
  247. package/templates/test/color.test.js +0 -128
  248. package/templates/test/enum.test.js +0 -109
  249. package/templates/test/icon.test.js +0 -113
  250. package/templates/test/integer.test.js +0 -103
  251. package/templates/test/manual.test.js +0 -246
  252. package/templates/test/number.test.js +0 -103
  253. package/templates/test/object.test.js +0 -442
  254. package/templates/test/oneOf.test.js +0 -806
  255. package/templates/test/string.test.js +0 -102
  256. package/templates/test/yaml.test.js +0 -621
  257. package/tutorial/next-steps.yaml +0 -83
  258. package/tutorial/tutorial-actions-operators-config.yaml +0 -142
  259. package/tutorial/tutorial-actions-operators.yaml +0 -436
  260. package/tutorial/tutorial-add-blocks-config.yaml +0 -109
  261. package/tutorial/tutorial-add-blocks.yaml +0 -195
  262. package/tutorial/tutorial-create-page-config.yaml +0 -77
  263. package/tutorial/tutorial-create-page.yaml +0 -196
  264. package/tutorial/tutorial-deploy.yaml +0 -146
  265. package/tutorial/tutorial-requests-config.yaml +0 -186
  266. package/tutorial/tutorial-requests.yaml +0 -338
  267. package/tutorial/tutorial-start.yaml +0 -282
  268. package/users/login-and-logout.yaml +0 -164
  269. package/users/openid-connect.yaml +0 -84
  270. package/users/protected-pages.yaml +0 -67
  271. package/users/roles.yaml +0 -70
  272. package/users/user-object.yaml +0 -73
  273. package/users/users-introduction.yaml +0 -80
  274. package/version.yaml +0 -1
@@ -1,63 +0,0 @@
1
- lowdefy: 3.23.2
2
- name: Generate PDF from data with Lowdefy
3
-
4
- app:
5
- html:
6
- appendHead: |
7
- <script type="module" src="/public/csvMake.js"></script>
8
-
9
- pages:
10
- - id: example
11
- type: PageHeaderMenu
12
- properties:
13
- title: Example
14
- areas:
15
- content:
16
- justify: center
17
- blocks:
18
- - id: generate_csv
19
- type: Button
20
- properties:
21
- size: large
22
- title: Generate a CSV
23
- color: '#1890ff'
24
- events:
25
- onClick:
26
- - id: generate_csv
27
- type: JsAction
28
- params:
29
- name: csvMake
30
- args:
31
- - profiles.csv # csv filename
32
- - - Username: booker12 # an array of data, usually a reference
33
- Identifier: 9012
34
- FirstName: Rachel
35
- LastName: Booker
36
- - Username: grey07
37
- Identifier: 2070
38
- FirstName: Laura
39
- LastName: Grey
40
- - Username: johnson81
41
- Identifier: 4081
42
- FirstName: Craig
43
- LastName: Johnson
44
- - Username: jenkins46
45
- Identifier: 9346
46
- FirstName: Mary
47
- LastName: Jenkins
48
- - Username: smith79
49
- Identifier: 5079
50
- FirstName: Jamie
51
- LastName: Smith
52
- - - Username # an array of field definitions
53
- - Identifier
54
- - FirstName
55
- - LastName
56
- footer:
57
- blocks:
58
- - id: footer
59
- type: Paragraph
60
- properties:
61
- type: secondary
62
- content: |
63
- Made by a Lowdefy 🤖
@@ -1,27 +0,0 @@
1
- const csvMakeFn = async (context, filename, data, fields) => {
2
- if (!Array.isArray(data) || typeof data[0] !== 'object') {
3
- throw new Error('csvMake data takes an array of objects');
4
- }
5
- if (!fields) {
6
- fields = Object.keys(data[0]);
7
- }
8
- const arrays = [fields];
9
- data.forEach((obj) => arrays.push(fields.map((field) => obj[field])));
10
- const csv = arrays
11
- .map((row) =>
12
- row
13
- .map((cell) => (typeof cell === 'undefined' || cell === null ? '' : cell))
14
- .map(String)
15
- .map((v) => v.replaceAll('"', '""'))
16
- .map((v) => `"${v}"`)
17
- .join(',')
18
- )
19
- .join('\r\n');
20
- const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
21
- const url = URL.createObjectURL(blob);
22
- const el = document.createElement('a');
23
- el.href = url;
24
- el.setAttribute('download', filename);
25
- el.click();
26
- };
27
- window.lowdefy.registerJsAction('csvMake', csvMakeFn);
@@ -1,200 +0,0 @@
1
- - _nunjucks:
2
- on:
3
- _state: invoice
4
- template: 'INV-{{ id }}-{{ inv_date | date("DD-MM-YYYY") }}.pdf'
5
- - pageMargins: [50, 25, 50, 70]
6
- defaultStyle:
7
- fontSize: 10
8
- images:
9
- logo:
10
- _string.concat:
11
- - _location: origin
12
- - /public/logo_example.png
13
- footer:
14
- _function:
15
- - columns:
16
- - qr:
17
- _string.concat:
18
- - _location: origin
19
- - /invoice?id="
20
- - _state: invoice.id
21
- - '"'
22
- margin: [50, 0, 0, 0]
23
- fit: '64'
24
- - alignment: 'right'
25
- fontSize: 7
26
- margin: [0, 0, 50, 0]
27
- text:
28
- __nunjucks:
29
- template: 'Page {{ page }} of {{ total }}'
30
- on:
31
- page:
32
- __args: 0
33
- total:
34
- __args: 1
35
- content:
36
- - columns:
37
- - width: 'auto'
38
- margin: [0, 20, 0, 0]
39
- stack:
40
- - fontSize: 9
41
- text: |
42
-
43
- - fontSize: 7
44
- text: |
45
- Example Services Ltd.
46
- 112 Street Name
47
- City, State 12345
48
- Country
49
- 001-AB
50
-
51
- +00-1234-5566
52
- info@example.com
53
-
54
- Vat Number: 444 5555 0000
55
-
56
- - width: '*'
57
- text: ' '
58
- - width: 110
59
- stack:
60
- - width: 110
61
- image: logo
62
- - margin: [0, 5, 0, 0]
63
- alignment: right
64
- fontSize: 7
65
- text: |
66
- Example Services Ltd.
67
- Reg Number: 2001/22224/09
68
-
69
- - margin: [0, 20, 0, 20]
70
- text: Customer Invoice
71
- bold: true
72
- alignment: center
73
- fontSize: 14
74
- - columns:
75
- - width: 150
76
- bold: true
77
- text: |
78
- INVOICE NUMBER:
79
- DATE ISSUED:
80
- ACCOUNT NUMBER:
81
- - width: '*'
82
- text:
83
- _nunjucks:
84
- template: |
85
- {{ id }}
86
- {{ inv_date | date("YYYY/MM/DD") }}
87
- {{ account_id }}
88
- on:
89
- _state: invoice
90
- - width: 150
91
- bold: true
92
- text: |
93
- CUSTOMER:
94
- ADDRESS:
95
- - width: '*'
96
- text:
97
- _nunjucks:
98
- template: |
99
- {{ customer.name }}
100
- {{ customer.address }}
101
- on:
102
- _state: invoice
103
-
104
- - layout: 'lightHorizontalLines'
105
- margin: [0, 10, 0, 0]
106
- table:
107
- widths: [70, '*', 70, 70, 70]
108
- headerRows: 1
109
- body:
110
- _json.parse:
111
- _nunjucks:
112
- on:
113
- services:
114
- _state: invoice.services
115
- template: |
116
- [
117
- [
118
- { "text": "ITEM CODE", "bold": true },
119
- { "text": "SERVICE", "bold": true },
120
- { "text": "UNIT PRICE", "bold": true, "alignment": "right" },
121
- { "text": "QTY", "bold": true, "alignment": "right" },
122
- { "text": "COST", "bold": true, "alignment": "right" }
123
- ],
124
- {% for item in services %}
125
- [
126
- "{{ loop.index }}: {{ item.code }}",
127
- "{{ item.name | safe }}",
128
- { "text": "{{ ( item.price / item.qty ).toFixed(2) }}", "alignment": "right"},
129
- { "text": "{{ item.qty }}", "alignment": "right"},
130
- { "text": "{{ item.price.toFixed(2) }}", "alignment": "right"}
131
- {% if loop.last %} ] {% else %} ], {% endif %}
132
- {% endfor %}
133
- ]
134
- - layout: 'headerLineOnly'
135
- margin: [0, -5, 0, 0]
136
- table:
137
- widths: ['*', 70, 70, 70]
138
- headerRows: 1
139
- body:
140
- - - ''
141
- - ''
142
- - ''
143
- - ''
144
- - - ''
145
- - alignment: right
146
- text: 'Subtotal:'
147
- - ''
148
- - alignment: right
149
- text:
150
- _number.toFixed:
151
- - _state: invoice.subtotal
152
- - 2
153
- - - ''
154
- - alignment: right
155
- text: 'Discount (5%):'
156
- - ''
157
- - alignment: right
158
- text:
159
- _number.toFixed:
160
- - _state: invoice.discount
161
- - 2
162
- - - ''
163
- - alignment: right
164
- text: 'VAT (15%):'
165
- - ''
166
- - alignment: right
167
- text:
168
- _number.toFixed:
169
- - _state: invoice.vat
170
- - 2
171
- - - ''
172
- - alignment: right
173
- text: 'Total:'
174
- - ''
175
- - alignment: right
176
- text:
177
- _number.toFixed:
178
- - _state: invoice.total
179
- - 2
180
- - layout: 'headerLineOnly'
181
- margin: [0, -5, 0, 0]
182
- table:
183
- widths: ['*', 70, 70, 70]
184
- headerRows: 1
185
- body:
186
- - - ''
187
- - ''
188
- - ''
189
- - ''
190
- - - ''
191
- - alignment: right
192
- bold: true
193
- text: 'BALANCE DUE:'
194
- - ''
195
- - alignment: right
196
- bold: true
197
- text:
198
- _number.toFixed:
199
- - _state: invoice.balance
200
- - 2
@@ -1,116 +0,0 @@
1
- lowdefy: 3.23.2
2
- name: Generate PDF from data with Lowdefy
3
-
4
- app:
5
- html:
6
- appendHead:
7
- _ref: my_header.html
8
-
9
- pages:
10
- - id: example
11
- type: PageHeaderMenu
12
- properties:
13
- title: Example
14
- events:
15
- onEnter:
16
- - id: init_data
17
- type: SetState
18
- params:
19
- invoice:
20
- id: '0030135'
21
- account_id: 'A-11344'
22
- inv_date:
23
- _date: now
24
- subtotal: 397.034
25
- discount: -19.8517
26
- vat: 59.5551
27
- total: 436.7374
28
- balance: 413.2330
29
- customer:
30
- name: Service Center
31
- phone: +123-456-7890
32
- vat_nmr: 12-333-4567
33
- address: |
34
- 123 Main St.
35
- Anytown
36
- CA
37
- US
38
- 9999
39
- services:
40
- - name: Hosting and Maintannce
41
- qty: 1
42
- price: 235.90
43
- code: X12-33C
44
- - name: Developer Hours
45
- qty: 16
46
- price: 60.345
47
- code: X12-39A
48
- - name: Designer Hours
49
- qty: 4
50
- price: 40.122
51
- code: X12-21A
52
- - name: Project Management
53
- qty: 2
54
- price: 60.667
55
- code: X12-49A
56
- areas:
57
- content:
58
- justify: center
59
- blocks:
60
- - id: content_card
61
- type: Card
62
- style:
63
- maxWidth: 800
64
- blocks:
65
- - id: content
66
- type: Result
67
- properties:
68
- title: Generate PDF from data with Lowdefy
69
- subTitle: <a href="https://docs.lowdefy.com/generate-pdf-document-from-data">Read the full how to guide</a>
70
- icon:
71
- name: PrinterTwoTone
72
- color: '#ff0000'
73
- areas:
74
- extra:
75
- gutter: 16
76
- blocks:
77
- - id: customer_description
78
- type: Descriptions
79
- properties:
80
- bordered: true
81
- size: small
82
- title:
83
- _string.concat:
84
- - 'Customer Details: '
85
- - _state: invoice.account_id
86
- column: 2
87
- items:
88
- _change_case.capitalCase:
89
- options:
90
- convertKeys: true
91
- on:
92
- _state: invoice.customer
93
-
94
- - id: generate_pdf_button
95
- type: Button
96
- properties:
97
- size: large
98
- title: Generate Invoice
99
- color: '#1890ff'
100
- events:
101
- onClick:
102
- - id: make_pdf
103
- type: JsAction
104
- params:
105
- name: pdfMake
106
- args:
107
- _ref:
108
- path: inv_template.yaml
109
- footer:
110
- blocks:
111
- - id: footer
112
- type: Paragraph
113
- properties:
114
- type: secondary
115
- content: |
116
- Made by a Lowdefy 🤖
@@ -1 +0,0 @@
1
- <script defer type="module" src="/public/modules/pdfMake.js"></script>
@@ -1,7 +0,0 @@
1
- export default async (url, module = { exports: {} }) =>
2
- (Function('module', 'exports', await (await fetch(url)).text()).call(
3
- module,
4
- module,
5
- module.exports
6
- ),
7
- module).exports;
@@ -1,7 +0,0 @@
1
- import importUmd from './importUmd.js';
2
- import vfs from './vfs_fonts.js';
3
- const pdfMake = await importUmd(`https://cdn.jsdelivr.net/npm/pdfmake@0.2.2/build/pdfmake.min.js`);
4
- const pdfMakeFn = async (context, filename, docDefinition, tableLayouts, fonts) => {
5
- await pdfMake.createPdf(docDefinition, tableLayouts, fonts, vfs).download(filename);
6
- };
7
- window.lowdefy.registerJsAction('pdfMake', pdfMakeFn);