@defra/forms-model 3.0.7 → 3.0.9

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 (280) hide show
  1. package/dist/browser/components/component-types.js.map +1 -1
  2. package/dist/browser/components/conditional-component-types.js.map +1 -1
  3. package/dist/browser/components/index.js.map +1 -1
  4. package/dist/browser/conditions/condition-abstract.js.map +1 -1
  5. package/dist/browser/conditions/condition-field.js.map +1 -1
  6. package/dist/browser/conditions/condition-group-def.js.map +1 -1
  7. package/dist/browser/conditions/condition-group.js.map +1 -1
  8. package/dist/browser/conditions/condition-model.js.map +1 -1
  9. package/dist/browser/conditions/condition-operators.js.map +1 -1
  10. package/dist/browser/conditions/condition-ref.js.map +1 -1
  11. package/dist/browser/conditions/condition-value-abstract.js.map +1 -1
  12. package/dist/browser/conditions/condition-values.js.map +1 -1
  13. package/dist/browser/conditions/condition.js.map +1 -1
  14. package/dist/browser/conditions/index.js.map +1 -1
  15. package/dist/browser/conditions/inline-condition-model.js.map +1 -1
  16. package/dist/browser/conditions/inline-condition-operators.js.map +1 -1
  17. package/dist/browser/conditions/types.js.map +1 -1
  18. package/dist/browser/data-model/conditions-wrapper.js.map +1 -1
  19. package/dist/browser/data-model/index.js +4 -40
  20. package/dist/browser/data-model/index.js.map +1 -1
  21. package/dist/browser/data-model/input-wrapper.js.map +1 -1
  22. package/dist/browser/data-model/types.js.map +1 -1
  23. package/dist/browser/form/index.js.map +1 -1
  24. package/dist/browser/index.js +45 -70
  25. package/dist/browser/index.js.map +1 -1
  26. package/dist/browser/migration/index.js.map +1 -1
  27. package/dist/browser/migration/migration.0-2.js.map +1 -1
  28. package/dist/browser/migration/migration.1-2.js.map +1 -1
  29. package/dist/browser/migration/whichMigrations.js.map +1 -1
  30. package/dist/browser/schema/index.js.map +1 -1
  31. package/dist/module/components/component-types.js.map +1 -1
  32. package/dist/module/components/conditional-component-types.js.map +1 -1
  33. package/dist/module/components/index.js.map +1 -1
  34. package/dist/module/conditions/condition-abstract.js.map +1 -1
  35. package/dist/module/conditions/condition-field.js.map +1 -1
  36. package/dist/module/conditions/condition-group-def.js.map +1 -1
  37. package/dist/module/conditions/condition-group.js.map +1 -1
  38. package/dist/module/conditions/condition-model.js.map +1 -1
  39. package/dist/module/conditions/condition-operators.js.map +1 -1
  40. package/dist/module/conditions/condition-ref.js.map +1 -1
  41. package/dist/module/conditions/condition-value-abstract.js.map +1 -1
  42. package/dist/module/conditions/condition-values.js.map +1 -1
  43. package/dist/module/conditions/condition.js.map +1 -1
  44. package/dist/module/conditions/index.js.map +1 -1
  45. package/dist/module/conditions/inline-condition-model.js.map +1 -1
  46. package/dist/module/conditions/inline-condition-operators.js.map +1 -1
  47. package/dist/module/conditions/types.js.map +1 -1
  48. package/dist/module/data-model/conditions-wrapper.js.map +1 -1
  49. package/dist/module/data-model/index.js +0 -37
  50. package/dist/module/data-model/index.js.map +1 -1
  51. package/dist/module/data-model/input-wrapper.js.map +1 -1
  52. package/dist/module/data-model/types.js.map +1 -1
  53. package/dist/module/form/index.js.map +1 -1
  54. package/dist/module/index.js +50 -75
  55. package/dist/module/index.js.map +1 -1
  56. package/dist/module/migration/index.js.map +1 -1
  57. package/dist/module/migration/migration.0-2.js.map +1 -1
  58. package/dist/module/migration/migration.1-2.js.map +1 -1
  59. package/dist/module/migration/whichMigrations.js.map +1 -1
  60. package/dist/module/schema/index.js.map +1 -1
  61. package/dist/types/components/component-types.d.ts +3 -0
  62. package/dist/{module → types}/components/component-types.d.ts.map +1 -1
  63. package/dist/types/components/conditional-component-types.d.ts +3 -0
  64. package/dist/types/components/conditional-component-types.d.ts.map +1 -0
  65. package/dist/types/components/index.d.ts +4 -0
  66. package/dist/types/components/index.d.ts.map +1 -0
  67. package/dist/{browser → types}/conditions/condition-abstract.d.ts +1 -1
  68. package/dist/types/conditions/condition-abstract.d.ts.map +1 -0
  69. package/dist/{browser → types}/conditions/condition-field.d.ts +1 -1
  70. package/dist/types/conditions/condition-field.d.ts.map +1 -0
  71. package/dist/{module → types}/conditions/condition-group-def.d.ts +1 -1
  72. package/dist/types/conditions/condition-group-def.d.ts.map +1 -0
  73. package/dist/{browser → types}/conditions/condition-group.d.ts +2 -2
  74. package/dist/types/conditions/condition-group.d.ts.map +1 -0
  75. package/dist/{module → types}/conditions/condition-model.d.ts +5 -5
  76. package/dist/types/conditions/condition-model.d.ts.map +1 -0
  77. package/dist/{module → types}/conditions/condition-operators.d.ts +2 -2
  78. package/dist/types/conditions/condition-operators.d.ts.map +1 -0
  79. package/dist/{module → types}/conditions/condition-ref.d.ts +2 -2
  80. package/dist/types/conditions/condition-ref.d.ts.map +1 -0
  81. package/dist/{module → types}/conditions/condition-value-abstract.d.ts +1 -1
  82. package/dist/types/conditions/condition-value-abstract.d.ts.map +1 -0
  83. package/dist/{module → types}/conditions/condition-values.d.ts +3 -3
  84. package/dist/types/conditions/condition-values.d.ts.map +1 -0
  85. package/dist/{module → types}/conditions/condition.d.ts +4 -4
  86. package/dist/types/conditions/condition.d.ts.map +1 -0
  87. package/dist/types/conditions/index.d.ts +11 -0
  88. package/dist/types/conditions/index.d.ts.map +1 -0
  89. package/dist/{browser → types}/conditions/inline-condition-model.d.ts.map +1 -1
  90. package/dist/{module → types}/conditions/types.d.ts +3 -3
  91. package/dist/types/conditions/types.d.ts.map +1 -0
  92. package/dist/types/data-model/conditions-wrapper.d.ts +10 -0
  93. package/dist/types/data-model/conditions-wrapper.d.ts.map +1 -0
  94. package/dist/types/data-model/index.d.ts +4 -0
  95. package/dist/types/data-model/index.d.ts.map +1 -0
  96. package/dist/{browser → types}/data-model/input-wrapper.d.ts +2 -2
  97. package/dist/types/data-model/input-wrapper.d.ts.map +1 -0
  98. package/dist/{module → types}/data-model/types.d.ts +12 -3
  99. package/dist/types/data-model/types.d.ts.map +1 -0
  100. package/dist/types/form/index.d.ts +2 -0
  101. package/dist/{module → types}/form/index.d.ts.map +1 -1
  102. package/dist/types/index.d.ts +12 -0
  103. package/dist/types/index.d.ts.map +1 -0
  104. package/dist/types/migration/index.d.ts +2 -0
  105. package/dist/{browser → types}/migration/index.d.ts.map +1 -1
  106. package/dist/types/migration/migration.0-2.d.ts +3 -0
  107. package/dist/{browser → types}/migration/migration.0-2.d.ts.map +1 -1
  108. package/dist/types/migration/migration.1-2.d.ts +3 -0
  109. package/dist/{browser → types}/migration/migration.1-2.d.ts.map +1 -1
  110. package/dist/{browser → types}/migration/whichMigrations.d.ts +1 -1
  111. package/dist/{browser → types}/migration/whichMigrations.d.ts.map +1 -1
  112. package/dist/types/schema/index.d.ts +2 -0
  113. package/dist/{module → types}/schema/index.d.ts.map +1 -1
  114. package/package.json +3 -5
  115. package/src/components/component-types.ts +1 -1
  116. package/src/components/conditional-component-types.ts +1 -1
  117. package/src/components/index.ts +3 -4
  118. package/src/conditions/condition-abstract.ts +1 -1
  119. package/src/conditions/condition-field.ts +2 -1
  120. package/src/conditions/condition-group-def.ts +1 -1
  121. package/src/conditions/condition-group.ts +3 -3
  122. package/src/conditions/condition-model.ts +9 -9
  123. package/src/conditions/condition-operators.ts +3 -4
  124. package/src/conditions/condition-ref.ts +2 -2
  125. package/src/conditions/condition-value-abstract.ts +1 -1
  126. package/src/conditions/condition-values.ts +7 -3
  127. package/src/conditions/condition.ts +9 -6
  128. package/src/conditions/index.ts +10 -10
  129. package/src/conditions/inline-condition-model.ts +6 -3
  130. package/src/conditions/inline-condition-operators.ts +1 -1
  131. package/src/conditions/types.ts +3 -3
  132. package/src/data-model/conditions-wrapper.ts +5 -15
  133. package/src/data-model/index.ts +3 -4
  134. package/src/data-model/input-wrapper.ts +3 -3
  135. package/src/data-model/types.ts +16 -3
  136. package/src/form/index.ts +1 -1
  137. package/src/index.ts +11 -14
  138. package/src/migration/index.ts +1 -1
  139. package/src/migration/migration.0-2.ts +1 -1
  140. package/src/migration/migration.1-2.ts +2 -2
  141. package/src/migration/whichMigrations.ts +3 -3
  142. package/src/schema/index.ts +1 -1
  143. package/dist/browser/components/component-types.d.ts +0 -3
  144. package/dist/browser/components/component-types.d.ts.map +0 -1
  145. package/dist/browser/components/conditional-component-types.d.ts +0 -3
  146. package/dist/browser/components/conditional-component-types.d.ts.map +0 -1
  147. package/dist/browser/components/index.d.ts +0 -5
  148. package/dist/browser/components/index.d.ts.map +0 -1
  149. package/dist/browser/conditions/condition-abstract.d.ts.map +0 -1
  150. package/dist/browser/conditions/condition-field.d.ts.map +0 -1
  151. package/dist/browser/conditions/condition-group-def.d.ts +0 -10
  152. package/dist/browser/conditions/condition-group-def.d.ts.map +0 -1
  153. package/dist/browser/conditions/condition-group.d.ts.map +0 -1
  154. package/dist/browser/conditions/condition-model.d.ts +0 -41
  155. package/dist/browser/conditions/condition-model.d.ts.map +0 -1
  156. package/dist/browser/conditions/condition-operators.d.ts +0 -248
  157. package/dist/browser/conditions/condition-operators.d.ts.map +0 -1
  158. package/dist/browser/conditions/condition-ref.d.ts +0 -12
  159. package/dist/browser/conditions/condition-ref.d.ts.map +0 -1
  160. package/dist/browser/conditions/condition-value-abstract.d.ts +0 -8
  161. package/dist/browser/conditions/condition-value-abstract.d.ts.map +0 -1
  162. package/dist/browser/conditions/condition-values.d.ts +0 -38
  163. package/dist/browser/conditions/condition-values.d.ts.map +0 -1
  164. package/dist/browser/conditions/condition.d.ts +0 -15
  165. package/dist/browser/conditions/condition.d.ts.map +0 -1
  166. package/dist/browser/conditions/index.d.ts +0 -11
  167. package/dist/browser/conditions/index.d.ts.map +0 -1
  168. package/dist/browser/conditions/types.d.ts +0 -34
  169. package/dist/browser/conditions/types.d.ts.map +0 -1
  170. package/dist/browser/data-model/conditions-wrapper.d.ts +0 -19
  171. package/dist/browser/data-model/conditions-wrapper.d.ts.map +0 -1
  172. package/dist/browser/data-model/index.d.ts +0 -5
  173. package/dist/browser/data-model/index.d.ts.map +0 -1
  174. package/dist/browser/data-model/input-wrapper.d.ts.map +0 -1
  175. package/dist/browser/data-model/types.d.ts +0 -149
  176. package/dist/browser/data-model/types.d.ts.map +0 -1
  177. package/dist/browser/form/index.d.ts +0 -2
  178. package/dist/browser/form/index.d.ts.map +0 -1
  179. package/dist/browser/index.d.ts +0 -11
  180. package/dist/browser/index.d.ts.map +0 -1
  181. package/dist/browser/migration/index.d.ts +0 -2
  182. package/dist/browser/migration/migration.0-2.d.ts +0 -3
  183. package/dist/browser/migration/migration.1-2.d.ts +0 -3
  184. package/dist/browser/schema/index.d.ts +0 -2
  185. package/dist/browser/schema/index.d.ts.map +0 -1
  186. package/dist/module/components/component-types.d.ts +0 -3
  187. package/dist/module/components/conditional-component-types.d.ts +0 -3
  188. package/dist/module/components/conditional-component-types.d.ts.map +0 -1
  189. package/dist/module/components/enums.d.ts +0 -27
  190. package/dist/module/components/enums.d.ts.map +0 -1
  191. package/dist/module/components/index.d.ts +0 -5
  192. package/dist/module/components/index.d.ts.map +0 -1
  193. package/dist/module/components/types.d.ts +0 -215
  194. package/dist/module/components/types.d.ts.map +0 -1
  195. package/dist/module/conditions/condition-abstract.d.ts +0 -16
  196. package/dist/module/conditions/condition-abstract.d.ts.map +0 -1
  197. package/dist/module/conditions/condition-field.d.ts +0 -13
  198. package/dist/module/conditions/condition-field.d.ts.map +0 -1
  199. package/dist/module/conditions/condition-group-def.d.ts.map +0 -1
  200. package/dist/module/conditions/condition-group.d.ts +0 -16
  201. package/dist/module/conditions/condition-group.d.ts.map +0 -1
  202. package/dist/module/conditions/condition-model.d.ts.map +0 -1
  203. package/dist/module/conditions/condition-operators.d.ts.map +0 -1
  204. package/dist/module/conditions/condition-ref.d.ts.map +0 -1
  205. package/dist/module/conditions/condition-value-abstract.d.ts.map +0 -1
  206. package/dist/module/conditions/condition-value-registration.d.ts +0 -10
  207. package/dist/module/conditions/condition-value-registration.d.ts.map +0 -1
  208. package/dist/module/conditions/condition-values.d.ts.map +0 -1
  209. package/dist/module/conditions/condition.d.ts.map +0 -1
  210. package/dist/module/conditions/enums.d.ts +0 -5
  211. package/dist/module/conditions/enums.d.ts.map +0 -1
  212. package/dist/module/conditions/helpers.d.ts +0 -3
  213. package/dist/module/conditions/helpers.d.ts.map +0 -1
  214. package/dist/module/conditions/index.d.ts +0 -11
  215. package/dist/module/conditions/index.d.ts.map +0 -1
  216. package/dist/module/conditions/inline-condition-model.d.ts +0 -86
  217. package/dist/module/conditions/inline-condition-model.d.ts.map +0 -1
  218. package/dist/module/conditions/inline-condition-operators.d.ts +0 -175
  219. package/dist/module/conditions/inline-condition-operators.d.ts.map +0 -1
  220. package/dist/module/conditions/inline-condition-values.d.ts +0 -93
  221. package/dist/module/conditions/inline-condition-values.d.ts.map +0 -1
  222. package/dist/module/conditions/types.d.ts.map +0 -1
  223. package/dist/module/data-model/conditions-wrapper.d.ts +0 -19
  224. package/dist/module/data-model/conditions-wrapper.d.ts.map +0 -1
  225. package/dist/module/data-model/enums.d.ts +0 -6
  226. package/dist/module/data-model/enums.d.ts.map +0 -1
  227. package/dist/module/data-model/index.d.ts +0 -5
  228. package/dist/module/data-model/index.d.ts.map +0 -1
  229. package/dist/module/data-model/input-wrapper.d.ts +0 -16
  230. package/dist/module/data-model/input-wrapper.d.ts.map +0 -1
  231. package/dist/module/data-model/types.d.ts.map +0 -1
  232. package/dist/module/form/form-configuration.d.ts +0 -8
  233. package/dist/module/form/form-configuration.d.ts.map +0 -1
  234. package/dist/module/form/index.d.ts +0 -2
  235. package/dist/module/index.d.ts +0 -11
  236. package/dist/module/index.d.ts.map +0 -1
  237. package/dist/module/migration/index.d.ts +0 -2
  238. package/dist/module/migration/index.d.ts.map +0 -1
  239. package/dist/module/migration/migration.0-2.d.ts +0 -3
  240. package/dist/module/migration/migration.0-2.d.ts.map +0 -1
  241. package/dist/module/migration/migration.1-2.d.ts +0 -3
  242. package/dist/module/migration/migration.1-2.d.ts.map +0 -1
  243. package/dist/module/migration/types.d.ts +0 -2
  244. package/dist/module/migration/types.d.ts.map +0 -1
  245. package/dist/module/migration/whichMigrations.d.ts +0 -7
  246. package/dist/module/migration/whichMigrations.d.ts.map +0 -1
  247. package/dist/module/schema/index.d.ts +0 -2
  248. package/dist/module/schema/schema.d.ts +0 -20
  249. package/dist/module/schema/schema.d.ts.map +0 -1
  250. package/dist/module/utils/helpers.d.ts +0 -9
  251. package/dist/module/utils/helpers.d.ts.map +0 -1
  252. package/dist/module/utils/logger.d.ts +0 -11
  253. package/dist/module/utils/logger.d.ts.map +0 -1
  254. /package/dist/{browser → types}/components/enums.d.ts +0 -0
  255. /package/dist/{browser → types}/components/enums.d.ts.map +0 -0
  256. /package/dist/{browser → types}/components/types.d.ts +0 -0
  257. /package/dist/{browser → types}/components/types.d.ts.map +0 -0
  258. /package/dist/{browser → types}/conditions/condition-value-registration.d.ts +0 -0
  259. /package/dist/{browser → types}/conditions/condition-value-registration.d.ts.map +0 -0
  260. /package/dist/{browser → types}/conditions/enums.d.ts +0 -0
  261. /package/dist/{browser → types}/conditions/enums.d.ts.map +0 -0
  262. /package/dist/{browser → types}/conditions/helpers.d.ts +0 -0
  263. /package/dist/{browser → types}/conditions/helpers.d.ts.map +0 -0
  264. /package/dist/{browser → types}/conditions/inline-condition-model.d.ts +0 -0
  265. /package/dist/{browser → types}/conditions/inline-condition-operators.d.ts +0 -0
  266. /package/dist/{browser → types}/conditions/inline-condition-operators.d.ts.map +0 -0
  267. /package/dist/{browser → types}/conditions/inline-condition-values.d.ts +0 -0
  268. /package/dist/{browser → types}/conditions/inline-condition-values.d.ts.map +0 -0
  269. /package/dist/{browser → types}/data-model/enums.d.ts +0 -0
  270. /package/dist/{browser → types}/data-model/enums.d.ts.map +0 -0
  271. /package/dist/{browser → types}/form/form-configuration.d.ts +0 -0
  272. /package/dist/{browser → types}/form/form-configuration.d.ts.map +0 -0
  273. /package/dist/{browser → types}/migration/types.d.ts +0 -0
  274. /package/dist/{browser → types}/migration/types.d.ts.map +0 -0
  275. /package/dist/{browser → types}/schema/schema.d.ts +0 -0
  276. /package/dist/{browser → types}/schema/schema.d.ts.map +0 -0
  277. /package/dist/{browser → types}/utils/helpers.d.ts +0 -0
  278. /package/dist/{browser → types}/utils/helpers.d.ts.map +0 -0
  279. /package/dist/{browser → types}/utils/logger.d.ts +0 -0
  280. /package/dist/{browser → types}/utils/logger.d.ts.map +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"inline-condition-operators.js","names":["defaultOperators","is","inline","withDefaults","param","Object","assign","textBasedFieldCustomisations","lengthIs","absoluteDateTimeOperators","absoluteDateTime","relativeTimeOperators","units","relativeTime","customOperators","_exports","CheckboxesField","contains","reverseInline","not","NumberField","DateField","dateUnits","TimeField","timeUnits","DatePartsField","DateTimeField","dateTimeUnits","DateTimePartsField","TextField","MultilineTextField","EmailAddressField","getOperatorNames","fieldType","keys","getConditionals","sort","getExpression","fieldName","operator","value","expression","type","name","getOperatorConfig","field","formatValue","operatorDefinition","absoluteDateOrTimeOperatorNames","relativeDateOrTimeOperatorNames","ConditionValue","toExpression","Error","pastOperator","futureOperator","RelativeTimeValue","direction","dateDirections","PAST"],"sources":["../../../src/conditions/inline-condition-operators.ts"],"sourcesContent":["import {\n ConditionValue,\n dateDirections,\n dateTimeUnits,\n dateUnits,\n RelativeTimeValue,\n timeUnits\n} from './inline-condition-values'\n\nconst defaultOperators = {\n is: inline('=='),\n 'is not': inline('!=')\n}\n\nfunction withDefaults(param) {\n return Object.assign({}, param, defaultOperators)\n}\n\nconst textBasedFieldCustomisations = {\n 'is longer than': lengthIs('>'),\n 'is shorter than': lengthIs('<'),\n 'has length': lengthIs('==')\n}\n\nconst absoluteDateTimeOperators = {\n is: absoluteDateTime('=='),\n 'is not': absoluteDateTime('!='),\n 'is before': absoluteDateTime('<'),\n 'is after': absoluteDateTime('>')\n}\n\nconst relativeTimeOperators = (units) => ({\n 'is at least': relativeTime('<=', '>=', units),\n 'is at most': relativeTime('>=', '<=', units),\n 'is less than': relativeTime('>', '<', units),\n 'is more than': relativeTime('<', '>', units)\n})\n\nexport const customOperators = {\n CheckboxesField: {\n contains: reverseInline('in'),\n 'does not contain': not(reverseInline('in'))\n },\n NumberField: withDefaults({\n 'is at least': inline('>='),\n 'is at most': inline('<='),\n 'is less than': inline('<'),\n 'is more than': inline('>')\n }),\n DateField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateUnits)\n ),\n TimeField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(timeUnits)\n ),\n DatePartsField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateUnits)\n ),\n DateTimeField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateTimeUnits)\n ),\n DateTimePartsField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateTimeUnits)\n ),\n TextField: withDefaults(textBasedFieldCustomisations),\n MultilineTextField: withDefaults(textBasedFieldCustomisations),\n EmailAddressField: withDefaults(textBasedFieldCustomisations)\n}\n\nexport function getOperatorNames(fieldType) {\n return Object.keys(getConditionals(fieldType)).sort()\n}\n\nexport function getExpression(fieldType, fieldName, operator, value) {\n return getConditionals(fieldType)[operator].expression(\n { type: fieldType, name: fieldName },\n value\n )\n}\n\nexport function getOperatorConfig(fieldType, operator) {\n return getConditionals(fieldType)[operator]\n}\n\nfunction getConditionals(fieldType) {\n return customOperators[fieldType] || defaultOperators\n}\n\nfunction inline(operator) {\n return {\n expression: (field, value) =>\n `${field.name} ${operator} ${formatValue(field.type, value.value)}`\n }\n}\n\nfunction lengthIs(operator) {\n return {\n expression: (field, value) =>\n `length(${field.name}) ${operator} ${value.value}`\n }\n}\n\nfunction reverseInline(operator) {\n return {\n expression: (field, value) =>\n `${formatValue(field.type, value.value)} ${operator} ${field.name}`\n }\n}\n\nfunction not(operatorDefinition) {\n return {\n expression: (field, value) =>\n `not (${operatorDefinition.expression(field, value)})`\n }\n}\n\nfunction formatValue(fieldType, value) {\n if (fieldType === 'NumberField' || fieldType === 'YesNoField') {\n return value\n }\n return `'${value}'`\n}\n\nexport const absoluteDateOrTimeOperatorNames = Object.keys(\n absoluteDateTimeOperators\n)\nexport const relativeDateOrTimeOperatorNames = Object.keys(\n relativeTimeOperators(dateTimeUnits)\n)\n\nfunction absoluteDateTime(operator) {\n return {\n expression: (field, value) => {\n if (value instanceof ConditionValue) {\n return `${field.name} ${operator} '${value.toExpression()}'`\n }\n throw Error('only Value types are supported')\n }\n }\n}\n\nfunction relativeTime(pastOperator, futureOperator, units) {\n return {\n units,\n expression: (field, value) => {\n if (value instanceof RelativeTimeValue) {\n const operator =\n value.direction === dateDirections.PAST\n ? pastOperator\n : futureOperator\n return `${field.name} ${operator} ${value.toExpression()}`\n }\n throw Error('time shift requires a TimeShiftValue')\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EASA,MAAMA,gBAAgB,GAAG;IACvBC,EAAE,EAAEC,MAAM,CAAC,IAAI,CAAC;IAChB,QAAQ,EAAEA,MAAM,CAAC,IAAI;EACvB,CAAC;EAED,SAASC,YAAYA,CAACC,KAAK,EAAE;IAC3B,OAAOC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEF,KAAK,EAAEJ,gBAAgB,CAAC;EACnD;EAEA,MAAMO,4BAA4B,GAAG;IACnC,gBAAgB,EAAEC,QAAQ,CAAC,GAAG,CAAC;IAC/B,iBAAiB,EAAEA,QAAQ,CAAC,GAAG,CAAC;IAChC,YAAY,EAAEA,QAAQ,CAAC,IAAI;EAC7B,CAAC;EAED,MAAMC,yBAAyB,GAAG;IAChCR,EAAE,EAAES,gBAAgB,CAAC,IAAI,CAAC;IAC1B,QAAQ,EAAEA,gBAAgB,CAAC,IAAI,CAAC;IAChC,WAAW,EAAEA,gBAAgB,CAAC,GAAG,CAAC;IAClC,UAAU,EAAEA,gBAAgB,CAAC,GAAG;EAClC,CAAC;EAED,MAAMC,qBAAqB,GAAIC,KAAK,KAAM;IACxC,aAAa,EAAEC,YAAY,CAAC,IAAI,EAAE,IAAI,EAAED,KAAK,CAAC;IAC9C,YAAY,EAAEC,YAAY,CAAC,IAAI,EAAE,IAAI,EAAED,KAAK,CA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,GACZC,cAAc;UACpB,OAAQ,GAAET,KAAK,CAACF,IAAK,IAAGJ,QAAS,IAAGC,KAAK,CAACW,YAAY,CAAC,CAAE,EAAC;QAC5D;QACA,MAAMC,KAAK,CAAC,sCAAsC,CAAC;MACrD;IACF,CAAC;EACH;AAAC"}
