@icure/form 2.0.11 → 2.1.2

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 (284) hide show
  1. package/.yarn/cache/@babel-runtime-npm-7.28.6-f40c99aeef-42d8a868c2.zip +0 -0
  2. package/.yarn/cache/@icure-api-npm-5.3.18-99d397b97c-0da319f009.zip +0 -0
  3. package/.yarn/cache/@icure-motss-app-datepicker-npm-6.0.0-rc.40-ca1da7abbb-9bbe2bed34.zip +0 -0
  4. package/.yarn/cache/@lit-labs-ssr-dom-shim-npm-1.5.1-3b3c832bd1-22c404c481.zip +0 -0
  5. package/.yarn/cache/@lit-reactive-element-npm-1.6.3-4828441e51-79b58631c3.zip +0 -0
  6. package/.yarn/cache/@lit-reactive-element-npm-2.1.2-2c713bebce-e0ed931b9c.zip +0 -0
  7. package/.yarn/cache/@lit-task-npm-1.0.3-48f265b3e9-790b6a2603.zip +0 -0
  8. package/.yarn/cache/@material-animation-npm-14.0.0-canary.53b3cad2f.0-06a813cdea-9b5190654c.zip +0 -0
  9. package/.yarn/cache/@material-base-npm-14.0.0-canary.53b3cad2f.0-d195c1fdc4-9f4928d115.zip +0 -0
  10. package/.yarn/cache/@material-button-npm-14.0.0-canary.53b3cad2f.0-d4b070f508-873295c56a.zip +0 -0
  11. package/.yarn/cache/@material-density-npm-14.0.0-canary.53b3cad2f.0-48c1f65059-a23f00edfe.zip +0 -0
  12. package/.yarn/cache/@material-dialog-npm-14.0.0-canary.53b3cad2f.0-96168fa294-c1a498b81a.zip +0 -0
  13. package/.yarn/cache/@material-dom-npm-14.0.0-canary.53b3cad2f.0-ac009dc871-f5817f76dd.zip +0 -0
  14. package/.yarn/cache/@material-elevation-npm-14.0.0-canary.53b3cad2f.0-3312f06793-2f8945c7b6.zip +0 -0
  15. package/.yarn/cache/@material-feature-targeting-npm-14.0.0-canary.53b3cad2f.0-a919042d50-e7a1ed68f9.zip +0 -0
  16. package/.yarn/cache/@material-floating-label-npm-14.0.0-canary.53b3cad2f.0-eb8f330f2f-5295dc481d.zip +0 -0
  17. package/.yarn/cache/@material-focus-ring-npm-14.0.0-canary.53b3cad2f.0-b22f851a2e-92273b1247.zip +0 -0
  18. package/.yarn/cache/@material-icon-button-npm-14.0.0-canary.53b3cad2f.0-e158d26048-19b51665f2.zip +0 -0
  19. package/.yarn/cache/@material-line-ripple-npm-14.0.0-canary.53b3cad2f.0-d089468db9-6518961487.zip +0 -0
  20. package/.yarn/cache/@material-list-npm-14.0.0-canary.53b3cad2f.0-df9ce05084-6c977f518d.zip +0 -0
  21. package/.yarn/cache/@material-menu-npm-14.0.0-canary.53b3cad2f.0-9489b592c8-71b6a1f4dd.zip +0 -0
  22. package/.yarn/cache/@material-menu-surface-npm-14.0.0-canary.53b3cad2f.0-52212f38f4-ad48e168ca.zip +0 -0
  23. package/.yarn/cache/@material-mwc-base-npm-0.27.0-79caf3ef2b-07af17edfc.zip +0 -0
  24. package/.yarn/cache/@material-mwc-button-npm-0.27.0-4b85f2b26f-2ef5cc0951.zip +0 -0
  25. package/.yarn/cache/@material-mwc-checkbox-npm-0.27.0-e837031d8e-ba53a6ea8c.zip +0 -0
  26. package/.yarn/cache/@material-mwc-dialog-npm-0.27.0-77c6071543-ffab528e8e.zip +0 -0
  27. package/.yarn/cache/@material-mwc-floating-label-npm-0.27.0-80e62b22c0-fbbf4f2e42.zip +0 -0
  28. package/.yarn/cache/@material-mwc-icon-button-npm-0.27.0-41f82f135b-7315c0735b.zip +0 -0
  29. package/.yarn/cache/@material-mwc-icon-npm-0.27.0-98c9e8509f-6dfa5115d5.zip +0 -0
  30. package/.yarn/cache/@material-mwc-line-ripple-npm-0.27.0-e6704221e0-6862ede0f4.zip +0 -0
  31. package/.yarn/cache/@material-mwc-list-npm-0.27.0-5344fc9de4-6c2ae4f1c6.zip +0 -0
  32. package/.yarn/cache/@material-mwc-menu-npm-0.27.0-7c2bb47797-126f733659.zip +0 -0
  33. package/.yarn/cache/@material-mwc-notched-outline-npm-0.27.0-0e0d1c4d5f-2739032f76.zip +0 -0
  34. package/.yarn/cache/@material-mwc-radio-npm-0.27.0-aa2098a280-0b0a0a6b99.zip +0 -0
  35. package/.yarn/cache/@material-mwc-ripple-npm-0.27.0-ed37672f08-9cd73fdfe4.zip +0 -0
  36. package/.yarn/cache/@material-mwc-textfield-npm-0.27.0-dabd704f55-978c893aca.zip +0 -0
  37. package/.yarn/cache/@material-notched-outline-npm-14.0.0-canary.53b3cad2f.0-ecacde98db-1a9f8db4d8.zip +0 -0
  38. package/.yarn/cache/@material-radio-npm-14.0.0-canary.53b3cad2f.0-c50de64d41-898554f2b3.zip +0 -0
  39. package/.yarn/cache/@material-ripple-npm-14.0.0-canary.53b3cad2f.0-49060bfe7e-08b71917e2.zip +0 -0
  40. package/.yarn/cache/@material-rtl-npm-14.0.0-canary.53b3cad2f.0-daca794b76-3c1b8b48c6.zip +0 -0
  41. package/.yarn/cache/@material-shape-npm-14.0.0-canary.53b3cad2f.0-5bcff722a6-6ad9b020c0.zip +0 -0
  42. package/.yarn/cache/@material-textfield-npm-14.0.0-canary.53b3cad2f.0-4414808dda-7072e3c9df.zip +0 -0
  43. package/.yarn/cache/@material-theme-npm-14.0.0-canary.53b3cad2f.0-9a24e7b046-fd44e92917.zip +0 -0
  44. package/.yarn/cache/@material-tokens-npm-14.0.0-canary.53b3cad2f.0-f1c87523da-efa909f861.zip +0 -0
  45. package/.yarn/cache/@material-touch-target-npm-14.0.0-canary.53b3cad2f.0-fa6a2d0875-dbc13cbe7a.zip +0 -0
  46. package/.yarn/cache/@material-typography-npm-14.0.0-canary.53b3cad2f.0-f4a58946f1-fa2671df40.zip +0 -0
  47. package/.yarn/cache/@types-linkify-it-npm-5.0.0-576a16b976-ec98e03aa8.zip +0 -0
  48. package/.yarn/cache/@types-markdown-it-npm-14.1.2-d0c4e12c49-ad66e0b377.zip +0 -0
  49. package/.yarn/cache/@types-mdurl-npm-2.0.0-2f4116c0b0-78746e96c6.zip +0 -0
  50. package/.yarn/cache/@types-trusted-types-npm-2.0.7-a07fc44f59-8e4202766a.zip +0 -0
  51. package/.yarn/cache/@webcomponents-webcomponentsjs-npm-2.8.0-36c07db4d2-186373c030.zip +0 -0
  52. package/.yarn/cache/argparse-npm-2.0.1-faff7999e6-83644b5649.zip +0 -0
  53. package/.yarn/cache/big-integer-npm-1.6.52-4bec75720c-6e86885787.zip +0 -0
  54. package/.yarn/cache/blocking-elements-npm-0.1.1-423f51c76e-9a34084405.zip +0 -0
  55. package/.yarn/cache/date-fns-npm-2.30.0-895c790e0f-f7be015232.zip +0 -0
  56. package/.yarn/cache/entities-npm-4.5.0-7cdb83b832-853f8ebd5b.zip +0 -0
  57. package/.yarn/cache/fast-deep-equal-npm-3.1.3-790edcfcf5-e21a9d8d84.zip +0 -0
  58. package/.yarn/cache/libphonenumber-js-npm-1.12.34-cd35ce8e26-e4bb10ba42.zip +0 -0
  59. package/.yarn/cache/linkify-it-npm-5.0.0-adb5f9c96f-b0b86cadaf.zip +0 -0
  60. package/.yarn/cache/lit-element-npm-3.3.3-2f9f9e38c0-29a596fa55.zip +0 -0
  61. package/.yarn/cache/lit-element-npm-4.2.2-70d4af2233-554254b87c.zip +0 -0
  62. package/.yarn/cache/lit-html-npm-2.8.0-82f88d6ebf-2d70df0724.zip +0 -0
  63. package/.yarn/cache/lit-html-npm-3.3.2-4a3e00215f-7fe23502ca.zip +0 -0
  64. package/.yarn/cache/lit-npm-2.8.0-92bb1333a4-2480e733f7.zip +0 -0
  65. package/.yarn/cache/lit-npm-3.3.2-7dea58471e-2136d4beac.zip +0 -0
  66. package/.yarn/cache/lodash-npm-4.17.21-6382451519-eb835a2e51.zip +0 -0
  67. package/.yarn/cache/markdown-it-npm-14.1.0-e337d75bfe-07296b45eb.zip +0 -0
  68. package/.yarn/cache/mdurl-npm-2.0.0-3259713daf-880bc289ef.zip +0 -0
  69. package/.yarn/cache/moment-npm-2.30.1-1c51a5c631-859236bab1.zip +0 -0
  70. package/.yarn/cache/orderedmap-npm-2.1.1-64b8a0684f-082cf970b0.zip +0 -0
  71. package/.yarn/cache/prosemirror-commands-npm-1.7.1-5b2afb6640-2316c40ea2.zip +0 -0
  72. package/.yarn/cache/prosemirror-history-npm-1.5.0-e639d02880-6afb0e1d17.zip +0 -0
  73. package/.yarn/cache/prosemirror-keymap-npm-1.2.3-0e7e0c8195-0a2eed2771.zip +0 -0
  74. package/.yarn/cache/prosemirror-markdown-npm-1.13.2-6e2f179fd8-ce9fcb3b13.zip +0 -0
  75. package/.yarn/cache/prosemirror-model-npm-1.25.4-e7ee2df3df-ab5aa609df.zip +0 -0
  76. package/.yarn/cache/prosemirror-schema-basic-npm-1.2.4-8f943ded01-10ed022990.zip +0 -0
  77. package/.yarn/cache/prosemirror-schema-list-npm-1.5.1-7b138c5fed-6c7041e5b8.zip +0 -0
  78. package/.yarn/cache/prosemirror-state-npm-1.4.4-8b7e3a396c-1b5dba46c2.zip +0 -0
  79. package/.yarn/cache/prosemirror-transform-npm-1.10.5-5b3b4f5f61-6f5921e53a.zip +0 -0
  80. package/.yarn/cache/prosemirror-view-npm-1.41.5-39b37df338-ee47e9091a.zip +0 -0
  81. package/.yarn/cache/punycode.js-npm-2.3.1-9084ecbbf5-13466d7ed5.zip +0 -0
  82. package/.yarn/cache/rope-sequence-npm-1.3.4-3b09587e5f-95cca2f99a.zip +0 -0
  83. package/.yarn/cache/text-encoding-npm-0.7.0-ff0c4af052-b6109a843f.zip +0 -0
  84. package/.yarn/cache/tslib-npm-2.8.1-66590b21b8-e4aba30e63.zip +0 -0
  85. package/.yarn/cache/uc.micro-npm-2.1.0-c45282c865-3719735824.zip +0 -0
  86. package/.yarn/cache/uuid-encoder-npm-1.2.0-6a9a810c6d-dd06230f08.zip +0 -0
  87. package/.yarn/cache/uuid-npm-8.3.2-eca0baba53-5575a8a75c.zip +0 -0
  88. package/.yarn/cache/uuid-npm-9.0.1-39a8442bc6-39931f6da7.zip +0 -0
  89. package/.yarn/cache/w3c-keyname-npm-2.2.8-66d7d5317a-95bafa4c04.zip +0 -0
  90. package/.yarn/cache/wicg-inert-npm-3.1.3-38590e83f2-45b3cfec63.zip +0 -0
  91. package/.yarn/install-state.gz +0 -0
  92. package/components/common/field-with-options.d.ts +2 -2
  93. package/components/common/field-with-options.js +8 -5
  94. package/components/common/field-with-options.js.map +1 -1
  95. package/components/common/field.d.ts +10 -3
  96. package/components/common/field.js +46 -21
  97. package/components/common/field.js.map +1 -1
  98. package/components/common/index.js +17 -1
  99. package/components/common/index.js.map +1 -1
  100. package/components/common/metadata-buttons-bar.d.ts +2 -1
  101. package/components/common/metadata-buttons-bar.js +113 -77
  102. package/components/common/metadata-buttons-bar.js.map +1 -1
  103. package/components/common/styles/paths.d.ts +1 -0
  104. package/components/common/styles/paths.js +41 -25
  105. package/components/common/styles/paths.js.map +1 -1
  106. package/components/common/utils.js +21 -11
  107. package/components/common/utils.js.map +1 -1
  108. package/components/icure-button/index.d.ts +1 -1
  109. package/components/icure-button/index.js +73 -29
  110. package/components/icure-button/index.js.map +1 -1
  111. package/components/icure-button-group/index.d.ts +5 -3
  112. package/components/icure-button-group/index.js +101 -61
  113. package/components/icure-button-group/index.js.map +1 -1
  114. package/components/icure-date-picker/index.d.ts +6 -3
  115. package/components/icure-date-picker/index.js +87 -43
  116. package/components/icure-date-picker/index.js.map +1 -1
  117. package/components/icure-dropdown-field/index.d.ts +5 -2
  118. package/components/icure-dropdown-field/index.js +82 -38
  119. package/components/icure-dropdown-field/index.js.map +1 -1
  120. package/components/icure-form/fields/button/button.js +17 -13
  121. package/components/icure-form/fields/button/button.js.map +1 -1
  122. package/components/icure-form/fields/button/index.js +17 -1
  123. package/components/icure-form/fields/button/index.js.map +1 -1
  124. package/components/icure-form/fields/button-group/checkbox.d.ts +2 -1
  125. package/components/icure-form/fields/button-group/checkbox.js +15 -11
  126. package/components/icure-form/fields/button-group/checkbox.js.map +1 -1
  127. package/components/icure-form/fields/button-group/index.js +18 -2
  128. package/components/icure-form/fields/button-group/index.js.map +1 -1
  129. package/components/icure-form/fields/button-group/radio-button.d.ts +2 -1
  130. package/components/icure-form/fields/button-group/radio-button.js +15 -11
  131. package/components/icure-form/fields/button-group/radio-button.js.map +1 -1
  132. package/components/icure-form/fields/date-picker/date-picker.d.ts +2 -1
  133. package/components/icure-form/fields/date-picker/date-picker.js +13 -9
  134. package/components/icure-form/fields/date-picker/date-picker.js.map +1 -1
  135. package/components/icure-form/fields/date-picker/date-time-picker.d.ts +2 -1
  136. package/components/icure-form/fields/date-picker/date-time-picker.js +13 -9
  137. package/components/icure-form/fields/date-picker/date-time-picker.js.map +1 -1
  138. package/components/icure-form/fields/date-picker/index.js +19 -3
  139. package/components/icure-form/fields/date-picker/index.js.map +1 -1
  140. package/components/icure-form/fields/date-picker/time-picker.d.ts +2 -1
  141. package/components/icure-form/fields/date-picker/time-picker.js +13 -9
  142. package/components/icure-form/fields/date-picker/time-picker.js.map +1 -1
  143. package/components/icure-form/fields/dropdown/dropdown-field.d.ts +1 -1
  144. package/components/icure-form/fields/dropdown/dropdown-field.js +15 -11
  145. package/components/icure-form/fields/dropdown/dropdown-field.js.map +1 -1
  146. package/components/icure-form/fields/dropdown/index.js +17 -1
  147. package/components/icure-form/fields/dropdown/index.js.map +1 -1
  148. package/components/icure-form/fields/index.js +26 -10
  149. package/components/icure-form/fields/index.js.map +1 -1
  150. package/components/icure-form/fields/items-list-field/index.js +17 -1
  151. package/components/icure-form/fields/items-list-field/index.js.map +1 -1
  152. package/components/icure-form/fields/items-list-field/items-list-field.d.ts +2 -1
  153. package/components/icure-form/fields/items-list-field/items-list-field.js +12 -8
  154. package/components/icure-form/fields/items-list-field/items-list-field.js.map +1 -1
  155. package/components/icure-form/fields/label/index.js +17 -1
  156. package/components/icure-form/fields/label/index.js.map +1 -1
  157. package/components/icure-form/fields/label/label.js +15 -11
  158. package/components/icure-form/fields/label/label.js.map +1 -1
  159. package/components/icure-form/fields/measure-field/index.js +17 -1
  160. package/components/icure-form/fields/measure-field/index.js.map +1 -1
  161. package/components/icure-form/fields/measure-field/measure-field.d.ts +2 -1
  162. package/components/icure-form/fields/measure-field/measure-field.js +14 -9
  163. package/components/icure-form/fields/measure-field/measure-field.js.map +1 -1
  164. package/components/icure-form/fields/number-field/index.js +17 -1
  165. package/components/icure-form/fields/number-field/index.js.map +1 -1
  166. package/components/icure-form/fields/number-field/number-field.d.ts +2 -1
  167. package/components/icure-form/fields/number-field/number-field.js +14 -9
  168. package/components/icure-form/fields/number-field/number-field.js.map +1 -1
  169. package/components/icure-form/fields/text-field/index.js +17 -1
  170. package/components/icure-form/fields/text-field/index.js.map +1 -1
  171. package/components/icure-form/fields/text-field/text-field.d.ts +2 -1
  172. package/components/icure-form/fields/text-field/text-field.js +26 -21
  173. package/components/icure-form/fields/text-field/text-field.js.map +1 -1
  174. package/components/icure-form/fields/token-field/index.js +17 -1
  175. package/components/icure-form/fields/token-field/index.js.map +1 -1
  176. package/components/icure-form/fields/token-field/token-field.d.ts +2 -1
  177. package/components/icure-form/fields/token-field/token-field.js +13 -9
  178. package/components/icure-form/fields/token-field/token-field.js.map +1 -1
  179. package/components/icure-form/fields/utils/index.js +13 -5
  180. package/components/icure-form/fields/utils/index.js.map +1 -1
  181. package/components/icure-form/index.d.ts +6 -2
  182. package/components/icure-form/index.js +138 -44
  183. package/components/icure-form/index.js.map +1 -1
  184. package/components/icure-form/renderer/form/form-selection-button.js +67 -27
  185. package/components/icure-form/renderer/form/form-selection-button.js.map +1 -1
  186. package/components/icure-form/renderer/form/form.js +264 -219
  187. package/components/icure-form/renderer/form/form.js.map +1 -1
  188. package/components/icure-form/renderer/index.d.ts +1 -1
  189. package/components/icure-form/renderer/index.js +2 -1
  190. package/components/icure-form/renderer/index.js.map +1 -1
  191. package/components/icure-label/index.js +70 -26
  192. package/components/icure-label/index.js.map +1 -1
  193. package/components/icure-text-field/index.d.ts +8 -2
  194. package/components/icure-text-field/index.js +309 -145
  195. package/components/icure-text-field/index.js.map +1 -1
  196. package/components/icure-text-field/plugin/caret-fix-plugin.js +7 -3
  197. package/components/icure-text-field/plugin/caret-fix-plugin.js.map +1 -1
  198. package/components/icure-text-field/plugin/has-content-class-plugin.js +7 -3
  199. package/components/icure-text-field/plugin/has-content-class-plugin.js.map +1 -1
  200. package/components/icure-text-field/plugin/mask-plugin.js +11 -7
  201. package/components/icure-text-field/plugin/mask-plugin.js.map +1 -1
  202. package/components/icure-text-field/plugin/regexp-plugin.js +9 -5
  203. package/components/icure-text-field/plugin/regexp-plugin.js.map +1 -1
  204. package/components/icure-text-field/prosemirror-commands.js +14 -10
  205. package/components/icure-text-field/prosemirror-commands.js.map +1 -1
  206. package/components/icure-text-field/prosemirror-utils.js +4 -1
  207. package/components/icure-text-field/prosemirror-utils.js.map +1 -1
  208. package/components/icure-text-field/schema/common-marks.js +7 -3
  209. package/components/icure-text-field/schema/common-marks.js.map +1 -1
  210. package/components/icure-text-field/schema/date-time-schema.js +8 -3
  211. package/components/icure-text-field/schema/date-time-schema.js.map +1 -1
  212. package/components/icure-text-field/schema/decimal-schema.js +4 -1
  213. package/components/icure-text-field/schema/decimal-schema.js.map +1 -1
  214. package/components/icure-text-field/schema/index.js +20 -17
  215. package/components/icure-text-field/schema/index.js.map +1 -1
  216. package/components/icure-text-field/schema/items-list-schema.js +6 -3
  217. package/components/icure-text-field/schema/items-list-schema.js.map +1 -1
  218. package/components/icure-text-field/schema/markdown-schema.js +10 -28
  219. package/components/icure-text-field/schema/markdown-schema.js.map +1 -1
  220. package/components/icure-text-field/schema/measure-schema.js +12 -6
  221. package/components/icure-text-field/schema/measure-schema.js.map +1 -1
  222. package/components/icure-text-field/schema/token-schema.js +8 -5
  223. package/components/icure-text-field/schema/token-schema.js.map +1 -1
  224. package/components/icure-text-field/schema/utils.js +6 -2
  225. package/components/icure-text-field/schema/utils.js.map +1 -1
  226. package/components/icure-text-field/selection-companion.js +5 -1
  227. package/components/icure-text-field/selection-companion.js.map +1 -1
  228. package/components/icure-text-field/suggestion-palette.js +10 -3
  229. package/components/icure-text-field/suggestion-palette.js.map +1 -1
  230. package/components/index.js +21 -5
  231. package/components/index.js.map +1 -1
  232. package/components/model/index.js +46 -22
  233. package/components/model/index.js.map +1 -1
  234. package/components/themes/default/index.js +32 -30
  235. package/components/themes/default/index.js.map +1 -1
  236. package/components/themes/icure-blue/index.js +104 -47
  237. package/components/themes/icure-blue/index.js.map +1 -1
  238. package/components/themes/kendo/index.js +55 -49
  239. package/components/themes/kendo/index.js.map +1 -1
  240. package/conversion/ckmeans-grouping.js +10 -3
  241. package/conversion/ckmeans-grouping.js.map +1 -1
  242. package/conversion/ckmeans.js +3 -1
  243. package/conversion/ckmeans.js.map +1 -1
  244. package/conversion/icure-convert.js +21 -18
  245. package/conversion/icure-convert.js.map +1 -1
  246. package/generic/index.js +17 -1
  247. package/generic/index.js.map +1 -1
  248. package/generic/model.d.ts +5 -4
  249. package/generic/model.js +2 -1
  250. package/generic/model.js.map +1 -1
  251. package/icure/form-values-container.d.ts +21 -13
  252. package/icure/form-values-container.js +265 -163
  253. package/icure/form-values-container.js.map +1 -1
  254. package/icure/icure-utils.js +21 -10
  255. package/icure/icure-utils.js.map +1 -1
  256. package/icure/index.js +18 -2
  257. package/icure/index.js.map +1 -1
  258. package/icure/model.js +2 -1
  259. package/index.d.ts +1 -0
  260. package/index.js +19 -1
  261. package/index.js.map +1 -1
  262. package/package.json +16 -13
  263. package/utils/code-utils.js +19 -11
  264. package/utils/code-utils.js.map +1 -1
  265. package/utils/dates.js +20 -9
  266. package/utils/dates.js.map +1 -1
  267. package/utils/fields-values-provider.d.ts +1 -1
  268. package/utils/fields-values-provider.js +28 -11
  269. package/utils/fields-values-provider.js.map +1 -1
  270. package/utils/interpreter.d.ts +2 -3
  271. package/utils/interpreter.js +16 -3
  272. package/utils/interpreter.js.map +1 -1
  273. package/utils/languages.js +8 -3
  274. package/utils/languages.js.map +1 -1
  275. package/utils/markdown.js +11 -6
  276. package/utils/markdown.js.map +1 -1
  277. package/utils/no-lodash.js +8 -3
  278. package/utils/no-lodash.js.map +1 -1
  279. package/utils/primitive.d.ts +1 -1
  280. package/utils/primitive.js +16 -11
  281. package/utils/primitive.js.map +1 -1
  282. package/utils/form-value-container.d.ts +0 -3
  283. package/utils/form-value-container.js +0 -30
  284. package/utils/form-value-container.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"icure-convert.js","sourceRoot":"","sources":["../../tmp/conversion/icure-convert.ts"],"names":[],"mappings":"AACA,OAAO,EACN,MAAM,EACN,QAAQ,EACR,UAAU,EACV,cAAc,EACd,aAAa,EAEb,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,WAAW,EACX,OAAO,EACP,OAAO,EACP,SAAS,EACT,UAAU,GACV,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE5C,MAAM,UAAU,aAAa,CAAC,IAAgB,EAAE,YAA0B;;IACzE,MAAM,aAAa,GAAG,EAAE,CAAA;IACxB,MAAM,aAAa,GAAG,CAAC,QAAwB,EAAE,KAAa,EAAE,MAAc,EAAE,EAAE,WACjF,OAAA,IAAI,SAAS,CAAC,MAAA,QAAQ,CAAC,IAAI,mCAAI,EAAE,EAAE,EAAE,UAAU,EAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAA,EAAA,CAAA;IAC1H,MAAM,kBAAkB,GAAG,CAAC,QAAwB,EAAE,KAAa,EAAE,MAAc,EAAE,EAAE,WACtF,OAAA,IAAI,cAAc,CAAC,MAAA,QAAQ,CAAC,IAAI,mCAAI,EAAE,EAAE,EAAE,UAAU,EAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,E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CAAC,QAAwB,EAAE,KAAK,EAAE,EAAE;;oBACxC,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,GAAG,CAAA;oBACvC,GAAG,IAAI,KAAK,CAAA;oBACZ,OAAO,MAAA,MACN;wBACC,YAAY,EAAE,aAAa;wBAC3B,cAAc,EAAE,YAAY;wBAC5B,aAAa,EAAE,gBAAgB;wBAC/B,YAAY,EAAE,eAAe;wBAC7B,eAAe,EAAE,iBAAiB;wBAClC,cAAc,EAAE,iBAAiB;wBACjC,iBAAiB,EAAE,kBAAkB;wBACrC,gBAAgB,EAAE,cAAc;wBAChC,aAAa,EAAE,WAAW;wBAC1B,YAAY,EAAE,gBAAgB;qBAE/B,EAAC,MAAA,MAAA,QAAQ,CAAC,MAAM,0CAAE,GAAG,mCAAI,EAAE,CAAC,mDAAG,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,MAAA,MAAA,QAAQ,CAAC,MAAM,0CAAE,MAAM,mCAAI,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA;gBACvH,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACH,CAAC,CAAC,CACF,CAAA;IACF,CAAC,CAAC,EACF,IAAI,CAAC,IAAI,CACT,CAAA;IACD,OAAO,UAAU,CAAA;AAClB,CAAC","sourcesContent":["import { FormLayout } from '@icure/api'\nimport {\n\tButton,\n\tCheckBox,\n\tDatePicker,\n\tDateTimePicker,\n\tDropdownField,\n\tField,\n\tForm,\n\tItemsListField,\n\tMeasureField,\n\tNumberField,\n\tSection,\n\tSubform,\n\tTextField,\n\tTokenField,\n} from '../components/model'\nimport { FormLayoutData } from '@icure/api/icc-api/model/FormLayoutData'\nimport { cluster } from './ckmeans-grouping'\n\nexport function convertLegacy(form: FormLayout, formsLibrary: FormLayout[]): Form {\n\tconst TOTAL_COLUMNS = 24\n\tconst makeTextField = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew TextField(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\tconst makeItemsListField = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew ItemsListField(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\tconst makeTokenField = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew TokenField(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\tconst makeCheckBox = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew CheckBox(formData.name ?? '', { shortLabel: formData.label, options: { [formData.label ?? '']: formData.label }, span: width, rowSpan: height > 1 ? height : undefined })\n\tconst makeMeasureField = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew MeasureField(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\tconst makeNumberField = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew NumberField(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\tconst makeDateTimeField = (formData: FormLayoutData, width: number, height: number) =>\n\t\t(formData.editor as any)?.displayTime\n\t\t\t? new DateTimePicker(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\t\t\t: new DatePicker(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\n\tconst makeDropdownField = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew DropdownField(formData.name ?? '', {\n\t\t\tshortLabel: formData.label,\n\t\t\tspan: width,\n\t\t\toptions: (formData.editor as any)?.menuOptions\n\t\t\t\t? (formData.editor as any)?.menuOptions.reduce(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tacc: {\n\t\t\t\t\t\t\t\t[key: string]: unknown\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tv: string,\n\t\t\t\t\t\t) => ({ ...acc, [`LEGACY|${v}|1`]: v }),\n\t\t\t\t\t\t{},\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t})\n\n\tconst makeSubForm = (formData: FormLayoutData, width: number, height: number) => {\n\t\tconst subForms = ((formData.editor as any)?.optionalFormGuids as string[])?.map((guid: string) => {\n\t\t\tconst subForm = formsLibrary.find((it) => it.guid === guid)\n\t\t\tif (!subForm) {\n\t\t\t\tthrow new Error(`Cannot find subform ${guid}`)\n\t\t\t}\n\t\t\treturn convertLegacy(subForm as FormLayout, formsLibrary)\n\t\t})\n\t\treturn new Subform(\n\t\t\tformData.name ?? '',\n\t\t\tsubForms.reduce((acc, sf) => ({ ...acc, [sf.form]: sf }), {}),\n\t\t\t{\n\t\t\t\tshortLabel: formData.label,\n\t\t\t\tspan: width,\n\t\t\t\trowSpan: height,\n\t\t\t},\n\t\t)\n\t}\n\n\tconst makeActionButton = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew Button(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\n\t// noinspection UnnecessaryLocalVariableJS\n\tconst translated = new Form(\n\t\t(form.group ? `${form.group}/${form.name}` : form.name) ?? 'Unknown',\n\t\t(form.sections ?? []).map((section) => {\n\t\t\tconst fld = (section.formColumns ?? []).flatMap((column) => column.formDataList ?? [])\n\t\t\tconst sortedList = fld.sort((a, b) => (a.editor?.top ?? 0) - (b.editor?.top ?? 0))\n\n\t\t\tconst rowClusters = cluster(\n\t\t\t\tfld.map((f) => f.editor?.top ?? 0),\n\t\t\t\t5,\n\t\t\t\t16,\n\t\t\t)\n\t\t\tconst rows = rowClusters.clusters\n\n\t\t\tconst intraCentroids = rowClusters.centroids.map((v, idx, centroids) => (idx > 0 ? v - centroids[idx - 1] : 0)).filter((x) => x > 0)\n\t\t\tconst meanHeightWithOutliers = intraCentroids.reduce((sum, v) => v + sum, 0) / intraCentroids.length\n\t\t\tconst intraCentroidsWithoutOutliers = intraCentroids.filter((x) => x < meanHeightWithOutliers * 2)\n\t\t\tconst meanHeight = intraCentroidsWithoutOutliers.reduce((sum, v) => v + sum, 0) / intraCentroidsWithoutOutliers.length\n\n\t\t\tconst formDataClusters = sortedList\n\t\t\t\t.reduce(\n\t\t\t\t\t(cs, fd) => {\n\t\t\t\t\t\tcs[rows.findIndex((c) => c.includes(fd.editor?.top ?? 0))].push(fd)\n\t\t\t\t\t\treturn cs\n\t\t\t\t\t},\n\t\t\t\t\tnew Array(rows.length).fill(null).map(() => [] as FormLayoutData[]),\n\t\t\t\t)\n\t\t\t\t.map((c) => c.sort((a, b) => (a.editor?.left ?? 0) - (b.editor?.left ?? 0)))\n\n\t\t\tconst leftMostField = sortedList.filter((f) => !f.subForm).reduce((a, b) => ((a.editor?.left ?? 0) < (b.editor?.left ?? 0) ? a : b))\n\t\t\tconst rightMostField = sortedList\n\t\t\t\t.filter((f) => !f.subForm)\n\t\t\t\t.reduce((a, b) => ((a.editor?.left ?? 0) + (a.editor?.width ?? 0) < (b.editor?.left ?? 0) + (b.editor?.width ?? 0) ? b : a))\n\n\t\t\tconst leftSide = leftMostField.editor?.left ?? 0\n\t\t\tconst formWidth = (rightMostField?.editor?.left ?? 0) + (rightMostField?.editor?.width ?? 1024) - leftSide\n\t\t\tconst interColumnsDistance = formWidth / TOTAL_COLUMNS\n\t\t\tconst columns = cluster(\n\t\t\t\tfld.map((f) => (f.editor?.left ?? 0) + (f.editor?.width ?? 0) - leftSide),\n\t\t\t\tformWidth / (TOTAL_COLUMNS * 2),\n\t\t\t\tMath.ceil((formWidth ?? 1024) / (TOTAL_COLUMNS * 4)),\n\t\t\t\tMath.max(Math.min(TOTAL_COLUMNS, fld.length / 2), 1),\n\t\t\t)\n\t\t\tconst columnsWidth = columns.centroids.map((v, idx, t) => v - (t[idx - 1] ?? 0))\n\n\t\t\tconst acc = columnsWidth.map(() => 1)\n\t\t\twhile (acc.reduce((s, v) => s + v, 0) < TOTAL_COLUMNS) {\n\t\t\t\tconst idx = acc.reduce(\n\t\t\t\t\t(s: [number | undefined, number], size: number, idx: number): [number | undefined, number] => {\n\t\t\t\t\t\tconst diff = size * interColumnsDistance - columnsWidth[idx]\n\t\t\t\t\t\treturn diff < 0 && -diff > s[1] ? [idx, -diff] : s\n\t\t\t\t\t},\n\t\t\t\t\t[undefined, 0],\n\t\t\t\t)\n\t\t\t\tconst selected = idx[0]\n\t\t\t\tif (selected === undefined) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tacc[selected]++\n\t\t\t}\n\t\t\t// noinspection UnnecessaryLocalVariableJS\n\t\t\tconst columnsRoundedWidth = acc\n\n\t\t\tconst columnsAccumulatedWidth = columnsRoundedWidth.reduce((acc, v) => [...acc, (acc[acc.length - 1] ?? 0) + v], [])\n\t\t\tconst columnsAccumulatedWidthWithInterColumns = columnsAccumulatedWidth.map((v) => v * interColumnsDistance)\n\n\t\t\treturn new Section(\n\t\t\t\t'Main',\n\t\t\t\tformDataClusters.flatMap((formDataRow: FormLayoutData[]) => {\n\t\t\t\t\tconst cols = formDataRow\n\t\t\t\t\t\t.map((formData: FormLayoutData) => {\n\t\t\t\t\t\t\treturn columnsAccumulatedWidth[\n\t\t\t\t\t\t\t\tcolumnsAccumulatedWidthWithInterColumns.reduce(\n\t\t\t\t\t\t\t\t\t([idx, min]: [number, number], x, n) => {\n\t\t\t\t\t\t\t\t\t\tconst right = (formData.editor?.left ?? 0) + (formData.editor?.width ?? 0) - leftSide\n\t\t\t\t\t\t\t\t\t\treturn Math.abs(x - right) < min ? [n, Math.abs(x - right)] : [idx, min]\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t[0, 99999],\n\t\t\t\t\t\t\t\t)[0]\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.map((x, idx, cols) => {\n\t\t\t\t\t\t\t//Try to solve inverted positions in columns by adding or removing one column\n\t\t\t\t\t\t\tconst prev = cols[idx - 1] ?? 0\n\t\t\t\t\t\t\tconst next = cols[idx + 1] ?? TOTAL_COLUMNS\n\t\t\t\t\t\t\treturn x > prev + 1 && x >= next - 1 ? x - 1 : x === prev ? x + 1 : x\n\t\t\t\t\t\t})\n\t\t\t\t\tconst subRows = cols.reduce((acc, v, idx, cols) => {\n\t\t\t\t\t\tif (idx === 0) {\n\t\t\t\t\t\t\treturn [[[idx, v]]]\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet row = 0\n\t\t\t\t\t\twhile (row < acc.length && acc[row][acc[row].length - 1][1] > v) {\n\t\t\t\t\t\t\trow++\n\t\t\t\t\t\t}\n\t\t\t\t\t\t;(acc[row] ?? (acc[row] = [])).push([idx, v] as [number, number])\n\t\t\t\t\t\treturn acc\n\t\t\t\t\t}, [] as [number, number][][])\n\n\t\t\t\t\treturn subRows.flatMap((subRow) => {\n\t\t\t\t\t\tconst acc = subRow.map((x) => x[1])\n\t\t\t\t\t\twhile (acc[acc.length - 1] < TOTAL_COLUMNS) {\n\t\t\t\t\t\t\tconst idx = acc.reduce(\n\t\t\t\t\t\t\t\t([minIdx, min]: [number | undefined, number], size: number, idx: number, columns: number[]): [number | undefined, number] => {\n\t\t\t\t\t\t\t\t\tconst scenario = columns.map((x, cidx) => (cidx === idx ? x + 1 : x))\n\t\t\t\t\t\t\t\t\tconst penalty = scenario.reduce((acc, v) => {\n\t\t\t\t\t\t\t\t\t\tconst right = (formDataRow[subRow[idx][0]].editor?.left ?? 0) + (formDataRow[subRow[idx][0]].editor?.width ?? 0) - leftSide\n\t\t\t\t\t\t\t\t\t\treturn acc + Math.abs(v * interColumnsDistance - right)\n\t\t\t\t\t\t\t\t\t}, 0)\n\t\t\t\t\t\t\t\t\treturn penalty < min ? [idx, penalty] : [minIdx, min]\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t[undefined, 999999],\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tconst selected = idx[0]\n\t\t\t\t\t\t\tif (selected === undefined) {\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (let i = selected; i < acc.length; i++) {\n\t\t\t\t\t\t\t\tacc[i]++\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst expandedCols = acc\n\t\t\t\t\t\tlet idx = 0\n\t\t\t\t\t\treturn subRow\n\t\t\t\t\t\t\t.map(([idx]) => formDataRow[idx])\n\t\t\t\t\t\t\t.map((formData: FormLayoutData, index) => {\n\t\t\t\t\t\t\t\tconst width = expandedCols[index] - idx\n\t\t\t\t\t\t\t\tidx += width\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tStringEditor: makeTextField,\n\t\t\t\t\t\t\t\t\t\tCheckBoxEditor: makeCheckBox,\n\t\t\t\t\t\t\t\t\t\tMeasureEditor: makeMeasureField,\n\t\t\t\t\t\t\t\t\t\tNumberEditor: makeNumberField,\n\t\t\t\t\t\t\t\t\t\tPopupMenuEditor: makeDropdownField,\n\t\t\t\t\t\t\t\t\t\tDateTimeEditor: makeDateTimeField,\n\t\t\t\t\t\t\t\t\t\tStringTableEditor: makeItemsListField,\n\t\t\t\t\t\t\t\t\t\tTokenFieldEditor: makeTokenField,\n\t\t\t\t\t\t\t\t\t\tSubFormEditor: makeSubForm,\n\t\t\t\t\t\t\t\t\t\tActionButton: makeActionButton,\n\t\t\t\t\t\t\t\t\t} as { [key: string]: (fd: FormLayoutData, w: number, h: number) => Field | Subform }\n\t\t\t\t\t\t\t\t)[formData.editor?.key ?? '']?.(formData, width, Math.max(1, Math.floor((formData.editor?.height ?? 0) / meanHeight)))\n\t\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t)\n\t\t}),\n\t\tform.guid,\n\t)\n\treturn translated\n}\n"]}
