@defra/forms-model 3.0.10 → 3.0.11

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 (237) hide show
  1. package/dist/browser/components/component-types.js +201 -219
  2. package/dist/browser/components/component-types.js.map +1 -1
  3. package/dist/browser/components/conditional-component-types.js +9 -27
  4. package/dist/browser/components/conditional-component-types.js.map +1 -1
  5. package/dist/browser/components/enums.js +27 -45
  6. package/dist/browser/components/enums.js.map +1 -1
  7. package/dist/browser/components/index.js +3 -35
  8. package/dist/browser/components/index.js.map +1 -1
  9. package/dist/browser/components/types.js +1 -15
  10. package/dist/browser/conditions/condition-abstract.js +42 -60
  11. package/dist/browser/conditions/condition-abstract.js.map +1 -1
  12. package/dist/browser/conditions/condition-field.js +23 -41
  13. package/dist/browser/conditions/condition-field.js.map +1 -1
  14. package/dist/browser/conditions/condition-group-def.js +23 -42
  15. package/dist/browser/conditions/condition-group-def.js.map +1 -1
  16. package/dist/browser/conditions/condition-group.js +43 -61
  17. package/dist/browser/conditions/condition-group.js.map +1 -1
  18. package/dist/browser/conditions/condition-model.js +185 -196
  19. package/dist/browser/conditions/condition-model.js.map +1 -1
  20. package/dist/browser/conditions/condition-operators.js +103 -124
  21. package/dist/browser/conditions/condition-operators.js.map +1 -1
  22. package/dist/browser/conditions/condition-ref.js +29 -47
  23. package/dist/browser/conditions/condition-ref.js.map +1 -1
  24. package/dist/browser/conditions/condition-value-abstract.js +19 -37
  25. package/dist/browser/conditions/condition-value-abstract.js.map +1 -1
  26. package/dist/browser/conditions/condition-value-registration.js +15 -34
  27. package/dist/browser/conditions/condition-value-registration.js.map +1 -1
  28. package/dist/browser/conditions/condition-values.js +98 -118
  29. package/dist/browser/conditions/condition-values.js.map +1 -1
  30. package/dist/browser/conditions/condition.js +36 -51
  31. package/dist/browser/conditions/condition.js.map +1 -1
  32. package/dist/browser/conditions/enums.js +5 -23
  33. package/dist/browser/conditions/enums.js.map +1 -1
  34. package/dist/browser/conditions/helpers.js +6 -25
  35. package/dist/browser/conditions/helpers.js.map +1 -1
  36. package/dist/browser/conditions/index.js +10 -143
  37. package/dist/browser/conditions/index.js.map +1 -1
  38. package/dist/browser/conditions/inline-condition-model.js +372 -394
  39. package/dist/browser/conditions/inline-condition-model.js.map +1 -1
  40. package/dist/browser/conditions/inline-condition-operators.js +103 -124
  41. package/dist/browser/conditions/inline-condition-operators.js.map +1 -1
  42. package/dist/browser/conditions/inline-condition-values.js +123 -145
  43. package/dist/browser/conditions/inline-condition-values.js.map +1 -1
  44. package/dist/browser/conditions/types.js +1 -15
  45. package/dist/browser/conditions/types.js.map +1 -1
  46. package/dist/browser/data-model/conditions-wrapper.js +27 -45
  47. package/dist/browser/data-model/conditions-wrapper.js.map +1 -1
  48. package/dist/browser/data-model/enums.js +6 -24
  49. package/dist/browser/data-model/enums.js.map +1 -1
  50. package/dist/browser/data-model/index.js +3 -35
  51. package/dist/browser/data-model/index.js.map +1 -1
  52. package/dist/browser/data-model/input-wrapper.js +28 -46
  53. package/dist/browser/data-model/input-wrapper.js.map +1 -1
  54. package/dist/browser/data-model/types.js +7 -25
  55. package/dist/browser/data-model/types.js.map +1 -1
  56. package/dist/browser/form/form-configuration.js +16 -35
  57. package/dist/browser/form/form-configuration.js.map +1 -1
  58. package/dist/browser/form/index.js +1 -23
  59. package/dist/browser/form/index.js.map +1 -1
  60. package/dist/browser/index.js +8 -97
  61. package/dist/browser/index.js.map +1 -1
  62. package/dist/browser/migration/index.js +1 -23
  63. package/dist/browser/migration/index.js.map +1 -1
  64. package/dist/browser/migration/migration.0-2.js +42 -60
  65. package/dist/browser/migration/migration.0-2.js.map +1 -1
  66. package/dist/browser/migration/migration.1-2.js +83 -99
  67. package/dist/browser/migration/migration.1-2.js.map +1 -1
  68. package/dist/browser/migration/types.js +1 -15
  69. package/dist/browser/migration/whichMigrations.js +20 -36
  70. package/dist/browser/migration/whichMigrations.js.map +1 -1
  71. package/dist/browser/schema/index.js +1 -29
  72. package/dist/browser/schema/index.js.map +1 -1
  73. package/dist/browser/schema/schema.js +231 -249
  74. package/dist/browser/schema/schema.js.map +1 -1
  75. package/dist/browser/utils/helpers.js +22 -43
  76. package/dist/browser/utils/helpers.js.map +1 -1
  77. package/dist/browser/utils/logger.js +24 -43
  78. package/dist/browser/utils/logger.js.map +1 -1
  79. package/dist/module/components/component-types.js +1 -5
  80. package/dist/module/components/component-types.js.map +1 -1
  81. package/dist/module/components/conditional-component-types.js +1 -5
  82. package/dist/module/components/conditional-component-types.js.map +1 -1
  83. package/dist/module/components/enums.js +1 -5
  84. package/dist/module/components/enums.js.map +1 -1
  85. package/dist/module/components/index.js +3 -24
  86. package/dist/module/components/index.js.map +1 -1
  87. package/dist/module/components/types.js +1 -1
  88. package/dist/module/conditions/condition-abstract.js +3 -8
  89. package/dist/module/conditions/condition-abstract.js.map +1 -1
  90. package/dist/module/conditions/condition-field.js +3 -8
  91. package/dist/module/conditions/condition-field.js.map +1 -1
  92. package/dist/module/conditions/condition-group-def.js +1 -6
  93. package/dist/module/conditions/condition-group-def.js.map +1 -1
  94. package/dist/module/conditions/condition-group.js +4 -9
  95. package/dist/module/conditions/condition-group.js.map +1 -1
  96. package/dist/module/conditions/condition-model.js +20 -25
  97. package/dist/module/conditions/condition-model.js.map +1 -1
  98. package/dist/module/conditions/condition-operators.js +15 -23
  99. package/dist/module/conditions/condition-operators.js.map +1 -1
  100. package/dist/module/conditions/condition-ref.js +2 -7
  101. package/dist/module/conditions/condition-ref.js.map +1 -1
  102. package/dist/module/conditions/condition-value-abstract.js +3 -8
  103. package/dist/module/conditions/condition-value-abstract.js.map +1 -1
  104. package/dist/module/conditions/condition-value-registration.js +1 -6
  105. package/dist/module/conditions/condition-value-registration.js.map +1 -1
  106. package/dist/module/conditions/condition-values.js +12 -20
  107. package/dist/module/conditions/condition-values.js.map +1 -1
  108. package/dist/module/conditions/condition.js +9 -14
  109. package/dist/module/conditions/condition.js.map +1 -1
  110. package/dist/module/conditions/enums.js +1 -5
  111. package/dist/module/conditions/enums.js.map +1 -1
  112. package/dist/module/conditions/helpers.js +2 -7
  113. package/dist/module/conditions/helpers.js.map +1 -1
  114. package/dist/module/conditions/index.js +10 -139
  115. package/dist/module/conditions/index.js.map +1 -1
  116. package/dist/module/conditions/inline-condition-model.js +15 -26
  117. package/dist/module/conditions/inline-condition-model.js.map +1 -1
  118. package/dist/module/conditions/inline-condition-operators.js +15 -23
  119. package/dist/module/conditions/inline-condition-operators.js.map +1 -1
  120. package/dist/module/conditions/inline-condition-values.js +9 -17
  121. package/dist/module/conditions/inline-condition-values.js.map +1 -1
  122. package/dist/module/conditions/types.js +1 -1
  123. package/dist/module/conditions/types.js.map +1 -1
  124. package/dist/module/data-model/conditions-wrapper.js +3 -8
  125. package/dist/module/data-model/conditions-wrapper.js.map +1 -1
  126. package/dist/module/data-model/enums.js +1 -5
  127. package/dist/module/data-model/enums.js.map +1 -1
  128. package/dist/module/data-model/index.js +3 -24
  129. package/dist/module/data-model/index.js.map +1 -1
  130. package/dist/module/data-model/input-wrapper.js +3 -8
  131. package/dist/module/data-model/input-wrapper.js.map +1 -1
  132. package/dist/module/data-model/types.js +1 -5
  133. package/dist/module/data-model/types.js.map +1 -1
  134. package/dist/module/form/form-configuration.js +1 -6
  135. package/dist/module/form/form-configuration.js.map +1 -1
  136. package/dist/module/form/index.js +1 -10
  137. package/dist/module/form/index.js.map +1 -1
  138. package/dist/module/index.js +8 -91
  139. package/dist/module/index.js.map +1 -1
  140. package/dist/module/migration/index.js +1 -10
  141. package/dist/module/migration/index.js.map +1 -1
  142. package/dist/module/migration/migration.0-2.js +1 -5
  143. package/dist/module/migration/migration.0-2.js.map +1 -1
  144. package/dist/module/migration/migration.1-2.js +3 -6
  145. package/dist/module/migration/migration.1-2.js.map +1 -1
  146. package/dist/module/migration/types.js +1 -1
  147. package/dist/module/migration/whichMigrations.js +5 -9
  148. package/dist/module/migration/whichMigrations.js.map +1 -1
  149. package/dist/module/schema/index.js +1 -16
  150. package/dist/module/schema/index.js.map +1 -1
  151. package/dist/module/schema/schema.js +163 -167
  152. package/dist/module/schema/schema.js.map +1 -1
  153. package/dist/module/utils/helpers.js +5 -13
  154. package/dist/module/utils/helpers.js.map +1 -1
  155. package/dist/module/utils/logger.js +1 -6
  156. package/dist/module/utils/logger.js.map +1 -1
  157. package/dist/types/components/component-types.d.ts +1 -1
  158. package/dist/types/components/component-types.d.ts.map +1 -1
  159. package/dist/types/components/conditional-component-types.d.ts +1 -1
  160. package/dist/types/components/conditional-component-types.d.ts.map +1 -1
  161. package/dist/types/components/index.d.ts +3 -3
  162. package/dist/types/components/index.d.ts.map +1 -1
  163. package/dist/types/conditions/condition-abstract.d.ts +1 -1
  164. package/dist/types/conditions/condition-abstract.d.ts.map +1 -1
  165. package/dist/types/conditions/condition-field.d.ts +1 -1
  166. package/dist/types/conditions/condition-field.d.ts.map +1 -1
  167. package/dist/types/conditions/condition-group-def.d.ts +2 -2
  168. package/dist/types/conditions/condition-group-def.d.ts.map +1 -1
  169. package/dist/types/conditions/condition-group.d.ts +2 -2
  170. package/dist/types/conditions/condition-group.d.ts.map +1 -1
  171. package/dist/types/conditions/condition-model.d.ts +5 -5
  172. package/dist/types/conditions/condition-model.d.ts.map +1 -1
  173. package/dist/types/conditions/condition-operators.d.ts +2 -2
  174. package/dist/types/conditions/condition-operators.d.ts.map +1 -1
  175. package/dist/types/conditions/condition-ref.d.ts +2 -2
  176. package/dist/types/conditions/condition-ref.d.ts.map +1 -1
  177. package/dist/types/conditions/condition-value-abstract.d.ts +1 -1
  178. package/dist/types/conditions/condition-value-abstract.d.ts.map +1 -1
  179. package/dist/types/conditions/condition-values.d.ts +3 -3
  180. package/dist/types/conditions/condition-values.d.ts.map +1 -1
  181. package/dist/types/conditions/condition.d.ts +4 -4
  182. package/dist/types/conditions/condition.d.ts.map +1 -1
  183. package/dist/types/conditions/index.d.ts +10 -10
  184. package/dist/types/conditions/index.d.ts.map +1 -1
  185. package/dist/types/conditions/types.d.ts +3 -3
  186. package/dist/types/conditions/types.d.ts.map +1 -1
  187. package/dist/types/data-model/conditions-wrapper.d.ts +1 -1
  188. package/dist/types/data-model/conditions-wrapper.d.ts.map +1 -1
  189. package/dist/types/data-model/index.d.ts +3 -3
  190. package/dist/types/data-model/index.d.ts.map +1 -1
  191. package/dist/types/data-model/input-wrapper.d.ts +2 -2
  192. package/dist/types/data-model/input-wrapper.d.ts.map +1 -1
  193. package/dist/types/data-model/types.d.ts +3 -3
  194. package/dist/types/data-model/types.d.ts.map +1 -1
  195. package/dist/types/form/index.d.ts +1 -1
  196. package/dist/types/form/index.d.ts.map +1 -1
  197. package/dist/types/index.d.ts +11 -11
  198. package/dist/types/index.d.ts.map +1 -1
  199. package/dist/types/migration/index.d.ts +1 -1
  200. package/dist/types/migration/index.d.ts.map +1 -1
  201. package/dist/types/migration/migration.0-2.d.ts +1 -1
  202. package/dist/types/migration/migration.0-2.d.ts.map +1 -1
  203. package/dist/types/migration/migration.1-2.d.ts +1 -1
  204. package/dist/types/migration/migration.1-2.d.ts.map +1 -1
  205. package/dist/types/migration/whichMigrations.d.ts +1 -1
  206. package/dist/types/migration/whichMigrations.d.ts.map +1 -1
  207. package/dist/types/schema/index.d.ts +1 -1
  208. package/dist/types/schema/index.d.ts.map +1 -1
  209. package/package.json +2 -1
  210. package/src/components/component-types.ts +1 -1
  211. package/src/components/conditional-component-types.ts +1 -1
  212. package/src/components/index.ts +3 -3
  213. package/src/conditions/condition-abstract.ts +1 -1
  214. package/src/conditions/condition-field.ts +2 -2
  215. package/src/conditions/condition-group-def.ts +1 -1
  216. package/src/conditions/condition-group.ts +3 -3
  217. package/src/conditions/condition-model.ts +9 -9
  218. package/src/conditions/condition-operators.ts +6 -3
  219. package/src/conditions/condition-ref.ts +2 -2
  220. package/src/conditions/condition-value-abstract.ts +1 -1
  221. package/src/conditions/condition-values.ts +3 -3
  222. package/src/conditions/condition.ts +6 -6
  223. package/src/conditions/index.ts +10 -10
  224. package/src/conditions/inline-condition-model.ts +3 -3
  225. package/src/conditions/inline-condition-operators.ts +1 -1
  226. package/src/conditions/types.ts +3 -3
  227. package/src/data-model/conditions-wrapper.ts +2 -2
  228. package/src/data-model/index.ts +3 -3
  229. package/src/data-model/input-wrapper.ts +3 -3
  230. package/src/data-model/types.ts +3 -3
  231. package/src/form/index.ts +1 -1
  232. package/src/index.ts +11 -11
  233. package/src/migration/index.ts +1 -1
  234. package/src/migration/migration.0-2.ts +1 -1
  235. package/src/migration/migration.1-2.ts +2 -2
  236. package/src/migration/whichMigrations.ts +3 -3
  237. package/src/schema/index.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"input-wrapper.js","names":["InputWrapper","constructor","rawData","page","options","_defineProperty","undefined","_classPrivateFieldInitSpec","_parentItemName","Object","assign","myPage","clone","components","propertyPath","ignoreSection","section","name","_classPrivateFieldSet","parentItemName","displayName","titleWithContext","_classPrivateFieldGet","title","_exports"],"sources":["../../../src/data-model/input-wrapper.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types'\nimport { type Page } from '~/src/data-model/types'\nimport { clone } from '~/src/utils/helpers'\n\nexport class InputWrapper {\n name: string | undefined = undefined\n title: string | undefined = undefined\n type: string | undefined = undefined\n propertyPath: string | undefined\n #parentItemName: string | undefined\n page: Page\n\n constructor(\n rawData: ComponentDef,\n page: Page,\n options: { ignoreSection?: boolean; parentItemName?: string }\n ) {\n Object.assign(this, rawData)\n const myPage = clone(page)\n\n delete myPage.components\n\n this.page = myPage\n this.propertyPath =\n !options.ignoreSection && page.section\n ? `${page.section}.${this.name}`\n : this.name\n this.#parentItemName = options.parentItemName\n }\n\n get displayName(): string | undefined {\n const titleWithContext = this.#parentItemName\n ? `${this.title} under ${this.#parentItemName}`\n : this.title\n\n return this.page.section\n ? `${titleWithContext} in ${this.page.section}`\n : titleWithContext\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAIO,MAAMA,YAAY,CAAC;IAQxBC,WAAWA,CACTC,OAAqB,EACrBC,IAAU,EACVC,OAA6D,EAC7D;MAAAC,eAAA,eAXyBC,SAAS;MAAAD,eAAA,gBACRC,SAAS;MAAAD,eAAA,eACVC,SAAS;MAAAD,eAAA;MAAAE,0BAAA,OAAAC,eAAA;MAAAH,eAAA;MAUlCI,MAAM,CAACC,MAAM,CAAC,IAAI,EAAER,OAAO,CAAC;MAC5B,MAAMS,MAAM,GAAG,IAAAC,cAAK,EAACT,IAAI,CAAC;MAE1B,OAAOQ,MAAM,CAACE,UAAU;MAExB,IAAI,CAACV,IAAI,GAAGQ,MAAM;MAClB,IAAI,CAACG,YAAY,GACf,CAACV,OAAO,CAACW,aAAa,IAAIZ,IAAI,CAACa,OAAO,GACjC,GAAEb,IAAI,CAACa,OAAQ,IAAG,IAAI,CAACC,IAAK,EAAC,GAC9B,IAAI,CAACA,IAAI;MACfC,qBAAA,CAAAV,eAAA,MAAI,EAAmBJ,OAAO,CAACe,cAAc;IAC/C;IAEA,IAAIC,WAAWA,CAAA,EAAuB;MACpC,MAAMC,gBAAgB,GAAGC,qBAAA,CAAAd,eAAA,MAAI,IACxB,GAAE,IAAI,CAACe,KAAM,UAAOD,qBAAA,CAAAd,eAAA,EAAE,IAAI,CAAiB,EAAC,GAC7C,IAAI,CAACe,KAAK;MAEd,OAAO,IAAI,CAACpB,IAAI,CAACa,OAAO,GACnB,GAAEK,gBAAiB,OAAM,IAAI,CAAClB,IAAI,CAACa,OAAQ,EAAC,GAC7CK,gBAAgB;IACtB;EACF;EAACG,QAAA,CAAAxB,YAAA,GAAAA,YAAA;AAAA"}