1
+ {"version":3,"file":"inline-condition-operators.js","names":["defaultOperators","is","inline","withDefaults","param","Object","assign","textBasedFieldCustomisations","lengthIs","absoluteDateTimeOperators","absoluteDateTime","relativeTimeOperators","units","relativeTime","customOperators","_exports","CheckboxesField","contains","reverseInline","not","NumberField","DateField","dateUnits","TimeField","timeUnits","DatePartsField","DateTimeField","dateTimeUnits","DateTimePartsField","TextField","MultilineTextField","EmailAddressField","getOperatorNames","fieldType","keys","getConditionals","sort","getExpression","fieldName","operator","value","expression","type","name","getOperatorConfig","field","formatValue","operatorDefinition","absoluteDateOrTimeOperatorNames","relativeDateOrTimeOperatorNames","ConditionValue","toExpression","Error","pastOperator","futureOperator","RelativeTimeValue","direction","dateDirections","PAST"],"sources":["../../../src/conditions/inline-condition-operators.ts"],"sourcesContent":["import {\n ConditionValue,\n dateDirections,\n dateTimeUnits,\n dateUnits,\n RelativeTimeValue,\n timeUnits\n} from '~/src/conditions/inline-condition-values'\n\nconst defaultOperators = {\n is: inline('=='),\n 'is not': inline('!=')\n}\n\nfunction withDefaults(param) {\n return Object.assign({}, param, defaultOperators)\n}\n\nconst textBasedFieldCustomisations = {\n 'is longer than': lengthIs('>'),\n 'is shorter than': lengthIs('<'),\n 'has length': lengthIs('==')\n}\n\nconst absoluteDateTimeOperators = {\n is: absoluteDateTime('=='),\n 'is not': absoluteDateTime('!='),\n 'is before': absoluteDateTime('<'),\n 'is after': absoluteDateTime('>')\n}\n\nconst relativeTimeOperators = (units) => ({\n 'is at least': relativeTime('<=', '>=', units),\n 'is at most': relativeTime('>=', '<=', units),\n 'is less than': relativeTime('>', '<', units),\n 'is more than': relativeTime('<', '>', units)\n})\n\nexport const customOperators = {\n CheckboxesField: {\n contains: reverseInline('in'),\n 'does not contain': not(reverseInline('in'))\n },\n NumberField: withDefaults({\n 'is at least': inline('>='),\n 'is at most': inline('<='),\n 'is less than': inline('<'),\n 'is more than': inline('>')\n }),\n DateField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateUnits)\n ),\n TimeField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(timeUnits)\n ),\n DatePartsField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateUnits)\n ),\n DateTimeField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateTimeUnits)\n ),\n DateTimePartsField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateTimeUnits)\n ),\n TextField: withDefaults(textBasedFieldCustomisations),\n MultilineTextField: withDefaults(textBasedFieldCustomisations),\n EmailAddressField: withDefaults(textBasedFieldCustomisations)\n}\n\nexport function getOperatorNames(fieldType) {\n return Object.keys(getConditionals(fieldType)).sort()\n}\n\nexport function getExpression(fieldType, fieldName, operator, value) {\n return getConditionals(fieldType)[operator].expression(\n { type: fieldType, name: fieldName },\n value\n )\n}\n\nexport function getOperatorConfig(fieldType, operator) {\n return getConditionals(fieldType)[operator]\n}\n\nfunction getConditionals(fieldType) {\n return customOperators[fieldType] || defaultOperators\n}\n\nfunction inline(operator) {\n return {\n expression: (field, value) =>\n `${field.name} ${operator} ${formatValue(field.type, value.value)}`\n }\n}\n\nfunction lengthIs(operator) {\n return {\n expression: (field, value) =>\n `length(${field.name}) ${operator} ${value.value}`\n }\n}\n\nfunction reverseInline(operator) {\n return {\n expression: (field, value) =>\n `${formatValue(field.type, value.value)} ${operator} ${field.name}`\n }\n}\n\nfunction not(operatorDefinition) {\n return {\n expression: (field, value) =>\n `not (${operatorDefinition.expression(field, value)})`\n }\n}\n\nfunction formatValue(fieldType, value) {\n if (fieldType === 'NumberField' || fieldType === 'YesNoField') {\n return value\n }\n return `'${value}'`\n}\n\nexport const absoluteDateOrTimeOperatorNames = Object.keys(\n absoluteDateTimeOperators\n)\nexport const relativeDateOrTimeOperatorNames = Object.keys(\n relativeTimeOperators(dateTimeUnits)\n)\n\nfunction absoluteDateTime(operator) {\n return {\n expression: (field, value) => {\n if (value instanceof ConditionValue) {\n return `${field.name} ${operator} '${value.toExpression()}'`\n }\n throw Error('only Value types are supported')\n }\n }\n}\n\nfunction relativeTime(pastOperator, futureOperator, units) {\n return {\n units,\n expression: (field, value) => {\n if (value instanceof RelativeTimeValue) {\n const operator =\n value.direction === dateDirections.PAST\n ? pastOperator\n : futureOperator\n return `${field.name} ${operator} ${value.toExpression()}`\n }\n throw Error('time shift requires a TimeShiftValue')\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EASA,MAAMA,gBAAgB,GAAG;IACvBC,EAAE,EAAEC,MAAM,CAAC,IAAI,CAAC;IAChB,QAAQ,EAAEA,MAAM,CAAC,IAAI;EACvB,CAAC;EAED,SAASC,YAAYA,CAACC,KAAK,EAAE;IAC3B,OAAOC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEF,KAAK,EAAEJ,gBAAgB,CAAC;EACnD;EAEA,MAAMO,4BAA4B,GAAG;IACnC,gBAAgB,EAAEC,QAAQ,CAAC,GAAG,CAAC;IAC/B,iBAAiB,EAAEA,QAAQ,CAAC,GAAG,CAAC;IAChC,YAAY,EAAEA,QAAQ,CAAC,IAAI;EAC7B,CAAC;EAED,MAAMC,yBAAyB,GAAG;IAChCR,EAAE,EAAES,gBAAgB,CAAC,IAAI,CAAC;IAC1B,QAAQ,EAAEA,gBAAgB,CAAC,IAAI,CAAC;IAChC,WAAW,EAAEA,gBAAgB,CAAC,GAAG,CAAC;IAClC,UAAU,EAAEA,gBAAgB,CAAC,GAAG;EAClC,CAAC;EAED,MAAMC,qBAAqB,GAAIC,KAAK,KAAM;IACxC,aAAa,EAAEC,YAAY,CAAC,IAAI,EAAE,IAAI,EAAED,KAAK,CAA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Q,GACZC,KAAK,CAACgB,SAAS,KAAKC,qCAAc,CAACC,IAAI,GACnCL,YAAY,GACZC,cAAc;UACpB,OAAQ,GAAET,KAAK,CAACF,IAAK,IAAGJ,QAAS,IAAGC,KAAK,CAACW,YAAY,CAAC,CAAE,EAAC;QAC5D;QACA,MAAMC,KAAK,CAAC,sCAAsC,CAAC;MACrD;IACF,CAAC;EACH;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/conditions/types.ts"],"sourcesContent":["import { Condition } from './condition'\nimport { ConditionRef } from './condition-ref'\nimport { ConditionGroup } from './condition-group'\n\nexport type ConditionsArray = (Condition | ConditionGroup | ConditionRef)[]\n\nexport type DateTimeUnitValues =\n | 'years'\n | 'months'\n | 'days'\n | 'hours'\n | 'minutes'\n | 'seconds'\n\nexport type DateUnits = {\n YEARS: { display: 'year(s)'; value: 'years' }\n MONTHS: { display: 'month(s)'; value: 'months' }\n DAYS: { display: 'day(s)'; value: 'days' }\n}\n\nexport type TimeUnits = {\n HOURS: { display: 'hour(s)'; value: 'hours' }\n MINUTES: { display: 'minute(s)'; value: 'minutes' }\n SECONDS: { display: 'second(s)'; value: 'seconds' }\n}\n"],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/conditions/types.ts"],"sourcesContent":["import { type Condition } from '~/src/conditions/condition'\nimport { type ConditionRef } from '~/src/conditions/condition-ref'\nimport { type ConditionGroup } from '~/src/conditions/condition-group'\n\nexport type ConditionsArray = (Condition | ConditionGroup | ConditionRef)[]\n\nexport type DateTimeUnitValues =\n | 'years'\n | 'months'\n | 'days'\n | 'hours'\n | 'minutes'\n | 'seconds'\n\nexport type DateUnits = {\n YEARS: { display: 'year(s)'; value: 'years' }\n MONTHS: { display: 'month(s)'; value: 'months' }\n DAYS: { display: 'day(s)'; value: 'days' }\n}\n\nexport type TimeUnits = {\n HOURS: { display: 'hour(s)'; value: 'hours' }\n MINUTES: { display: 'minute(s)'; value: 'minutes' }\n SECONDS: { display: 'second(s)'; value: 'seconds' }\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"conditions-wrapper.js","names":["ConditionsWrapper","constructor","rawData","_defineProperty","name","displayName","value","expression","ConditionsModel","from","toExpression","clone","_exports"],"sources":["../../../src/data-model/conditions-wrapper.ts"],"sourcesContent":["import { Condition } from '../conditions/condition'\nimport { ConditionsModel } from '../conditions/condition-model'\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\nexport class ConditionsWrapper {\n name: string\n displayName: string\n value: ConditionWrapperValue\n\n constructor(rawData: ConditionRawData) {\n const { name, displayName, value } = rawData\n this.displayName = displayName || name\n this.value = value\n this.name = name\n }\n\n get expression() {\n if (typeof this.value === 'string') {\n // Previously conditions were defined as strings, e.g: \"section.age < 18\"\n // keep this so application can support legacy forms exports.\n return this.value\n }\n\n return ConditionsModel.from(this.value).toExpression()\n }\n\n clone(): ConditionsWrapper {\n return new ConditionsWrapper(this)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAgBO,MAAMA,iBAAiB,CAAC;IAK7BC,WAAWA,CAACC,OAAyB,EAAE;MAAAC,eAAA;MAAAA,eAAA;MAAAA,eAAA;MACrC,MAAM;QAAEC,IAAI;QAAEC,WAAW;QAAEC;MAAM,CAAC,GAAGJ,OAAO;MAC5C,IAAI,CAACG,WAAW,GAAGA,WAAW,IAAID,IAAI;MACtC,IAAI,CAACE,KAAK,GAAGA,KAAK;MAClB,IAAI,CAACF,IAAI,GAAGA,IAAI;IAClB;IAEA,IAAIG,UAAUA,CAAA,EAAG;MACf,IAAI,OAAO,IAAI,CAACD,KAAK,KAAK,QAAQ,EAAE;QAClC;QACA;QACA,OAAO,IAAI,CAACA,KAAK;MACnB;MAEA,OAAOE,+BAAe,CAACC,IAAI,CAAC,IAAI,CAACH,KAAK,CAAC,CAACI,YAAY,CAAC,CAAC;IACxD;IAEAC,KAAKA,CAAA,EAAsB;MACzB,OAAO,IAAIX,iBAAiB,CAAC,IAAI,CAAC;IACpC;EACF;EAACY,QAAA,CAAAZ,iBAAA,GAAAA,iBAAA;AAAA"}
1
+ {"version":3,"file":"conditions-wrapper.js","names":["ConditionsWrapper","constructor","rawData","_defineProperty","name","displayName","value","expression","ConditionsModel","from","toExpression","clone","_exports"],"sources":["../../../src/data-model/conditions-wrapper.ts"],"sourcesContent":["import { ConditionsModel } from '~/src/conditions/condition-model'\nimport {\n type ConditionRawData,\n type ConditionWrapperValue\n} from '~/src/data-model/types'\n\nexport class ConditionsWrapper {\n name: string\n displayName: string\n value: ConditionWrapperValue\n\n constructor(rawData: ConditionRawData) {\n const { name, displayName, value } = rawData\n this.displayName = displayName || name\n this.value = value\n this.name = name\n }\n\n get expression() {\n if (typeof this.value === 'string') {\n // Previously conditions were defined as strings, e.g: \"section.age < 18\"\n // keep this so application can support legacy forms exports.\n return this.value\n }\n\n return ConditionsModel.from(this.value).toExpression()\n }\n\n clone(): ConditionsWrapper {\n return new ConditionsWrapper(this)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAMO,MAAMA,iBAAiB,CAAC;IAK7BC,WAAWA,CAACC,OAAyB,EAAE;MAAAC,eAAA;MAAAA,eAAA;MAAAA,eAAA;MACrC,MAAM;QAAEC,IAAI;QAAEC,WAAW;QAAEC;MAAM,CAAC,GAAGJ,OAAO;MAC5C,IAAI,CAACG,WAAW,GAAGA,WAAW,IAAID,IAAI;MACtC,IAAI,CAACE,KAAK,GAAGA,KAAK;MAClB,IAAI,CAACF,IAAI,GAAGA,IAAI;IAClB;IAEA,IAAIG,UAAUA,CAAA,EAAG;MACf,IAAI,OAAO,IAAI,CAACD,KAAK,KAAK,QAAQ,EAAE;QAClC;QACA;QACA,OAAO,IAAI,CAACA,KAAK;MACnB;MAEA,OAAOE,+BAAe,CAACC,IAAI,CAAC,IAAI,CAACH,KAAK,CAAC,CAACI,YAAY,CAAC,CAAC;IACxD;IAEAC,KAAKA,CAAA,EAAsB;MACzB,OAAO,IAAIX,iBAAiB,CAAC,IAAI,CAAC;IACpC;EACF;EAACY,QAAA,CAAAZ,iBAAA,GAAAA,iBAAA;AAAA"}
@@ -1,72 +1,36 @@
1
1
  (function (global, factory) {
2
2
  if (typeof define === "function" && define.amd) {
3
- define(["exports", "./input-wrapper", "./conditions-wrapper", "./types", "./enums"], factory);
3
+ define(["exports", "./input-wrapper", "./conditions-wrapper", "./enums"], factory);
4
4
  } else if (typeof exports !== "undefined") {
5
- factory(exports, require("./input-wrapper"), require("./conditions-wrapper"), require("./types"), require("./enums"));
5
+ factory(exports, require("./input-wrapper"), require("./conditions-wrapper"), require("./enums"));
6
6
  } else {
7
7
  var mod = {
8
8
  exports: {}
9
9
  };
10
- factory(mod.exports, global.inputWrapper, global.conditionsWrapper, global.types, global.enums);
10
+ factory(mod.exports, global.inputWrapper, global.conditionsWrapper, global.enums);
11
11
  global.index = mod.exports;
12
12
  }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _inputWrapper, _conditionsWrapper, _types, _enums) {
13
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _inputWrapper, _conditionsWrapper, _enums) {
14
14
  "use strict";
15
15
 
16
16
  _exports.__esModule = true;
17
- Object.defineProperty(_exports, "ConditionRawData", {
18
- enumerable: true,
19
- get: function () {
20
- return _conditionsWrapper.ConditionRawData;
21
- }
22
- });
23
17
  Object.defineProperty(_exports, "ConditionsWrapper", {
24
18
  enumerable: true,
25
19
  get: function () {
26
20
  return _conditionsWrapper.ConditionsWrapper;
27
21
  }
28
22
  });
29
- Object.defineProperty(_exports, "ConfirmationPage", {
30
- enumerable: true,
31
- get: function () {
32
- return _types.ConfirmationPage;
33
- }
34
- });
35
23
  Object.defineProperty(_exports, "InputWrapper", {
36
24
  enumerable: true,
37
25
  get: function () {
38
26
  return _inputWrapper.InputWrapper;
39
27
  }
40
28
  });
41
- Object.defineProperty(_exports, "Item", {
42
- enumerable: true,
43
- get: function () {
44
- return _types.Item;
45
- }
46
- });
47
- Object.defineProperty(_exports, "List", {
48
- enumerable: true,
49
- get: function () {
50
- return _types.List;
51
- }
52
- });
53
29
  Object.defineProperty(_exports, "OutputType", {
54
30
  enumerable: true,
55
31
  get: function () {
56
32
  return _enums.OutputType;
57
33
  }
58
34
  });
59
- Object.defineProperty(_exports, "Page", {
60
- enumerable: true,
61
- get: function () {
62
- return _types.Page;
63
- }
64
- });
65
- Object.defineProperty(_exports, "Section", {
66
- enumerable: true,
67
- get: function () {
68
- return _types.Section;
69
- }
70
- });
71
35
  });
72
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/data-model/index.ts"],"sourcesContent":["export { InputWrapper } from './input-wrapper'\nexport { ConditionsWrapper, ConditionRawData } from './conditions-wrapper'\nexport { Page, Item, Section, List, ConfirmationPage } from './types'\nexport { OutputType } from './enums'\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/data-model/index.ts"],"sourcesContent":["export { InputWrapper } from '~/src/data-model/input-wrapper'\nexport { ConditionsWrapper } from '~/src/data-model/conditions-wrapper'\nexport { OutputType } from '~/src/data-model/enums'\n"],"mappings":""}
@@ -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 { clone } from '../utils/helpers'\nimport { ComponentDef } from '../components/types'\nimport { Page } from './types'\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":["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 +1 @@
1
- {"version":3,"file":"types.js","names":["isMultipleApiKey","payApiKey","obj","test","undefined","production"],"sources":["../../../src/data-model/types.ts"],"sourcesContent":["import { ConditionRawData } from '.'\nimport { ComponentDef } from '../components/types'\nimport { OutputType } from './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\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;;EAmBA;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'\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 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/form/index.ts"],"sourcesContent":["export { FormConfiguration } from './form-configuration'\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/form/index.ts"],"sourcesContent":["export { FormConfiguration } from '~/src/form/form-configuration'\n"],"mappings":""}
@@ -14,81 +14,58 @@
14
14
  "use strict";
15
15
 
16
16
  _exports.__esModule = true;
17
- var _exportNames = {
18
- Schema: true,
19
- componentSchema: true,
20
- ConditionRawData: true,
21
- ConditionsWrapper: true,
22
- OutputType: true,
23
- Logger: true,
24
- FormConfiguration: true,
25
- ComponentTypeEnum: true,
26
- ComponentTypes: true,
27
- ConditionalComponentTypes: true
28
- };
29
- Object.defineProperty(_exports, "ComponentTypeEnum", {
30
- enumerable: true,
31
- get: function () {
32
- return _components.ComponentTypeEnum;
33
- }
34
- });
35
- Object.defineProperty(_exports, "ComponentTypes", {
36
- enumerable: true,
37
- get: function () {
38
- return _components.ComponentTypes;
39
- }
40
- });
41
- Object.defineProperty(_exports, "ConditionRawData", {
42
- enumerable: true,
43
- get: function () {
44
- return _dataModel.ConditionRawData;
45
- }
46
- });
47
- Object.defineProperty(_exports, "ConditionalComponentTypes", {
48
- enumerable: true,
49
- get: function () {
50
- return _components.ConditionalComponentTypes;
51
- }
52
- });
53
- Object.defineProperty(_exports, "ConditionsWrapper", {
54
- enumerable: true,
55
- get: function () {
56
- return _dataModel.ConditionsWrapper;
57
- }
58
- });
59
- Object.defineProperty(_exports, "FormConfiguration", {
60
- enumerable: true,
61
- get: function () {
62
- return _form.FormConfiguration;
63
- }
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
+ });
64
26
  });
65
- Object.defineProperty(_exports, "Logger", {
66
- enumerable: true,
67
- get: function () {
68
- return _logger.Logger;
69
- }
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
+ });
70
36
  });
