@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,64 +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
- []
27
- # - id: generate_csv
28
- # type: JsAction # TODO:
29
- # params:
30
- # name: csvMake
31
- # args:
32
- # - profiles.csv # csv filename
33
- # - - Username: booker12 # an array of data, usually a reference
34
- # Identifier: 9012
35
- # FirstName: Rachel
36
- # LastName: Booker
37
- # - Username: grey07
38
- # Identifier: 2070
39
- # FirstName: Laura
40
- # LastName: Grey
41
- # - Username: johnson81
42
- # Identifier: 4081
43
- # FirstName: Craig
44
- # LastName: Johnson
45
- # - Username: jenkins46
46
- # Identifier: 9346
47
- # FirstName: Mary
48
- # LastName: Jenkins
49
- # - Username: smith79
50
- # Identifier: 5079
51
- # FirstName: Jamie
52
- # LastName: Smith
53
- # - - Username # an array of field definitions
54
- # - Identifier
55
- # - FirstName
56
- # - LastName
57
- footer:
58
- blocks:
59
- - id: footer
60
- type: Paragraph
61
- properties:
62
- type: secondary
63
- content: |
64
- 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,117 +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: AiTwoTonePrinter
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
- []
103
- # - id: make_pdf
104
- # type: JsAction # TODO:
105
- # params:
106
- # name: pdfMake
107
- # args:
108
- # _ref:
109
- # path: inv_template.yaml
110
- footer:
111
- blocks:
112
- - id: footer
113
- type: Paragraph
114
- properties:
115
- type: secondary
116
- content: |
117
- 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);