1
+ {"version":3,"file":"icure-convert.js","sourceRoot":"","sources":["../../tmp/conversion/icure-convert.ts"],"names":[],"mappings":";;AAoBA,sCAgNC;AAnOD,+CAe4B;AAE5B,y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,mCAAI,EAAE,CAAC,mDAAG,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,MAAA,MAAA,QAAQ,CAAC,MAAM,0CAAE,MAAM,mCAAI,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA;gBACvH,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACH,CAAC,CAAC,CACF,CAAA;IACF,CAAC,CAAC,EACF,IAAI,CAAC,IAAI,CACT,CAAA;IACD,OAAO,UAAU,CAAA;AAClB,CAAC","sourcesContent":["import { FormLayout } from '@icure/api'\nimport {\n\tButton,\n\tCheckBox,\n\tDatePicker,\n\tDateTimePicker,\n\tDropdownField,\n\tField,\n\tForm,\n\tItemsListField,\n\tMeasureField,\n\tNumberField,\n\tSection,\n\tSubform,\n\tTextField,\n\tTokenField,\n} from '../components/model'\nimport { FormLayoutData } from '@icure/api/icc-api/model/FormLayoutData'\nimport { cluster } from './ckmeans-grouping'\n\nexport function convertLegacy(form: FormLayout, formsLibrary: FormLayout[]): Form {\n\tconst TOTAL_COLUMNS = 24\n\tconst makeTextField = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew TextField(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\tconst makeItemsListField = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew ItemsListField(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\tconst makeTokenField = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew TokenField(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\tconst makeCheckBox = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew CheckBox(formData.name ?? '', { shortLabel: formData.label, options: { [formData.label ?? '']: formData.label }, span: width, rowSpan: height > 1 ? height : undefined })\n\tconst makeMeasureField = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew MeasureField(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\tconst makeNumberField = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew NumberField(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\tconst makeDateTimeField = (formData: FormLayoutData, width: number, height: number) =>\n\t\t(formData.editor as any)?.displayTime\n\t\t\t? new DateTimePicker(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\t\t\t: new DatePicker(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\n\tconst makeDropdownField = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew DropdownField(formData.name ?? '', {\n\t\t\tshortLabel: formData.label,\n\t\t\tspan: width,\n\t\t\toptions: (formData.editor as any)?.menuOptions\n\t\t\t\t? (formData.editor as any)?.menuOptions.reduce(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tacc: {\n\t\t\t\t\t\t\t\t[key: string]: unknown\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tv: string,\n\t\t\t\t\t\t) => ({ ...acc, [`LEGACY|${v}|1`]: v }),\n\t\t\t\t\t\t{},\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t})\n\n\tconst makeSubForm = (formData: FormLayoutData, width: number, height: number) => {\n\t\tconst subForms = ((formData.editor as any)?.optionalFormGuids as string[])?.map((guid: string) => {\n\t\t\tconst subForm = formsLibrary.find((it) => it.guid === guid)\n\t\t\tif (!subForm) {\n\t\t\t\tthrow new Error(`Cannot find subform ${guid}`)\n\t\t\t}\n\t\t\treturn convertLegacy(subForm as FormLayout, formsLibrary)\n\t\t})\n\t\treturn new Subform(\n\t\t\tformData.name ?? '',\n\t\t\tsubForms.reduce((acc, sf) => ({ ...acc, [sf.form]: sf }), {}),\n\t\t\t{\n\t\t\t\tshortLabel: formData.label,\n\t\t\t\tspan: width,\n\t\t\t\trowSpan: height,\n\t\t\t},\n\t\t)\n\t}\n\n\tconst makeActionButton = (formData: FormLayoutData, width: number, height: number) =>\n\t\tnew Button(formData.name ?? '', { shortLabel: formData.label, span: width, rowSpan: height > 1 ? height : undefined })\n\n\t// noinspection UnnecessaryLocalVariableJS\n\tconst translated = new Form(\n\t\t(form.group ? `${form.group}/${form.name}` : form.name) ?? 'Unknown',\n\t\t(form.sections ?? []).map((section) => {\n\t\t\tconst fld = (section.formColumns ?? []).flatMap((column) => column.formDataList ?? [])\n\t\t\tconst sortedList = fld.sort((a, b) => (a.editor?.top ?? 0) - (b.editor?.top ?? 0))\n\n\t\t\tconst rowClusters = cluster(\n\t\t\t\tfld.map((f) => f.editor?.top ?? 0),\n\t\t\t\t5,\n\t\t\t\t16,\n\t\t\t)\n\t\t\tconst rows = rowClusters.clusters\n\n\t\t\tconst intraCentroids = rowClusters.centroids.map((v, idx, centroids) => (idx > 0 ? v - centroids[idx - 1] : 0)).filter((x) => x > 0)\n\t\t\tconst meanHeightWithOutliers = intraCentroids.reduce((sum, v) => v + sum, 0) / intraCentroids.length\n\t\t\tconst intraCentroidsWithoutOutliers = intraCentroids.filter((x) => x < meanHeightWithOutliers * 2)\n\t\t\tconst meanHeight = intraCentroidsWithoutOutliers.reduce((sum, v) => v + sum, 0) / intraCentroidsWithoutOutliers.length\n\n\t\t\tconst formDataClusters = sortedList\n\t\t\t\t.reduce(\n\t\t\t\t\t(cs, fd) => {\n\t\t\t\t\t\tcs[rows.findIndex((c) => c.includes(fd.editor?.top ?? 0))].push(fd)\n\t\t\t\t\t\treturn cs\n\t\t\t\t\t},\n\t\t\t\t\tnew Array(rows.length).fill(null).map(() => [] as FormLayoutData[]),\n\t\t\t\t)\n\t\t\t\t.map((c) => c.sort((a, b) => (a.editor?.left ?? 0) - (b.editor?.left ?? 0)))\n\n\t\t\tconst leftMostField = sortedList.filter((f) => !f.subForm).reduce((a, b) => ((a.editor?.left ?? 0) < (b.editor?.left ?? 0) ? a : b))\n\t\t\tconst rightMostField = sortedList\n\t\t\t\t.filter((f) => !f.subForm)\n\t\t\t\t.reduce((a, b) => ((a.editor?.left ?? 0) + (a.editor?.width ?? 0) < (b.editor?.left ?? 0) + (b.editor?.width ?? 0) ? b : a))\n\n\t\t\tconst leftSide = leftMostField.editor?.left ?? 0\n\t\t\tconst formWidth = (rightMostField?.editor?.left ?? 0) + (rightMostField?.editor?.width ?? 1024) - leftSide\n\t\t\tconst interColumnsDistance = formWidth / TOTAL_COLUMNS\n\t\t\tconst columns = cluster(\n\t\t\t\tfld.map((f) => (f.editor?.left ?? 0) + (f.editor?.width ?? 0) - leftSide),\n\t\t\t\tformWidth / (TOTAL_COLUMNS * 2),\n\t\t\t\tMath.ceil((formWidth ?? 1024) / (TOTAL_COLUMNS * 4)),\n\t\t\t\tMath.max(Math.min(TOTAL_COLUMNS, fld.length / 2), 1),\n\t\t\t)\n\t\t\tconst columnsWidth = columns.centroids.map((v, idx, t) => v - (t[idx - 1] ?? 0))\n\n\t\t\tconst acc = columnsWidth.map(() => 1)\n\t\t\twhile (acc.reduce((s, v) => s + v, 0) < TOTAL_COLUMNS) {\n\t\t\t\tconst idx = acc.reduce(\n\t\t\t\t\t(s: [number | undefined, number], size: number, idx: number): [number | undefined, number] => {\n\t\t\t\t\t\tconst diff = size * interColumnsDistance - columnsWidth[idx]\n\t\t\t\t\t\treturn diff < 0 && -diff > s[1] ? [idx, -diff] : s\n\t\t\t\t\t},\n\t\t\t\t\t[undefined, 0],\n\t\t\t\t)\n\t\t\t\tconst selected = idx[0]\n\t\t\t\tif (selected === undefined) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tacc[selected]++\n\t\t\t}\n\t\t\t// noinspection UnnecessaryLocalVariableJS\n\t\t\tconst columnsRoundedWidth = acc\n\n\t\t\tconst columnsAccumulatedWidth = columnsRoundedWidth.reduce((acc, v) => [...acc, (acc[acc.length - 1] ?? 0) + v], [])\n\t\t\tconst columnsAccumulatedWidthWithInterColumns = columnsAccumulatedWidth.map((v) => v * interColumnsDistance)\n\n\t\t\treturn new Section(\n\t\t\t\t'Main',\n\t\t\t\tformDataClusters.flatMap((formDataRow: FormLayoutData[]) => {\n\t\t\t\t\tconst cols = formDataRow\n\t\t\t\t\t\t.map((formData: FormLayoutData) => {\n\t\t\t\t\t\t\treturn columnsAccumulatedWidth[\n\t\t\t\t\t\t\t\tcolumnsAccumulatedWidthWithInterColumns.reduce(\n\t\t\t\t\t\t\t\t\t([idx, min]: [number, number], x, n) => {\n\t\t\t\t\t\t\t\t\t\tconst right = (formData.editor?.left ?? 0) + (formData.editor?.width ?? 0) - leftSide\n\t\t\t\t\t\t\t\t\t\treturn Math.abs(x - right) < min ? [n, Math.abs(x - right)] : [idx, min]\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t[0, 99999],\n\t\t\t\t\t\t\t\t)[0]\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.map((x, idx, cols) => {\n\t\t\t\t\t\t\t//Try to solve inverted positions in columns by adding or removing one column\n\t\t\t\t\t\t\tconst prev = cols[idx - 1] ?? 0\n\t\t\t\t\t\t\tconst next = cols[idx + 1] ?? TOTAL_COLUMNS\n\t\t\t\t\t\t\treturn x > prev + 1 && x >= next - 1 ? x - 1 : x === prev ? x + 1 : x\n\t\t\t\t\t\t})\n\t\t\t\t\tconst subRows = cols.reduce((acc, v, idx, cols) => {\n\t\t\t\t\t\tif (idx === 0) {\n\t\t\t\t\t\t\treturn [[[idx, v]]]\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet row = 0\n\t\t\t\t\t\twhile (row < acc.length && acc[row][acc[row].length - 1][1] > v) {\n\t\t\t\t\t\t\trow++\n\t\t\t\t\t\t}\n\t\t\t\t\t\t;(acc[row] ?? (acc[row] = [])).push([idx, v] as [number, number])\n\t\t\t\t\t\treturn acc\n\t\t\t\t\t}, [] as [number, number][][])\n\n\t\t\t\t\treturn subRows.flatMap((subRow) => {\n\t\t\t\t\t\tconst acc = subRow.map((x) => x[1])\n\t\t\t\t\t\twhile (acc[acc.length - 1] < TOTAL_COLUMNS) {\n\t\t\t\t\t\t\tconst idx = acc.reduce(\n\t\t\t\t\t\t\t\t([minIdx, min]: [number | undefined, number], size: number, idx: number, columns: number[]): [number | undefined, number] => {\n\t\t\t\t\t\t\t\t\tconst scenario = columns.map((x, cidx) => (cidx === idx ? x + 1 : x))\n\t\t\t\t\t\t\t\t\tconst penalty = scenario.reduce((acc, v) => {\n\t\t\t\t\t\t\t\t\t\tconst right = (formDataRow[subRow[idx][0]].editor?.left ?? 0) + (formDataRow[subRow[idx][0]].editor?.width ?? 0) - leftSide\n\t\t\t\t\t\t\t\t\t\treturn acc + Math.abs(v * interColumnsDistance - right)\n\t\t\t\t\t\t\t\t\t}, 0)\n\t\t\t\t\t\t\t\t\treturn penalty < min ? [idx, penalty] : [minIdx, min]\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t[undefined, 999999],\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tconst selected = idx[0]\n\t\t\t\t\t\t\tif (selected === undefined) {\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (let i = selected; i < acc.length; i++) {\n\t\t\t\t\t\t\t\tacc[i]++\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst expandedCols = acc\n\t\t\t\t\t\tlet idx = 0\n\t\t\t\t\t\treturn subRow\n\t\t\t\t\t\t\t.map(([idx]) => formDataRow[idx])\n\t\t\t\t\t\t\t.map((formData: FormLayoutData, index) => {\n\t\t\t\t\t\t\t\tconst width = expandedCols[index] - idx\n\t\t\t\t\t\t\t\tidx += width\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tStringEditor: makeTextField,\n\t\t\t\t\t\t\t\t\t\tCheckBoxEditor: makeCheckBox,\n\t\t\t\t\t\t\t\t\t\tMeasureEditor: makeMeasureField,\n\t\t\t\t\t\t\t\t\t\tNumberEditor: makeNumberField,\n\t\t\t\t\t\t\t\t\t\tPopupMenuEditor: makeDropdownField,\n\t\t\t\t\t\t\t\t\t\tDateTimeEditor: makeDateTimeField,\n\t\t\t\t\t\t\t\t\t\tStringTableEditor: makeItemsListField,\n\t\t\t\t\t\t\t\t\t\tTokenFieldEditor: makeTokenField,\n\t\t\t\t\t\t\t\t\t\tSubFormEditor: makeSubForm,\n\t\t\t\t\t\t\t\t\t\tActionButton: makeActionButton,\n\t\t\t\t\t\t\t\t\t} as { [key: string]: (fd: FormLayoutData, w: number, h: number) => Field | Subform }\n\t\t\t\t\t\t\t\t)[formData.editor?.key ?? '']?.(formData, width, Math.max(1, Math.floor((formData.editor?.height ?? 0) / meanHeight)))\n\t\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t)\n\t\t}),\n\t\tform.guid,\n\t)\n\treturn translated\n}\n"]}
package/generic/index.js CHANGED
@@ -1,2 +1,18 @@
1
- export * from './model';
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
+ __exportStar(require("./model"), exports);
2
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../tmp/generic/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA","sourcesContent":["export * from './model'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../tmp/generic/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB","sourcesContent":["export * from './model'\n"]}
@@ -1,4 +1,4 @@
1
- import { FieldMetadata } from '../components/model';
1
+ import { FieldMetadata, FieldValue } from '../components/model';
2
2
  /**
3
3
  * VersionedData is a structure that contains the values of a form, organized by id and version.
4
4
  */
