@saltcorn/data 0.7.1 → 0.7.2-beta.3

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 (246) hide show
  1. package/dist/app-locales/en.json +6 -0
  2. package/dist/app-locales/public/da.json +3 -0
  3. package/dist/app-locales/public/tlh.json +3 -0
  4. package/dist/base-plugin/actions.d.ts.map +1 -1
  5. package/dist/base-plugin/actions.js +4 -1
  6. package/dist/base-plugin/actions.js.map +1 -1
  7. package/dist/base-plugin/fieldviews.d.ts +24 -0
  8. package/dist/base-plugin/fieldviews.d.ts.map +1 -1
  9. package/dist/base-plugin/fieldviews.js +57 -5
  10. package/dist/base-plugin/fieldviews.js.map +1 -1
  11. package/dist/base-plugin/index.d.ts +230 -13
  12. package/dist/base-plugin/index.d.ts.map +1 -1
  13. package/dist/base-plugin/types.d.ts +114 -73
  14. package/dist/base-plugin/types.d.ts.map +1 -1
  15. package/dist/base-plugin/types.js +141 -37
  16. package/dist/base-plugin/types.js.map +1 -1
  17. package/dist/base-plugin/viewtemplates/edit.d.ts +47 -3
  18. package/dist/base-plugin/viewtemplates/edit.d.ts.map +1 -1
  19. package/dist/base-plugin/viewtemplates/edit.js +204 -85
  20. package/dist/base-plugin/viewtemplates/edit.js.map +1 -1
  21. package/dist/base-plugin/viewtemplates/feed.d.ts +14 -1
  22. package/dist/base-plugin/viewtemplates/feed.d.ts.map +1 -1
  23. package/dist/base-plugin/viewtemplates/feed.js +20 -8
  24. package/dist/base-plugin/viewtemplates/feed.js.map +1 -1
  25. package/dist/base-plugin/viewtemplates/filter.d.ts +17 -1
  26. package/dist/base-plugin/viewtemplates/filter.d.ts.map +1 -1
  27. package/dist/base-plugin/viewtemplates/filter.js +64 -45
  28. package/dist/base-plugin/viewtemplates/filter.js.map +1 -1
  29. package/dist/base-plugin/viewtemplates/list.d.ts +20 -1
  30. package/dist/base-plugin/viewtemplates/list.d.ts.map +1 -1
  31. package/dist/base-plugin/viewtemplates/list.js +59 -40
  32. package/dist/base-plugin/viewtemplates/list.js.map +1 -1
  33. package/dist/base-plugin/viewtemplates/listshowlist.d.ts +14 -1
  34. package/dist/base-plugin/viewtemplates/listshowlist.d.ts.map +1 -1
  35. package/dist/base-plugin/viewtemplates/listshowlist.js +15 -4
  36. package/dist/base-plugin/viewtemplates/listshowlist.js.map +1 -1
  37. package/dist/base-plugin/viewtemplates/room.d.ts +41 -1
  38. package/dist/base-plugin/viewtemplates/room.d.ts.map +1 -1
  39. package/dist/base-plugin/viewtemplates/room.js +107 -80
  40. package/dist/base-plugin/viewtemplates/room.js.map +1 -1
  41. package/dist/base-plugin/viewtemplates/show.d.ts +37 -4
  42. package/dist/base-plugin/viewtemplates/show.d.ts.map +1 -1
  43. package/dist/base-plugin/viewtemplates/show.js +112 -75
  44. package/dist/base-plugin/viewtemplates/show.js.map +1 -1
  45. package/dist/base-plugin/viewtemplates/viewable_fields.d.ts +26 -7
  46. package/dist/base-plugin/viewtemplates/viewable_fields.d.ts.map +1 -1
  47. package/dist/base-plugin/viewtemplates/viewable_fields.js +60 -48
  48. package/dist/base-plugin/viewtemplates/viewable_fields.js.map +1 -1
  49. package/dist/coverage/coverage-final.json +46 -0
  50. package/dist/coverage/lcov-report/block-navigation.d.ts +2 -0
  51. package/dist/coverage/lcov-report/block-navigation.d.ts.map +1 -0
  52. package/dist/coverage/lcov-report/block-navigation.js +71 -0
  53. package/dist/coverage/lcov-report/block-navigation.js.map +1 -0
  54. package/dist/coverage/lcov-report/prettify.d.ts +1 -0
  55. package/dist/coverage/lcov-report/prettify.d.ts.map +1 -0
  56. package/dist/coverage/lcov-report/prettify.js +478 -0
  57. package/dist/coverage/lcov-report/prettify.js.map +1 -0
  58. package/dist/coverage/lcov-report/sorter.d.ts +2 -0
  59. package/dist/coverage/lcov-report/sorter.d.ts.map +1 -0
  60. package/dist/coverage/lcov-report/sorter.js +164 -0
  61. package/dist/coverage/lcov-report/sorter.js.map +1 -0
  62. package/dist/db/connect.d.ts.map +1 -1
  63. package/dist/db/connect.js +8 -1
  64. package/dist/db/connect.js.map +1 -1
  65. package/dist/db/connect_mobile.d.ts +9 -0
  66. package/dist/db/connect_mobile.d.ts.map +1 -0
  67. package/dist/db/connect_mobile.js +15 -0
  68. package/dist/db/connect_mobile.js.map +1 -0
  69. package/dist/db/fixtures.d.ts.map +1 -1
  70. package/dist/db/fixtures.js +2 -1
  71. package/dist/db/fixtures.js.map +1 -1
  72. package/dist/db/index.d.ts.map +1 -1
  73. package/dist/db/index.js +16 -2
  74. package/dist/db/index.js.map +1 -1
  75. package/dist/db/state.d.ts +207 -52
  76. package/dist/db/state.d.ts.map +1 -1
  77. package/dist/db/state.js +87 -84
  78. package/dist/db/state.js.map +1 -1
  79. package/dist/index.d.ts +8 -0
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +27 -2
  82. package/dist/index.js.map +1 -1
  83. package/dist/migrate.d.ts.map +1 -1
  84. package/dist/migrate.js +54 -40
  85. package/dist/migrate.js.map +1 -1
  86. package/dist/mobile-mocks/db/postgres.d.ts +1 -0
  87. package/dist/mobile-mocks/db/postgres.d.ts.map +1 -0
  88. package/dist/mobile-mocks/db/postgres.js +2 -0
  89. package/dist/mobile-mocks/db/postgres.js.map +1 -0
  90. package/dist/mobile-mocks/db/sqlite.d.ts +1 -0
  91. package/dist/mobile-mocks/db/sqlite.d.ts.map +1 -0
  92. package/dist/mobile-mocks/db/sqlite.js +2 -0
  93. package/dist/mobile-mocks/db/sqlite.js.map +1 -0
  94. package/dist/mobile-mocks/models/email.d.ts +1 -0
  95. package/dist/mobile-mocks/models/email.d.ts.map +1 -0
  96. package/dist/mobile-mocks/models/email.js +2 -0
  97. package/dist/mobile-mocks/models/email.js.map +1 -0
  98. package/dist/mobile-mocks/node/async_hooks.d.ts +4 -0
  99. package/dist/mobile-mocks/node/async_hooks.d.ts.map +1 -0
  100. package/dist/mobile-mocks/node/async_hooks.js +8 -0
  101. package/dist/mobile-mocks/node/async_hooks.js.map +1 -0
  102. package/dist/mobile-mocks/node/child_process.d.ts +3 -0
  103. package/dist/mobile-mocks/node/child_process.d.ts.map +1 -0
  104. package/dist/mobile-mocks/node/child_process.js +6 -0
  105. package/dist/mobile-mocks/node/child_process.js.map +1 -0
  106. package/dist/mobile-mocks/node/fs/promises.d.ts +6 -0
  107. package/dist/mobile-mocks/node/fs/promises.d.ts.map +1 -0
  108. package/dist/mobile-mocks/node/fs/promises.js +16 -0
  109. package/dist/mobile-mocks/node/fs/promises.js.map +1 -0
  110. package/dist/mobile-mocks/node/fs.d.ts +4 -0
  111. package/dist/mobile-mocks/node/fs.d.ts.map +1 -0
  112. package/dist/mobile-mocks/node/fs.js +15 -0
  113. package/dist/mobile-mocks/node/fs.js.map +1 -0
  114. package/dist/mobile-mocks/node/latest-version.d.ts +2 -0
  115. package/dist/mobile-mocks/node/latest-version.d.ts.map +1 -0
  116. package/dist/mobile-mocks/node/latest-version.js +7 -0
  117. package/dist/mobile-mocks/node/latest-version.js.map +1 -0
  118. package/dist/mobile-mocks/node/v8.d.ts +3 -0
  119. package/dist/mobile-mocks/node/v8.d.ts.map +1 -0
  120. package/dist/mobile-mocks/node/v8.js +8 -0
  121. package/dist/mobile-mocks/node/v8.js.map +1 -0
  122. package/dist/mobile-mocks/npm/env-paths.d.ts +6 -0
  123. package/dist/mobile-mocks/npm/env-paths.d.ts.map +1 -0
  124. package/dist/mobile-mocks/npm/env-paths.js +9 -0
  125. package/dist/mobile-mocks/npm/env-paths.js.map +1 -0
  126. package/dist/mobile-mocks/saltcorn/plugin-testing.d.ts +1 -0
  127. package/dist/mobile-mocks/saltcorn/plugin-testing.d.ts.map +1 -0
  128. package/dist/mobile-mocks/saltcorn/plugin-testing.js +2 -0
  129. package/dist/mobile-mocks/saltcorn/plugin-testing.js.map +1 -0
  130. package/dist/models/config.d.ts +9 -10
  131. package/dist/models/config.d.ts.map +1 -1
  132. package/dist/models/config.js +8 -7
  133. package/dist/models/config.js.map +1 -1
  134. package/dist/models/discovery.d.ts.map +1 -1
  135. package/dist/models/discovery.js +5 -1
  136. package/dist/models/discovery.js.map +1 -1
  137. package/dist/models/field.d.ts +5 -4
  138. package/dist/models/field.d.ts.map +1 -1
  139. package/dist/models/field.js +22 -19
  140. package/dist/models/field.js.map +1 -1
  141. package/dist/models/fieldrepeat.d.ts +5 -0
  142. package/dist/models/fieldrepeat.d.ts.map +1 -1
  143. package/dist/models/fieldrepeat.js +2 -0
  144. package/dist/models/fieldrepeat.js.map +1 -1
  145. package/dist/models/form.d.ts +2 -0
  146. package/dist/models/form.d.ts.map +1 -1
  147. package/dist/models/form.js +1 -0
  148. package/dist/models/form.js.map +1 -1
  149. package/dist/models/index.d.ts +2 -13
  150. package/dist/models/index.d.ts.map +1 -1
  151. package/dist/models/layout.d.ts.map +1 -1
  152. package/dist/models/layout.js +12 -2
  153. package/dist/models/layout.js.map +1 -1
  154. package/dist/models/page.d.ts +1 -1
  155. package/dist/models/page.d.ts.map +1 -1
  156. package/dist/models/page.js +10 -9
  157. package/dist/models/page.js.map +1 -1
  158. package/dist/models/scheduler.d.ts.map +1 -1
  159. package/dist/models/scheduler.js +3 -1
  160. package/dist/models/scheduler.js.map +1 -1
  161. package/dist/models/table.d.ts +2 -1
  162. package/dist/models/table.d.ts.map +1 -1
  163. package/dist/models/table.js +21 -10
  164. package/dist/models/table.js.map +1 -1
  165. package/dist/models/trigger.d.ts +3 -3
  166. package/dist/models/trigger.d.ts.map +1 -1
  167. package/dist/models/trigger.js +4 -5
  168. package/dist/models/trigger.js.map +1 -1
  169. package/dist/models/user.d.ts +1 -1
  170. package/dist/models/user.d.ts.map +1 -1
  171. package/dist/models/user.js +7 -15
  172. package/dist/models/user.js.map +1 -1
  173. package/dist/models/view.d.ts +16 -12
  174. package/dist/models/view.d.ts.map +1 -1
  175. package/dist/models/view.js +63 -15
  176. package/dist/models/view.js.map +1 -1
  177. package/dist/models/workflow.d.ts +1 -0
  178. package/dist/models/workflow.d.ts.map +1 -1
  179. package/dist/models/workflow.js +58 -2
  180. package/dist/models/workflow.js.map +1 -1
  181. package/dist/package.json +127 -0
  182. package/dist/plugin-helper.d.ts +17 -13
  183. package/dist/plugin-helper.d.ts.map +1 -1
  184. package/dist/plugin-helper.js +89 -61
  185. package/dist/plugin-helper.js.map +1 -1
  186. package/dist/tests/actions.test.js +30 -5
  187. package/dist/tests/actions.test.js.map +1 -1
  188. package/dist/tests/db.test.d.ts +2 -0
  189. package/dist/tests/db.test.d.ts.map +1 -0
  190. package/dist/tests/db.test.js +32 -0
  191. package/dist/tests/db.test.js.map +1 -0
  192. package/dist/tests/exact_views.test.js +274 -19
  193. package/dist/tests/exact_views.test.js.map +1 -1
  194. package/dist/tests/models.test.js +46 -1
  195. package/dist/tests/models.test.js.map +1 -1
  196. package/dist/tests/remote_query_helper.d.ts +341 -0
  197. package/dist/tests/remote_query_helper.d.ts.map +1 -0
  198. package/dist/tests/remote_query_helper.js +446 -0
  199. package/dist/tests/remote_query_helper.js.map +1 -0
  200. package/dist/tests/state.test.d.ts +2 -0
  201. package/dist/tests/state.test.d.ts.map +1 -0
  202. package/dist/tests/state.test.js +78 -0
  203. package/dist/tests/state.test.js.map +1 -0
  204. package/dist/tests/view.test.js +29 -0
  205. package/dist/tests/view.test.js.map +1 -1
  206. package/dist/tsconfig.json +24 -0
  207. package/dist/tsconfig.ref.json +9 -0
  208. package/dist/tsconfig.ref.tsbuildinfo +1 -1
  209. package/dist/utils.d.ts +3 -1
  210. package/dist/utils.d.ts.map +1 -1
  211. package/dist/utils.js +14 -23
  212. package/dist/utils.js.map +1 -1
  213. package/dist/webpack.config.d.ts +57 -0
  214. package/dist/webpack.config.d.ts.map +1 -0
  215. package/dist/webpack.config.js +75 -0
  216. package/dist/webpack.config.js.map +1 -0
  217. package/package.json +38 -13
  218. package/CHANGELOG.md +0 -8
  219. package/dist/models/backup.d.ts +0 -9
  220. package/dist/models/backup.d.ts.map +0 -1
  221. package/dist/models/backup.js +0 -278
  222. package/dist/models/backup.js.map +0 -1
  223. package/dist/models/pack.d.ts +0 -42
  224. package/dist/models/pack.d.ts.map +0 -1
  225. package/dist/models/pack.js +0 -419
  226. package/dist/models/pack.js.map +0 -1
  227. package/dist/models/tenant.d.ts +0 -17
  228. package/dist/models/tenant.d.ts.map +0 -1
  229. package/dist/models/tenant.js +0 -152
  230. package/dist/models/tenant.js.map +0 -1
  231. package/dist/tests/backup.test.d.ts +0 -2
  232. package/dist/tests/backup.test.d.ts.map +0 -1
  233. package/dist/tests/backup.test.js +0 -101
  234. package/dist/tests/backup.test.js.map +0 -1
  235. package/dist/tests/pack.test.d.ts +0 -2
  236. package/dist/tests/pack.test.d.ts.map +0 -1
  237. package/dist/tests/pack.test.js +0 -338
  238. package/dist/tests/pack.test.js.map +0 -1
  239. package/dist/tests/random.test.d.ts +0 -2
  240. package/dist/tests/random.test.d.ts.map +0 -1
  241. package/dist/tests/random.test.js +0 -149
  242. package/dist/tests/random.test.js.map +0 -1
  243. package/dist/tests/tenant.test.d.ts +0 -2
  244. package/dist/tests/tenant.test.d.ts.map +0 -1
  245. package/dist/tests/tenant.test.js +0 -52
  246. package/dist/tests/tenant.test.js.map +0 -1