1
+ {"version":3,"file":"input-wrapper.js","names":["clone","_parentItemName","WeakMap","InputWrapper","constructor","rawData","page","options","_defineProperty","undefined","_classPrivateFieldInitSpec","Object","assign","myPage","components","propertyPath","ignoreSection","section","name","_classPrivateFieldSet","parentItemName","displayName","titleWithContext","_classPrivateFieldGet","title"],"sources":["../../../src/data-model/input-wrapper.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport { type Page } from '~/src/data-model/types.js'\nimport { clone } from '~/src/utils/helpers.js'\n\nexport class InputWrapper {\n name: string | undefined = undefined\n title: string | undefined = undefined\n type: string | undefined = undefined\n propertyPath: string | undefined\n #parentItemName: string | undefined\n page: Page\n\n constructor(\n rawData: ComponentDef,\n page: Page,\n options: { ignoreSection?: boolean; parentItemName?: string }\n ) {\n Object.assign(this, rawData)\n const myPage = clone(page)\n\n delete myPage.components\n\n this.page = myPage\n this.propertyPath =\n !options.ignoreSection && page.section\n ? `${page.section}.${this.name}`\n : this.name\n this.#parentItemName = options.parentItemName\n }\n\n get displayName(): string | undefined {\n const titleWithContext = this.#parentItemName\n ? `${this.title} under ${this.#parentItemName}`\n : this.title\n\n return this.page.section\n ? `${titleWithContext} in ${this.page.section}`\n : titleWithContext\n }\n}\n"],"mappings":";;;;;;;;AAEA,SAASA,KAAK;AAAgC,IAAAC,eAAA,oBAAAC,OAAA;AAE9C,OAAO,MAAMC,YAAY,CAAC;EAQxBC,WAAWA,CACTC,OAAqB,EACrBC,IAAU,EACVC,OAA6D,EAC7D;IAAAC,eAAA,eAXyBC,SAAS;IAAAD,eAAA,gBACRC,SAAS;IAAAD,eAAA,eACVC,SAAS;IAAAD,eAAA;IAAAE,0BAAA,OAAAT,eAAA;IAAAO,eAAA;IAUlCG,MAAM,CAACC,MAAM,CAAC,IAAI,EAAEP,OAAO,CAAC;IAC5B,MAAMQ,MAAM,GAAGb,KAAK,CAACM,IAAI,CAAC;IAE1B,OAAOO,MAAM,CAACC,UAAU;IAExB,IAAI,CAACR,IAAI,GAAGO,MAAM;IAClB,IAAI,CAACE,YAAY,GACf,CAACR,OAAO,CAACS,aAAa,IAAIV,IAAI,CAACW,OAAO,GACjC,GAAEX,IAAI,CAACW,OAAQ,IAAG,IAAI,CAACC,IAAK,EAAC,GAC9B,IAAI,CAACA,IAAI;IACfC,qBAAA,CAAAlB,eAAA,MAAI,EAAmBM,OAAO,CAACa,cAAc;EAC/C;EAEA,IAAIC,WAAWA,CAAA,EAAuB;IACpC,MAAMC,gBAAgB,GAAGC,qBAAA,CAAAtB,eAAA,MAAI,IACxB,GAAE,IAAI,CAACuB,KAAM,UAAOD,qBAAA,CAAAtB,eAAA,EAAE,IAAI,CAAiB,EAAC,GAC7C,IAAI,CAACuB,KAAK;IAEd,OAAO,IAAI,CAAClB,IAAI,CAACW,OAAO,GACnB,GAAEK,gBAAiB,OAAM,IAAI,CAAChB,IAAI,CAACW,OAAQ,EAAC,GAC7CK,gBAAgB;EACtB;AACF"}
@@ -1,27 +1,9 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define(["exports"], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory(exports);
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory(mod.exports);
11
- global.types = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
14
- "use strict";
1
+ export function isMultipleApiKey(payApiKey) {
2
+ const obj = payApiKey;
3
+ return obj.test !== undefined || obj.production !== undefined;
4
+ }
15
5
 
16
- _exports.__esModule = true;
17
- _exports.isMultipleApiKey = isMultipleApiKey;
18
- function isMultipleApiKey(payApiKey) {
19
- const obj = payApiKey;
20
- return obj.test !== undefined || obj.production !== undefined;
21
- }
22
-
23
- /**
24
- * `FormDefinition` is a typescript representation of `Schema`
25
- */
26
- });
6
+ /**
7
+ * `FormDefinition` is a typescript representation of `Schema`
8
+ */
27
9
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["isMultipleApiKey","payApiKey","obj","test","undefined","production"],"sources":["../../../src/data-model/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types'\nimport { type Condition } from '~/src/conditions/condition'\nimport { type OutputType } from '~/src/data-model/enums'\n\ntype Toggleable<T> = boolean | T\n\nexport interface Next {\n path: string\n condition?: string\n}\nexport type Link = Next\n\nexport interface Page {\n title: string\n path: string\n controller: string\n components?: ComponentDef[]\n section: string // the section ID\n next?: { path: string; condition?: string }[]\n}\n\nexport interface RepeatingFieldPage extends Page {\n controller: 'RepeatingFieldPageController'\n options: {\n summaryDisplayMode?: {\n samePage?: boolean\n separatePage?: boolean\n hideRowTitles?: boolean\n }\n customText?: {\n separatePageTitle?: string\n }\n }\n}\n\nexport interface Section {\n name: string\n title: string\n hideTitle: boolean\n}\n\nexport interface Item {\n text: string\n value: string | number | boolean\n description?: string\n condition?: string\n}\n\nexport interface List {\n name: string\n title: string\n type: 'string' | 'number' | 'boolean'\n items: Item[]\n}\n\nexport interface Feedback {\n feedbackForm?: boolean\n url?: string\n emailAddress?: string\n}\n\nexport type PhaseBanner = {\n phase?: 'alpha' | 'beta'\n feedbackUrl?: string\n}\n\nexport type MultipleApiKeys = {\n test?: string\n production?: string\n}\n\nexport type EmailOutputConfiguration = {\n emailAddress: string\n}\n\nexport type NotifyOutputConfiguration = {\n apiKey: string\n templateId: string\n emailField: string\n personalisation: string[]\n personalisationFieldCustomisation?: {\n [personalisationName: string]: string[]\n }\n addReferencesToPersonalisation?: boolean\n emailReplyToIdConfiguration?: {\n emailReplyToId: string\n condition?: string | undefined\n }[]\n}\n\nexport type WebhookOutputConfiguration = {\n url: string\n}\n\nexport type OutputConfiguration =\n | EmailOutputConfiguration\n | NotifyOutputConfiguration\n | WebhookOutputConfiguration\n\nexport type Output = {\n name: string\n title: string\n type: OutputType\n outputConfiguration: OutputConfiguration\n}\n\nexport type ConfirmationPage = {\n customText: {\n title: string\n paymentSkipped: Toggleable<string>\n nextSteps: Toggleable<string>\n }\n components: ComponentDef[]\n}\n\nexport type PaymentSkippedWarningPage = {\n customText: {\n title: string\n caption: string\n body: string\n }\n}\n\nexport type SpecialPages = {\n confirmationPage?: ConfirmationPage\n paymentSkippedWarningPage?: PaymentSkippedWarningPage\n}\n\nexport function isMultipleApiKey(\n payApiKey: string | MultipleApiKeys | undefined\n): payApiKey is MultipleApiKeys {\n const obj = payApiKey as MultipleApiKeys\n return obj.test !== undefined || obj.production !== undefined\n}\n\nexport type Fee = {\n description: string\n amount: number\n multiplier?: string\n condition?: string\n prefix?: string\n}\n\nexport type FeeOptions = {\n paymentReferenceFormat?: string\n payReturnUrl?: string\n allowSubmissionWithoutPayment: boolean\n maxAttempts: number\n customPayErrorMessage?: string\n showPaymentSkippedWarningPage: boolean\n}\n\nexport type ConditionWrapperValue =\n | string\n | {\n name: string\n conditions: Condition[]\n }\n\nexport type ConditionRawData = {\n name: string\n displayName: string\n value: ConditionWrapperValue\n}\n\n/**\n * `FormDefinition` is a typescript representation of `Schema`\n */\nexport type FormDefinition = {\n pages: Array<Page | RepeatingFieldPage>\n conditions: ConditionRawData[]\n lists: List[]\n sections: Section[]\n startPage?: Page['path'] | undefined\n name?: string | undefined\n feedback?: Feedback\n phaseBanner?: PhaseBanner\n fees: Fee[]\n skipSummary?: boolean | undefined\n outputs: Output[]\n declaration?: string | undefined\n metadata?: Record<string, any>\n payApiKey?: string | MultipleApiKeys | undefined\n specialPages?: SpecialPages\n paymentReferenceFormat?: string\n feeOptions: FeeOptions\n}\n"],"mappings":";;;;;;;;;;;;;;;;;EAgIO,SAASA,gBAAgBA,CAC9BC,SAA+C,EACjB;IAC9B,MAAMC,GAAG,GAAGD,SAA4B;IACxC,OAAOC,GAAG,CAACC,IAAI,KAAKC,SAAS,IAAIF,GAAG,CAACG,UAAU,KAAKD,SAAS;EAC/D;;EAgCA;AACA;AACA;AAFA"}
1
+ {"version":3,"file":"types.js","names":["isMultipleApiKey","payApiKey","obj","test","undefined","production"],"sources":["../../../src/data-model/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport { type Condition } from '~/src/conditions/condition.js'\nimport { type OutputType } from '~/src/data-model/enums.js'\n\ntype Toggleable<T> = boolean | T\n\nexport interface Next {\n path: string\n condition?: string\n}\nexport type Link = Next\n\nexport interface Page {\n title: string\n path: string\n controller: string\n components?: ComponentDef[]\n section: string // the section ID\n next?: { path: string; condition?: string }[]\n}\n\nexport interface RepeatingFieldPage extends Page {\n controller: 'RepeatingFieldPageController'\n options: {\n summaryDisplayMode?: {\n samePage?: boolean\n separatePage?: boolean\n hideRowTitles?: boolean\n }\n customText?: {\n separatePageTitle?: string\n }\n }\n}\n\nexport interface Section {\n name: string\n title: string\n hideTitle: boolean\n}\n\nexport interface Item {\n text: string\n value: string | number | boolean\n description?: string\n condition?: string\n}\n\nexport interface List {\n name: string\n title: string\n type: 'string' | 'number' | 'boolean'\n items: Item[]\n}\n\nexport interface Feedback {\n feedbackForm?: boolean\n url?: string\n emailAddress?: string\n}\n\nexport type PhaseBanner = {\n phase?: 'alpha' | 'beta'\n feedbackUrl?: string\n}\n\nexport type MultipleApiKeys = {\n test?: string\n production?: string\n}\n\nexport type EmailOutputConfiguration = {\n emailAddress: string\n}\n\nexport type NotifyOutputConfiguration = {\n apiKey: string\n templateId: string\n emailField: string\n personalisation: string[]\n personalisationFieldCustomisation?: {\n [personalisationName: string]: string[]\n }\n addReferencesToPersonalisation?: boolean\n emailReplyToIdConfiguration?: {\n emailReplyToId: string\n condition?: string | undefined\n }[]\n}\n\nexport type WebhookOutputConfiguration = {\n url: string\n}\n\nexport type OutputConfiguration =\n | EmailOutputConfiguration\n | NotifyOutputConfiguration\n | WebhookOutputConfiguration\n\nexport type Output = {\n name: string\n title: string\n type: OutputType\n outputConfiguration: OutputConfiguration\n}\n\nexport type ConfirmationPage = {\n customText: {\n title: string\n paymentSkipped: Toggleable<string>\n nextSteps: Toggleable<string>\n }\n components: ComponentDef[]\n}\n\nexport type PaymentSkippedWarningPage = {\n customText: {\n title: string\n caption: string\n body: string\n }\n}\n\nexport type SpecialPages = {\n confirmationPage?: ConfirmationPage\n paymentSkippedWarningPage?: PaymentSkippedWarningPage\n}\n\nexport function isMultipleApiKey(\n payApiKey: string | MultipleApiKeys | undefined\n): payApiKey is MultipleApiKeys {\n const obj = payApiKey as MultipleApiKeys\n return obj.test !== undefined || obj.production !== undefined\n}\n\nexport type Fee = {\n description: string\n amount: number\n multiplier?: string\n condition?: string\n prefix?: string\n}\n\nexport type FeeOptions = {\n paymentReferenceFormat?: string\n payReturnUrl?: string\n allowSubmissionWithoutPayment: boolean\n maxAttempts: number\n customPayErrorMessage?: string\n showPaymentSkippedWarningPage: boolean\n}\n\nexport type ConditionWrapperValue =\n | string\n | {\n name: string\n conditions: Condition[]\n }\n\nexport type ConditionRawData = {\n name: string\n displayName: string\n value: ConditionWrapperValue\n}\n\n/**\n * `FormDefinition` is a typescript representation of `Schema`\n */\nexport type FormDefinition = {\n pages: Array<Page | RepeatingFieldPage>\n conditions: ConditionRawData[]\n lists: List[]\n sections: Section[]\n startPage?: Page['path'] | undefined\n name?: string | undefined\n feedback?: Feedback\n phaseBanner?: PhaseBanner\n fees: Fee[]\n skipSummary?: boolean | undefined\n outputs: Output[]\n declaration?: string | undefined\n metadata?: Record<string, any>\n payApiKey?: string | MultipleApiKeys | undefined\n specialPages?: SpecialPages\n paymentReferenceFormat?: string\n feeOptions: FeeOptions\n}\n"],"mappings":"AAgIA,OAAO,SAASA,gBAAgBA,CAC9BC,SAA+C,EACjB;EAC9B,MAAMC,GAAG,GAAGD,SAA4B;EACxC,OAAOC,GAAG,CAACC,IAAI,KAAKC,SAAS,IAAIF,GAAG,CAACG,UAAU,KAAKD,SAAS;AAC/D;;AAgCA;AACA;AACA"}
@@ -1,38 +1,19 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define(["exports"], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory(exports);
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory(mod.exports);
11
- global.formConfiguration = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
14
- "use strict";
15
-
16
- _exports.__esModule = true;
17
- _exports.FormConfiguration = void 0;
18
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
20
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
21
- class FormConfiguration {
22
- constructor(Key, DisplayName, LastModified, feedbackForm) {
23
- _defineProperty(this, "Key", void 0);
24
- _defineProperty(this, "DisplayName", void 0);
25
- _defineProperty(this, "LastModified", void 0);
26
- _defineProperty(this, "feedbackForm", void 0);
27
- if (!Key) {
28
- throw Error('Form configuration must have a key');
29
- }
30
- this.Key = Key;
31
- this.DisplayName = DisplayName || Key;
32
- this.LastModified = LastModified;
33
- this.feedbackForm = feedbackForm || false;
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
+ export class FormConfiguration {
5
+ constructor(Key, DisplayName, LastModified, feedbackForm) {
6
+ _defineProperty(this, "Key", void 0);
7
+ _defineProperty(this, "DisplayName", void 0);
8
+ _defineProperty(this, "LastModified", void 0);
9
+ _defineProperty(this, "feedbackForm", void 0);
10
+ if (!Key) {
11
+ throw Error('Form configuration must have a key');
34
12
  }
13
+ this.Key = Key;
14
+ this.DisplayName = DisplayName || Key;
15
+ this.LastModified = LastModified;
16
+ this.feedbackForm = feedbackForm || false;
35
17
  }
36
- _exports.FormConfiguration = FormConfiguration;
37
- });
18
+ }
38
19
  //# sourceMappingURL=form-configuration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-configuration.js","names":["FormConfiguration","constructor","Key","DisplayName","LastModified","feedbackForm","_defineProperty","Error","_exports"],"sources":["../../../src/form/form-configuration.ts"],"sourcesContent":["export class FormConfiguration {\n Key: string\n DisplayName: string\n LastModified: string | undefined\n feedbackForm: boolean | undefined\n\n constructor(\n Key: string,\n DisplayName?: string,\n LastModified?: string,\n feedbackForm?: boolean\n ) {\n if (!Key) {\n throw Error('Form configuration must have a key')\n }\n this.Key = Key\n this.DisplayName = DisplayName || Key\n this.LastModified = LastModified\n this.feedbackForm = feedbackForm || false\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,iBAAiB,CAAC;IAM7BC,WAAWA,CACTC,GAAW,EACXC,WAAoB,EACpBC,YAAqB,EACrBC,YAAsB,EACtB;MAAAC,eAAA;MAAAA,eAAA;MAAAA,eAAA;MAAAA,eAAA;MACA,IAAI,CAACJ,GAAG,EAAE;QACR,MAAMK,KAAK,CAAC,oCAAoC,CAAC;MACnD;MACA,IAAI,CAACL,GAAG,GAAGA,GAAG;MACd,IAAI,CAACC,WAAW,GAAGA,WAAW,IAAID,GAAG;MACrC,IAAI,CAACE,YAAY,GAAGA,YAAY;MAChC,IAAI,CAACC,YAAY,GAAGA,YAAY,IAAI,KAAK;IAC3C;EACF;EAACG,QAAA,CAAAR,iBAAA,GAAAA,iBAAA;AAAA"}
1
+ {"version":3,"file":"form-configuration.js","names":["FormConfiguration","constructor","Key","DisplayName","LastModified","feedbackForm","_defineProperty","Error"],"sources":["../../../src/form/form-configuration.ts"],"sourcesContent":["export class FormConfiguration {\n Key: string\n DisplayName: string\n LastModified: string | undefined\n feedbackForm: boolean | undefined\n\n constructor(\n Key: string,\n DisplayName?: string,\n LastModified?: string,\n feedbackForm?: boolean\n ) {\n if (!Key) {\n throw Error('Form configuration must have a key')\n }\n this.Key = Key\n this.DisplayName = DisplayName || Key\n this.LastModified = LastModified\n this.feedbackForm = feedbackForm || false\n }\n}\n"],"mappings":";;;AAAA,OAAO,MAAMA,iBAAiB,CAAC;EAM7BC,WAAWA,CACTC,GAAW,EACXC,WAAoB,EACpBC,YAAqB,EACrBC,YAAsB,EACtB;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACA,IAAI,CAACJ,GAAG,EAAE;MACR,MAAMK,KAAK,CAAC,oCAAoC,CAAC;IACnD;IACA,IAAI,CAACL,GAAG,GAAGA,GAAG;IACd,IAAI,CAACC,WAAW,GAAGA,WAAW,IAAID,GAAG;IACrC,IAAI,CAACE,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACC,YAAY,GAAGA,YAAY,IAAI,KAAK;EAC3C;AACF"}
@@ -1,24 +1,2 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define(["exports", "./form-configuration"], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory(exports, require("./form-configuration"));
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory(mod.exports, global.formConfiguration);
11
- global.index = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _formConfiguration) {
14
- "use strict";
15
-
16
- _exports.__esModule = true;
17
- Object.defineProperty(_exports, "FormConfiguration", {
18
- enumerable: true,
19
- get: function () {
20
- return _formConfiguration.FormConfiguration;
21
- }
22
- });
23
- });
1
+ export { FormConfiguration } from "./form-configuration.js";
24
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/form/index.ts"],"sourcesContent":["export { FormConfiguration } from '~/src/form/form-configuration'\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":["FormConfiguration"],"sources":["../../../src/form/index.ts"],"sourcesContent":["export { FormConfiguration } from '~/src/form/form-configuration.js'\n"],"mappings":"AAAA,SAASA,iBAAiB"}
@@ -1,98 +1,9 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define(["exports", "./schema", "./data-model", "./utils/logger", "./form", "./components", "./conditions", "./utils/helpers", "./migration"], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory(exports, require("./schema"), require("./data-model"), require("./utils/logger"), require("./form"), require("./components"), require("./conditions"), require("./utils/helpers"), require("./migration"));
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory(mod.exports, global.schema, global.dataModel, global.logger, global.form, global.components, global.conditions, global.helpers, global.migration);
11
- global.index = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _schema, _dataModel, _logger, _form, _components, _conditions, _helpers, _migration) {
14
- "use strict";
15
-
16
- _exports.__esModule = true;
17
- Object.keys(_schema).forEach(function (key) {
18
- if (key === "default" || key === "__esModule") return;
19
- if (key in _exports && _exports[key] === _schema[key]) return;
20
- Object.defineProperty(_exports, key, {
21
- enumerable: true,
22
- get: function () {
23
- return _schema[key];
24
- }
25
- });
26
- });
27
- Object.keys(_dataModel).forEach(function (key) {
28
- if (key === "default" || key === "__esModule") return;
29
- if (key in _exports && _exports[key] === _dataModel[key]) return;
30
- Object.defineProperty(_exports, key, {
31
- enumerable: true,
32
- get: function () {
33
- return _dataModel[key];
34
- }
35
- });
36
- });
37
- Object.keys(_logger).forEach(function (key) {
38
- if (key === "default" || key === "__esModule") return;
39
- if (key in _exports && _exports[key] === _logger[key]) return;
40
- Object.defineProperty(_exports, key, {
41
- enumerable: true,
42
- get: function () {
43
- return _logger[key];
44
- }
45
- });
46
- });
47
- Object.keys(_form).forEach(function (key) {
48
- if (key === "default" || key === "__esModule") return;
49
- if (key in _exports && _exports[key] === _form[key]) return;
50
- Object.defineProperty(_exports, key, {
51
- enumerable: true,
52
- get: function () {
53
- return _form[key];
54
- }
55
- });
56
- });
57
- Object.keys(_components).forEach(function (key) {
58
- if (key === "default" || key === "__esModule") return;
59
- if (key in _exports && _exports[key] === _components[key]) return;
60
- Object.defineProperty(_exports, key, {
61
- enumerable: true,
62
- get: function () {
63
- return _components[key];
64
- }
65
- });
66
- });
67
- Object.keys(_conditions).forEach(function (key) {
68
- if (key === "default" || key === "__esModule") return;
69
- if (key in _exports && _exports[key] === _conditions[key]) return;
70
- Object.defineProperty(_exports, key, {
71
- enumerable: true,
72
- get: function () {
73
- return _conditions[key];
74
- }
75
- });
76
- });
77
- Object.keys(_helpers).forEach(function (key) {
78
- if (key === "default" || key === "__esModule") return;
79
- if (key in _exports && _exports[key] === _helpers[key]) return;
80
- Object.defineProperty(_exports, key, {
81
- enumerable: true,
82
- get: function () {
83
- return _helpers[key];
84
- }
85
- });
86
- });
87
- Object.keys(_migration).forEach(function (key) {
88
- if (key === "default" || key === "__esModule") return;
89
- if (key in _exports && _exports[key] === _migration[key]) return;
90
- Object.defineProperty(_exports, key, {
91
- enumerable: true,
92
- get: function () {
93
- return _migration[key];
94
- }
95
- });
96
- });
97
- });
1
+ export * from "./schema/index.js";
2
+ export * from "./data-model/index.js";
3
+ export * from "./utils/logger.js";
4
+ export * from "./form/index.js";
5
+ export * from "./components/index.js";
6
+ export * from "./conditions/index.js";
7
+ export * from "./utils/helpers.js";
8
+ export * from "./migration/index.js";
98
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Object","keys","_schema","forEach","key","_exports","defineProperty","enumerable","get","_dataModel","_logger","_form","_components","_conditions","_helpers","_migration"],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/schema'\nexport * from '~/src/data-model'\nexport * from '~/src/utils/logger'\nexport * from '~/src/form'\nexport * from '~/src/components'\nexport * from '~/src/conditions'\nexport * from '~/src/utils/helpers'\nexport * from '~/src/migration'\nexport type * from '~/src/components/types'\nexport type * from '~/src/conditions/types'\nexport type * from '~/src/data-model/types'\n"],"mappings":";;;;;;;;;;;;;;;;EAAAA,MAAA,CAAAC,IAAA,CAAAC,OAAA,EAAAC,OAAA,WAAAC,GAAA;IAAA,IAAAA,GAAA,kBAAAA,GAAA;IAAA,IAAAA,GAAA,IAAAC,QAAA,IAAAA,QAAA,CAAAD,GAAA,MAAAF,OAAA,CAAAE,GAAA;IAAAJ,MAAA,CAAAM,cAAA,CAAAD,QAAA,EAAAD,GAAA;MAAAG,UAAA;MAAAC,GAAA,WAAAA,CAAA;QAAA,OAAAN,OAAA,CAAAE,GAAA;MAAA;IAAA;EAAA;EACAJ,MAAA,CAAAC,IAAA,CAAAQ,UAAA,EAAAN,OAAA,WAAAC,GAAA;IAAA,IAAAA,GAAA,kBAAAA,GAAA;IAAA,IAAAA,GAAA,IAAAC,QAAA,IAAAA,QAAA,CAAAD,GAAA,MAAAK,UAAA,CAAAL,GAAA;IAAAJ,MAAA,CAAAM,cAAA,CAAAD,QAAA,EAAAD,GAAA;MAAAG,UAAA;MAAAC,GAAA,WAAAA,CAAA;QAAA,OAAAC,UAAA,CAAAL,GAAA;MAAA;IAAA;EAAA;EACAJ,MAAA,CAAAC,IAAA,CAAAS,OAAA,EAAAP,OAAA,WAAAC,GAAA;IAAA,IAAAA,GAAA,kBAAAA,GAAA;IAAA,IAAAA,GAAA,IAAAC,QAAA,IAAAA,QAAA,CAAAD,GAAA,MAAAM,OAAA,CAAAN,GAAA;IAAAJ,MAAA,CAAAM,cAAA,CAAAD,QAAA,EAAAD,GAAA;MAAAG,UAAA;MAAAC,GAAA,WAAAA,CAAA;QAAA,OAAAE,OAAA,CAAAN,GAAA;MAAA;IAAA;EAAA;EACAJ,MAAA,CAAAC,IAAA,CAAAU,KAAA,EAAAR,OAAA,WAAAC,GAAA;IAAA,IAAAA,GAAA,kBAAAA,GAAA;IAAA,IAAAA,GAAA,IAAAC,QAAA,IAAAA,QAAA,CAAAD,GAAA,MAAAO,KAAA,CAAAP,GAAA;IAAAJ,MAAA,CAAAM,cAAA,CAAAD,QAAA,EAAAD,GAAA;MAAAG,UAAA;MAAAC,GAAA,WAAAA,CAAA;QAAA,OAAAG,KAAA,CAAAP,GAAA;MAAA;IAAA;EAAA;EACAJ,MAAA,CAAAC,IAAA,CAAAW,WAAA,EAAAT,OAAA,WAAAC,GAAA;IAAA,IAAAA,GAAA,kBAAAA,GAAA;IAAA,IAAAA,GAAA,IAAAC,QAAA,IAAAA,QAAA,CAAAD,GAAA,MAAAQ,WAAA,CAAAR,GAAA;IAAAJ,MAAA,CAAAM,cAAA,CAAAD,QAAA,EAAAD,GAAA;MAAAG,UAAA;MAAAC,GAAA,WAAAA,CAAA;QAAA,OAAAI,WAAA,CAAAR,GAAA;MAAA;IAAA;EAAA;EACAJ,MAAA,CAAAC,IAAA,CAAAY,WAAA,EAAAV,OAAA,WAAAC,GAAA;IAAA,IAAAA,GAAA,kBAAAA,GAAA;IAAA,IAAAA,GAAA,IAAAC,QAAA,IAAAA,QAAA,CAAAD,GAAA,MAAAS,WAAA,CAAAT,GAAA;IAAAJ,MAAA,CAAAM,cAAA,CAAAD,QAAA,EAAAD,GAAA;MAAAG,UAAA;MAAAC,GAAA,WAAAA,CAAA;QAAA,OAAAK,WAAA,CAAAT,GAAA;MAAA;IAAA;EAAA;EACAJ,MAAA,CAAAC,IAAA,CAAAa,QAAA,EAAAX,OAAA,WAAAC,GAAA;IAAA,IAAAA,GAAA,kBAAAA,GAAA;IAAA,IAAAA,GAAA,IAAAC,QAAA,IAAAA,QAAA,CAAAD,GAAA,MAAAU,QAAA,CAAAV,GAAA;IAAAJ,MAAA,CAAAM,cAAA,CAAAD,QAAA,EAAAD,GAAA;MAAAG,UAAA;MAAAC,GAAA,WAAAA,CAAA;QAAA,OAAAM,QAAA,CAAAV,GAAA;MAAA;IAAA;EAAA;EACAJ,MAAA,CAAAC,IAAA,CAAAc,UAAA,EAAAZ,OAAA,WAAAC,GAAA;IAAA,IAAAA,GAAA,kBAAAA,GAAA;IAAA,IAAAA,GAAA,IAAAC,QAAA,IAAAA,QAAA,CAAAD,GAAA,MAAAW,UAAA,CAAAX,GAAA;IAAAJ,MAAA,CAAAM,cAAA,CAAAD,QAAA,EAAAD,GAAA;MAAAG,UAAA;MAAAC,GAAA,WAAAA,CAAA;QAAA,OAAAO,UAAA,CAAAX,GAAA;MAAA;IAAA;EAAA;AAA+B"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/schema/index.js'\nexport * from '~/src/data-model/index.js'\nexport * from '~/src/utils/logger.js'\nexport * from '~/src/form/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/migration/index.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/data-model/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
@@ -1,24 +1,2 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define(["exports", "./whichMigrations"], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory(exports, require("./whichMigrations"));
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory(mod.exports, global.whichMigrations);
11
- global.index = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _whichMigrations) {
14
- "use strict";
15
-
16
- _exports.__esModule = true;
17
- Object.defineProperty(_exports, "whichMigrations", {
18
- enumerable: true,
19
- get: function () {
20
- return _whichMigrations.whichMigrations;
21
- }
22
- });
23
- });
1
+ export { whichMigrations } from "./whichMigrations.js";
24
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/migration/index.ts"],"sourcesContent":["export { whichMigrations } from '~/src/migration/whichMigrations'\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":["whichMigrations"],"sources":["../../../src/migration/index.ts"],"sourcesContent":["export { whichMigrations } from '~/src/migration/whichMigrations.js'\n"],"mappings":"AAAA,SAASA,eAAe"}
@@ -1,65 +1,47 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define(["exports"], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory(exports);
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory(mod.exports);
11
- global.migration02 = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
14
- "use strict";
15
-
16
- _exports.__esModule = true;
17
- _exports.migrate = migrate;
18
- const _excluded = ["list"];
19
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
20
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
21
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
23
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
25
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
26
- function needsUpgrade(data) {
27
- var _data$pages;
28
- return !!((_data$pages = data.pages) !== null && _data$pages !== void 0 ? _data$pages : []).flatMap(page => page.components).find(component => {
29
- var _component$options;
30
- return (_component$options = component.options) === null || _component$options === void 0 ? void 0 : _component$options.list;
31
- });
32
- }
33
- function migrate(data) {
34
- if (!needsUpgrade(data)) {
35
- return _objectSpread(_objectSpread({}, data), {}, {
36
- version: 2
37
- });
38
- }
39
- const {
40
- pages
41
- } = data;
42
- const newPages = pages.flatMap(page => {
43
- return page.components.map(component => {
44
- var _component$options2;
45
- if (!((_component$options2 = component.options) !== null && _component$options2 !== void 0 && _component$options2.list)) {
46
- return component;
47
- }
48
- const _component$options3 = component.options,
49
- {
50
- list
51
- } = _component$options3,
52
- rest = _objectWithoutProperties(_component$options3, _excluded);
53
- return _objectSpread(_objectSpread({}, component), {}, {
54
- list,
55
- options: _objectSpread({}, rest)
56
- });
57
- });
58
- });
1
+ const _excluded = ["list"];
2
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
3
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
8
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
+ function needsUpgrade(data) {
10
+ var _data$pages;
11
+ return !!((_data$pages = data.pages) !== null && _data$pages !== void 0 ? _data$pages : []).flatMap(page => page.components).find(component => {
12
+ var _component$options;
13
+ return (_component$options = component.options) === null || _component$options === void 0 ? void 0 : _component$options.list;
14
+ });
15
+ }
16
+ export function migrate(data) {
17
+ if (!needsUpgrade(data)) {
59
18
  return _objectSpread(_objectSpread({}, data), {}, {
60
- pages: newPages,
61
19
  version: 2
62
20
  });
63
21
  }
64
- });
22
+ const {
23
+ pages
24
+ } = data;
25
+ const newPages = pages.flatMap(page => {
26
+ return page.components.map(component => {
27
+ var _component$options2;
28
+ if (!((_component$options2 = component.options) !== null && _component$options2 !== void 0 && _component$options2.list)) {
29
+ return component;
30
+ }
31
+ const _component$options3 = component.options,
32
+ {
33
+ list
34
+ } = _component$options3,
35
+ rest = _objectWithoutProperties(_component$options3, _excluded);
36
+ return _objectSpread(_objectSpread({}, component), {}, {
37
+ list,
38
+ options: _objectSpread({}, rest)
39
+ });
40
+ });
41
+ });
42
+ return _objectSpread(_objectSpread({}, data), {}, {
43
+ pages: newPages,
44
+ version: 2
45
+ });
46
+ }
65
47
  //# sourceMappingURL=migration.0-2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration.0-2.js","names":["needsUpgrade","data","_data$pages","pages","flatMap","page","components","find","component","_component$options","options","list","migrate","_objectSpread","version","newPages","map","_component$options2","_component$options3","rest","_objectWithoutProperties","_excluded"],"sources":["../../../src/migration/migration.0-2.ts"],"sourcesContent":["import { type MigrationScript } from '~/src/migration/types'\n\nfunction needsUpgrade(data) {\n return !!(data.pages ?? [])\n .flatMap((page) => page.components)\n .find((component) => component.options?.list)\n}\n\nexport function migrate(data): MigrationScript {\n if (!needsUpgrade(data)) {\n return { ...data, version: 2 }\n }\n const { pages } = data\n const newPages = pages.flatMap((page) => {\n return page.components.map((component) => {\n if (!component.options?.list) {\n return component\n }\n const { list, ...rest } = component.options\n return { ...component, list, options: { ...rest } }\n })\n })\n\n return {\n ...data,\n pages: newPages,\n version: 2\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAEA,SAASA,YAAYA,CAACC,IAAI,EAAE;IAAA,IAAAC,WAAA;IAC1B,OAAO,CAAC,CAAC,EAAAA,WAAA,GAACD,IAAI,CAACE,KAAK,cAAAD,WAAA,cAAAA,WAAA,GAAI,EAAE,EACvBE,OAAO,CAAEC,IAAI,IAAKA,IAAI,CAACC,UAAU,CAAC,CAClCC,IAAI,CAAEC,SAAS;MAAA,IAAAC,kBAAA;MAAA,QAAAA,kBAAA,GAAKD,SAAS,CAACE,OAAO,cAAAD,kBAAA,uBAAjBA,kBAAA,CAAmBE,IAAI;IAAA,EAAC;EACjD;EAEO,SAASC,OAAOA,CAACX,IAAI,EAAmB;IAC7C,IAAI,CAACD,YAAY,CAACC,IAAI,CAAC,EAAE;MACvB,OAAAY,aAAA,CAAAA,aAAA,KAAYZ,IAAI;QAAEa,OAAO,EAAE;MAAC;IAC9B;IACA,MAAM;MAAEX;IAAM,CAAC,GAAGF,IAAI;IACtB,MAAMc,QAAQ,GAAGZ,KAAK,CAACC,OAAO,CAAEC,IAAI,IAAK;MACvC,OAAOA,IAAI,CAACC,UAAU,CAACU,GAAG,CAAER,SAAS,IAAK;QAAA,IAAAS,mBAAA;QACxC,IAAI,GAAAA,mBAAA,GAACT,SAAS,CAACE,OAAO,cAAAO,mBAAA,eAAjBA,mBAAA,CAAmBN,IAAI,GAAE;UAC5B,OAAOH,SAAS;QAClB;QACA,MAAAU,mBAAA,GAA0BV,SAAS,CAACE,OAAO;UAArC;YAAEC;UAAc,CAAC,GAAAO,mBAAA;UAANC,IAAI,GAAAC,wBAAA,CAAAF,mBAAA,EAAAG,SAAA;QACrB,OAAAR,aAAA,CAAAA,aAAA,KAAYL,SAAS;UAAEG,IAAI;UAAED,OAAO,EAAAG,aAAA,KAAOM,IAAI;QAAE;MACnD,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAAN,aAAA,CAAAA,aAAA,KACKZ,IAAI;MACPE,KAAK,EAAEY,QAAQ;MACfD,OAAO,EAAE;IAAC;EAEd;AAAC"}