71
- Object.defineProperty(_exports, "OutputType", {
72
- enumerable: true,
73
- get: function () {
74
- return _dataModel.OutputType;
75
- }
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
+ });
76
46
  });
77
- Object.defineProperty(_exports, "Schema", {
78
- enumerable: true,
79
- get: function () {
80
- return _schema.Schema;
81
- }
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
+ });
82
56
  });
83
- Object.defineProperty(_exports, "componentSchema", {
84
- enumerable: true,
85
- get: function () {
86
- return _schema.componentSchema;
87
- }
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
+ });
88
66
  });
89
67
  Object.keys(_conditions).forEach(function (key) {
90
68
  if (key === "default" || key === "__esModule") return;
91
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
92
69
  if (key in _exports && _exports[key] === _conditions[key]) return;
93
70
  Object.defineProperty(_exports, key, {
94
71
  enumerable: true,
@@ -99,7 +76,6 @@
99
76
  });
100
77
  Object.keys(_helpers).forEach(function (key) {
101
78
  if (key === "default" || key === "__esModule") return;
102
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
103
79
  if (key in _exports && _exports[key] === _helpers[key]) return;
104
80
  Object.defineProperty(_exports, key, {
105
81
  enumerable: true,
@@ -110,7 +86,6 @@
110
86
  });
111
87
  Object.keys(_migration).forEach(function (key) {
112
88
  if (key === "default" || key === "__esModule") return;
113
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
114
89
  if (key in _exports && _exports[key] === _migration[key]) return;
115
90
  Object.defineProperty(_exports, key, {
116
91
  enumerable: true,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Object","keys","_conditions","forEach","key","prototype","hasOwnProperty","call","_exportNames","_exports","defineProperty","enumerable","get","_helpers","_migration"],"sources":["../../src/index.ts"],"sourcesContent":["export { Schema, componentSchema } from './schema'\nexport { ConditionRawData, ConditionsWrapper, OutputType } from './data-model'\nexport { Logger } from './utils/logger'\nexport { FormConfiguration } from './form'\nexport {\n ComponentTypeEnum,\n ComponentTypes,\n ConditionalComponentTypes\n} from './components'\nexport * from './conditions'\nex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A,QAAA,CAAAL,GAAA,MAAAU,UAAA,CAAAV,GAAA;IAAAJ,MAAA,CAAAU,cAAA,CAAAD,QAAA,EAAAL,GAAA;MAAAO,UAAA;MAAAC,GAAA,WAAAA,CAAA;QAAA,OAAAE,UAAA,CAAAV,GAAA;MAAA;IAAA;EAAA;AAA2B"}
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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AAA;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 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/migration/index.ts"],"sourcesContent":["export { whichMigrations } from './whichMigrations'\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/migration/index.ts"],"sourcesContent":["export { whichMigrations } from '~/src/migration/whichMigrations'\n"],"mappings":""}
@@ -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 { MigrationScript } from './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'\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 +1 @@
1
- {"version":3,"file":"migration.1-2.js","names":["recastItem","label","value","condition","hint","item","title","conditions","addListId","component","values","_objectSpread","list","type","nanoid","migratePage","page","components","map","removeValues","rest","_objectWithoutProperties","_excluded","needsUpgrade","data","pages","flatMap","find","migrate","_data$lists","version","componentsWithList","filter","c","_c$values","items","valuesAsLists","name","lists"],"sources":["../../../src/migration/migration.1-2.ts"],"sourcesContent":["import { MigrationScript } from './types'\nimport { nanoid } from '../utils/helpers'\n\n/**\n * @private\n * StaticItem is a deprecated Type.\n * It should only be used for aiding migration scripts.\n */\ntype StaticItem = {\n label: string\n value: string | number | boolean\n hint?: string\n condition?: string\n}\n\n/**\n * @private\n * StaticComponentValues is a deprecated Type.\n * It should only be used for aiding migration scripts.\n */\ntype StaticComponentValues = {\n list: any\n type: 'static' | 'listRef'\n valueType: string | number\n items: StaticItem[]\n}\n\ntype Item = {\n title: string\n value: any\n conditions?: any\n hint?: string\n}\n\nfunction recastItem({ label, value, condition, hint }: StaticItem) {\n const item: Item = {\n title: label,\n value\n }\n\n condition && (item.conditions = condition)\n hint && (item.hint = hint)\n return item\n}\n\nfunction addListId(component: { values: StaticComponentValues }) {\n if (!component.values) {\n return component\n }\n const { values } = component\n return {\n ...component,\n list: values.type === 'listRef' ? values.list : nanoid()\n }\n}\n\nfunction migratePage(page) {\n return {\n ...page,\n components: page.components.map(addListId)\n }\n}\n\nfunction removeValues(page) {\n return {\n ...page,\n components: page.components.map((component) => {\n const { values, ...rest } = component\n return {\n ...rest\n }\n })\n }\n}\n\nfunction needsUpgrade(data) {\n return !!data.pages\n .flatMap((page) => page.components)\n .find((component) => component.values)\n}\n\nexport function migrate(data): MigrationScript {\n if (!needsUpgrade(data)) {\n return { ...data, version: 2 }\n }\n const pages = data.pages.map(migratePage)\n const componentsWithList = pages.flatMap((page) =>\n page.components.filter((c) => c.values?.items)\n )\n\n const valuesAsLists = componentsWithList.map((component) => {\n return {\n title: component.title,\n name: component.list,\n items: component.values.items.map((item) => recastItem(item))\n }\n })\n\n return {\n ...data,\n pages: pages.map(removeValues),\n lists: [...(data.lists ?? []), ...valuesAsLists],\n version: 2\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAGA;AACA;AACA;AACA;AACA;;EAQA;AACA;AACA;AACA;AACA;;EAeA,SAASA,UAAUA,CAAC;IAAEC,KAAK;IAAEC,KAAK;IAAEC,SAAS;IAAEC;EAAiB,CAAC,EAAE;IACjE,MAAMC,IAAU,GAAG;MACjBC,KAAK,EAAEL,KAAK;MACZC;IACF,CAAC;IAED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Ab,aAAA,CAAAA,aAAA,KAAYa,IAAI;QAAEM,OAAO,EAAE;MAAC;IAC9B;IACA,MAAML,KAAK,GAAGD,IAAI,CAACC,KAAK,CAACP,GAAG,CAACH,WAAW,CAAC;IACzC,MAAMgB,kBAAkB,GAAGN,KAAK,CAACC,OAAO,CAAEV,IAAI,IAC5CA,IAAI,CAACC,UAAU,CAACe,MAAM,CAAEC,CAAC;MAAA,IAAAC,SAAA;MAAA,QAAAA,SAAA,GAAKD,CAAC,CAACvB,MAAM,cAAAwB,SAAA,uBAARA,SAAA,CAAUC,KAAK;IAAA,EAC/C,CAAC;IAED,MAAMC,aAAa,GAAGL,kBAAkB,CAACb,GAAG,CAAET,SAAS,IAAK;MAC1D,OAAO;QACLH,KAAK,EAAEG,SAAS,CAACH,KAAK;QACtB+B,IAAI,EAAE5B,SAAS,CAACG,IAAI;QACpBuB,KAAK,EAAE1B,SAAS,CAACC,MAAM,CAACyB,KAAK,CAACjB,GAAG,CAAEb,IAAI,IAAKL,UAAU,CAACK,IAAI,CAAC;MAC9D,CAAC;IACH,CAAC,CAAC;IAEF,OAAAM,aAAA,CAAAA,aAAA,KACKa,IAAI;MACPC,KAAK,EAAEA,KAAK,CAACP,GAAG,CAACC,YAAY,CAAC;MAC9BmB,KAAK,EAAE,CAAC,KAAAT,WAAA,GAAIL,IAAI,CAACc,KAAK,cAAAT,WAAA,cAAAA,WAAA,GAAI,EAAE,CAAC,EAAE,GAAGO,aAAa,CAAC;MAChDN,OAAO,EAAE;IAAC;EAEd;AAAC"}
1
+ {"version":3,"file":"migration.1-2.js","names":["recastItem","label","value","condition","hint","item","title","conditions","addListId","component","values","_objectSpread","list","type","nanoid","migratePage","page","components","map","removeValues","rest","_objectWithoutProperties","_excluded","needsUpgrade","data","pages","flatMap","find","migrate","_data$lists","version","componentsWithList","filter","c","_c$values","items","valuesAsLists","name","lists"],"sources":["../../../src/migration/migration.1-2.ts"],"sourcesContent":["import { nanoid } from '~/src/utils/helpers'\nimport { type MigrationScript } from '~/src/migration/types'\n\n/**\n * @private\n * StaticItem is a deprecated Type.\n * It should only be used for aiding migration scripts.\n */\ntype StaticItem = {\n label: string\n value: string | number | boolean\n hint?: string\n condition?: string\n}\n\n/**\n * @private\n * StaticComponentValues is a deprecated Type.\n * It should only be used for aiding migration scripts.\n */\ntype StaticComponentValues = {\n list: any\n type: 'static' | 'listRef'\n valueType: string | number\n items: StaticItem[]\n}\n\ntype Item = {\n title: string\n value: any\n conditions?: any\n hint?: string\n}\n\nfunction recastItem({ label, value, condition, hint }: StaticItem) {\n const item: Item = {\n title: label,\n value\n }\n\n condition && (item.conditions = condition)\n hint && (item.hint = hint)\n return item\n}\n\nfunction addListId(component: { values: StaticComponentValues }) {\n if (!component.values) {\n return component\n }\n const { values } = component\n return {\n ...component,\n list: values.type === 'listRef' ? values.list : nanoid()\n }\n}\n\nfunction migratePage(page) {\n return {\n ...page,\n components: page.components.map(addListId)\n }\n}\n\nfunction removeValues(page) {\n return {\n ...page,\n components: page.components.map((component) => {\n const { values, ...rest } = component\n return {\n ...rest\n }\n })\n }\n}\n\nfunction needsUpgrade(data) {\n return !!data.pages\n .flatMap((page) => page.components)\n .find((component) => component.values)\n}\n\nexport function migrate(data): MigrationScript {\n if (!needsUpgrade(data)) {\n return { ...data, version: 2 }\n }\n const pages = data.pages.map(migratePage)\n const componentsWithList = pages.flatMap((page) =>\n page.components.filter((c) => c.values?.items)\n )\n\n const valuesAsLists = componentsWithList.map((component) => {\n return {\n title: component.title,\n name: component.list,\n items: component.values.items.map((item) => recastItem(item))\n }\n })\n\n return {\n ...data,\n pages: pages.map(removeValues),\n lists: [...(data.lists ?? []), ...valuesAsLists],\n version: 2\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAGA;AACA;AACA;AACA;AACA;;EAQA;AACA;AACA;AACA;AACA;;EAeA,SAASA,UAAUA,CAAC;IAAEC,KAAK;IAAEC,KAAK;IAAEC,SAAS;IAAEC;EAAiB,CAAC,EAA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AA,IAAAK,WAAA;IAC7C,IAAI,CAACN,YAAY,CAACC,IAAI,CAAC,EAAE;MACvB,OAAAb,aAAA,CAAAA,aAAA,KAAYa,IAAI;QAAEM,OAAO,EAAE;MAAC;IAC9B;IACA,MAAML,KAAK,GAAGD,IAAI,CAACC,KAAK,CAACP,GAAG,CAACH,WAAW,CAAC;IACzC,MAAMgB,kBAAkB,GAAGN,KAAK,CAACC,OAAO,CAAEV,IAAI,IAC5CA,IAAI,CAACC,UAAU,CAACe,MAAM,CAAEC,CAAC;MAAA,IAAAC,SAAA;MAAA,QAAAA,SAAA,GAAKD,CAAC,CAACvB,MAAM,cAAAwB,SAAA,uBAARA,SAAA,CAAUC,KAAK;IAAA,EAC/C,CAAC;IAED,MAAMC,aAAa,GAAGL,kBAAkB,CAACb,GAAG,CAAET,SAAS,IAAK;MAC1D,OAAO;QACLH,KAAK,EAAEG,SAAS,CAACH,KAAK;QACtB+B,IAAI,EAAE5B,SAAS,CAACG,IAAI;QACpBuB,KAAK,EAAE1B,SAAS,CAACC,MAAM,CAACyB,KAAK,CAACjB,GAAG,CAAEb,IAAI,IAAKL,UAAU,CAACK,IAAI,CAAC;MAC9D,CAAC;IACH,CAAC,CAAC;IAEF,OAAAM,aAAA,CAAAA,aAAA,KACKa,IAAI;MACPC,KAAK,EAAEA,KAAK,CAACP,GAAG,CAACC,YAAY,CAAC;MAC9BmB,KAAK,EAAE,CAAC,KAAAT,WAAA,GAAIL,IAAI,CAACc,KAAK,cAAAT,WAAA,cAAAA,WAAA,GAAI,EAAE,CAAC,EAAE,GAAGO,aAAa,CAAC;MAChDN,OAAO,EAAE;IAAC;EAEd;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"whichMigrations.js","names":["whichMigrations","version","migrations","Set","add","V0_TO_V2","V1_TO_V2"],"sources":["../../../src/migration/whichMigrations.ts"],"sourcesContent":["import { migrate as V0_TO_V2 } from './migration.0-2'\nimport { migrate as V1_TO_V2 } from './migration.1-2'\nimport { MigrationScript } from './types'\n\n/**\n * Returns which migrations that should be run against your Object with the given version\n * @param version\n */\nexport function whichMigrations(version: number) {\n const migrations = new Set<MigrationScript>()\n switch (version) {\n case 0:\n migrations.add(V0_TO_V2)\n /**\n * we are skipping v1 entirely. If we weren't you would do migrations.add([V1_TO_V2, V2_TO_V3]) for example.\n */\n break\n case 1:\n migrations.add(V1_TO_V2)\n break\n }\n return migrations\n}\n"],"mappings":";;;;;;;;;;;;;;;;;EAIA;AACA;AACA;AACA;EACO,SAASA,eAAeA,CAACC,OAAe,EAAE;IAC/C,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAkB,CAAC;IAC7C,QAAQF,OAAO;MACb,KAAK,CAAC;QACJC,UAAU,CAACE,GAAG,CAACC,kBAAQ,CAAC;QACxB;AACN;AACA;QACM;MACF,KAAK,CAAC;QACJH,UAAU,CAACE,GAAG,CAACE,mBAAQ,CAAC;QACxB;IACJ;IACA,OAAOJ,UAAU;EACnB;AAAC"}
1
+ {"version":3,"file":"whichMigrations.js","names":["whichMigrations","version","migrations","Set","add","V0_TO_V2","V1_TO_V2"],"sources":["../../../src/migration/whichMigrations.ts"],"sourcesContent":["import { migrate as V0_TO_V2 } from '~/src/migration/migration.0-2'\nimport { migrate as V1_TO_V2 } from '~/src/migration/migration.1-2'\nimport { type MigrationScript } from '~/src/migration/types'\n\n/**\n * Returns which migrations that should be run against your Object with the given version\n * @param version\n */\nexport function whichMigrations(version: number) {\n const migrations = new Set<MigrationScript>()\n switch (version) {\n case 0:\n migrations.add(V0_TO_V2)\n /**\n * we are skipping v1 entirely. If we weren't you would do migrations.add([V1_TO_V2, V2_TO_V3]) for example.\n */\n break\n case 1:\n migrations.add(V1_TO_V2)\n break\n }\n return migrations\n}\n"],"mappings":";;;;;;;;;;;;;;;;;EAIA;AACA;AACA;AACA;EACO,SAASA,eAAeA,CAACC,OAAe,EAAE;IAC/C,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAkB,CAAC;IAC7C,QAAQF,OAAO;MACb,KAAK,CAAC;QACJC,UAAU,CAACE,GAAG,CAACC,kBAAQ,CAAC;QACxB;AACN;AACA;QACM;MACF,KAAK,CAAC;QACJH,UAAU,CAACE,GAAG,CAACE,mBAAQ,CAAC;QACxB;IACJ;IACA,OAAOJ,UAAU;EACnB;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/schema/index.ts"],"sourcesContent":["export { Schema, componentSchema } from './schema'\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/schema/index.ts"],"sourcesContent":["export { Schema, componentSchema } from '~/src/schema/schema'\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"component-types.js","names":["ComponentTypes","exports","name","type","title","subType","hint","options","schema","list","content"],"sources":["../../../src/components/component-types.ts"],"sourcesContent":["import { ComponentDef } from './types'\n\nexport const ComponentTypes: ComponentDef[] = [\n {\n name: 'TextField',\n type: 'TextField',\n title: 'Text field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MultilineTextField',\n type: 'MultilineTextField',\n title: 'Multiline text field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'YesNoField',\n type: 'YesNoField',\n title: 'Yes/No field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DateField',\n type: 'DateField',\n title: 'Date field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'TimeField',\n type: 'TimeField',\n title: 'Time field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DateTimeField',\n type: 'DateTimeField',\n title: 'Date time field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DatePartsField',\n type: 'DatePartsField',\n title: 'Date parts field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DateTimePartsField',\n type: 'DateTimePartsField',\n title: 'Date time parts field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MonthYearField',\n type: 'MonthYearField',\n title: 'Month year field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'SelectField',\n type: 'SelectField',\n title: 'Select field',\n subType: 'listField',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'AutocompleteField',\n type: 'AutocompleteField',\n title: 'Autocomplete field',\n subType: 'listField',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'RadiosField',\n type: 'RadiosField',\n title: 'Radios field',\n subType: 'listField',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'CheckboxesField',\n type: 'CheckboxesField',\n title: 'Checkboxes field',\n subType: 'listField',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'NumberField',\n type: 'NumberField',\n title: 'Number field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'UkAddressField',\n type: 'UkAddressField',\n title: 'UK address field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'TelephoneNumberField',\n type: 'TelephoneNumberField',\n title: 'Telephone number field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'EmailAddressField',\n type: 'EmailAddressField',\n title: 'Email address field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'FileUploadField',\n type: 'FileUploadField',\n title: 'File upload field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'Para',\n type: 'Para',\n title: 'Paragraph',\n subType: 'content',\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'Html',\n type: 'Html',\n title: 'Html',\n subType: 'content',\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'InsetText',\n type: 'InsetText',\n title: 'Inset text',\n subType: 'content',\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'Details',\n type: 'Details',\n title: 'Details',\n subType: 'content',\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'FlashCard',\n type: 'FlashCard',\n title: 'Flash card',\n subType: 'content',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'List',\n type: 'List',\n title: 'List',\n subType: 'content',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'WebsiteField',\n type: 'WebsiteField',\n title: 'Website field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n }\n]\n"],"mappings":";;;;AAEO,MAAMA,cAA8B,GAAAC,OAAA,CAAAD,cAAA,GAAG,CAC5C;EACEE,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,YAAY;EACnBC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,oBAAoB;EAC1BC,IAAI,EAAE,oBAAoB;EAC1BC,KAAK,EAAE,sBAAsB;EAC7BC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,YAAY;EAClBC,IAAI,EAAE,YAAY;EAClBC,KAAK,EAAE,cAAc;EACrBC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,YAAY;EACnBC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,YAAY;EACnBC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,M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AAE,SAAS;EAClBE,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC,CAAC;EACVC,IAAI,EAAE;AACR,CAAC,EACD;EACEP,IAAI,EAAE,cAAc;EACpBC,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAE,eAAe;EACtBC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,CACF"}
1
+ {"version":3,"file":"component-types.js","names":["ComponentTypes","exports","name","type","title","subType","hint","options","schema","list","content"],"sources":["../../../src/components/component-types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types'\n\nexport const ComponentTypes: ComponentDef[] = [\n {\n name: 'TextField',\n type: 'TextField',\n title: 'Text field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MultilineTextField',\n type: 'MultilineTextField',\n title: 'Multiline text field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'YesNoField',\n type: 'YesNoField',\n title: 'Yes/No field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DateField',\n type: 'DateField',\n title: 'Date field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'TimeField',\n type: 'TimeField',\n title: 'Time field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DateTimeField',\n type: 'DateTimeField',\n title: 'Date time field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DatePartsField',\n type: 'DatePartsField',\n title: 'Date parts field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'DateTimePartsField',\n type: 'DateTimePartsField',\n title: 'Date time parts field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MonthYearField',\n type: 'MonthYearField',\n title: 'Month year field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'SelectField',\n type: 'SelectField',\n title: 'Select field',\n subType: 'listField',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'AutocompleteField',\n type: 'AutocompleteField',\n title: 'Autocomplete field',\n subType: 'listField',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'RadiosField',\n type: 'RadiosField',\n title: 'Radios field',\n subType: 'listField',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'CheckboxesField',\n type: 'CheckboxesField',\n title: 'Checkboxes field',\n subType: 'listField',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'NumberField',\n type: 'NumberField',\n title: 'Number field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'UkAddressField',\n type: 'UkAddressField',\n title: 'UK address field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'TelephoneNumberField',\n type: 'TelephoneNumberField',\n title: 'Telephone number field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'EmailAddressField',\n type: 'EmailAddressField',\n title: 'Email address field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'FileUploadField',\n type: 'FileUploadField',\n title: 'File upload field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'Para',\n type: 'Para',\n title: 'Paragraph',\n subType: 'content',\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'Html',\n type: 'Html',\n title: 'Html',\n subType: 'content',\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'InsetText',\n type: 'InsetText',\n title: 'Inset text',\n subType: 'content',\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'Details',\n type: 'Details',\n title: 'Details',\n subType: 'content',\n content: '',\n options: {},\n schema: {}\n },\n {\n name: 'FlashCard',\n type: 'FlashCard',\n title: 'Flash card',\n subType: 'content',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'List',\n type: 'List',\n title: 'List',\n subType: 'content',\n options: {},\n schema: {},\n list: ''\n },\n {\n name: 'WebsiteField',\n type: 'WebsiteField',\n title: 'Website field',\n subType: 'field',\n hint: '',\n options: {},\n schema: {}\n }\n]\n"],"mappings":";;;;AAEO,MAAMA,cAA8B,GAAAC,OAAA,CAAAD,cAAA,GAAG,CAC5C;EACEE,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,YAAY;EACnBC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,oBAAoB;EAC1BC,IAAI,EAAE,oBAAoB;EAC1BC,KAAK,EAAE,sBAAsB;EAC7BC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,YAAY;EAClBC,IAAI,EAAE,YAAY;EAClBC,KAAK,EAAE,cAAc;EACrBC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,YAAY;EACnBC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,YAAY;EACnBC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,eAAe;EACrBC,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAE,i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ACD;EACEP,IAAI,EAAE,cAAc;EACpBC,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAE,eAAe;EACtBC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"conditional-component-types.js","names":["ConditionalComponentTypes","exports","name","title","subType"],"sources":["../../../src/components/conditional-component-types.ts"],"sourcesContent":["import { ConditionalComponent } from './types'\n\nexport const ConditionalComponentTypes: ConditionalComponent[] = [\n {\n name: 'TextField',\n title: 'Text field',\n subType: 'field'\n },\n {\n name: 'NumberField',\n title: 'Number field',\n subType: 'field'\n }\n]\n"],"mappings":";;;;AAEO,MAAMA,yBAAiD,GAAAC,OAAA,CAAAD,yBAAA,GAAG,CAC/D;EACEE,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,YAAY;EACnBC,OAAO,EAAE;AACX,CAAC,EACD;EACEF,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAE,cAAc;EACrBC,OAAO,EAAE;AACX,CAAC,CACF"}
1
+ {"version":3,"file":"conditional-component-types.js","names":["ConditionalComponentTypes","exports","name","title","subType"],"sources":["../../../src/components/conditional-component-types.ts"],"sourcesContent":["import { type ConditionalComponent } from '~/src/components/types'\n\nexport const ConditionalComponentTypes: ConditionalComponent[] = [\n {\n name: 'TextField',\n title: 'Text field',\n subType: 'field'\n },\n {\n name: 'NumberField',\n title: 'Number field',\n subType: 'field'\n }\n]\n"],"mappings":";;;;AAEO,MAAMA,yBAAiD,GAAAC,OAAA,CAAAD,yBAAA,GAAG,CAC/D;EACEE,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,YAAY;EACnBC,OAAO,EAAE;AACX,CAAC,EACD;EACEF,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAE,cAAc;EACrBC,OAAO,EAAE;AACX,CAAC,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_componentTypes","require","_conditionalComponentTypes","_enums"],"sources":["../../../src/components/index.ts"],"sourcesContent":["export { ComponentTypes } from './component-types'\nexport { ConditionalComponentTypes } from './conditional-component-types'\nexport { ComponentTypeEnum } from './enums'\nexport type * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,0BAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA"}
1
+ {"version":3,"file":"index.js","names":["_componentTypes","require","_conditionalComponentTypes","_enums"],"sources":["../../../src/components/index.ts"],"sourcesContent":["export { ComponentTypes } from '~/src/components/component-types'\nexport { ConditionalComponentTypes } from '~/src/components/conditional-component-types'\nexport { ComponentTypeEnum } from '~/src/components/enums'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,0BAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"condition-abstract.js","names":["_enums","require","ConditionAbstract","constructor","coordinator","Object","values","Coordinator","includes","Error","coordinatorString","getCoordinator","setCoordinator","isGroup","getGroupedConditions","_asFirstCondition","asFirstCondition","clone","conditionString","conditionExpression","exports"],"sources":["../../../src/conditions/condition-abstract.ts"],"sourcesContent":["import { Coordinator } from './enums'\n\nexport class ConditionAbstract {\n coordinator: Coordinator | undefined\n\n constructor(coordinator: Coordinator | undefined) {\n if (coordinator && !Object.values(Coordinator).includes(coordinator)) {\n throw Error(`coordinator ${coordinator} is not a valid coordinator`)\n }\n\n this.coordinator = coordinator\n }\n\n coordinatorString() {\n return this.coordinator ? `${this.coordinator} ` : ''\n }\n\n getCoordinator() {\n return this.coordinator\n }\n\n setCoordinator(coordinator: Coordinator | undefined) {\n this.coordinator = coordinator\n }\n\n isGroup() {\n return false\n }\n\n getGroupedConditions() {\n return [this]\n }\n\n _asFirstCondition() {\n delete this.coordinator\n }\n\n asFirstCondition() {\n throw Error(\n 'Unsupported Operation. Method asFirstCondition have not been implemented'\n )\n }\n\n clone() {\n throw Error('Unsupported Operation. Method clone have not been implemented')\n }\n\n conditionString() {\n throw Error(\n 'Unsupported Operation. Method conditionString have not been implemented'\n )\n }\n\n conditionExpression() {\n throw Error(\n 'Unsupported Operation. Method conditionExpression have not been implemented'\n )\n }\n}\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,iBAAiB,CAAC;EAG7BC,WAAWA,CAACC,WAAoC,EAAE;IAChD,IAAIA,WAAW,IAAI,CAACC,MAAM,CAACC,MAAM,CAACC,kBAAW,CAAC,CAACC,QAAQ,CAACJ,WAAW,CAAC,EAAE;MACpE,MAAMK,KAAK,CAAE,eAAcL,WAAY,6BAA4B,CAAC;IACtE;IAEA,IAAI,CAACA,WAAW,GAAGA,WAAW;EAChC;EAEAM,iBAAiBA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACN,WAAW,GAAI,GAAE,IAAI,CAACA,WAAY,GAAE,GAAG,EAAE;EACvD;EAEAO,cAAcA,CAAA,EAAG;IACf,OAAO,IAAI,CAACP,WAAW;EACzB;EAEAQ,cAAcA,CAACR,WAAoC,EAAE;IACnD,IAAI,CAACA,WAAW,GAAGA,WAAW;EAChC;EAEAS,OAAOA,CAAA,EAAG;IACR,OAAO,KAAK;EACd;EAEAC,oBAAoBA,CAAA,EAAG;IACrB,OAAO,CAAC,IAAI,CAAC;EACf;EAEAC,iBAAiBA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACX,WAAW;EACzB;EAEAY,gBAAgBA,CAAA,EAAG;IACjB,MAAMP,KAAK,CACT,0EACF,CAAC;EACH;EAEAQ,KAAKA,CAAA,EAAG;IACN,MAAMR,KAAK,CAAC,+DAA+D,CAAC;EAC9E;EAEAS,eAAeA,CAAA,EAAG;IAChB,MAAMT,KAAK,CACT,yEACF,CAAC;EACH;EAEAU,mBAAmBA,CAAA,EAAG;IACpB,MAAMV,KAAK,CACT,6EACF,CAAC;EACH;AACF;AAACW,OAAA,CAAAlB,iBAAA,GAAAA,iBAAA"}
1
+ {"version":3,"file":"condition-abstract.js","names":["_enums","require","ConditionAbstract","constructor","coordinator","Object","values","Coordinator","includes","Error","coordinatorString","getCoordinator","setCoordinator","isGroup","getGroupedConditions","_asFirstCondition","asFirstCondition","clone","conditionString","conditionExpression","exports"],"sources":["../../../src/conditions/condition-abstract.ts"],"sourcesContent":["import { Coordinator } from '~/src/conditions/enums'\n\nexport class ConditionAbstract {\n coordinator: Coordinator | undefined\n\n constructor(coordinator: Coordinator | undefined) {\n if (coordinator && !Object.values(Coordinator).includes(coordinator)) {\n throw Error(`coordinator ${coordinator} is not a valid coordinator`)\n }\n\n this.coordinator = coordinator\n }\n\n coordinatorString() {\n return this.coordinator ? `${this.coordinator} ` : ''\n }\n\n getCoordinator() {\n return this.coordinator\n }\n\n setCoordinator(coordinator: Coordinator | undefined) {\n this.coordinator = coordinator\n }\n\n isGroup() {\n return false\n }\n\n getGroupedConditions() {\n return [this]\n }\n\n _asFirstCondition() {\n delete this.coordinator\n }\n\n asFirstCondition() {\n throw Error(\n 'Unsupported Operation. Method asFirstCondition have not been implemented'\n )\n }\n\n clone() {\n throw Error('Unsupported Operation. Method clone have not been implemented')\n }\n\n conditionString() {\n throw Error(\n 'Unsupported Operation. Method conditionString have not been implemented'\n )\n }\n\n conditionExpression() {\n throw Error(\n 'Unsupported Operation. Method conditionExpression have not been implemented'\n )\n }\n}\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,iBAAiB,CAAC;EAG7BC,WAAWA,CAACC,WAAoC,EAAE;IAChD,IAAIA,WAAW,IAAI,CAACC,MAAM,CAACC,MAAM,CAACC,kBAAW,CAAC,CAACC,QAAQ,CAACJ,WAAW,CAAC,EAAE;MACpE,MAAMK,KAAK,CAAE,eAAcL,WAAY,6BAA4B,CAAC;IACtE;IAEA,IAAI,CAACA,WAAW,GAAGA,WAAW;EAChC;EAEAM,iBAAiBA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACN,WAAW,GAAI,GAAE,IAAI,CAACA,WAAY,GAAE,GAAG,EAAE;EACvD;EAEAO,cAAcA,CAAA,EAAG;IACf,OAAO,IAAI,CAACP,WAAW;EACzB;EAEAQ,cAAcA,CAACR,WAAoC,EAAE;IACnD,IAAI,CAACA,WAAW,GAAGA,WAAW;EAChC;EAEAS,OAAOA,CAAA,EAAG;IACR,OAAO,KAAK;EACd;EAEAC,oBAAoBA,CAAA,EAAG;IACrB,OAAO,CAAC,IAAI,CAAC;EACf;EAEAC,iBAAiBA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACX,WAAW;EACzB;EAEAY,gBAAgBA,CAAA,EAAG;IACjB,MAAMP,KAAK,CACT,0EACF,CAAC;EACH;EAEAQ,KAAKA,CAAA,EAAG;IACN,MAAMR,KAAK,CAAC,+DAA+D,CAAC;EAC9E;EAEAS,eAAeA,CAAA,EAAG;IAChB,MAAMT,KAAK,CACT,yEACF,CAAC;EACH;EAEAU,mBAAmBA,CAAA,EAAG;IACpB,MAAMV,KAAK,CACT,6EACF,CAAC;EACH;AACF;AAACW,OAAA,CAAAlB,iBAAA,GAAAA,iBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"condition-field.js","names":["_components","require","ConditionField","constructor","name","type","display","Error","ComponentTypes","find","componentType","from","obj","exports"],"sources":["../../../src/conditions/condition-field.ts"],"sourcesContent":["import { ComponentTypes, ComponentType } from '../components'\n\nexport class ConditionField {\n name: string\n type: ComponentType\n display: string\n\n constructor(name: string, type: ComponentType, display: string) {\n if (!name || typeof name !== 'string') {\n throw Error(`name ${name} is not valid`)\n }\n\n if (!ComponentTypes.find((componentType) => componentType.type === type)) {\n throw Error(`type ${type} is not valid`)\n }\n\n if (!display || typeof display !== 'string') {\n throw Error(`display ${display} is not valid`)\n }\n\n this.name = name\n this.type = type\n this.display = display\n }\n\n static from(obj: { name: string; type: ComponentType; display: string }) {\n return new ConditionField(obj.name, obj.type, obj.display)\n }\n}\n"],"mappings":";;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEO,MAAMC,cAAc,CAAC;EAK1BC,WAAWA,CAACC,IAAY,EAAEC,IAAmB,EAAEC,OAAe,EAAE;IAC9D,IAAI,CAACF,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;MACrC,MAAMG,KAAK,CAAE,QAAOH,IAAK,eAAc,CAAC;IAC1C;IAEA,IAAI,CAACI,0BAAc,CAACC,IAAI,CAAEC,aAAa,IAAKA,aAAa,CAACL,IAAI,KAAKA,IAAI,CAAC,EAAE;MACxE,MAAME,KAAK,CAAE,QAAOF,IAAK,eAAc,CAAC;IAC1C;IAEA,IAAI,CAACC,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MAC3C,MAAMC,KAAK,CAAE,WAAUD,OAAQ,eAAc,CAAC;IAChD;IAEA,IAAI,CAACF,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,OAAO,GAAGA,OAAO;EACxB;EAEA,OAAOK,IAAIA,CAACC,GAA2D,EAAE;IACvE,OAAO,IAAIV,cAAc,CAACU,GAAG,CAACR,IAAI,EAAEQ,GAAG,CAACP,IAAI,EAAEO,GAAG,CAACN,OAAO,CAAC;EAC5D;AACF;AAACO,OAAA,CAAAX,cAAA,GAAAA,cAAA"}
1
+ {"version":3,"file":"condition-field.js","names":["_components","require","ConditionField","constructor","name","type","display","Error","ComponentTypes","find","componentType","from","obj","exports"],"sources":["../../../src/conditions/condition-field.ts"],"sourcesContent":["import { ComponentTypes } from '~/src/components'\nimport { type ComponentType } from '~/src/components/types'\n\nexport class ConditionField {\n name: string\n type: ComponentType\n display: string\n\n constructor(name: string, type: ComponentType, display: string) {\n if (!name || typeof name !== 'string') {\n throw Error(`name ${name} is not valid`)\n }\n\n if (!ComponentTypes.find((componentType) => componentType.type === type)) {\n throw Error(`type ${type} is not valid`)\n }\n\n if (!display || typeof display !== 'string') {\n throw Error(`display ${display} is not valid`)\n }\n\n this.name = name\n this.type = type\n this.display = display\n }\n\n static from(obj: { name: string; type: ComponentType; display: string }) {\n return new ConditionField(obj.name, obj.type, obj.display)\n }\n}\n"],"mappings":";;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAGO,MAAMC,cAAc,CAAC;EAK1BC,WAAWA,CAACC,IAAY,EAAEC,IAAmB,EAAEC,OAAe,EAAE;IAC9D,IAAI,CAACF,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;MACrC,MAAMG,KAAK,CAAE,QAAOH,IAAK,eAAc,CAAC;IAC1C;IAEA,IAAI,CAACI,0BAAc,CAACC,IAAI,CAAEC,aAAa,IAAKA,aAAa,CAACL,IAAI,KAAKA,IAAI,CAAC,EAAE;MACxE,MAAME,KAAK,CAAE,QAAOF,IAAK,eAAc,CAAC;IAC1C;IAEA,IAAI,CAACC,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MAC3C,MAAMC,KAAK,CAAE,WAAUD,OAAQ,eAAc,CAAC;IAChD;IAEA,IAAI,CAACF,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,OAAO,GAAGA,OAAO;EACxB;EAEA,OAAOK,IAAIA,CAACC,GAA2D,EAAE;IACvE,OAAO,IAAIV,cAAc,CAACU,GAAG,CAACR,IAAI,EAAEQ,GAAG,CAACP,IAAI,EAAEO,GAAG,CAACN,OAAO,CAAC;EAC5D;AACF;AAACO,OAAA,CAAAX,cAAA,GAAAA,cAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"condition-group-def.js","names":["ConditionGroupDef","constructor","first","last","Error","contains","index","startsWith","applyTo","conditions","splice","exports"],"sources":["../../../src/conditions/condition-group-def.ts"],"sourcesContent":["import { ConditionsArray } from './types'\n\nexport class ConditionGroupDef {\n first: number\n last: number\n\n constructor(first: number, last: number) {\n if (typeof first !== 'number' || typeof last !== 'number') {\n throw Error(`Cannot construct a group from ${first} and ${last}`)\n } else if (first >= last) {\n throw Error(`Last (${last}) must be greater than first (${first})`)\n }\n\n this.first = first\n this.last = last\n }\n\n contains(index: number) {\n return this.first <= index && this.last >= index\n }\n\n startsWith(index: number) {\n return this.first === index\n }\n\n applyTo(conditions: ConditionsArray) {\n return [...conditions].splice(this.first, this.last - this.first + 1)\n }\n}\n"],"mappings":";;;;AAEO,MAAMA,iBAAiB,CAAC;EAI7BC,WAAWA,CAACC,KAAa,EAAEC,IAAY,EAAE;IACvC,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAI,OAAOC,IAAI,KAAK,QAAQ,EAAE;MACzD,MAAMC,KAAK,CAAE,iCAAgCF,KAAM,QAAOC,IAAK,EAAC,CAAC;IACnE,CAAC,MAAM,IAAID,KAAK,IAAIC,IAAI,EAAE;MACxB,MAAMC,KAAK,CAAE,SAAQD,IAAK,iCAAgCD,KAAM,GAAE,CAAC;IACrE;IAEA,IAAI,CAACA,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,IAAI,GAAGA,IAAI;EAClB;EAEAE,QAAQA,CAACC,KAAa,EAAE;IACtB,OAAO,IAAI,CAACJ,KAAK,IAAII,KAAK,IAAI,IAAI,CAACH,IAAI,IAAIG,KAAK;EAClD;EAEAC,UAAUA,CAACD,KAAa,EAAE;IACxB,OAAO,IAAI,CAACJ,KAAK,KAAKI,KAAK;EAC7B;EAEAE,OAAOA,CAACC,UAA2B,EAAE;IACnC,OAAO,CAAC,GAAGA,UAAU,CAAC,CAACC,MAAM,CAAC,IAAI,CAACR,KAAK,EAAE,IAAI,CAACC,IAAI,GAAG,IAAI,CAACD,KAAK,GAAG,CAAC,CAAC;EACvE;AACF;AAACS,OAAA,CAAAX,iBAAA,GAAAA,iBAAA"}
1
+ {"version":3,"file":"condition-group-def.js","names":["ConditionGroupDef","constructor","first","last","Error","contains","index","startsWith","applyTo","conditions","splice","exports"],"sources":["../../../src/conditions/condition-group-def.ts"],"sourcesContent":["import { type ConditionsArray } from '~/src/conditions/types'\n\nexport class ConditionGroupDef {\n first: number\n last: number\n\n constructor(first: number, last: number) {\n if (typeof first !== 'number' || typeof last !== 'number') {\n throw Error(`Cannot construct a group from ${first} and ${last}`)\n } else if (first >= last) {\n throw Error(`Last (${last}) must be greater than first (${first})`)\n }\n\n this.first = first\n this.last = last\n }\n\n contains(index: number) {\n return this.first <= index && this.last >= index\n }\n\n startsWith(index: number) {\n return this.first === index\n }\n\n applyTo(conditions: ConditionsArray) {\n return [...conditions].splice(this.first, this.last - this.first + 1)\n }\n}\n"],"mappings":";;;;AAEO,MAAMA,iBAAiB,CAAC;EAI7BC,WAAWA,CAACC,KAAa,EAAEC,IAAY,EAAE;IACvC,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAI,OAAOC,IAAI,KAAK,QAAQ,EAAE;MACzD,MAAMC,KAAK,CAAE,iCAAgCF,KAAM,QAAOC,IAAK,EAAC,CAAC;IACnE,CAAC,MAAM,IAAID,KAAK,IAAIC,IAAI,EAAE;MACxB,MAAMC,KAAK,CAAE,SAAQD,IAAK,iCAAgCD,KAAM,GAAE,CAAC;IACrE;IAEA,IAAI,CAACA,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,IAAI,GAAGA,IAAI;EAClB;EAEAE,QAAQA,CAACC,KAAa,EAAE;IACtB,OAAO,IAAI,CAACJ,KAAK,IAAII,KAAK,IAAI,IAAI,CAACH,IAAI,IAAIG,KAAK;EAClD;EAEAC,UAAUA,CAACD,KAAa,EAAE;IACxB,OAAO,IAAI,CAACJ,KAAK,KAAKI,KAAK;EAC7B;EAEAE,OAAOA,CAACC,UAA2B,EAAE;IACnC,OAAO,CAAC,GAAGA,UAAU,CAAC,CAACC,MAAM,CAAC,IAAI,CAACR,KAAK,EAAE,IAAI,CAACC,IAAI,GAAG,IAAI,CAACD,KAAK,GAAG,CAAC,CAAC;EACvE;AACF;AAACS,OAAA,CAAAX,iBAAA,GAAAA,iBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"condition-group.js","names":["_helpers","require","ConditionGroup","constructor","conditions","Array","isArray","length","Error","coordinatorString","conditionString","copy","splice","map","condition","toPresentationString","join","conditionExpression","toExpression","asFirstCondition","getCoordinator","setCoordinator","coordinator","isGroup","getGroupedConditions","clone","exports"],"sources":["../../../src/conditions/condition-group.ts"],"sourcesContent":["import { Coordinator } from './enums'\nimport { toPresentationString, toExpression } from './helpers'\nimport { ConditionsArray } from './types'\n\nexport class ConditionGroup {\n conditions: ConditionsArray\n\n constructor(conditions: ConditionsArray = []) {\n if (!Array.isArray(conditions) || conditions.length < 2) {\n throw Error('Cannot construct a condition group from a single condition')\n }\n\n this.conditions = conditions\n }\n\n coordinatorString() {\n return this.conditions[0].coordinatorString()\n }\n\n conditionString() {\n const copy = [...this.conditions]\n copy.splice(0, 1)\n return `(${this.conditions[0].conditionString()} ${copy\n .map((condition) => toPresentationString(condition))\n .join(' ')})`\n }\n\n conditionExpression() {\n const copy = [...this.conditions]\n copy.splice(0, 1)\n return `(${this.conditions[0].conditionExpression()} ${copy\n .map((condition) => toExpression(condition))\n .join(' ')})`\n }\n\n asFirstCondition() {\n this.conditions[0].asFirstCondition()\n return this\n }\n\n getCoordinator() {\n return this.conditions[0].getCoordinator()\n }\n\n setCoordinator(coordinator: Coordinator | undefined) {\n this.conditions[0].setCoordinator(coordinator)\n }\n\n isGroup() {\n return true\n }\n\n getGroupedConditions() {\n return this.conditions.map((condition) => condition.clone())\n }\n\n clone() {\n return new ConditionGroup(\n this.conditions.map((condition) => condition.clone())\n )\n }\n}\n"],"mappings":";;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAGO,MAAMC,cAAc,CAAC;EAG1BC,WAAWA,CAACC,UAA2B,GAAG,EAAE,EAAE;IAC5C,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,UAAU,CAAC,IAAIA,UAAU,CAACG,MAAM,GAAG,CAAC,EAAE;M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C,WAAW,CAAC;EAChD;EAEAC,OAAOA,CAAA,EAAG;IACR,OAAO,IAAI;EACb;EAEAC,oBAAoBA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACpB,UAAU,CAACS,GAAG,CAAEC,SAAS,IAAKA,SAAS,CAACW,KAAK,CAAC,CAAC,CAAC;EAC9D;EAEAA,KAAKA,CAAA,EAAG;IACN,OAAO,IAAIvB,cAAc,CACvB,IAAI,CAACE,UAAU,CAACS,GAAG,CAAEC,SAAS,IAAKA,SAAS,CAACW,KAAK,CAAC,CAAC,CACtD,CAAC;EACH;AACF;AAACC,OAAA,CAAAxB,cAAA,GAAAA,cAAA"}
1
+ {"version":3,"file":"condition-group.js","names":["_helpers","require","ConditionGroup","constructor","conditions","Array","isArray","length","Error","coordinatorString","conditionString","copy","splice","map","condition","toPresentationString","join","conditionExpression","toExpression","asFirstCondition","getCoordinator","setCoordinator","coordinator","isGroup","getGroupedConditions","clone","exports"],"sources":["../../../src/conditions/condition-group.ts"],"sourcesContent":["import { Coordinator } from '~/src/conditions/enums'\nimport { toPresentationString, toExpression } from '~/src/conditions/helpers'\nimport { type ConditionsArray } from '~/src/conditions/types'\n\nexport class ConditionGroup {\n conditions: ConditionsArray\n\n constructor(conditions: ConditionsArray = []) {\n if (!Array.isArray(conditions) || conditions.length < 2) {\n throw Error('Cannot construct a condition group from a single condition')\n }\n\n this.conditions = conditions\n }\n\n coordinatorString() {\n return this.conditions[0].coordinatorString()\n }\n\n conditionString() {\n const copy = [...this.conditions]\n copy.splice(0, 1)\n return `(${this.conditions[0].conditionString()} ${copy\n .map((condition) => toPresentationString(condition))\n .join(' ')})`\n }\n\n conditionExpression() {\n const copy = [...this.conditions]\n copy.splice(0, 1)\n return `(${this.conditions[0].conditionExpression()} ${copy\n .map((condition) => toExpression(condition))\n .join(' ')})`\n }\n\n asFirstCondition() {\n this.conditions[0].asFirstCondition()\n return this\n }\n\n getCoordinator() {\n return this.conditions[0].getCoordinator()\n }\n\n setCoordinator(coordinator: Coordinator | undefined) {\n this.conditions[0].setCoordinator(coordinator)\n }\n\n isGroup() {\n return true\n }\n\n getGroupedConditions() {\n return this.conditions.map((condition) => condition.clone())\n }\n\n clone() {\n return new ConditionGroup(\n this.conditions.map((condition) => condition.clone())\n )\n }\n}\n"],"mappings":";;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAGO,MAAMC,cAAc,CAAC;EAG1BC,WAAWA,CAACC,UAA2B,GAAG,EAAE,EAAE;IAC5C,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,UAAU,CAAC,IAAIA,UAAU,CAACG,MAAM,GAAG,CAAC,EAAE;MACvD,MAAMC,KAAK,CAAC,4DAA4D,CAAC;IAC3E;IAEA,IAAI,CAACJ,UAAU,GAAGA,UAAU;EAC9B;EAEAK,iBAAiBA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACL,UAAU,CAAC,CAAC,CAAC,CAACK,iBAAiB,CAAC,CAAC;EAC/C;EAEAC,eAAeA,CAAA,EAAG;IAChB,MAAMC,IAAI,GAAG,CAAC,GAAG,IAAI,CAACP,UAAU,CAAC;IACjCO,IAAI,CAACC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;IACjB,OAAQ,IAAG,IAAI,CAACR,UAAU,CAAC,CAAC,CAAC,CAACM,eAAe,CAAC,CAAE,IAAGC,IAAI,CACpDE,GAAG,CAAEC,SAAS,IAAK,IAAAC,6BAAoB,EAACD,SAAS,CAAC,CAAC,CACnDE,IAAI,CAAC,GAAG,CAAE,GAAE;EACjB;EAEAC,mBAAmBA,CAAA,EAAG;IACpB,MAAMN,IAAI,GAAG,CAAC,GAAG,IAAI,CAACP,UAAU,CAAC;IACjCO,IAAI,CAACC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;IACjB,OAAQ,IAAG,IAAI,CAACR,UAAU,CAAC,CAAC,CAAC,CAACa,mBAAmB,CAAC,CAAE,IAAGN,IAAI,CACxDE,GAAG,CAAEC,SAAS,IAAK,IAAAI,qBAAY,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