@@ -50,13 +50,14 @@ export type ID = string;
50
50
  export interface FormValuesContainer<Value, Metadata> {
51
51
  compute<T, S extends {
52
52
  [key: string | symbol]: unknown;
53
- }>(formula: string, sandbox?: S): T | undefined;
53
+ }>(formula: string, sandbox?: S): Promise<T | undefined>;
54
54
  getLabel(): string;
55
55
  getFormId(): string | undefined;
56
+ getDefaultValue(label: string): Promise<FieldValue | undefined>;
56
57
  getValues(revisionsFilter: (id: string, history: Version<Metadata>[]) => (string | null)[]): VersionedData<Value>;
57
58
  getMetadata(id: string, revisions: (string | null)[]): VersionedData<Metadata>;
58
- getChildren(): FormValuesContainer<Value, Metadata>[];
59
- getValidationErrors(): [FieldMetadata, string][];
59
+ getChildren(): Promise<FormValuesContainer<Value, Metadata>[]>;
60
+ getValidationErrors(): Promise<[FieldMetadata, string][]>;
60
61
  setValue(label: string, language: string, data?: Value, id?: string, metadata?: Metadata, changeListenersOverrider?: (fvc: FormValuesContainer<Value, Metadata>) => void): void;
61
62
  setMetadata(metadata: Metadata, id?: string): void;