@@ -215,17 +215,23 @@ export namespace int {
215
215
  export { isEdit_12 as isEdit };
216
216
  const blockDisplay_5: boolean;
217
217
  export { blockDisplay_5 as blockDisplay };
218
+ const configFields_5: {
219
+ name: string;
220
+ label: string;
221
+ type: string;
222
+ }[];
223
+ export { configFields_5 as configFields };
218
224
  export function run_12(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
219
225
  export { run_12 as run };
220
226
  }
221
227
  export { edit_1 as edit };
222
228
  export namespace number_slider {
223
- export function configFields_5(field: any): {
229
+ export function configFields_6(field: any): {
224
230
  name: string;
225
231
  type: any;
226
232
  required: boolean;
227
233
  }[];
228
- export { configFields_5 as configFields };
234
+ export { configFields_6 as configFields };
229
235
  const isEdit_13: boolean;
230
236
  export { isEdit_13 as isEdit };
231
237
  const blockDisplay_6: boolean;
@@ -233,8 +239,24 @@ export namespace int {
233
239
  export function run_13(nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any): any;
234
240
  export { run_13 as run };
235
241
  }
242
+ export namespace range_interval {
243
+ export function configFields_7(field: any): {
244
+ name: string;
245
+ type: any;
246
+ required: boolean;
247
+ }[];
248
+ export { configFields_7 as configFields };
249
+ const isEdit_14: boolean;
250
+ export { isEdit_14 as isEdit };
251
+ const isFilter_1: boolean;
252
+ export { isFilter_1 as isFilter };
253
+ const blockDisplay_7: boolean;
254
+ export { blockDisplay_7 as blockDisplay };
255
+ export function run_14(nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}): any;
256
+ export { run_14 as run };
257
+ }
236
258
  export namespace progress_bar {
237
- export function configFields_6(field: any): ({
259
+ export function configFields_8(field: any): ({
238
260
  name: string;
239
261
  type: any;
240
262
  required: boolean;
@@ -245,20 +267,28 @@ export namespace int {
245
267
  label: string;
246
268
  required?: undefined;
247
269
  })[];
248
- export { configFields_6 as configFields };
249
- const isEdit_14: boolean;
250
- export { isEdit_14 as isEdit };
251
- export function run_14(v: any, req: any, attrs?: {}): any;
252
- export { run_14 as run };
253
- }
254
- export namespace above_input {
270
+ export { configFields_8 as configFields };
255
271
  const isEdit_15: boolean;
256
272
  export { isEdit_15 as isEdit };
257
- const isFilter_1: boolean;
258
- export { isFilter_1 as isFilter };
259
- export function run_15(nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}): any;
273
+ export function run_15(v: any, req: any, attrs?: {}): any;
260
274
  export { run_15 as run };
261
275
  }
276
+ export namespace above_input {
277
+ const isEdit_16: boolean;
278
+ export { isEdit_16 as isEdit };
279
+ const isFilter_2: boolean;
280
+ export { isFilter_2 as isFilter };
281
+ const blockDisplay_8: boolean;
282
+ export { blockDisplay_8 as blockDisplay };
283
+ const configFields_9: {
284
+ name: string;
285
+ label: string;
286
+ type: string;
287
+ }[];
288
+ export { configFields_9 as configFields };
289
+ export function run_16(nm: any, v: any, attrs: {} | undefined, cls: any, requiZred: any, field: any, state?: {}): any;
290
+ export { run_16 as run };
291
+ }
262
292
  export namespace below_input { }
263
293
  }
264
294
  export { fieldviews_1 as fieldviews };
@@ -280,37 +310,37 @@ export namespace bool {
280
310
  export { contract_2 as contract };
281
311
  export namespace fieldviews_2 {
282
312
  export namespace show_1 {
283
- const isEdit_16: boolean;
284
- export { isEdit_16 as isEdit };
285
- export function run_16(v: any): any;
286
- export { run_16 as run };
287
- }
288
- export { show_1 as show };
289
- export namespace checkboxes {
290
313
  const isEdit_17: boolean;
291
314
  export { isEdit_17 as isEdit };
292
315
  export function run_17(v: any): any;
293
316
  export { run_17 as run };
294
317
  }
295
- export namespace TrueFalse {
318
+ export { show_1 as show };
319
+ export namespace checkboxes {
296
320
  const isEdit_18: boolean;
297
321
  export { isEdit_18 as isEdit };
298
- export function run_18(v: any): "" | "True" | "False";
322
+ export function run_18(v: any): any;
299
323
  export { run_18 as run };
300
324
  }
301
- export namespace edit_2 {
325
+ export namespace TrueFalse {
302
326
  const isEdit_19: boolean;
303
327
  export { isEdit_19 as isEdit };
304
- export function run_19(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
328
+ export function run_19(v: any): "" | "True" | "False";
305
329
  export { run_19 as run };
306
330
  }
307
- export { edit_2 as edit };
308
- export namespace tristate {
331
+ export namespace edit_2 {
309
332
  const isEdit_20: boolean;
310
333
  export { isEdit_20 as isEdit };
311
334
  export function run_20(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
312
335
  export { run_20 as run };
313
336
  }
337
+ export { edit_2 as edit };
338
+ export namespace tristate {
339
+ const isEdit_21: boolean;
340
+ export { isEdit_21 as isEdit };
341
+ export function run_21(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
342
+ export { run_21 as run };
343
+ }
314
344
  }
315
345
  export { fieldviews_2 as fieldviews };
316
346
  const attributes_2: object[];
@@ -334,60 +364,60 @@ export namespace date {
334
364
  export { attributes_3 as attributes };
335
365
  export namespace fieldviews_3 {
336
366
  export namespace show_2 {
337
- const isEdit_21: boolean;
338
- export { isEdit_21 as isEdit };
339
- export function run_21(d: any, req: any): any;
340
- export { run_21 as run };
341
- }
342
- export { show_2 as show };
343
- export namespace showDay {
344
367
  const isEdit_22: boolean;
345
368
  export { isEdit_22 as isEdit };
346
369
  export function run_22(d: any, req: any): any;
347
370
  export { run_22 as run };
348
371
  }
349
- export namespace format {
372
+ export { show_2 as show };
373
+ export namespace showDay {
350
374
  const isEdit_23: boolean;
351
375
  export { isEdit_23 as isEdit };
352
- const configFields_7: {
376
+ export function run_23(d: any, req: any): any;
377
+ export { run_23 as run };
378
+ }
379
+ export namespace format {
380
+ const isEdit_24: boolean;
381
+ export { isEdit_24 as isEdit };
382
+ const configFields_10: {
353
383
  name: string;
354
384
  label: string;
355
385
  type: string;
356
386
  sublabel: string;
357
387
  }[];
358
- export { configFields_7 as configFields };
359
- export function run_23(d: any, req: any, options: any): string;
360
- export { run_23 as run };
361
- }
362
- export namespace relative {
363
- const isEdit_24: boolean;
364
- export { isEdit_24 as isEdit };
365
- export function run_24(d: any, req: any): string;
388
+ export { configFields_10 as configFields };
389
+ export function run_24(d: any, req: any, options: any): string;
366
390
  export { run_24 as run };
367
391
  }
368
- export namespace yearsAgo {
392
+ export namespace relative {
369
393
  const isEdit_25: boolean;
370
394
  export { isEdit_25 as isEdit };
371
395
  export function run_25(d: any, req: any): string;
372
396
  export { run_25 as run };
373
397
  }
374
- export namespace edit_3 {
398
+ export namespace yearsAgo {
375
399
  const isEdit_26: boolean;
376
400
  export { isEdit_26 as isEdit };
377
- const blockDisplay_7: boolean;
378
- export { blockDisplay_7 as blockDisplay };
379
- export function run_26(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
401
+ export function run_26(d: any, req: any): string;
380
402
  export { run_26 as run };
381
403
  }
382
- export { edit_3 as edit };
383
- export namespace editDay {
404
+ export namespace edit_3 {
384
405
  const isEdit_27: boolean;
385
406
  export { isEdit_27 as isEdit };
386
- const blockDisplay_8: boolean;
387
- export { blockDisplay_8 as blockDisplay };
407
+ const blockDisplay_9: boolean;
408
+ export { blockDisplay_9 as blockDisplay };
388
409
  export function run_27(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
389
410
  export { run_27 as run };
390
411
  }
412
+ export { edit_3 as edit };
413
+ export namespace editDay {
414
+ const isEdit_28: boolean;
415
+ export { isEdit_28 as isEdit };
416
+ const blockDisplay_10: boolean;
417
+ export { blockDisplay_10 as blockDisplay };
418
+ export function run_28(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
419
+ export { run_28 as run };
420
+ }
391
421
  }
392
422
  export { fieldviews_3 as fieldviews };
393
423
  export namespace presets_1 {
@@ -411,26 +441,37 @@ export namespace float {
411
441
  export { contract_4 as contract };
412
442
  export namespace fieldviews_4 {
413
443
  export namespace show_3 {
414
- const isEdit_28: boolean;
415
- export { isEdit_28 as isEdit };
416
- export function run_28(s: any): string;
417
- export { run_28 as run };
418
- }
419
- export { show_3 as show };
420
- export namespace edit_4 {
421
444
  const isEdit_29: boolean;
422
445
  export { isEdit_29 as isEdit };
423
- const blockDisplay_9: boolean;
424
- export { blockDisplay_9 as blockDisplay };
425
- export function run_29(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
446
+ export function run_29(s: any): string;
426
447
  export { run_29 as run };
427
448
  }
449
+ export { show_3 as show };
450
+ export namespace edit_4 {
451
+ const isEdit_30: boolean;
452
+ export { isEdit_30 as isEdit };
453
+ const blockDisplay_11: boolean;
454
+ export { blockDisplay_11 as blockDisplay };
455
+ export function run_30(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
456
+ export { run_30 as run };
457
+ }
428
458
  export { edit_4 as edit };
429
459
  export namespace number_slider_1 { }
430
460
  export { number_slider_1 as number_slider };
461
+ export namespace range_interval_1 { }
462
+ export { range_interval_1 as range_interval };
431
463
  export namespace progress_bar_1 { }
432
464
  export { progress_bar_1 as progress_bar };
433
- export namespace above_input_1 { }
465
+ export namespace above_input_1 {
466
+ const isEdit_31: boolean;
467
+ export { isEdit_31 as isEdit };
468
+ const isFilter_3: boolean;
469
+ export { isFilter_3 as isFilter };
470
+ const blockDisplay_12: boolean;
471
+ export { blockDisplay_12 as blockDisplay };
472
+ export function run_31(nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}): any;
473
+ export { run_31 as run };
474
+ }
434
475
  export { above_input_1 as above_input };
435
476
  export namespace below_input_1 { }
436
477
  export { below_input_1 as below_input };
@@ -452,19 +493,19 @@ export namespace color {
452
493
  export { contract_5 as contract };
453
494
  export namespace fieldviews_5 {
454
495
  export namespace show_4 {
455
- const isEdit_30: boolean;
456
- export { isEdit_30 as isEdit };
457
- export function run_30(s: any): any;
458
- export { run_30 as run };
496
+ const isEdit_32: boolean;
497
+ export { isEdit_32 as isEdit };
498
+ export function run_32(s: any): any;
499
+ export { run_32 as run };
459
500
  }
460
501
  export { show_4 as show };
461
502
  export namespace edit_5 {
462
- const isEdit_31: boolean;
463
- export { isEdit_31 as isEdit };
464
- const blockDisplay_10: boolean;
465
- export { blockDisplay_10 as blockDisplay };
466
- export function run_31(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
467
- export { run_31 as run };
503
+ const isEdit_33: boolean;
504
+ export { isEdit_33 as isEdit };
505
+ const blockDisplay_13: boolean;
506
+ export { blockDisplay_13 as blockDisplay };
507
+ export function run_33(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
508
+ export { run_33 as run };
468
509
  }
469
510
  export { edit_5 as edit };
470
511
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../base-plugin/types.js"],"names":[],"mappings":";gBA2Ka,MAAM;oBAEN,MAAM;IAML,+CAqEX;IAMS;;gBAK+D;;;;YAYxC,6BAAyB;;;;;YAQjD,mCAAqD;;;;;;YASrD,yDAAmE;;;;;;YAOzC,mCAA6B;;;;;;;YAU9C;;;;;;;;;;;;;;;;;;;;;iBA8Bb;YACI,6FA8CG;;;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AqBE;;;;;wBAGA,MAAM,EAAE;;IAOC,2EAKnB;IAKK,kDAUL;;IAKW,8CAAU;IAKd,0CAAwB;IAItB,sCAAiB;;;;kBA9UhB,MAAM;;sBAEN,MAAM;;IAKP,uCAAa;;wBACZ,MAAM,EAAE;;;;;;YAeV,8CAKG;;;;;;;YASH,8CAKG;;;;;;;;;;;;;YAiBH,+DAIJ;;;;;;YASI,iDAKJ;;;;;;YASI,iDAGJ;;;;;;;;YAWI,8FAgBD;;;;;;;;;YAWC,8FAgBD;;;;;;QASD,qBAAgB;;;IAOjB,yDAWL;;IAMC,gDAEgC;;;;kBArSvB,MAAM;;sBAEN,MAAM;;IAQP;;;iBAAmD;;;;;;YAY/B,uCAAc;;;;;;;;;YAUnC,8FAeD;;;;;;;;;;;;;;;;;YA12BH,qHAaD;;;;;;;;wBAq2BO,MAAM,EAAE;;IAWb,+DAUL;;IAMC,mEAKC;;;;kBAvKQ,MAAM;;sBAEN,MAAM;;IAKP,uCAAY;;;;;;YAcb,oCAMG;;;;;;;;;YAWH,8FAUD;;;;;;wBAGG,MAAM,EAAE;;IAMb,0CAOL;;IAIS,sCAET"}
@@ -8,7 +8,7 @@
8
8
  * @subcategory base-plugin
9
9
  */
10
10
  const moment = require("moment");
11
- const { input, select, option, text, div, h3, a, i, button, textarea, span, img, text_attr, script, domReady, } = require("@saltcorn/markup/tags");
11
+ const { input, select, option, text, div, h3, a, i, button, textarea, span, img, text_attr, script, domReady, section, } = require("@saltcorn/markup/tags");
12
12
  const { contract, is } = require("contractis");
13
13
  const { radio_group, checkbox_group } = require("@saltcorn/markup/helpers");
14
14
  const { getState } = require("../db/state");
@@ -19,13 +19,12 @@ const isdef = (x) => (typeof x === "undefined" || x === null ? false : true);
19
19
  const eqStr = (x, y) => `${x}` === `${y}`;
20
20
  const number_slider = (type) => ({
21
21
  configFields: (field) => [
22
- ...(!isdef(field.attributes.max) && !isdef(field.attributes.min)
23
- ? [
24
- { name: "min", type, required: false },
25
- { name: "max", type, required: false },
26
- ]
22
+ ...(!isdef(field.attributes.min)
23
+ ? [{ name: "min", type, required: false }]
24
+ : []),
25
+ ...(!isdef(field.attributes.max)
26
+ ? [{ name: "max", type, required: false }]
27
27
  : []),
28
- //{ name: "also_entry", type: "Bool", label: "Also entry" },
29
28
  ],
30
29
  isEdit: true,
31
30
  blockDisplay: true,
@@ -42,11 +41,54 @@ const number_slider = (type) => ({
42
41
  ? Math.pow(10, -attrs.decimal_places)
43
42
  : "0.01",
44
43
  id: `input${text_attr(nm)}`,
45
- ...(attrs.max && { max: attrs.max }),
46
- ...(attrs.min && { min: attrs.min }),
44
+ ...(isdef(attrs.max) && { max: attrs.max }),
45
+ ...(isdef(attrs.min) && { min: attrs.min }),
47
46
  ...(isdef(v) && { value: text_attr(v) }),
48
47
  }),
49
48
  });
49
+ const range_interval = (type) => ({
50
+ configFields: (field) => [
51
+ ...(!isdef(field.attributes.min)
52
+ ? [{ name: "min", type, required: false }]
53
+ : []),
54
+ ...(!isdef(field.attributes.max)
55
+ ? [{ name: "max", type, required: false }]
56
+ : []),
57
+ ],
58
+ isEdit: false,
59
+ isFilter: true,
60
+ blockDisplay: true,
61
+ /* https://stackoverflow.com/a/31083391 */
62
+ run: (nm, v, attrs = {}, cls, required, field, state = {}) => {
63
+ return section({ class: ["range-slider", cls] }, span({ class: "rangeValues" }), input({
64
+ ...(isdef(state[`_gte_${nm}`])
65
+ ? {
66
+ value: text_attr(state[`_gte_${nm}`]),
67
+ }
68
+ : isdef(attrs.min)
69
+ ? { value: text_attr(attrs.min) }
70
+ : {}),
71
+ ...(isdef(attrs.max) && { max: attrs.max }),
72
+ ...(isdef(attrs.min) && { min: attrs.min }),
73
+ type: "range",
74
+ disabled: attrs.disabled,
75
+ onChange: `set_state_field('_gte_${nm}', this.value)`,
76
+ }), input({
77
+ ...(isdef(state[`_lte_${nm}`])
78
+ ? {
79
+ value: text_attr(state[`_lte_${nm}`]),
80
+ }
81
+ : isdef(attrs.max)
82
+ ? { value: text_attr(attrs.max) }
83
+ : {}),
84
+ ...(isdef(attrs.max) && { max: attrs.max }),
85
+ ...(isdef(attrs.min) && { min: attrs.min }),
86
+ type: "range",
87
+ disabled: attrs.disabled,
88
+ onChange: `set_state_field('_lte_${nm}', this.value)`,
89
+ }));
90
+ },
91
+ });
50
92
  const progress_bar = (type) => ({
51
93
  configFields: (field) => [
52
94
  ...(!isdef(field.attributes.min)
@@ -74,20 +116,46 @@ const progress_bar = (type) => ({
74
116
  },
75
117
  })),
76
118
  });
77
- const number_limit = (type, direction) => ({
119
+ const number_limit = (direction) => ({
120
+ isEdit: false,
121
+ isFilter: true,
122
+ blockDisplay: true,
123
+ configFields: [
124
+ { name: "stepper_btns", label: "Stepper buttons", type: "Bool" },
125
+ ],
126
+ run: (nm, v, attrs = {}, cls, requiZred, field, state = {}) => {
127
+ const onChange = `set_state_field('_${direction}_${nm}', this.value)`;
128
+ return attrs?.stepper_btns
129
+ ? number_stepper(undefined, isdef(state[`_${direction}_${nm}`])
130
+ ? text_attr(state[`_${direction}_${nm}`])
131
+ : undefined, {
132
+ ...attrs,
133
+ onChange: `set_state_field('_${direction}_${nm}', $('#numlim_${nm}_${direction}').val())`,
134
+ }, cls, undefined, `numlim_${nm}_${direction}`)
135
+ : input({
136
+ type: "number",
137
+ class: ["form-control", cls],
138
+ disabled: attrs.disabled,
139
+ onChange,
140
+ step: 1,
141
+ ...(attrs.max && { max: attrs.max }),
142
+ ...(attrs.min && { min: attrs.min }),
143
+ ...(isdef(state[`_${direction}_${nm}`]) && {
144
+ value: text_attr(state[`_${direction}_${nm}`]),
145
+ }),
146
+ });
147
+ },
148
+ });
149
+ const float_number_limit = (direction) => ({
78
150
  isEdit: false,
79
151
  isFilter: true,
152
+ blockDisplay: true,
80
153
  run: (nm, v, attrs = {}, cls, required, field, state = {}) => input({
81
154
  type: "number",
82
155
  class: ["form-control", cls],
83
- blockDisplay: true,
84
156
  disabled: attrs.disabled,
85
157
  onChange: `set_state_field('_${direction}_${nm}', this.value)`,
86
- step: type === "Integer"
87
- ? "1"
88
- : attrs.decimal_places
89
- ? Math.pow(10, -attrs.decimal_places)
90
- : "0.01",
158
+ step: attrs.decimal_places ? Math.pow(10, -attrs.decimal_places) : "0.01",
91
159
  ...(attrs.max && { max: attrs.max }),
92
160
  ...(attrs.min && { min: attrs.min }),
93
161
  ...(isdef(state[`_${direction}_${nm}`]) && {
@@ -95,6 +163,27 @@ const number_limit = (type, direction) => ({
95
163
  }),
96
164
  }),
97
165
  });
166
+ const number_stepper = (name, v, attrs, cls, fieldname, id) => div({ class: "input-group" }, button({
167
+ class: "btn btn-outline-secondary",
168
+ type: "button",
169
+ onClick: `$('#${id}').val(Math.max(${isdef(attrs.min) ? attrs.min : "-Infinity"},+$('#${id}').val()-1));${attrs.onChange || ""}`,
170
+ }, i({ class: "fas fa-minus" })), input({
171
+ type: "number",
172
+ class: ["form-control", "hideupdownbtns", cls],
173
+ disabled: attrs.disabled,
174
+ "data-fieldname": fieldname,
175
+ name,
176
+ onChange: attrs.onChange,
177
+ id,
178
+ step: "1",
179
+ ...(attrs.max && { max: attrs.max }),
180
+ ...(attrs.min && { min: attrs.min }),
181
+ ...(isdef(v) && { value: text_attr(v) }),
182
+ }), button({
183
+ class: "btn btn-outline-secondary",
184
+ type: "button",
185
+ onClick: `$('#${id}').val(Math.min(${isdef(attrs.max) ? attrs.max : "Infinity"},+$('#${id}').val()+1));${attrs.onChange || ""}`,
186
+ }, i({ class: "fas fa-plus" })));
98
187
  /**
99
188
  * @param {string} v
100
189
  * @param {string} optsStr
@@ -638,24 +727,34 @@ const int = {
638
727
  edit: {
639
728
  isEdit: true,
640
729
  blockDisplay: true,
641
- run: (nm, v, attrs, cls, required, field) => input({
642
- type: "number",
643
- class: ["form-control", cls],
644
- disabled: attrs.disabled,
645
- "data-fieldname": text_attr(field.name),
646
- name: text_attr(nm),
647
- onChange: attrs.onChange,
648
- id: `input${text_attr(nm)}`,
649
- step: "1",
650
- ...(attrs.max && { max: attrs.max }),
651
- ...(attrs.min && { min: attrs.min }),
652
- ...(isdef(v) && { value: text_attr(v) }),
653
- }),
730
+ configFields: [
731
+ { name: "stepper_btns", label: "Stepper buttons", type: "Bool" },
732
+ ],
733
+ run: (nm, v, attrs, cls, required, field) => {
734
+ const id = `input${text_attr(nm)}`;
735
+ const name = text_attr(nm);
736
+ return attrs?.stepper_btns
737
+ ? number_stepper(name, v, attrs, cls, text_attr(field.name), id)
738
+ : input({
739
+ type: "number",
740
+ class: ["form-control", cls],
741
+ disabled: attrs.disabled,
742
+ "data-fieldname": text_attr(field.name),
743
+ name,
744
+ onChange: attrs.onChange,
745
+ id,
746
+ step: "1",
747
+ ...(attrs.max && { max: attrs.max }),
748
+ ...(attrs.min && { min: attrs.min }),
749
+ ...(isdef(v) && { value: text_attr(v) }),
750
+ });
751
+ },
654
752
  },
655
753
  number_slider: number_slider("Integer"),
754
+ range_interval: range_interval("Integer"),
656
755
  progress_bar: progress_bar("Integer"),
657
- above_input: number_limit("Integer", "gte"),
658
- below_input: number_limit("Integer", "lte"),
756
+ above_input: number_limit("gte"),
757
+ below_input: number_limit("lte"),
659
758
  },
660
759
  /** @type {object[]} */
661
760
  attributes: [
@@ -827,9 +926,10 @@ const float = {
827
926
  }),
828
927
  },
829
928
  number_slider: number_slider("Float"),
929
+ range_interval: range_interval("Float"),
830
930
  progress_bar: progress_bar("Float"),
831
- above_input: number_limit("Float", "gte"),
832
- below_input: number_limit("Float", "lte"),
931
+ above_input: float_number_limit("gte"),
932
+ below_input: float_number_limit("lte"),
833
933
  },
834
934
  /** @type {object[]} */
835
935
  attributes: [
@@ -912,7 +1012,7 @@ const date = {
912
1012
  show: {
913
1013
  isEdit: false,
914
1014
  run: (d, req) => typeof d === "string"
915
- ? text(d)
1015
+ ? localeDateTime(new Date(d))
916
1016
  : d && d.toISOString
917
1017
  ? localeDateTime(d)
918
1018
  : "",
@@ -925,7 +1025,7 @@ const date = {
925
1025
  showDay: {
926
1026
  isEdit: false,
927
1027
  run: (d, req) => typeof d === "string"
928
- ? text(d)
1028
+ ? localeDate(new Date(d))
929
1029
  : d && d.toISOString
930
1030
  ? localeDate(d)
931
1031
  : "",
@@ -1000,7 +1100,9 @@ const date = {
1000
1100
  disabled: attrs.disabled,
1001
1101
  id: `input${text_attr(nm)}`,
1002
1102
  ...(isdef(v) && {
1003
- value: text_attr(typeof v === "string" ? v : v.toLocaleString(attrs.locale)),
1103
+ value: text_attr(typeof v === "string"
1104
+ ? new Date(v).toLocaleString(attrs.locale)
1105
+ : v.toLocaleString(attrs.locale)),
1004
1106
  }),
1005
1107
  }),
1006
1108
  },
@@ -1021,7 +1123,9 @@ const date = {
1021
1123
  disabled: attrs.disabled,
1022
1124
  id: `input${text_attr(nm)}`,
1023
1125
  ...(isdef(v) && {
1024
- value: text_attr(typeof v === "string" ? v : v.toLocaleDateString(attrs.locale)),
1126
+ value: text_attr(typeof v === "string"
1127
+ ? new Date(v).toLocaleDateString(attrs.locale)
1128
+ : v.toLocaleDateString(attrs.locale)),
1025
1129
  }),
1026
1130
  }),
1027
1131
  },