@researchdatabox/sails-ng-common 0.0.1-beta.10173

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 (236) hide show
  1. package/README.md +5 -0
  2. package/dist/src/config/base-field-component.model.d.ts +26 -0
  3. package/dist/src/config/base-field-component.model.js +29 -0
  4. package/dist/src/config/base-field-component.outline.d.ts +106 -0
  5. package/dist/src/config/base-field-component.outline.js +3 -0
  6. package/dist/src/config/component/accordion.model.d.ts +103 -0
  7. package/dist/src/config/component/accordion.model.js +127 -0
  8. package/dist/src/config/component/accordion.outline.d.ts +150 -0
  9. package/dist/src/config/component/accordion.outline.js +13 -0
  10. package/dist/src/config/component/action-row-layout.model.d.ts +28 -0
  11. package/dist/src/config/component/action-row-layout.model.js +35 -0
  12. package/dist/src/config/component/action-row-layout.outline.d.ts +36 -0
  13. package/dist/src/config/component/action-row-layout.outline.js +6 -0
  14. package/dist/src/config/component/cancel-button.model.d.ts +48 -0
  15. package/dist/src/config/component/cancel-button.model.js +58 -0
  16. package/dist/src/config/component/cancel-button.outline.d.ts +79 -0
  17. package/dist/src/config/component/cancel-button.outline.js +6 -0
  18. package/dist/src/config/component/checkbox-input.model.d.ts +67 -0
  19. package/dist/src/config/component/checkbox-input.model.js +79 -0
  20. package/dist/src/config/component/checkbox-input.outline.d.ts +87 -0
  21. package/dist/src/config/component/checkbox-input.outline.js +8 -0
  22. package/dist/src/config/component/checkbox-tree.model.d.ts +68 -0
  23. package/dist/src/config/component/checkbox-tree.model.js +80 -0
  24. package/dist/src/config/component/checkbox-tree.outline.d.ts +99 -0
  25. package/dist/src/config/component/checkbox-tree.outline.js +8 -0
  26. package/dist/src/config/component/content.model.d.ts +46 -0
  27. package/dist/src/config/component/content.model.js +56 -0
  28. package/dist/src/config/component/content.outline.d.ts +68 -0
  29. package/dist/src/config/component/content.outline.js +6 -0
  30. package/dist/src/config/component/data-location.model.d.ts +83 -0
  31. package/dist/src/config/component/data-location.model.js +95 -0
  32. package/dist/src/config/component/data-location.outline.d.ts +118 -0
  33. package/dist/src/config/component/data-location.outline.js +6 -0
  34. package/dist/src/config/component/date-input.model.d.ts +67 -0
  35. package/dist/src/config/component/date-input.model.js +80 -0
  36. package/dist/src/config/component/date-input.outline.d.ts +82 -0
  37. package/dist/src/config/component/date-input.outline.js +8 -0
  38. package/dist/src/config/component/default-layout.model.d.ts +22 -0
  39. package/dist/src/config/component/default-layout.model.js +30 -0
  40. package/dist/src/config/component/default-layout.outline.d.ts +29 -0
  41. package/dist/src/config/component/default-layout.outline.js +5 -0
  42. package/dist/src/config/component/delete-button.model.d.ts +46 -0
  43. package/dist/src/config/component/delete-button.model.js +48 -0
  44. package/dist/src/config/component/delete-button.outline.d.ts +83 -0
  45. package/dist/src/config/component/delete-button.outline.js +5 -0
  46. package/dist/src/config/component/dropdown-input.model.d.ts +65 -0
  47. package/dist/src/config/component/dropdown-input.model.js +78 -0
  48. package/dist/src/config/component/dropdown-input.outline.d.ts +86 -0
  49. package/dist/src/config/component/dropdown-input.outline.js +8 -0
  50. package/dist/src/config/component/file-upload.model.d.ts +67 -0
  51. package/dist/src/config/component/file-upload.model.js +81 -0
  52. package/dist/src/config/component/file-upload.outline.d.ts +93 -0
  53. package/dist/src/config/component/file-upload.outline.js +8 -0
  54. package/dist/src/config/component/group.model.d.ts +61 -0
  55. package/dist/src/config/component/group.model.js +75 -0
  56. package/dist/src/config/component/group.outline.d.ts +77 -0
  57. package/dist/src/config/component/group.outline.js +8 -0
  58. package/dist/src/config/component/inline-layout.model.d.ts +22 -0
  59. package/dist/src/config/component/inline-layout.model.js +29 -0
  60. package/dist/src/config/component/inline-layout.outline.d.ts +29 -0
  61. package/dist/src/config/component/inline-layout.outline.js +5 -0
  62. package/dist/src/config/component/integration-status.model.d.ts +49 -0
  63. package/dist/src/config/component/integration-status.model.js +65 -0
  64. package/dist/src/config/component/integration-status.outline.d.ts +55 -0
  65. package/dist/src/config/component/integration-status.outline.js +5 -0
  66. package/dist/src/config/component/map.model.d.ts +68 -0
  67. package/dist/src/config/component/map.model.js +85 -0
  68. package/dist/src/config/component/map.outline.d.ts +102 -0
  69. package/dist/src/config/component/map.outline.js +8 -0
  70. package/dist/src/config/component/pdf-list.model.d.ts +68 -0
  71. package/dist/src/config/component/pdf-list.model.js +71 -0
  72. package/dist/src/config/component/pdf-list.outline.d.ts +91 -0
  73. package/dist/src/config/component/pdf-list.outline.js +6 -0
  74. package/dist/src/config/component/publish-data-location-refresh.model.d.ts +39 -0
  75. package/dist/src/config/component/publish-data-location-refresh.model.js +52 -0
  76. package/dist/src/config/component/publish-data-location-refresh.outline.d.ts +52 -0
  77. package/dist/src/config/component/publish-data-location-refresh.outline.js +5 -0
  78. package/dist/src/config/component/publish-data-location-selector.model.d.ts +78 -0
  79. package/dist/src/config/component/publish-data-location-selector.model.js +104 -0
  80. package/dist/src/config/component/publish-data-location-selector.outline.d.ts +104 -0
  81. package/dist/src/config/component/publish-data-location-selector.outline.js +6 -0
  82. package/dist/src/config/component/question-tree.helper.d.ts +58 -0
  83. package/dist/src/config/component/question-tree.helper.js +291 -0
  84. package/dist/src/config/component/question-tree.model.d.ts +64 -0
  85. package/dist/src/config/component/question-tree.model.js +80 -0
  86. package/dist/src/config/component/question-tree.outline.d.ts +308 -0
  87. package/dist/src/config/component/question-tree.outline.js +9 -0
  88. package/dist/src/config/component/radio-input.model.d.ts +65 -0
  89. package/dist/src/config/component/radio-input.model.js +77 -0
  90. package/dist/src/config/component/radio-input.outline.d.ts +85 -0
  91. package/dist/src/config/component/radio-input.outline.js +8 -0
  92. package/dist/src/config/component/record-metadata-retriever.model.d.ts +41 -0
  93. package/dist/src/config/component/record-metadata-retriever.model.js +57 -0
  94. package/dist/src/config/component/record-metadata-retriever.outline.d.ts +47 -0
  95. package/dist/src/config/component/record-metadata-retriever.outline.js +5 -0
  96. package/dist/src/config/component/record-selector.model.d.ts +61 -0
  97. package/dist/src/config/component/record-selector.model.js +61 -0
  98. package/dist/src/config/component/record-selector.outline.d.ts +85 -0
  99. package/dist/src/config/component/record-selector.outline.js +6 -0
  100. package/dist/src/config/component/repeatable.model.d.ts +91 -0
  101. package/dist/src/config/component/repeatable.model.js +112 -0
  102. package/dist/src/config/component/repeatable.outline.d.ts +109 -0
  103. package/dist/src/config/component/repeatable.outline.js +10 -0
  104. package/dist/src/config/component/reusable.model.d.ts +42 -0
  105. package/dist/src/config/component/reusable.model.js +57 -0
  106. package/dist/src/config/component/reusable.outline.d.ts +49 -0
  107. package/dist/src/config/component/reusable.outline.js +6 -0
  108. package/dist/src/config/component/rich-text-editor.model.d.ts +65 -0
  109. package/dist/src/config/component/rich-text-editor.model.js +79 -0
  110. package/dist/src/config/component/rich-text-editor.outline.d.ts +86 -0
  111. package/dist/src/config/component/rich-text-editor.outline.js +8 -0
  112. package/dist/src/config/component/save-button.model.d.ts +49 -0
  113. package/dist/src/config/component/save-button.model.js +59 -0
  114. package/dist/src/config/component/save-button.outline.d.ts +84 -0
  115. package/dist/src/config/component/save-button.outline.js +6 -0
  116. package/dist/src/config/component/save-status.model.d.ts +42 -0
  117. package/dist/src/config/component/save-status.model.js +60 -0
  118. package/dist/src/config/component/save-status.outline.d.ts +52 -0
  119. package/dist/src/config/component/save-status.outline.js +6 -0
  120. package/dist/src/config/component/simple-input.model.d.ts +62 -0
  121. package/dist/src/config/component/simple-input.model.js +75 -0
  122. package/dist/src/config/component/simple-input.outline.d.ts +80 -0
  123. package/dist/src/config/component/simple-input.outline.js +9 -0
  124. package/dist/src/config/component/suggested-validation-summary.model.d.ts +45 -0
  125. package/dist/src/config/component/suggested-validation-summary.model.js +61 -0
  126. package/dist/src/config/component/suggested-validation-summary.outline.d.ts +51 -0
  127. package/dist/src/config/component/suggested-validation-summary.outline.js +5 -0
  128. package/dist/src/config/component/tab-content.model.d.ts +63 -0
  129. package/dist/src/config/component/tab-content.model.js +77 -0
  130. package/dist/src/config/component/tab-content.outline.d.ts +92 -0
  131. package/dist/src/config/component/tab-content.outline.js +8 -0
  132. package/dist/src/config/component/tab-nav-button.model.d.ts +45 -0
  133. package/dist/src/config/component/tab-nav-button.model.js +55 -0
  134. package/dist/src/config/component/tab-nav-button.outline.d.ts +64 -0
  135. package/dist/src/config/component/tab-nav-button.outline.js +6 -0
  136. package/dist/src/config/component/tab.model.d.ts +71 -0
  137. package/dist/src/config/component/tab.model.js +84 -0
  138. package/dist/src/config/component/tab.outline.d.ts +106 -0
  139. package/dist/src/config/component/tab.outline.js +9 -0
  140. package/dist/src/config/component/text-area.model.d.ts +63 -0
  141. package/dist/src/config/component/text-area.model.js +76 -0
  142. package/dist/src/config/component/text-area.outline.d.ts +81 -0
  143. package/dist/src/config/component/text-area.outline.js +8 -0
  144. package/dist/src/config/component/typeahead-input.model.d.ts +81 -0
  145. package/dist/src/config/component/typeahead-input.model.js +93 -0
  146. package/dist/src/config/component/typeahead-input.outline.d.ts +121 -0
  147. package/dist/src/config/component/typeahead-input.outline.js +8 -0
  148. package/dist/src/config/component/validation-summary.model.d.ts +42 -0
  149. package/dist/src/config/component/validation-summary.model.js +60 -0
  150. package/dist/src/config/component/validation-summary.outline.d.ts +57 -0
  151. package/dist/src/config/component/validation-summary.outline.js +6 -0
  152. package/dist/src/config/dictionary.model.d.ts +648 -0
  153. package/dist/src/config/dictionary.model.js +181 -0
  154. package/dist/src/config/dictionary.outline.d.ts +96 -0
  155. package/dist/src/config/dictionary.outline.js +3 -0
  156. package/dist/src/config/field-component.model.d.ts +7 -0
  157. package/dist/src/config/field-component.model.js +11 -0
  158. package/dist/src/config/field-component.outline.d.ts +20 -0
  159. package/dist/src/config/field-component.outline.js +3 -0
  160. package/dist/src/config/field-layout.model.d.ts +19 -0
  161. package/dist/src/config/field-layout.model.js +23 -0
  162. package/dist/src/config/field-layout.outline.d.ts +42 -0
  163. package/dist/src/config/field-layout.outline.js +3 -0
  164. package/dist/src/config/field-model.model.d.ts +21 -0
  165. package/dist/src/config/field-model.model.js +24 -0
  166. package/dist/src/config/field-model.outline.d.ts +63 -0
  167. package/dist/src/config/field-model.outline.js +3 -0
  168. package/dist/src/config/field.model.d.ts +12 -0
  169. package/dist/src/config/field.model.js +12 -0
  170. package/dist/src/config/field.outline.d.ts +19 -0
  171. package/dist/src/config/field.outline.js +3 -0
  172. package/dist/src/config/form-behaviour.outline.d.ts +128 -0
  173. package/dist/src/config/form-behaviour.outline.js +40 -0
  174. package/dist/src/config/form-component.model.d.ts +38 -0
  175. package/dist/src/config/form-component.model.js +36 -0
  176. package/dist/src/config/form-component.outline.d.ts +297 -0
  177. package/dist/src/config/form-component.outline.js +27 -0
  178. package/dist/src/config/form-config.model.d.ts +33 -0
  179. package/dist/src/config/form-config.model.js +36 -0
  180. package/dist/src/config/form-config.outline.d.ts +107 -0
  181. package/dist/src/config/form-config.outline.js +3 -0
  182. package/dist/src/config/form-override.model.d.ts +128 -0
  183. package/dist/src/config/form-override.model.js +1320 -0
  184. package/dist/src/config/form-override.outline.d.ts +15 -0
  185. package/dist/src/config/form-override.outline.js +3 -0
  186. package/dist/src/config/form-prehydrate.outline.d.ts +17 -0
  187. package/dist/src/config/form-prehydrate.outline.js +5 -0
  188. package/dist/src/config/form-types.model.d.ts +6 -0
  189. package/dist/src/config/form-types.model.js +23 -0
  190. package/dist/src/config/form-types.outline.d.ts +48 -0
  191. package/dist/src/config/form-types.outline.js +137 -0
  192. package/dist/src/config/helpers.d.ts +31 -0
  193. package/dist/src/config/helpers.js +122 -0
  194. package/dist/src/config/names/naming-helpers.d.ts +112 -0
  195. package/dist/src/config/names/naming-helpers.js +188 -0
  196. package/dist/src/config/names/query-helpers.d.ts +43 -0
  197. package/dist/src/config/names/query-helpers.js +59 -0
  198. package/dist/src/config/shared.outline.d.ts +54 -0
  199. package/dist/src/config/shared.outline.js +41 -0
  200. package/dist/src/config/visitor/base.model.d.ts +143 -0
  201. package/dist/src/config/visitor/base.model.js +336 -0
  202. package/dist/src/config/visitor/base.outline.d.ts +146 -0
  203. package/dist/src/config/visitor/base.outline.js +3 -0
  204. package/dist/src/config/visitor/common.model.d.ts +119 -0
  205. package/dist/src/config/visitor/common.model.js +422 -0
  206. package/dist/src/date-format-helpers.d.ts +1 -0
  207. package/dist/src/date-format-helpers.js +21 -0
  208. package/dist/src/handlebars-helpers.d.ts +264 -0
  209. package/dist/src/handlebars-helpers.js +670 -0
  210. package/dist/src/html-helpers.d.ts +15 -0
  211. package/dist/src/html-helpers.js +42 -0
  212. package/dist/src/index.d.ts +118 -0
  213. package/dist/src/index.js +145 -0
  214. package/dist/src/jsonata-helpers.d.ts +40 -0
  215. package/dist/src/jsonata-helpers.js +106 -0
  216. package/dist/src/logger.interface.d.ts +14 -0
  217. package/dist/src/logger.interface.js +3 -0
  218. package/dist/src/record.model.d.ts +35 -0
  219. package/dist/src/record.model.js +21 -0
  220. package/dist/src/report.model.d.ts +64 -0
  221. package/dist/src/report.model.js +19 -0
  222. package/dist/src/status.model.d.ts +22 -0
  223. package/dist/src/status.model.js +28 -0
  224. package/dist/src/template.outline.d.ts +79 -0
  225. package/dist/src/template.outline.js +14 -0
  226. package/dist/src/translation-helpers.d.ts +10 -0
  227. package/dist/src/translation-helpers.js +30 -0
  228. package/dist/src/validation/form.model.d.ts +323 -0
  229. package/dist/src/validation/form.model.js +31 -0
  230. package/dist/src/validation/helpers.d.ts +16 -0
  231. package/dist/src/validation/helpers.js +104 -0
  232. package/dist/src/validation/validators-support.d.ts +41 -0
  233. package/dist/src/validation/validators-support.js +183 -0
  234. package/dist/src/validation/validators.d.ts +21 -0
  235. package/dist/src/validation/validators.js +377 -0
  236. package/package.json +96 -0
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Escape content for HTML text nodes only.
3
+ * Do not use this for HTML attributes, URLs, CSS, or JavaScript contexts.
4
+ */
5
+ export declare function escapeHtmlText(value: unknown): string;
6
+ /**
7
+ * Convert base64-encoded text to Unicode text.
8
+ * @param value The encoded string.
9
+ */
10
+ export declare function decodeBase64(value: string): string;
11
+ /**
12
+ * Convert arbitrary Unicode text to base64 encoding.
13
+ * @param value The text to convert to base64.
14
+ */
15
+ export declare function encodeBase64(value: string): string;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.escapeHtmlText = escapeHtmlText;
4
+ exports.decodeBase64 = decodeBase64;
5
+ exports.encodeBase64 = encodeBase64;
6
+ /**
7
+ * Escape content for HTML text nodes only.
8
+ * Do not use this for HTML attributes, URLs, CSS, or JavaScript contexts.
9
+ */
10
+ function escapeHtmlText(value) {
11
+ return String(value ?? '')
12
+ .replaceAll('&', '&')
13
+ .replaceAll('<', '&lt;')
14
+ .replaceAll('>', '&gt;')
15
+ .replaceAll('"', '&quot;')
16
+ .replaceAll("'", '&#39;');
17
+ }
18
+ /**
19
+ * Convert base64-encoded text to Unicode text.
20
+ * @param value The encoded string.
21
+ */
22
+ function decodeBase64(value) {
23
+ const binString = atob(value);
24
+ const bytes = Uint8Array.from(binString, (m) => {
25
+ const cp = m.codePointAt(0);
26
+ if (cp === undefined) {
27
+ throw new Error(`Cannot decode base64 string due to unknown code point.`);
28
+ }
29
+ return cp;
30
+ });
31
+ return new TextDecoder().decode(bytes);
32
+ }
33
+ /**
34
+ * Convert arbitrary Unicode text to base64 encoding.
35
+ * @param value The text to convert to base64.
36
+ */
37
+ function encodeBase64(value) {
38
+ const bytes = new TextEncoder().encode(value);
39
+ const binString = Array.from(bytes, (byte) => String.fromCodePoint(byte)).join("");
40
+ return btoa(binString);
41
+ }
42
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHRtbC1oZWxwZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2h0bWwtaGVscGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUlBLHdDQU9DO0FBTUQsb0NBVUM7QUFNRCxvQ0FNQztBQXZDRDs7O0dBR0c7QUFDSCxTQUFnQixjQUFjLENBQUMs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EdBQUcsS0FBSyxDQUFDLElBQUksQ0FBQyxLQUFLLEVBQUUsQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUMzQyxNQUFNLENBQUMsYUFBYSxDQUFDLElBQUksQ0FBQyxDQUMzQixDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUNYLE9BQU8sSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDO0FBQ3pCLENBQUMifQ==
@@ -0,0 +1,118 @@
1
+ export * from './record.model';
2
+ export * from './report.model';
3
+ export * from './status.model';
4
+ export * from './template.outline';
5
+ export * from './date-format-helpers';
6
+ export * from './handlebars-helpers';
7
+ export * from './jsonata-helpers';
8
+ export * from './html-helpers';
9
+ export * from './translation-helpers';
10
+ export * from './config/helpers';
11
+ export * from './config/dictionary.outline';
12
+ export * from './config/dictionary.model';
13
+ export * from './config/shared.outline';
14
+ export * from './config/form-config.outline';
15
+ export * from './config/form-config.model';
16
+ export * from './config/form-prehydrate.outline';
17
+ export * from './config/form-behaviour.outline';
18
+ export * from './config/form-component.outline';
19
+ export * from './config/form-component.model';
20
+ export * from './config/base-field-component.outline';
21
+ export * from './config/base-field-component.model';
22
+ export * from './config/field-model.outline';
23
+ export * from './config/field-model.model';
24
+ export * from './config/field-layout.outline';
25
+ export * from './config/field-layout.model';
26
+ export * from './config/field-component.outline';
27
+ export * from './config/field-component.model';
28
+ export * from './config/field.outline';
29
+ export * from './config/field.model';
30
+ export * from './config/form-override.model';
31
+ export * from './config/form-override.outline';
32
+ export * from './config/form-types.model';
33
+ export * from './config/form-types.outline';
34
+ export * from './config/names/query-helpers';
35
+ export * from './config/names/naming-helpers';
36
+ export * from './config/visitor/base.outline';
37
+ export * from './config/visitor/base.model';
38
+ export * from './config/visitor/common.model';
39
+ export * from './logger.interface';
40
+ export * from './config/component/checkbox-input.model';
41
+ export * from './config/component/checkbox-input.outline';
42
+ export * from './config/component/default-layout.model';
43
+ export * from './config/component/default-layout.outline';
44
+ export * from './config/component/action-row-layout.model';
45
+ export * from './config/component/action-row-layout.outline';
46
+ export * from './config/component/inline-layout.model';
47
+ export * from './config/component/inline-layout.outline';
48
+ export * from './config/component/dropdown-input.model';
49
+ export * from './config/component/dropdown-input.outline';
50
+ export * from './config/component/group.model';
51
+ export * from './config/component/group.outline';
52
+ export * from './config/component/radio-input.model';
53
+ export * from './config/component/radio-input.outline';
54
+ export * from './config/component/repeatable.model';
55
+ export * from './config/component/repeatable.outline';
56
+ export * from './config/component/save-button.model';
57
+ export * from './config/component/save-button.outline';
58
+ export * from './config/component/save-status.model';
59
+ export * from './config/component/save-status.outline';
60
+ export * from './config/component/integration-status.model';
61
+ export * from './config/component/integration-status.outline';
62
+ export * from './config/component/cancel-button.model';
63
+ export * from './config/component/cancel-button.outline';
64
+ export * from './config/component/delete-button.model';
65
+ export * from './config/component/delete-button.outline';
66
+ export * from './config/component/tab-nav-button.model';
67
+ export * from './config/component/tab-nav-button.outline';
68
+ export * from './config/component/simple-input.model';
69
+ export * from './config/component/simple-input.outline';
70
+ export * from './config/component/tab.model';
71
+ export * from './config/component/tab.outline';
72
+ export * from './config/component/accordion.model';
73
+ export * from './config/component/accordion.outline';
74
+ export * from './config/component/tab-content.model';
75
+ export * from './config/component/tab-content.outline';
76
+ export * from './config/component/text-area.model';
77
+ export * from './config/component/text-area.outline';
78
+ export * from './config/component/content.model';
79
+ export * from './config/component/content.outline';
80
+ export * from './config/component/validation-summary.model';
81
+ export * from './config/component/validation-summary.outline';
82
+ export * from './config/component/suggested-validation-summary.model';
83
+ export * from './config/component/suggested-validation-summary.outline';
84
+ export * from './config/component/date-input.model';
85
+ export * from './config/component/date-input.outline';
86
+ export * from './config/component/question-tree.model';
87
+ export * from './config/component/question-tree.outline';
88
+ export * from './config/component/question-tree.helper';
89
+ export * from './config/component/checkbox-tree.model';
90
+ export * from './config/component/checkbox-tree.outline';
91
+ export * from './config/component/record-selector.model';
92
+ export * from './config/component/record-selector.outline';
93
+ export * from './config/component/typeahead-input.model';
94
+ export * from './config/component/typeahead-input.outline';
95
+ export * from './config/component/rich-text-editor.model';
96
+ export * from './config/component/rich-text-editor.outline';
97
+ export * from './config/component/map.model';
98
+ export * from './config/component/map.outline';
99
+ export * from './config/component/file-upload.model';
100
+ export * from './config/component/file-upload.outline';
101
+ export * from './config/component/pdf-list.model';
102
+ export * from './config/component/pdf-list.outline';
103
+ export * from './config/component/record-metadata-retriever.model';
104
+ export * from './config/component/record-metadata-retriever.outline';
105
+ export * from './config/component/publish-data-location-refresh.model';
106
+ export * from './config/component/publish-data-location-refresh.outline';
107
+ export * from './config/component/data-location.model';
108
+ export * from './config/component/data-location.outline';
109
+ export * from './config/component/publish-data-location-selector.model';
110
+ export * from './config/component/publish-data-location-selector.outline';
111
+ export * from './config/component/reusable.model';
112
+ export * from './config/component/reusable.outline';
113
+ export * from './config/component/question-tree.model';
114
+ export * from './config/component/question-tree.outline';
115
+ export * from './validation/helpers';
116
+ export * from './validation/form.model';
117
+ export * from './validation/validators';
118
+ export * from './validation/validators-support';
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // top
18
+ __exportStar(require("./record.model"), exports);
19
+ __exportStar(require("./report.model"), exports);
20
+ __exportStar(require("./status.model"), exports);
21
+ __exportStar(require("./template.outline"), exports);
22
+ __exportStar(require("./date-format-helpers"), exports);
23
+ __exportStar(require("./handlebars-helpers"), exports);
24
+ __exportStar(require("./jsonata-helpers"), exports);
25
+ __exportStar(require("./html-helpers"), exports);
26
+ __exportStar(require("./translation-helpers"), exports);
27
+ // config
28
+ __exportStar(require("./config/helpers"), exports);
29
+ __exportStar(require("./config/dictionary.outline"), exports);
30
+ __exportStar(require("./config/dictionary.model"), exports);
31
+ __exportStar(require("./config/shared.outline"), exports);
32
+ __exportStar(require("./config/form-config.outline"), exports);
33
+ __exportStar(require("./config/form-config.model"), exports);
34
+ __exportStar(require("./config/form-prehydrate.outline"), exports);
35
+ // Form behaviours are exported from the shared package so both server visitors
36
+ // and Angular runtime code consume the same v1 config contract.
37
+ __exportStar(require("./config/form-behaviour.outline"), exports);
38
+ __exportStar(require("./config/form-component.outline"), exports);
39
+ __exportStar(require("./config/form-component.model"), exports);
40
+ __exportStar(require("./config/base-field-component.outline"), exports);
41
+ __exportStar(require("./config/base-field-component.model"), exports);
42
+ __exportStar(require("./config/field-model.outline"), exports);
43
+ __exportStar(require("./config/field-model.model"), exports);
44
+ __exportStar(require("./config/field-layout.outline"), exports);
45
+ __exportStar(require("./config/field-layout.model"), exports);
46
+ __exportStar(require("./config/field-component.outline"), exports);
47
+ __exportStar(require("./config/field-component.model"), exports);
48
+ __exportStar(require("./config/field.outline"), exports);
49
+ __exportStar(require("./config/field.model"), exports);
50
+ __exportStar(require("./config/form-override.model"), exports);
51
+ __exportStar(require("./config/form-override.outline"), exports);
52
+ __exportStar(require("./config/form-types.model"), exports);
53
+ __exportStar(require("./config/form-types.outline"), exports);
54
+ // names
55
+ __exportStar(require("./config/names/query-helpers"), exports);
56
+ __exportStar(require("./config/names/naming-helpers"), exports);
57
+ // config/visitor
58
+ __exportStar(require("./config/visitor/base.outline"), exports);
59
+ __exportStar(require("./config/visitor/base.model"), exports);
60
+ __exportStar(require("./config/visitor/common.model"), exports);
61
+ __exportStar(require("./logger.interface"), exports);
62
+ // config/component
63
+ __exportStar(require("./config/component/checkbox-input.model"), exports);
64
+ __exportStar(require("./config/component/checkbox-input.outline"), exports);
65
+ __exportStar(require("./config/component/default-layout.model"), exports);
66
+ __exportStar(require("./config/component/default-layout.outline"), exports);
67
+ __exportStar(require("./config/component/action-row-layout.model"), exports);
68
+ __exportStar(require("./config/component/action-row-layout.outline"), exports);
69
+ __exportStar(require("./config/component/inline-layout.model"), exports);
70
+ __exportStar(require("./config/component/inline-layout.outline"), exports);
71
+ __exportStar(require("./config/component/dropdown-input.model"), exports);
72
+ __exportStar(require("./config/component/dropdown-input.outline"), exports);
73
+ __exportStar(require("./config/component/group.model"), exports);
74
+ __exportStar(require("./config/component/group.outline"), exports);
75
+ __exportStar(require("./config/component/radio-input.model"), exports);
76
+ __exportStar(require("./config/component/radio-input.outline"), exports);
77
+ __exportStar(require("./config/component/repeatable.model"), exports);
78
+ __exportStar(require("./config/component/repeatable.outline"), exports);
79
+ __exportStar(require("./config/component/save-button.model"), exports);
80
+ __exportStar(require("./config/component/save-button.outline"), exports);
81
+ __exportStar(require("./config/component/save-status.model"), exports);
82
+ __exportStar(require("./config/component/save-status.outline"), exports);
83
+ __exportStar(require("./config/component/integration-status.model"), exports);
84
+ __exportStar(require("./config/component/integration-status.outline"), exports);
85
+ __exportStar(require("./config/component/cancel-button.model"), exports);
86
+ __exportStar(require("./config/component/cancel-button.outline"), exports);
87
+ __exportStar(require("./config/component/delete-button.model"), exports);
88
+ __exportStar(require("./config/component/delete-button.outline"), exports);
89
+ __exportStar(require("./config/component/tab-nav-button.model"), exports);
90
+ __exportStar(require("./config/component/tab-nav-button.outline"), exports);
91
+ __exportStar(require("./config/component/simple-input.model"), exports);
92
+ __exportStar(require("./config/component/simple-input.outline"), exports);
93
+ __exportStar(require("./config/component/tab.model"), exports);
94
+ __exportStar(require("./config/component/tab.outline"), exports);
95
+ __exportStar(require("./config/component/accordion.model"), exports);
96
+ __exportStar(require("./config/component/accordion.outline"), exports);
97
+ __exportStar(require("./config/component/tab-content.model"), exports);
98
+ __exportStar(require("./config/component/tab-content.outline"), exports);
99
+ __exportStar(require("./config/component/text-area.model"), exports);
100
+ __exportStar(require("./config/component/text-area.outline"), exports);
101
+ __exportStar(require("./config/component/content.model"), exports);
102
+ __exportStar(require("./config/component/content.outline"), exports);
103
+ __exportStar(require("./config/component/validation-summary.model"), exports);
104
+ __exportStar(require("./config/component/validation-summary.outline"), exports);
105
+ __exportStar(require("./config/component/suggested-validation-summary.model"), exports);
106
+ __exportStar(require("./config/component/suggested-validation-summary.outline"), exports);
107
+ __exportStar(require("./config/component/date-input.model"), exports);
108
+ __exportStar(require("./config/component/date-input.outline"), exports);
109
+ __exportStar(require("./config/component/question-tree.model"), exports);
110
+ __exportStar(require("./config/component/question-tree.outline"), exports);
111
+ __exportStar(require("./config/component/question-tree.helper"), exports);
112
+ __exportStar(require("./config/component/checkbox-tree.model"), exports);
113
+ __exportStar(require("./config/component/checkbox-tree.outline"), exports);
114
+ __exportStar(require("./config/component/record-selector.model"), exports);
115
+ __exportStar(require("./config/component/record-selector.outline"), exports);
116
+ __exportStar(require("./config/component/typeahead-input.model"), exports);
117
+ __exportStar(require("./config/component/typeahead-input.outline"), exports);
118
+ __exportStar(require("./config/component/rich-text-editor.model"), exports);
119
+ __exportStar(require("./config/component/rich-text-editor.outline"), exports);
120
+ __exportStar(require("./config/component/map.model"), exports);
121
+ __exportStar(require("./config/component/map.outline"), exports);
122
+ __exportStar(require("./config/component/file-upload.model"), exports);
123
+ __exportStar(require("./config/component/file-upload.outline"), exports);
124
+ __exportStar(require("./config/component/pdf-list.model"), exports);
125
+ __exportStar(require("./config/component/pdf-list.outline"), exports);
126
+ __exportStar(require("./config/component/record-metadata-retriever.model"), exports);
127
+ __exportStar(require("./config/component/record-metadata-retriever.outline"), exports);
128
+ // Exported so hooks and Angular runtime can reference the same component name
129
+ // and visitor-aware definitions.
130
+ __exportStar(require("./config/component/publish-data-location-refresh.model"), exports);
131
+ __exportStar(require("./config/component/publish-data-location-refresh.outline"), exports);
132
+ __exportStar(require("./config/component/data-location.model"), exports);
133
+ __exportStar(require("./config/component/data-location.outline"), exports);
134
+ __exportStar(require("./config/component/publish-data-location-selector.model"), exports);
135
+ __exportStar(require("./config/component/publish-data-location-selector.outline"), exports);
136
+ __exportStar(require("./config/component/reusable.model"), exports);
137
+ __exportStar(require("./config/component/reusable.outline"), exports);
138
+ __exportStar(require("./config/component/question-tree.model"), exports);
139
+ __exportStar(require("./config/component/question-tree.outline"), exports);
140
+ // validation
141
+ __exportStar(require("./validation/helpers"), exports);
142
+ __exportStar(require("./validation/form.model"), exports);
143
+ __exportStar(require("./validation/validators"), exports);
144
+ __exportStar(require("./validation/validators-support"), exports);
145
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLE1BQU07QUFDTixpREFBK0I7QUFDL0IsaURBQStCO0FBQy9CLGlEQUErQjtBQUMvQixxREFBbUM7QUFDbkMsd0RBQXNDO0FBQ3RDLHVEQUFxQztBQUNyQyxvREFBa0M7QUFDbEMsaURBQStCO0FBQy9CLHdEQUFzQztBQUN0QyxTQUFTO0FBQ1QsbURBQWlDO0FBQ2pDLDhEQUE0QztBQUM1Qyw0REFBMEM7QUFDMUMsMERBQXdDO0FBQ3hDLCtEQUE2QztBQUM3Qyw2REFBMkM7QUFDM0MsbUVBQWlEO0FBQ2pELCtFQUErRTtBQUMvRSxnRUFBZ0U7QUFDaEUsa0VBQWdEO0FBQ2hELGtFQUFnRDtBQUNoRCxnRUFBOEM7QUFDOUMsd0VBQXNEO0FBQ3RELHNFQUFvRDtBQUNwRCwrREFBNkM7QUFDN0MsNkRBQTJDO0FBQzNDLGdFQUE4QztBQUM5Qyw4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RCx3RkFBc0U7QUFDdEUsMEZBQXdFO0FBQ3hFLHNFQUFvRDtBQUNwRCx3RUFBc0Q7QUFDdEQseUVBQXVEO0FBQ3ZELDJFQUF5RDtBQUN6RCwwRUFBd0Q7QUFDeEQseUVBQXVEO0FBQ3ZELDJFQUF5RDtBQUN6RCwyRUFBeUQ7QUFDekQsNkVBQTJEO0FBQzNELDJFQUF5RDtBQUN6RCw2RUFBMkQ7QUFDM0QsNEVBQTBEO0FBQzFELDhFQUE0RDtBQUM1RCwrREFBNkM7QUFDN0MsaUVBQStDO0FBQy9DLHVFQUFxRDtBQUNyRCx5RUFBdUQ7QUFDdkQsb0VBQWtEO0FBQ2xELHNFQUFvRDtBQUNwRCxxRkFBbUU7QUFDbkUsdUZBQXFFO0FBQ3JFLDhFQUE4RTtBQUM5RSxpQ0FBaUM7QUFDakMseUZBQXVFO0FBQ3ZFLDJGQUF5RTtBQUN6RSx5RUFBdUQ7QUFDdkQsMkVBQXlEO0FBQ3pELDBGQUF3RTtBQUN4RSw0RkFBMEU7QUFDMUUsb0VBQWtEO0FBQ2xELHNFQUFvRDtBQUNwRCx5RUFBdUQ7QUFDdkQsMkVBQXlEO0FBQ3pELGFBQWE7QUFDYix1REFBcUM7QUFDckMsMERBQXdDO0FBQ3hDLDBEQUF3QztBQUN4QyxrRUFBZ0QifQ==
@@ -0,0 +1,40 @@
1
+ import jsonata from 'jsonata';
2
+ /**
3
+ * A function that accepts a context and evaluates a previously compiled expression.
4
+ */
5
+ export type JSONataEvaluate = (context: unknown) => Promise<unknown>;
6
+ /**
7
+ * Format a date using the luxon library.
8
+ * @param value The value to format.
9
+ * @param format The format to use.
10
+ * @param sourceFormat The optional format of the value, if known.
11
+ */
12
+ export declare function luxonFormatDate(value: undefined | null | string | number | Date, format: undefined | null | string, sourceFormat?: null | string): string;
13
+ /**
14
+ * Prepare a jsonata expression to be transferred from server to client.
15
+ * @param expression The jsonata expression string.
16
+ */
17
+ export declare function jsonataExpressionEncode(expression: string): string;
18
+ /**
19
+ * Provide an encoded JSONata expression string and return a compiled JSONata expression object.
20
+ *
21
+ * Registers the common custom functions that should be available everywhere.
22
+ *
23
+ * @param expressionEncoded The encoded expression string.
24
+ * @param options The compile options.
25
+ * @return compiled JSONata expression object
26
+ */
27
+ export declare function jsonataDecodeCompile(expressionEncoded: string, options?: jsonata.JsonataOptions): jsonata.Expression;
28
+ /**
29
+ * Provide a JSONata expression string and return a compiled JSONata expression object.
30
+ *
31
+ * Registers the common custom functions that should be available everywhere.
32
+ *
33
+ * @param expression The expression string.
34
+ * @param options The compile options.
35
+ * @return compiled JSONata expression object
36
+ */
37
+ export declare function jsonataCompile(expression: string, options?: jsonata.JsonataOptions): jsonata.Expression;
38
+ export declare function jsonataEvaluate(compiled: jsonata.Expression, context: unknown, bindings?: Record<string, unknown>): Promise<unknown>;
39
+ export declare function jsonataCompileAndEvaluate(expression: string, context: unknown, bindings?: Record<string, unknown>): Promise<unknown>;
40
+ export declare function jsonataEvaluateFunc(expression: string, bindings?: Record<string, unknown>): JSONataEvaluate;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.luxonFormatDate = luxonFormatDate;
7
+ exports.jsonataExpressionEncode = jsonataExpressionEncode;
8
+ exports.jsonataDecodeCompile = jsonataDecodeCompile;
9
+ exports.jsonataCompile = jsonataCompile;
10
+ exports.jsonataEvaluate = jsonataEvaluate;
11
+ exports.jsonataCompileAndEvaluate = jsonataCompileAndEvaluate;
12
+ exports.jsonataEvaluateFunc = jsonataEvaluateFunc;
13
+ const jsonata_1 = __importDefault(require("jsonata"));
14
+ const luxon_1 = require("luxon");
15
+ const html_helpers_1 = require("./html-helpers");
16
+ /**
17
+ * Format a date using the luxon library.
18
+ * @param value The value to format.
19
+ * @param format The format to use.
20
+ * @param sourceFormat The optional format of the value, if known.
21
+ */
22
+ function luxonFormatDate(value, format, sourceFormat) {
23
+ if (value === undefined || value === null || value === '') {
24
+ return '';
25
+ }
26
+ const outputFormat = typeof format === 'string' && format ? format : 'yyyy-LL-dd';
27
+ const inputFormat = typeof sourceFormat === 'string' && sourceFormat ? sourceFormat : undefined;
28
+ const valueAsString = typeof value === 'string' ? value.trim() : String(value);
29
+ let dateTime;
30
+ if (value instanceof Date) {
31
+ dateTime = luxon_1.DateTime.fromJSDate(value);
32
+ }
33
+ else if (typeof value === 'number') {
34
+ dateTime = luxon_1.DateTime.fromMillis(value);
35
+ }
36
+ else if (inputFormat) {
37
+ dateTime = luxon_1.DateTime.fromFormat(valueAsString, inputFormat);
38
+ }
39
+ else {
40
+ const candidates = [
41
+ luxon_1.DateTime.fromISO(valueAsString),
42
+ luxon_1.DateTime.fromFormat(valueAsString, 'yyyy/MM/dd'),
43
+ luxon_1.DateTime.fromFormat(valueAsString, 'yyyy-MM-dd'),
44
+ luxon_1.DateTime.fromRFC2822(valueAsString),
45
+ luxon_1.DateTime.fromHTTP(valueAsString),
46
+ ];
47
+ dateTime = candidates.find(candidate => candidate.isValid) ?? luxon_1.DateTime.invalid('Unparsable date');
48
+ }
49
+ return dateTime.isValid ? dateTime.toFormat(outputFormat) : '';
50
+ }
51
+ /**
52
+ * Prepare a jsonata expression to be transferred from server to client.
53
+ * @param expression The jsonata expression string.
54
+ */
55
+ function jsonataExpressionEncode(expression) {
56
+ return (0, html_helpers_1.encodeBase64)(expression);
57
+ }
58
+ /**
59
+ * Provide an encoded JSONata expression string and return a compiled JSONata expression object.
60
+ *
61
+ * Registers the common custom functions that should be available everywhere.
62
+ *
63
+ * @param expressionEncoded The encoded expression string.
64
+ * @param options The compile options.
65
+ * @return compiled JSONata expression object
66
+ */
67
+ function jsonataDecodeCompile(expressionEncoded, options) {
68
+ return jsonataCompile((0, html_helpers_1.decodeBase64)(expressionEncoded), options);
69
+ }
70
+ /**
71
+ * Provide a JSONata expression string and return a compiled JSONata expression object.
72
+ *
73
+ * Registers the common custom functions that should be available everywhere.
74
+ *
75
+ * @param expression The expression string.
76
+ * @param options The compile options.
77
+ * @return compiled JSONata expression object
78
+ */
79
+ function jsonataCompile(expression, options) {
80
+ const compiled = (0, jsonata_1.default)(expression, options);
81
+ // Disable JSONata's dynamic eval function so browser/server validators only run the configured expression.
82
+ compiled.registerFunction('eval', () => { throw new Error('Attempted to invoke eval'); });
83
+ // Register a function for formatting date time values.
84
+ // First param 'value': string, number, null, object (to allow Date)
85
+ // Second param 'format': string, null
86
+ // Third param 'sourceFormat': string, null, optional
87
+ // Return type: string
88
+ compiled.registerFunction('luxonFormatDate', luxonFormatDate, '<(snlo)(sl)(sl)?:s>');
89
+ // TODO: consider registering a function for translations
90
+ // TODO: consider replacing regex with google's re2?
91
+ return compiled;
92
+ }
93
+ async function jsonataEvaluate(compiled, context, bindings) {
94
+ return await compiled.evaluate(context, bindings);
95
+ }
96
+ async function jsonataCompileAndEvaluate(expression, context, bindings) {
97
+ const compiled = jsonataCompile(expression);
98
+ return await jsonataEvaluate(compiled, context, bindings);
99
+ }
100
+ function jsonataEvaluateFunc(expression, bindings) {
101
+ const compiled = jsonataCompile(expression);
102
+ return async function (value) {
103
+ return await jsonataEvaluate(compiled, value, bindings);
104
+ };
105
+ }
106
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianNvbmF0YS1oZWxwZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2pzb25hdGEtaGVscGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQWVBLDBDQWdDQztBQU1ELDBEQUVDO0FBV0Qsb0RBRUM7QUFXRCx3Q0FpQkM7QUFFRCwwQ0FNQztBQUVELDhEQU9DO0FBRUQsa0RBS0M7QUF4SEQsc0RBQThCO0FBQzlCLGlDQUFpQztBQUNqQyxpREFBMEQ7QUFPMUQ7Ozs7O0dBS0c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QUFjO1FBQ25DLE9BQU8sTUFBTSxlQUFlLENBQUMsUUFBUSxFQUFFLEtBQUssRUFBRSxRQUFRLENBQUMsQ0FBQztJQUMxRCxDQUFDLENBQUM7QUFDSixDQUFDIn0=
@@ -0,0 +1,14 @@
1
+ export interface ILogger {
2
+ silly: (...args: any[]) => void;
3
+ verbose: (...args: any[]) => void;
4
+ trace: (...args: any[]) => void;
5
+ debug: (...args: any[]) => void;
6
+ log: (...args: any[]) => void;
7
+ info: (...args: any[]) => void;
8
+ warn: (...args: any[]) => void;
9
+ error: (...args: any[]) => void;
10
+ crit: (...args: any[]) => void;
11
+ fatal: (...args: any[]) => void;
12
+ silent: (...args: any[]) => void;
13
+ blank: (...args: any[]) => void;
14
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyLmludGVyZmFjZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2dnZXIuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Defines the property/column rendering configuration
3
+ */
4
+ export interface RecordPropViewMetaDto {
5
+ /**
6
+ * control visibility
7
+ *
8
+ * warning breaking change, used to be called 'show'
9
+ */
10
+ hide: boolean;
11
+ /**
12
+ * if set, will run this against _.template
13
+ */
14
+ template: string;
15
+ /**
16
+ * the property/variable name
17
+ */
18
+ property: string;
19
+ /**
20
+ * the column header
21
+ */
22
+ label: string;
23
+ /**
24
+ * whether to expect the property to be multi-valued
25
+ */
26
+ multivalue: boolean;
27
+ }
28
+ /**
29
+ * Model for each page of records
30
+ */
31
+ export interface RecordPageDto {
32
+ records: unknown[];
33
+ total: number;
34
+ pageNum: number;
35
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // Copyright (c) 2023 Queensland Cyber Infrastructure Foundation (http://www.qcif.edu.au/)
3
+ //
4
+ // GNU GENERAL PUBLIC LICENSE
5
+ // Version 2, June 1991
6
+ //
7
+ // This program is free software; you can redistribute it and/or modify
8
+ // it under the terms of the GNU General Public License as published by
9
+ // the Free Software Foundation; either version 2 of the License, or
10
+ // (at your option) any later version.
11
+ //
12
+ // This program is distributed in the hope that it will be useful,
13
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ // GNU General Public License for more details.
16
+ //
17
+ // You should have received a copy of the GNU General Public License along
18
+ // with this program; if not, write to the Free Software Foundation, Inc.,
19
+ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVjb3JkLm1vZGVsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3JlY29yZC5tb2RlbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsMEZBQTBGO0FBQzFGLEVBQUU7QUFDRiw2QkFBNkI7QUFDN0IsMEJBQTBCO0FBQzFCLEVBQUU7QUFDRix1RUFBdUU7QUFDdkUsdUVBQXVFO0FBQ3ZFLG9FQUFvRTtBQUNwRSxzQ0FBc0M7QUFDdEMsRUFBRTtBQUNGLGtFQUFrRTtBQUNsRSxpRUFBaUU7QUFDakUsZ0VBQWdFO0FBQ2hFLCtDQUErQztBQUMvQyxFQUFFO0FBQ0YsMEVBQTBFO0FBQzFFLDBFQUEwRTtBQUMxRSw4REFBOEQifQ==
@@ -0,0 +1,64 @@
1
+ import { RecordPageDto, RecordPropViewMetaDto } from "./record.model";
2
+ export interface ReportFilterDto {
3
+ type: string;
4
+ paramName: string;
5
+ message: string;
6
+ property: string;
7
+ }
8
+ export declare class ReportDto {
9
+ title: string;
10
+ name: string;
11
+ solrQuery: string;
12
+ filter: ReportFilterDto[];
13
+ columns: RecordPropViewMetaDto[];
14
+ constructor();
15
+ }
16
+ export interface ReportConfigFilterDatabaseDto {
17
+ fromProperty: string;
18
+ toProperty: string;
19
+ }
20
+ export interface ReportConfigFilterDto {
21
+ type: string;
22
+ paramName: string;
23
+ message: string;
24
+ property: string;
25
+ database?: ReportConfigFilterDatabaseDto | null;
26
+ }
27
+ export interface ReportConfigColumnDto {
28
+ label: string;
29
+ property: string;
30
+ hide?: boolean;
31
+ exportTemplate?: string;
32
+ template?: string;
33
+ multivalue?: boolean;
34
+ }
35
+ export interface ReportConfigDatabaseQueryDto {
36
+ queryName: string;
37
+ }
38
+ export interface ReportConfigSolrQueryDto {
39
+ baseQuery: string;
40
+ searchCore: string;
41
+ }
42
+ export interface ReportConfigDto {
43
+ name: string;
44
+ title: string;
45
+ reportSource: 'database' | 'solr';
46
+ databaseQuery: ReportConfigDatabaseQueryDto | null;
47
+ solrQuery: ReportConfigSolrQueryDto | null;
48
+ filter: ReportConfigFilterDto[];
49
+ columns: ReportConfigColumnDto[];
50
+ readOnly: boolean;
51
+ readOnlyReason?: string;
52
+ canEdit: boolean;
53
+ canDelete: boolean;
54
+ canPreview: boolean;
55
+ }
56
+ export interface ReportConfigPreviewDto extends ReportResultDto {
57
+ success: boolean;
58
+ }
59
+ /**
60
+ * Users of Record Table must extend RecordPage model
61
+ */
62
+ export interface ReportResultDto extends RecordPageDto {
63
+ recordsPerPage: number;
64
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportDto = void 0;
4
+ class ReportDto {
5
+ title;
6
+ name;
7
+ solrQuery;
8
+ filter;
9
+ columns;
10
+ constructor() {
11
+ this.title = "";
12
+ this.name = "";
13
+ this.solrQuery = "";
14
+ this.filter = [];
15
+ this.columns = [];
16
+ }
17
+ }
18
+ exports.ReportDto = ReportDto;
19
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVwb3J0Lm1vZGVsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3JlcG9ydC5tb2RlbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFTQSxNQUFhLFNBQVM7SUFDcEIsS0FBSyxDQUFTO0lBQ2QsSUFBSSxDQUFTO0lBQ2IsU0FBUyxDQUFTO0lBQ2xCLE1BQU0sQ0FBb0I7SUFDMUIsT0FBTyxDQUEwQjtJQUNqQztRQUNFLElBQUksQ0FBQyxLQUFLLEdBQUcsRUFBRSxDQUFDO1FBQ2hCLElBQUksQ0FBQyxJQUFJLEdBQUcsRUFBRSxDQUFDO1FBQ2YsSUFBSSxDQUFDLFNBQVMsR0FBRyxFQUFFLENBQUM7UUFDcEIsSUFBSSxDQUFDLE1BQU0sR0FBRyxFQUFFLENBQUM7UUFDakIsSUFBSSxDQUFDLE9BQU8sR0FBRyxFQUFFLENBQUM7SUFDcEIsQ0FBQztDQUNGO0FBYkQsOEJBYUMifQ==