62
63
  delete(serviceId: string): void;
package/generic/model.js CHANGED
@@ -1,2 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../../tmp/generic/model.ts"],"names":[],"mappings":"","sourcesContent":["import { FieldMetadata } from '../components/model'\n\n/**\n * VersionedData is a structure that contains the values of a form, organized by id and version.\n */\nexport interface VersionedData<T> {\n\t[id: string]: Version<T>[]\n}\n\n/**\n * Version is a structure that contains a value, a revision number and a modification timestamp used to sort the versions.\n */\nexport interface Version<T> {\n\trevision: string | null //null means that the version is not saved yet\n\tmodified?: number\n\tvalue: T\n}\n\nexport type ID = string\n/**\n * FormValuesContainer is a readonly structure that provides and handle the values of a form.\n * It is a tree structure where each node is a FormValuesContainer with the same Value and Metadata types.\n *\n * The following methods are provided and must be implemented by the concrete class:\n * - `compute(formula: string, sandbox?: S): T?` : computes a formula based on the values of the form, inside a provided sandbox. If no sandbox is provided, the default sandbox is used.\n * - `getLabel(): string` : returns the label of the form values container (used to display the title of the form in hierarchical contexts)\n * - `getFormId(): string?` : returns the id of the form values container\n * - `getValues(revisionsFilter: Lambda): VersionedData<Value>` : obtains the values to be displayed in the form, using a filter\n * \t\t\tto select the desired versioned data that are to be displayed in a specific field.\n * - `getMetadata(id: string, revisions: (string | null)[]): VersionedData<Metadata>` : obtains the metadata of a specific value, for the specified revisions.\n * - `getValidationErrors(): [FieldMetadata, string][]`: returns the validation errors of the form values container for the values that are currently stored in it.\n * - `getChildren(): FormValuesContainer<Value, Metadata>[]` : returns the children of the form values container\n * - `setValue(label: string, language: string, data?: Value, id?: string, metadata?: Metadata): FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, ID>` :\n * \t\t\tmodifies the value associated to a field in the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container along with the modified value.\n * - `setMetadata(label: string, metadata: Metadata, id?: string): FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, ID>` :\n * \t\t\tmodifies the metadata associated to a value in the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container along with the modified metadata.\n * - `delete(valueId: string): FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, void>` :\n * \t\t\tdeletes a value from the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container without the deleted value.\n * - `addChild(anchorId: string, templateId: string, label: string): Promise<FormValuesContainerMutation<...>, FormValuesContainer<...>>>`:\n * \t\t\tadds a child to the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container with the added child.\n * - `removeChild(container: FormValuesContainer<Value, Metadata>): Promise<FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, void>>` :\n * \t\t\tremoves a child from the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container without the removed child.\n * - `registerChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void` :\n * \t\t\tregisters a listener that will be called whenever the form values container is modified.\n * - `unregisterChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void` : unregisters a listener that was previously registered.\n *\n */\nexport interface FormValuesContainer<Value, Metadata> {\n\t//information retrieval\n\tcompute<T, S extends { [key: string | symbol]: unknown }>(formula: string, sandbox?: S): T | undefined\n\tgetLabel(): string\n\tgetFormId(): string | undefined\n\tgetValues(revisionsFilter: (id: string, history: Version<Metadata>[]) => (string | null)[]): VersionedData<Value>\n\tgetMetadata(id: string, revisions: (string | null)[]): VersionedData<Metadata>\n\tgetChildren(): FormValuesContainer<Value, Metadata>[]\n\tgetValidationErrors(): [FieldMetadata, string][]\n\t//modification\n\tsetValue(label: string, language: string, data?: Value, id?: string, metadata?: Metadata, changeListenersOverrider?: (fvc: FormValuesContainer<Value, Metadata>) => void): void\n\tsetMetadata(metadata: Metadata, id?: string): void\n\tdelete(serviceId: string): void\n\t//hierarchy\n\taddChild(anchorId: string, templateId: string, label: string): Promise<void>\n\tremoveChild(container: FormValuesContainer<Value, Metadata>): Promise<void>\n\t//listeners\n\tregisterChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void\n\tunregisterChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void\n\n\tsynchronise(): FormValuesContainer<Value, Metadata>\n}\n\n/**\n * FormValuesContainerMutation is a structure that wraps a new form values container along with the modified value.\n */\nexport interface FormValuesContainerMutation<Value, Metadata, FVC extends FormValuesContainer<Value, Metadata>, Result> {\n\tresult: Result\n\tformValuesContainer: FVC\n}\n\nexport type Suggestion = { id: string; code?: string; text: string; terms: string[]; label: { [lng: string]: string } }\n"]}
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../tmp/generic/model.ts"],"names":[],"mappings":"","sourcesContent":["import { FieldMetadata, FieldValue } from '../components/model'\n\n/**\n * VersionedData is a structure that contains the values of a form, organized by id and version.\n */\nexport interface VersionedData<T> {\n\t[id: string]: Version<T>[]\n}\n\n/**\n * Version is a structure that contains a value, a revision number and a modification timestamp used to sort the versions.\n */\nexport interface Version<T> {\n\trevision: string | null //null means that the version is not saved yet\n\tmodified?: number\n\tvalue: T\n}\n\nexport type ID = string\n/**\n * FormValuesContainer is a readonly structure that provides and handle the values of a form.\n * It is a tree structure where each node is a FormValuesContainer with the same Value and Metadata types.\n *\n * The following methods are provided and must be implemented by the concrete class:\n * - `compute(formula: string, sandbox?: S): T?` : computes a formula based on the values of the form, inside a provided sandbox. If no sandbox is provided, the default sandbox is used.\n * - `getLabel(): string` : returns the label of the form values container (used to display the title of the form in hierarchical contexts)\n * - `getFormId(): string?` : returns the id of the form values container\n * - `getValues(revisionsFilter: Lambda): VersionedData<Value>` : obtains the values to be displayed in the form, using a filter\n * \t\t\tto select the desired versioned data that are to be displayed in a specific field.\n * - `getMetadata(id: string, revisions: (string | null)[]): VersionedData<Metadata>` : obtains the metadata of a specific value, for the specified revisions.\n * - `getValidationErrors(): [FieldMetadata, string][]`: returns the validation errors of the form values container for the values that are currently stored in it.\n * - `getChildren(): FormValuesContainer<Value, Metadata>[]` : returns the children of the form values container\n * - `setValue(label: string, language: string, data?: Value, id?: string, metadata?: Metadata): FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, ID>` :\n * \t\t\tmodifies the value associated to a field in the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container along with the modified value.\n * - `setMetadata(label: string, metadata: Metadata, id?: string): FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, ID>` :\n * \t\t\tmodifies the metadata associated to a value in the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container along with the modified metadata.\n * - `delete(valueId: string): FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, void>` :\n * \t\t\tdeletes a value from the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container without the deleted value.\n * - `addChild(anchorId: string, templateId: string, label: string): Promise<FormValuesContainerMutation<...>, FormValuesContainer<...>>>`:\n * \t\t\tadds a child to the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container with the added child.\n * - `removeChild(container: FormValuesContainer<Value, Metadata>): Promise<FormValuesContainerMutation<Value, Metadata, FormValuesContainer<Value, Metadata>, void>>` :\n * \t\t\tremoves a child from the form values container. As a form values container is immutable, this method returns a mutation wrapping\n * \t\t\ta new form values container without the removed child.\n * - `registerChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void` :\n * \t\t\tregisters a listener that will be called whenever the form values container is modified.\n * - `unregisterChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void` : unregisters a listener that was previously registered.\n *\n */\nexport interface FormValuesContainer<Value, Metadata> {\n\t//information retrieval\n\tcompute<T, S extends { [key: string | symbol]: unknown }>(formula: string, sandbox?: S): Promise<T | undefined>\n\tgetLabel(): string\n\tgetFormId(): string | undefined\n\tgetDefaultValue(label: string): Promise<FieldValue | undefined>\n\tgetValues(revisionsFilter: (id: string, history: Version<Metadata>[]) => (string | null)[]): VersionedData<Value>\n\tgetMetadata(id: string, revisions: (string | null)[]): VersionedData<Metadata>\n\tgetChildren(): Promise<FormValuesContainer<Value, Metadata>[]>\n\tgetValidationErrors(): Promise<[FieldMetadata, string][]>\n\t//modification\n\tsetValue(label: string, language: string, data?: Value, id?: string, metadata?: Metadata, changeListenersOverrider?: (fvc: FormValuesContainer<Value, Metadata>) => void): void\n\tsetMetadata(metadata: Metadata, id?: string): void\n\tdelete(serviceId: string): void\n\t//hierarchy\n\taddChild(anchorId: string, templateId: string, label: string): Promise<void>\n\tremoveChild(container: FormValuesContainer<Value, Metadata>): Promise<void>\n\t//listeners\n\tregisterChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void\n\tunregisterChangeListener(listener: (newValue: FormValuesContainer<Value, Metadata>) => void): void\n\n\tsynchronise(): FormValuesContainer<Value, Metadata>\n}\n\n/**\n * FormValuesContainerMutation is a structure that wraps a new form values container along with the modified value.\n */\nexport interface FormValuesContainerMutation<Value, Metadata, FVC extends FormValuesContainer<Value, Metadata>, Result> {\n\tresult: Result\n\tformValuesContainer: FVC\n}\n\nexport type Suggestion = { id: string; code?: string; text: string; terms: string[]; label: { [lng: string]: string } }\n"]}
@@ -29,27 +29,28 @@ export declare class BridgedFormValuesContainer implements FormValuesContainer<F
29
29
  private validatorsProvider;
30
30
  private language;
31
31
  private changeListeners;
32
+ private interpreterContext;
32
33
  private contact;
33
34
  private contactFormValuesContainer;
34
35
  private _id;
35
- private mutateAndNotify;
36
+ private readonly mutateAndNotify;
36
37
  toString(): string;
37
38
  /**
38
39
  * Creates an instance of BridgedFormValuesContainer.
39
40
  * @param responsible The id of the data owner responsible for the creation of the values
40
- * @param contact The displayed contact (may be in the past). === to currentContact if the contact is the contact of the day
41
41
  * @param contactFormValuesContainer The wrapped ContactFormValuesContainer
42
42
  * @param interpreter A function that can interpret formulas
43
+ * @param contact The displayed contact (may be in the past). === to currentContact if the contact is the contact of the day
44
+ * @param initialValuesProvider A lambda that provides the initial values of the form
43
45
  * @param dependentValuesProvider A function that provides the dependent values (computed on the basis of other values) for a given anchorId and templateId
44
46
  * @param validatorsProvider A function that provides the validators for a given anchorId and templateId
45
47
  * @param language The language in which the values are displayed
46
48
  * @param changeListeners The listeners that will be notified when the values change
47
- * @param initialValuesProvider A lambda that provides the initial values of the form
49
+ * @param interpreterContext A map with keys that are the names of the variables and values that are the functions that return the values of the variables
48
50
  */
49
51
  constructor(responsible: string, contactFormValuesContainer: ContactFormValuesContainer, interpreter?: (<T, S extends {
50
- [key: string]: unknown;
51
- [key: symbol]: unknown;
52
- }>(formula: string, sandbox: S) => T | undefined) | undefined, contact?: Contact, initialValuesProvider?: (anchorId?: string, templateId?: string) => {
52
+ [key: string | symbol]: unknown;
53
+ }>(formula: string, sandbox: S) => Promise<T | undefined>) | undefined, contact?: Contact, initialValuesProvider?: (anchorId?: string, templateId?: string) => {
53
54
  metadata: FieldMetadata;
54
55
  revisionsFilter: (id: string, history: Version<FieldMetadata>[]) => (string | null)[];
55
56
  formula: string;
@@ -60,14 +61,19 @@ export declare class BridgedFormValuesContainer implements FormValuesContainer<F
60
61
  }[], validatorsProvider?: (anchorId: string | undefined, templateId: string) => {
61
62
  metadata: FieldMetadata;
62
63
  validators: Validator[];
63
- }[], language?: string, changeListeners?: ((newValue: BridgedFormValuesContainer) => void)[]);
64
+ }[], language?: string, changeListeners?: ((newValue: BridgedFormValuesContainer) => void)[], interpreterContext?: {
65
+ [variable: string]: () => unknown;
66
+ });
67
+ init(): Promise<this>;
64
68
  getLabel(): string;