1
+ {"version":3,"file":"migration.0-2.js","names":["needsUpgrade","data","_data$pages","pages","flatMap","page","components","find","component","_component$options","options","list","migrate","_objectSpread","version","newPages","map","_component$options2","_component$options3","rest","_objectWithoutProperties","_excluded"],"sources":["../../../src/migration/migration.0-2.ts"],"sourcesContent":["import { type MigrationScript } from '~/src/migration/types.js'\n\nfunction needsUpgrade(data) {\n return !!(data.pages ?? [])\n .flatMap((page) => page.components)\n .find((component) => component.options?.list)\n}\n\nexport function migrate(data): MigrationScript {\n if (!needsUpgrade(data)) {\n return { ...data, version: 2 }\n }\n const { pages } = data\n const newPages = pages.flatMap((page) => {\n return page.components.map((component) => {\n if (!component.options?.list) {\n return component\n }\n const { list, ...rest } = component.options\n return { ...component, list, options: { ...rest } }\n })\n })\n\n return {\n ...data,\n pages: newPages,\n version: 2\n }\n}\n"],"mappings":";;;;;;;;AAEA,SAASA,YAAYA,CAACC,IAAI,EAAE;EAAA,IAAAC,WAAA;EAC1B,OAAO,CAAC,CAAC,EAAAA,WAAA,GAACD,IAAI,CAACE,KAAK,cAAAD,WAAA,cAAAA,WAAA,GAAI,EAAE,EACvBE,OAAO,CAAEC,IAAI,IAAKA,IAAI,CAACC,UAAU,CAAC,CAClCC,IAAI,CAAEC,SAAS;IAAA,IAAAC,kBAAA;IAAA,QAAAA,kBAAA,GAAKD,SAAS,CAACE,OAAO,cAAAD,kBAAA,uBAAjBA,kBAAA,CAAmBE,IAAI;EAAA,EAAC;AACjD;AAEA,OAAO,SAASC,OAAOA,CAACX,IAAI,EAAmB;EAC7C,IAAI,CAACD,YAAY,CAACC,IAAI,CAAC,EAAE;IACvB,OAAAY,aAAA,CAAAA,aAAA,KAAYZ,IAAI;MAAEa,OAAO,EAAE;IAAC;EAC9B;EACA,MAAM;IAAEX;EAAM,CAAC,GAAGF,IAAI;EACtB,MAAMc,QAAQ,GAAGZ,KAAK,CAACC,OAAO,CAAEC,IAAI,IAAK;IACvC,OAAOA,IAAI,CAACC,UAAU,CAACU,GAAG,CAAER,SAAS,IAAK;MAAA,IAAAS,mBAAA;MACxC,IAAI,GAAAA,mBAAA,GAACT,SAAS,CAACE,OAAO,cAAAO,mBAAA,eAAjBA,mBAAA,CAAmBN,IAAI,GAAE;QAC5B,OAAOH,SAAS;MAClB;MACA,MAAAU,mBAAA,GAA0BV,SAAS,CAACE,OAAO;QAArC;UAAEC;QAAc,CAAC,GAAAO,mBAAA;QAANC,IAAI,GAAAC,wBAAA,CAAAF,mBAAA,EAAAG,SAAA;MACrB,OAAAR,aAAA,CAAAA,aAAA,KAAYL,SAAS;QAAEG,IAAI;QAAED,OAAO,EAAAG,aAAA,KAAOM,IAAI;MAAE;IACnD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAAN,aAAA,CAAAA,aAAA,KACKZ,IAAI;IACPE,KAAK,EAAEY,QAAQ;IACfD,OAAO,EAAE;EAAC;AAEd"}