65
69
  getFormId(): string | undefined;
66
70
  getContactFormValuesContainer(): ContactFormValuesContainer;
67
71
  registerChangeListener(listener: (newValue: BridgedFormValuesContainer) => void): void;
68
72
  unregisterChangeListener(listener: (newValue: BridgedFormValuesContainer) => void): void;
73
+ getDefaultValue(label: string): Promise<FieldValue | undefined>;
69
74
  getValues(revisionsFilter: (id: string, history: Version<FieldMetadata>[]) => (string | null)[]): VersionedData<FieldValue>;
70
75
  getMetadata(id: string, revisions: (string | null)[]): VersionedData<FieldMetadata>;
76
+ private convertRawValue;
71
77
  private computeInitialValues;
72
78
  private computeDependentValues;
73
79
  setValue(label: string, language: string, fv?: FieldValue, id?: string, metadata?: FieldMetadata): void;
@@ -76,9 +82,9 @@ export declare class BridgedFormValuesContainer implements FormValuesContainer<F
76
82
  private getVersionedValuesForKey;
77
83
  compute<T, S extends {
78
84
  [key: string | symbol]: unknown;
79
- }>(formula: string, sandbox?: S): T | undefined;
80
- getChildren(): FormValuesContainer<FieldValue, FieldMetadata>[];
81
- getValidationErrors(): [FieldMetadata, string][];
85
+ }>(formula: string, sandbox?: S): Promise<T | undefined>;
86
+ getChildren(): Promise<FormValuesContainer<FieldValue, FieldMetadata>[]>;
87
+ getValidationErrors(): Promise<[FieldMetadata, string][]>;
82
88
  addChild(anchorId: string, templateId: string, label: string): Promise<void>;
83
89
  removeChild(container: BridgedFormValuesContainer): Promise<void>;
84
90
  synchronise(): this;
@@ -102,6 +108,7 @@ export declare class ContactFormValuesContainer implements FormValuesContainer<S
102
108
  changeListeners: ((newValue: ContactFormValuesContainer) => void)[];
103
109
  private _id;
104
110
  private _initialised;
111
+ private indexedServices;
105
112
  toString(): string;
106
113
  mustBeInitialised(): boolean;
107
114
  /**
@@ -120,14 +127,15 @@ export declare class ContactFormValuesContainer implements FormValuesContainer<S
120
127
  getFormId(): string | undefined;
121
128
  registerChangeListener(listener: (newValue: ContactFormValuesContainer) => void): void;
122
129
  unregisterChangeListener(listener: (newValue: ContactFormValuesContainer) => void): void;
123
- getChildren(): ContactFormValuesContainer[];
124
- getValidationErrors(): [FieldMetadata, string][];
130
+ getChildren(): Promise<ContactFormValuesContainer[]>;
131
+ getValidationErrors(): Promise<[FieldMetadata, string][]>;
132
+ getDefaultValue(): Promise<FieldValue | undefined>;
125
133
  getValues(revisionsFilter: (id: string, history: Version<ServiceMetadata>[]) => (string | null)[]): VersionedData<Service>;
126
134
  getMetadata(id: string, revisions: (string | null)[]): VersionedData<ServiceMetadata>;
127
135
  setMetadata(meta: ServiceMetadata, id?: string): void;
128
136
  setValue(label: string, language: string, value?: Service, id?: string, metadata?: ServiceMetadata, changeListenersOverrider?: (fvc: ContactFormValuesContainer) => void): void;
129
137
  delete(serviceId: string): void;
130
- compute<T>(): T | undefined;
138
+ compute<T>(): Promise<T | undefined>;
131
139
  /** returns all services in history that match a selector
132
140
  *
133
141
  * @private