@defra/forms-model 3.0.11 → 3.0.12

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 (81) hide show
  1. package/package.json +2 -4
  2. package/dist/browser/components/component-types.js +0 -202
  3. package/dist/browser/components/component-types.js.map +0 -1
  4. package/dist/browser/components/conditional-component-types.js +0 -10
  5. package/dist/browser/components/conditional-component-types.js.map +0 -1
  6. package/dist/browser/components/enums.js +0 -28
  7. package/dist/browser/components/enums.js.map +0 -1
  8. package/dist/browser/components/index.js +0 -4
  9. package/dist/browser/components/index.js.map +0 -1
  10. package/dist/browser/components/types.js +0 -2
  11. package/dist/browser/components/types.js.map +0 -1
  12. package/dist/browser/conditions/condition-abstract.js +0 -44
  13. package/dist/browser/conditions/condition-abstract.js.map +0 -1
  14. package/dist/browser/conditions/condition-field.js +0 -27
  15. package/dist/browser/conditions/condition-field.js.map +0 -1
  16. package/dist/browser/conditions/condition-group-def.js +0 -26
  17. package/dist/browser/conditions/condition-group-def.js.map +0 -1
  18. package/dist/browser/conditions/condition-group.js +0 -46
  19. package/dist/browser/conditions/condition-group.js.map +0 -1
  20. package/dist/browser/conditions/condition-model.js +0 -203
  21. package/dist/browser/conditions/condition-model.js.map +0 -1
  22. package/dist/browser/conditions/condition-operators.js +0 -111
  23. package/dist/browser/conditions/condition-operators.js.map +0 -1
  24. package/dist/browser/conditions/condition-ref.js +0 -33
  25. package/dist/browser/conditions/condition-ref.js.map +0 -1
  26. package/dist/browser/conditions/condition-value-abstract.js +0 -23
  27. package/dist/browser/conditions/condition-value-abstract.js.map +0 -1
  28. package/dist/browser/conditions/condition-value-registration.js +0 -18
  29. package/dist/browser/conditions/condition-value-registration.js.map +0 -1
  30. package/dist/browser/conditions/condition-values.js +0 -107
  31. package/dist/browser/conditions/condition-values.js.map +0 -1
  32. package/dist/browser/conditions/condition.js +0 -41
  33. package/dist/browser/conditions/condition.js.map +0 -1
  34. package/dist/browser/conditions/enums.js +0 -6
  35. package/dist/browser/conditions/enums.js.map +0 -1
  36. package/dist/browser/conditions/helpers.js +0 -7
  37. package/dist/browser/conditions/helpers.js.map +0 -1
  38. package/dist/browser/conditions/index.js +0 -11
  39. package/dist/browser/conditions/index.js.map +0 -1
  40. package/dist/browser/conditions/inline-condition-model.js +0 -396
  41. package/dist/browser/conditions/inline-condition-model.js.map +0 -1
  42. package/dist/browser/conditions/inline-condition-operators.js +0 -111
  43. package/dist/browser/conditions/inline-condition-operators.js.map +0 -1
  44. package/dist/browser/conditions/inline-condition-values.js +0 -137
  45. package/dist/browser/conditions/inline-condition-values.js.map +0 -1
  46. package/dist/browser/conditions/types.js +0 -2
  47. package/dist/browser/conditions/types.js.map +0 -1
  48. package/dist/browser/data-model/conditions-wrapper.js +0 -31
  49. package/dist/browser/data-model/conditions-wrapper.js.map +0 -1
  50. package/dist/browser/data-model/enums.js +0 -7
  51. package/dist/browser/data-model/enums.js.map +0 -1
  52. package/dist/browser/data-model/index.js +0 -4
  53. package/dist/browser/data-model/index.js.map +0 -1
  54. package/dist/browser/data-model/input-wrapper.js +0 -31
  55. package/dist/browser/data-model/input-wrapper.js.map +0 -1
  56. package/dist/browser/data-model/types.js +0 -9
  57. package/dist/browser/data-model/types.js.map +0 -1
  58. package/dist/browser/form/form-configuration.js +0 -19
  59. package/dist/browser/form/form-configuration.js.map +0 -1
  60. package/dist/browser/form/index.js +0 -2
  61. package/dist/browser/form/index.js.map +0 -1
  62. package/dist/browser/index.js +0 -9
  63. package/dist/browser/index.js.map +0 -1
  64. package/dist/browser/migration/index.js +0 -2
  65. package/dist/browser/migration/index.js.map +0 -1
  66. package/dist/browser/migration/migration.0-2.js +0 -47
  67. package/dist/browser/migration/migration.0-2.js.map +0 -1
  68. package/dist/browser/migration/migration.1-2.js +0 -92
  69. package/dist/browser/migration/migration.1-2.js.map +0 -1
  70. package/dist/browser/migration/types.js +0 -2
  71. package/dist/browser/migration/types.js.map +0 -1
  72. package/dist/browser/migration/whichMigrations.js +0 -22
  73. package/dist/browser/migration/whichMigrations.js.map +0 -1
  74. package/dist/browser/schema/index.js +0 -2
  75. package/dist/browser/schema/index.js.map +0 -1
  76. package/dist/browser/schema/schema.js +0 -237
  77. package/dist/browser/schema/schema.js.map +0 -1
  78. package/dist/browser/utils/helpers.js +0 -27
  79. package/dist/browser/utils/helpers.js.map +0 -1
  80. package/dist/browser/utils/logger.js +0 -27
  81. package/dist/browser/utils/logger.js.map +0 -1
@@ -1,111 +0,0 @@
1
- import { ConditionValue, dateDirections, dateTimeUnits, dateUnits, RelativeTimeValue, timeUnits } from "./inline-condition-values.js";
2
- const defaultOperators = {
3
- is: inline('=='),
4
- 'is not': inline('!=')
5
- };
6
- function withDefaults(param) {
7
- return Object.assign({}, param, defaultOperators);
8
- }
9
- const textBasedFieldCustomisations = {
10
- 'is longer than': lengthIs('>'),
11
- 'is shorter than': lengthIs('<'),
12
- 'has length': lengthIs('==')
13
- };
14
- const absoluteDateTimeOperators = {
15
- is: absoluteDateTime('=='),
16
- 'is not': absoluteDateTime('!='),
17
- 'is before': absoluteDateTime('<'),
18
- 'is after': absoluteDateTime('>')
19
- };
20
- const relativeTimeOperators = units => ({
21
- 'is at least': relativeTime('<=', '>=', units),
22
- 'is at most': relativeTime('>=', '<=', units),
23
- 'is less than': relativeTime('>', '<', units),
24
- 'is more than': relativeTime('<', '>', units)
25
- });
26
- export const customOperators = {
27
- CheckboxesField: {
28
- contains: reverseInline('in'),
29
- 'does not contain': not(reverseInline('in'))
30
- },
31
- NumberField: withDefaults({
32
- 'is at least': inline('>='),
33
- 'is at most': inline('<='),
34
- 'is less than': inline('<'),
35
- 'is more than': inline('>')
36
- }),
37
- DateField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(dateUnits)),
38
- TimeField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(timeUnits)),
39
- DatePartsField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(dateUnits)),
40
- DateTimeField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(dateTimeUnits)),
41
- DateTimePartsField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(dateTimeUnits)),
42
- TextField: withDefaults(textBasedFieldCustomisations),
43
- MultilineTextField: withDefaults(textBasedFieldCustomisations),
44
- EmailAddressField: withDefaults(textBasedFieldCustomisations)
45
- };
46
- export function getOperatorNames(fieldType) {
47
- return Object.keys(getConditionals(fieldType)).sort();
48
- }
49
- export function getExpression(fieldType, fieldName, operator, value) {
50
- return getConditionals(fieldType)[operator].expression({
51
- type: fieldType,
52
- name: fieldName
53
- }, value);
54
- }
55
- export function getOperatorConfig(fieldType, operator) {
56
- return getConditionals(fieldType)[operator];
57
- }
58
- function getConditionals(fieldType) {
59
- return customOperators[fieldType] || defaultOperators;
60
- }
61
- function inline(operator) {
62
- return {
63
- expression: (field, value) => `${field.name} ${operator} ${formatValue(field.type, value.value)}`
64
- };
65
- }
66
- function lengthIs(operator) {
67
- return {
68
- expression: (field, value) => `length(${field.name}) ${operator} ${value.value}`
69
- };
70
- }
71
- function reverseInline(operator) {
72
- return {
73
- expression: (field, value) => `${formatValue(field.type, value.value)} ${operator} ${field.name}`
74
- };
75
- }
76
- function not(operatorDefinition) {
77
- return {
78
- expression: (field, value) => `not (${operatorDefinition.expression(field, value)})`
79
- };
80
- }
81
- function formatValue(fieldType, value) {
82
- if (fieldType === 'NumberField' || fieldType === 'YesNoField') {
83
- return value;
84
- }
85
- return `'${value}'`;
86
- }
87
- export const absoluteDateOrTimeOperatorNames = Object.keys(absoluteDateTimeOperators);
88
- export const relativeDateOrTimeOperatorNames = Object.keys(relativeTimeOperators(dateTimeUnits));
89
- function absoluteDateTime(operator) {
90
- return {
91
- expression: (field, value) => {
92
- if (value instanceof ConditionValue) {
93
- return `${field.name} ${operator} '${value.toExpression()}'`;
94
- }
95
- throw Error('only Value types are supported');
96
- }
97
- };
98
- }
99
- function relativeTime(pastOperator, futureOperator, units) {
100
- return {
101
- units,
102
- expression: (field, value) => {
103
- if (value instanceof RelativeTimeValue) {
104
- const operator = value.direction === dateDirections.PAST ? pastOperator : futureOperator;
105
- return `${field.name} ${operator} ${value.toExpression()}`;
106
- }
107
- throw Error('time shift requires a TimeShiftValue');
108
- }
109
- };
110
- }
111
- //# sourceMappingURL=inline-condition-operators.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-condition-operators.js","names":["ConditionValue","dateDirections","dateTimeUnits","dateUnits","RelativeTimeValue","timeUnits","defaultOperators","is","inline","withDefaults","param","Object","assign","textBasedFieldCustomisations","lengthIs","absoluteDateTimeOperators","absoluteDateTime","relativeTimeOperators","units","relativeTime","customOperators","CheckboxesField","contains","reverseInline","not","NumberField","DateField","TimeField","DatePartsField","DateTimeField","DateTimePartsField","TextField","MultilineTextField","EmailAddressField","getOperatorNames","fieldType","keys","getConditionals","sort","getExpression","fieldName","operator","value","expression","type","name","getOperatorConfig","field","formatValue","operatorDefinition","absoluteDateOrTimeOperatorNames","relativeDateOrTimeOperatorNames","toExpression","Error","pastOperator","futureOperator","direction","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.js'\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":"AAAA,SACEA,cAAc,EACdC,cAAc,EACdC,aAAa,EACbC,SAAS,EACTC,iBAAiB,EACjBC,SAAS;AAGX,MAAMC,gBAAgB,GAAG;EACvBC,EAAE,EAAEC,MAAM,CAAC,IAAI,CAAC;EAChB,QAAQ,EAAEA,MAAM,CAAC,IAAI;AACvB,CAAC;AAED,SAASC,YAAYA,CAACC,KAAK,EAAE;EAC3B,OAAOC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEF,KAAK,EAAEJ,gBAAgB,CAAC;AACnD;AAEA,MAAMO,4BAA4B,GAAG;EACnC,gBAAgB,EAAEC,QAAQ,CAAC,GAAG,CAAC;EAC/B,iBAAiB,EAAEA,QAAQ,CAAC,GAAG,CAAC;EAChC,YAAY,EAAEA,QAAQ,CAAC,IAAI;AAC7B,CAAC;AAED,MAAMC,yBAAyB,GAAG;EAChCR,EAAE,EAAES,gBAAgB,CAAC,IAAI,CAAC;EAC1B,QAAQ,EAAEA,gBAAgB,CAAC,IAAI,CAAC;EAChC,WAAW,EAAEA,gBAAgB,CAAC,GAAG,CAAC;EAClC,UAAU,EAAEA,gBAAgB,CAAC,GAAG;AAClC,CAAC;AAED,MAAMC,qBAAqB,GAAI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tC,MAAMqC,QAAQ,GACZC,KAAK,CAACc,SAAS,KAAKvD,cAAc,CAACwD,IAAI,GACnCH,YAAY,GACZC,cAAc;QACpB,OAAQ,GAAER,KAAK,CAACF,IAAK,IAAGJ,QAAS,IAAGC,KAAK,CAACU,YAAY,CAAC,CAAE,EAAC;MAC5D;MACA,MAAMC,KAAK,CAAC,sCAAsC,CAAC;IACrD;EACF,CAAC;AACH"}
@@ -1,137 +0,0 @@
1
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
3
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- const conditionValueFactories = {};
5
- class Registration {
6
- constructor(type, factory) {
7
- _defineProperty(this, "type", void 0);
8
- conditionValueFactories[type] = factory;
9
- this.type = type;
10
- }
11
- }
12
- export class AbstractConditionValue {
13
- constructor(registration) {
14
- _defineProperty(this, "type", void 0);
15
- if (new.target === AbstractConditionValue) {
16
- throw new TypeError('Cannot construct ConditionValue instances directly');
17
- }
18
- if (!(registration instanceof Registration)) {
19
- throw new TypeError('You must register your value type! Call registerValueType!');
20
- }
21
- this.type = registration.type;
22
- }
23
- toPresentationString() {}
24
- toExpression() {}
25
- }
26
- const valueType = registerValueType('Value', obj => ConditionValue.from(obj));
27
- export class ConditionValue extends AbstractConditionValue {
28
- constructor(value, display) {
29
- super(valueType);
30
- _defineProperty(this, "value", void 0);
31
- _defineProperty(this, "display", void 0);
32
- if (!value || typeof value !== 'string') {
33
- throw Error(`value ${value} is not valid`);
34
- }
35
- if (display && typeof display !== 'string') {
36
- throw Error(`display ${display} is not valid`);
37
- }
38
- this.value = value;
39
- this.display = display || value;
40
- }
41
- toPresentationString() {
42
- return this.display;
43
- }
44
- toExpression() {
45
- return this.value;
46
- }
47
- static from(obj) {
48
- return new ConditionValue(obj.value, obj.display);
49
- }
50
- clone() {
51
- return ConditionValue.from(this);
52
- }
53
- }
54
- export const dateDirections = {
55
- FUTURE: 'in the future',
56
- PAST: 'in the past'
57
- };
58
- export const dateUnits = {
59
- YEARS: {
60
- display: 'year(s)',
61
- value: 'years'
62
- },
63
- MONTHS: {
64
- display: 'month(s)',
65
- value: 'months'
66
- },
67
- DAYS: {
68
- display: 'day(s)',
69
- value: 'days'
70
- }
71
- };
72
- export const timeUnits = {
73
- HOURS: {
74
- display: 'hour(s)',
75
- value: 'hours'
76
- },
77
- MINUTES: {
78
- display: 'minute(s)',
79
- value: 'minutes'
80
- },
81
- SECONDS: {
82
- display: 'second(s)',
83
- value: 'seconds'
84
- }
85
- };
86
- export const dateTimeUnits = Object.assign({}, dateUnits, timeUnits);
87
- export const relativeTimeValueType = registerValueType('RelativeTime', obj => RelativeTimeValue.from(obj));
88
- export class RelativeTimeValue extends AbstractConditionValue {
89
- constructor(timePeriod, timeUnit, direction, timeOnly = false) {
90
- super(relativeTimeValueType);
91
- _defineProperty(this, "timePeriod", void 0);
92
- _defineProperty(this, "timeUnit", void 0);
93
- _defineProperty(this, "direction", void 0);
94
- _defineProperty(this, "timeOnly", void 0);
95
- if (typeof timePeriod !== 'string') {
96
- throw Error(`time period ${timePeriod} is not valid`);
97
- }
98
- if (!Object.values(dateTimeUnits).map(it => it.value).includes(timeUnit)) {
99
- throw Error(`time unit ${timeUnit} is not valid`);
100
- }
101
- if (!Object.values(dateDirections).includes(direction)) {
102
- throw Error(`direction ${direction} is not valid`);
103
- }
104
- this.timePeriod = timePeriod;
105
- this.timeUnit = timeUnit;
106
- this.direction = direction;
107
- this.timeOnly = timeOnly;
108
- }
109
- toPresentationString() {
110
- return `${this.timePeriod} ${this.timeUnit} ${this.direction}`;
111
- }
112
- toExpression() {
113
- const timePeriod = this.direction === dateDirections.PAST ? 0 - Number(this.timePeriod) : this.timePeriod;
114
- return this.timeOnly ? `timeForComparison(${timePeriod}, '${this.timeUnit}')` : `dateForComparison(${timePeriod}, '${this.timeUnit}')`;
115
- }
116
- static from(obj) {
117
- return new RelativeTimeValue(obj.timePeriod, obj.timeUnit, obj.direction, obj.timeOnly);
118
- }
119
- clone() {
120
- return RelativeTimeValue.from(this);
121
- }
122
- }
123
-
124
- /**
125
- * All value types should call this, and should be located in this file.
126
- * Furthermore the types should be registered without the classes needing to be instantiated.
127
- *
128
- * Otherwise we can't guarantee they've been registered for deserialization before
129
- * valueFrom is called
130
- */
131
- function registerValueType(type, factory) {
132
- return new Registration(type, factory);
133
- }
134
- export function valueFrom(obj) {
135
- return conditionValueFactories[obj.type](obj);
136
- }
137
- //# sourceMappingURL=inline-condition-values.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-condition-values.js","names":["conditionValueFactories","Registration","constructor","type","factory","_defineProperty","AbstractConditionValue","registration","new","target","TypeError","toPresentationString","toExpression","valueType","registerValueType","obj","ConditionValue","from","value","display","Error","clone","dateDirections","FUTURE","PAST","dateUnits","YEARS","MONTHS","DAYS","timeUnits","HOURS","MINUTES","SECONDS","dateTimeUnits","Object","assign","relativeTimeValueType","RelativeTimeValue","timePeriod","timeUnit","direction","timeOnly","values","map","it","includes","Number","valueFrom"],"sources":["../../../src/conditions/inline-condition-values.ts"],"sourcesContent":["const conditionValueFactories = {}\n\nclass Registration {\n type\n\n constructor(type, factory) {\n conditionValueFactories[type] = factory\n this.type = type\n }\n}\n\nexport class AbstractConditionValue {\n type\n\n constructor(registration) {\n if (new.target === AbstractConditionValue) {\n throw new TypeError('Cannot construct ConditionValue instances directly')\n }\n if (!(registration instanceof Registration)) {\n throw new TypeError(\n 'You must register your value type! Call registerValueType!'\n )\n }\n this.type = registration.type\n }\n\n toPresentationString() {}\n toExpression() {}\n}\n\nconst valueType = registerValueType('Value', (obj) => ConditionValue.from(obj))\nexport class ConditionValue extends AbstractConditionValue {\n value\n display\n\n constructor(value, display) {\n super(valueType)\n if (!value || typeof value !== 'string') {\n throw Error(`value ${value} is not valid`)\n }\n if (display && typeof display !== 'string') {\n throw Error(`display ${display} is not valid`)\n }\n this.value = value\n this.display = display || value\n }\n\n toPresentationString() {\n return this.display\n }\n\n toExpression() {\n return this.value\n }\n\n static from(obj) {\n return new ConditionValue(obj.value, obj.display)\n }\n\n clone() {\n return ConditionValue.from(this)\n }\n}\n\nexport const dateDirections = {\n FUTURE: 'in the future',\n PAST: 'in the past'\n}\n\nexport const dateUnits = {\n YEARS: { display: 'year(s)', value: 'years' },\n MONTHS: { display: 'month(s)', value: 'months' },\n DAYS: { display: 'day(s)', value: 'days' }\n}\nexport const timeUnits = {\n HOURS: { display: 'hour(s)', value: 'hours' },\n MINUTES: { display: 'minute(s)', value: 'minutes' },\n SECONDS: { display: 'second(s)', value: 'seconds' }\n}\nexport const dateTimeUnits = Object.assign({}, dateUnits, timeUnits)\n\nexport const relativeTimeValueType = registerValueType('RelativeTime', (obj) =>\n RelativeTimeValue.from(obj)\n)\nexport class RelativeTimeValue extends AbstractConditionValue {\n timePeriod\n timeUnit\n direction\n timeOnly\n\n constructor(timePeriod, timeUnit, direction, timeOnly = false) {\n super(relativeTimeValueType)\n if (typeof timePeriod !== 'string') {\n throw Error(`time period ${timePeriod} is not valid`)\n }\n if (\n !Object.values(dateTimeUnits)\n .map((it) => it.value)\n .includes(timeUnit)\n ) {\n throw Error(`time unit ${timeUnit} is not valid`)\n }\n if (!Object.values(dateDirections).includes(direction)) {\n throw Error(`direction ${direction} is not valid`)\n }\n this.timePeriod = timePeriod\n this.timeUnit = timeUnit\n this.direction = direction\n this.timeOnly = timeOnly\n }\n\n toPresentationString() {\n return `${this.timePeriod} ${this.timeUnit} ${this.direction}`\n }\n\n toExpression() {\n const timePeriod =\n this.direction === dateDirections.PAST\n ? 0 - Number(this.timePeriod)\n : this.timePeriod\n return this.timeOnly\n ? `timeForComparison(${timePeriod}, '${this.timeUnit}')`\n : `dateForComparison(${timePeriod}, '${this.timeUnit}')`\n }\n\n static from(obj) {\n return new RelativeTimeValue(\n obj.timePeriod,\n obj.timeUnit,\n obj.direction,\n obj.timeOnly\n )\n }\n\n clone() {\n return RelativeTimeValue.from(this)\n }\n}\n\n/**\n * All value types should call this, and should be located in this file.\n * Furthermore the types should be registered without the classes needing to be instantiated.\n *\n * Otherwise we can't guarantee they've been registered for deserialization before\n * valueFrom is called\n */\nfunction registerValueType(type, factory) {\n return new Registration(type, factory)\n}\n\nexport function valueFrom(obj) {\n return conditionValueFactories[obj.type](obj)\n}\n"],"mappings":";;;AAAA,MAAMA,uBAAuB,GAAG,CAAC,CAAC;AAElC,MAAMC,YAAY,CAAC;EAGjBC,WAAWA,CAACC,IAAI,EAAEC,OAAO,EAAE;IAAAC,eAAA;IACzBL,uBAAuB,CAACG,IAAI,CAAC,GAAGC,OAAO;IACvC,IAAI,CAACD,IAAI,GAAGA,IAAI;EAClB;AACF;AAEA,OAAO,MAAMG,sBAAsB,CAAC;EAGlCJ,WAAWA,CAACK,YAAY,EAAE;IAAAF,eAAA;IACxB,IAAIG,GAAG,CAACC,MAAM,KAAKH,sBAAsB,EAAE;MACzC,MAAM,IAAII,SAAS,CAAC,oDAAoD,CAAC;IAC3E;IACA,IAAI,EAAEH,YAAY,YAAYN,YAAY,CAAC,EAAE;MAC3C,MAAM,IAAIS,SAAS,CACjB,4DACF,CAAC;IACH;IACA,IAAI,CAACP,IAAI,GAAGI,YAAY,CAACJ,IAAI;EAC/B;EAEAQ,oBAAoBA,CAAA,EAAG,CAAC;EACxBC,YAAYA,CAAA,EAAG,CAAC;AAClB;AAEA,MAAMC,SAAS,GAAGC,iBAAiB,CAAC,OAAO,EAAGC,GAAG,IAAKC,cAAc,CAACC,IAAI,CAACF,GAAG,CAAC,CAAC;AAC/E,OAAO,MAAMC,cAAc,SAASV,sBAAsB,CAAC;EAIzDJ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;EAEA9B,oBAAoBA,CAAA,EAAG;IACrB,OAAQ,GAAE,IAAI,CAAC2B,UAAW,IAAG,IAAI,CAACC,QAAS,IAAG,IAAI,CAACC,SAAU,EAAC;EAChE;EAEA5B,YAAYA,CAAA,EAAG;IACb,MAAM0B,UAAU,GACd,IAAI,CAACE,SAAS,KAAKlB,cAAc,CAACE,IAAI,GAClC,CAAC,GAAGsB,MAAM,CAAC,IAAI,CAACR,UAAU,CAAC,GAC3B,IAAI,CAACA,UAAU;IACrB,OAAO,IAAI,CAACG,QAAQ,GACf,qBAAoBH,UAAW,MAAK,IAAI,CAACC,QAAS,IAAG,GACrD,qBAAoBD,UAAW,MAAK,IAAI,CAACC,QAAS,IAAG;EAC5D;EAEA,OAAOtB,IAAIA,CAACF,GAAG,EAAE;IACf,OAAO,IAAIsB,iBAAiB,CAC1BtB,GAAG,CAACuB,UAAU,EACdvB,GAAG,CAACwB,QAAQ,EACZxB,GAAG,CAACyB,SAAS,EACbzB,GAAG,CAAC0B,QACN,CAAC;EACH;EAEApB,KAAKA,CAAA,EAAG;IACN,OAAOgB,iBAAiB,CAACpB,IAAI,CAAC,IAAI,CAAC;EACrC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASH,iBAAiBA,CAACX,IAAI,EAAEC,OAAO,EAAE;EACxC,OAAO,IAAIH,YAAY,CAACE,IAAI,EAAEC,OAAO,CAAC;AACxC;AAEA,OAAO,SAAS2C,SAASA,CAAChC,GAAG,EAAE;EAC7B,OAAOf,uBAAuB,CAACe,GAAG,CAACZ,IAAI,CAAC,CAACY,GAAG,CAAC;AAC/C"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/conditions/types.ts"],"sourcesContent":["import { type Condition } from '~/src/conditions/condition.js'\nimport { type ConditionRef } from '~/src/conditions/condition-ref.js'\nimport { type ConditionGroup } from '~/src/conditions/condition-group.js'\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,31 +0,0 @@
1
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
3
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { ConditionsModel } from "../conditions/condition-model.js";
5
- export class ConditionsWrapper {
6
- constructor(rawData) {
7
- _defineProperty(this, "name", void 0);
8
- _defineProperty(this, "displayName", void 0);
9
- _defineProperty(this, "value", void 0);
10
- const {
11
- name,
12
- displayName,
13
- value
14
- } = rawData;
15
- this.displayName = displayName || name;
16
- this.value = value;
17
- this.name = name;
18
- }
19
- get expression() {
20
- if (typeof this.value === 'string') {
21
- // Previously conditions were defined as strings, e.g: "section.age < 18"
22
- // keep this so application can support legacy forms exports.
23
- return this.value;
24
- }
25
- return ConditionsModel.from(this.value).toExpression();
26
- }
27
- clone() {
28
- return new ConditionsWrapper(this);
29
- }
30
- }
31
- //# sourceMappingURL=conditions-wrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditions-wrapper.js","names":["ConditionsModel","ConditionsWrapper","constructor","rawData","_defineProperty","name","displayName","value","expression","from","toExpression","clone"],"sources":["../../../src/data-model/conditions-wrapper.ts"],"sourcesContent":["import { ConditionsModel } from '~/src/conditions/condition-model.js'\nimport {\n type ConditionRawData,\n type ConditionWrapperValue\n} from '~/src/data-model/types.js'\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":";;;AAAA,SAASA,eAAe;AAMxB,OAAO,MAAMC,iBAAiB,CAAC;EAK7BC,WAAWA,CAACC,OAAyB,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACrC,MAAM;MAAEC,IAAI;MAAEC,WAAW;MAAEC;IAAM,CAAC,GAAGJ,OAAO;IAC5C,IAAI,CAACG,WAAW,GAAGA,WAAW,IAAID,IAAI;IACtC,IAAI,CAACE,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACF,IAAI,GAAGA,IAAI;EAClB;EAEA,IAAIG,UAAUA,CAAA,EAAG;IACf,IAAI,OAAO,IAAI,CAACD,KAAK,KAAK,QAAQ,EAAE;MAClC;MACA;MACA,OAAO,IAAI,CAACA,KAAK;IACnB;IAEA,OAAOP,eAAe,CAACS,IAAI,CAAC,IAAI,CAACF,KAAK,CAAC,CAACG,YAAY,CAAC,CAAC;EACxD;EAEAC,KAAKA,CAAA,EAAsB;IACzB,OAAO,IAAIV,iBAAiB,CAAC,IAAI,CAAC;EACpC;AACF"}
@@ -1,7 +0,0 @@
1
- export let OutputType = /*#__PURE__*/function (OutputType) {
2
- OutputType["Email"] = "email";
3
- OutputType["Notify"] = "notify";
4
- OutputType["Webhook"] = "webhook";
5
- return OutputType;
6
- }({});
7
- //# sourceMappingURL=enums.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enums.js","names":["OutputType"],"sources":["../../../src/data-model/enums.ts"],"sourcesContent":["export enum OutputType {\n Email = 'email',\n Notify = 'notify',\n Webhook = 'webhook'\n}\n"],"mappings":"AAAA,WAAYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA"}
@@ -1,4 +0,0 @@
1
- export { InputWrapper } from "./input-wrapper.js";
2
- export { ConditionsWrapper } from "./conditions-wrapper.js";
3
- export { OutputType } from "./enums.js";
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["InputWrapper","ConditionsWrapper","OutputType"],"sources":["../../../src/data-model/index.ts"],"sourcesContent":["export { InputWrapper } from '~/src/data-model/input-wrapper.js'\nexport { ConditionsWrapper } from '~/src/data-model/conditions-wrapper.js'\nexport { OutputType } from '~/src/data-model/enums.js'\n"],"mappings":"AAAA,SAASA,YAAY;AACrB,SAASC,iBAAiB;AAC1B,SAASC,UAAU"}
@@ -1,31 +0,0 @@
1
- function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
2
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
3
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
5
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
7
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
8
- function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
9
- import { clone } from "../utils/helpers.js";
10
- var _parentItemName = /*#__PURE__*/new WeakMap();
11
- export class InputWrapper {
12
- constructor(rawData, page, options) {
13
- _defineProperty(this, "name", undefined);
14
- _defineProperty(this, "title", undefined);
15
- _defineProperty(this, "type", undefined);
16
- _defineProperty(this, "propertyPath", void 0);
17
- _classPrivateFieldInitSpec(this, _parentItemName, void 0);
18
- _defineProperty(this, "page", void 0);
19
- Object.assign(this, rawData);
20
- const myPage = clone(page);
21
- delete myPage.components;
22
- this.page = myPage;
23
- this.propertyPath = !options.ignoreSection && page.section ? `${page.section}.${this.name}` : this.name;
24
- _classPrivateFieldSet(_parentItemName, this, options.parentItemName);
25
- }
26
- get displayName() {
27
- const titleWithContext = _classPrivateFieldGet(_parentItemName, this) ? `${this.title} under ${_classPrivateFieldGet(_parentItemName, this)}` : this.title;
28
- return this.page.section ? `${titleWithContext} in ${this.page.section}` : titleWithContext;
29
- }
30
- }
31
- //# sourceMappingURL=input-wrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-wrapper.js","names":["clone","_parentItemName","WeakMap","InputWrapper","constructor","rawData","page","options","_defineProperty","undefined","_classPrivateFieldInitSpec","Object","assign","myPage","components","propertyPath","ignoreSection","section","name","_classPrivateFieldSet","parentItemName","displayName","titleWithContext","_classPrivateFieldGet","title"],"sources":["../../../src/data-model/input-wrapper.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport { type Page } from '~/src/data-model/types.js'\nimport { clone } from '~/src/utils/helpers.js'\n\nexport class InputWrapper {\n name: string | undefined = undefined\n title: string | undefined = undefined\n type: string | undefined = undefined\n propertyPath: string | undefined\n #parentItemName: string | undefined\n page: Page\n\n constructor(\n rawData: ComponentDef,\n page: Page,\n options: { ignoreSection?: boolean; parentItemName?: string }\n ) {\n Object.assign(this, rawData)\n const myPage = clone(page)\n\n delete myPage.components\n\n this.page = myPage\n this.propertyPath =\n !options.ignoreSection && page.section\n ? `${page.section}.${this.name}`\n : this.name\n this.#parentItemName = options.parentItemName\n }\n\n get displayName(): string | undefined {\n const titleWithContext = this.#parentItemName\n ? `${this.title} under ${this.#parentItemName}`\n : this.title\n\n return this.page.section\n ? `${titleWithContext} in ${this.page.section}`\n : titleWithContext\n }\n}\n"],"mappings":";;;;;;;;AAEA,SAASA,KAAK;AAAgC,IAAAC,eAAA,oBAAAC,OAAA;AAE9C,OAAO,MAAMC,YAAY,CAAC;EAQxBC,WAAWA,CACTC,OAAqB,EACrBC,IAAU,EACVC,OAA6D,EAC7D;IAAAC,eAAA,eAXyBC,SAAS;IAAAD,eAAA,gBACRC,SAAS;IAAAD,eAAA,eACVC,SAAS;IAAAD,eAAA;IAAAE,0BAAA,OAAAT,eAAA;IAAAO,eAAA;IAUlCG,MAAM,CAACC,MAAM,CAAC,IAAI,EAAEP,OAAO,CAAC;IAC5B,MAAMQ,MAAM,GAAGb,KAAK,CAACM,IAAI,CAAC;IAE1B,OAAOO,MAAM,CAACC,UAAU;IAExB,IAAI,CAACR,IAAI,GAAGO,MAAM;IAClB,IAAI,CAACE,YAAY,GACf,CAACR,OAAO,CAACS,aAAa,IAAIV,IAAI,CAACW,OAAO,GACjC,GAAEX,IAAI,CAACW,OAAQ,IAAG,IAAI,CAACC,IAAK,EAAC,GAC9B,IAAI,CAACA,IAAI;IACfC,qBAAA,CAAAlB,eAAA,MAAI,EAAmBM,OAAO,CAACa,cAAc;EAC/C;EAEA,IAAIC,WAAWA,CAAA,EAAuB;IACpC,MAAMC,gBAAgB,GAAGC,qBAAA,CAAAtB,eAAA,MAAI,IACxB,GAAE,IAAI,CAACuB,KAAM,UAAOD,qBAAA,CAAAtB,eAAA,EAAE,IAAI,CAAiB,EAAC,GAC7C,IAAI,CAACuB,KAAK;IAEd,OAAO,IAAI,CAAClB,IAAI,CAACW,OAAO,GACnB,GAAEK,gBAAiB,OAAM,IAAI,CAAChB,IAAI,CAACW,OAAQ,EAAC,GAC7CK,gBAAgB;EACtB;AACF"}
@@ -1,9 +0,0 @@
1
- export function isMultipleApiKey(payApiKey) {
2
- const obj = payApiKey;
3
- return obj.test !== undefined || obj.production !== undefined;
4
- }
5
-
6
- /**
7
- * `FormDefinition` is a typescript representation of `Schema`
8
- */
9
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","names":["isMultipleApiKey","payApiKey","obj","test","undefined","production"],"sources":["../../../src/data-model/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport { type Condition } from '~/src/conditions/condition.js'\nimport { type OutputType } from '~/src/data-model/enums.js'\n\ntype Toggleable<T> = boolean | T\n\nexport interface Next {\n path: string\n condition?: string\n}\nexport type Link = Next\n\nexport interface Page {\n title: string\n path: string\n controller: string\n components?: ComponentDef[]\n section: string // the section ID\n next?: { path: string; condition?: string }[]\n}\n\nexport interface RepeatingFieldPage extends Page {\n controller: 'RepeatingFieldPageController'\n options: {\n summaryDisplayMode?: {\n samePage?: boolean\n separatePage?: boolean\n hideRowTitles?: boolean\n }\n customText?: {\n separatePageTitle?: string\n }\n }\n}\n\nexport interface Section {\n name: string\n title: string\n hideTitle: boolean\n}\n\nexport interface Item {\n text: string\n value: string | number | boolean\n description?: string\n condition?: string\n}\n\nexport interface List {\n name: string\n title: string\n type: 'string' | 'number' | 'boolean'\n items: Item[]\n}\n\nexport interface Feedback {\n feedbackForm?: boolean\n url?: string\n emailAddress?: string\n}\n\nexport type PhaseBanner = {\n phase?: 'alpha' | 'beta'\n feedbackUrl?: string\n}\n\nexport type MultipleApiKeys = {\n test?: string\n production?: string\n}\n\nexport type EmailOutputConfiguration = {\n emailAddress: string\n}\n\nexport type NotifyOutputConfiguration = {\n apiKey: string\n templateId: string\n emailField: string\n personalisation: string[]\n personalisationFieldCustomisation?: {\n [personalisationName: string]: string[]\n }\n addReferencesToPersonalisation?: boolean\n emailReplyToIdConfiguration?: {\n emailReplyToId: string\n condition?: string | undefined\n }[]\n}\n\nexport type WebhookOutputConfiguration = {\n url: string\n}\n\nexport type OutputConfiguration =\n | EmailOutputConfiguration\n | NotifyOutputConfiguration\n | WebhookOutputConfiguration\n\nexport type Output = {\n name: string\n title: string\n type: OutputType\n outputConfiguration: OutputConfiguration\n}\n\nexport type ConfirmationPage = {\n customText: {\n title: string\n paymentSkipped: Toggleable<string>\n nextSteps: Toggleable<string>\n }\n components: ComponentDef[]\n}\n\nexport type PaymentSkippedWarningPage = {\n customText: {\n title: string\n caption: string\n body: string\n }\n}\n\nexport type SpecialPages = {\n confirmationPage?: ConfirmationPage\n paymentSkippedWarningPage?: PaymentSkippedWarningPage\n}\n\nexport function isMultipleApiKey(\n payApiKey: string | MultipleApiKeys | undefined\n): payApiKey is MultipleApiKeys {\n const obj = payApiKey as MultipleApiKeys\n return obj.test !== undefined || obj.production !== undefined\n}\n\nexport type Fee = {\n description: string\n amount: number\n multiplier?: string\n condition?: string\n prefix?: string\n}\n\nexport type FeeOptions = {\n paymentReferenceFormat?: string\n payReturnUrl?: string\n allowSubmissionWithoutPayment: boolean\n maxAttempts: number\n customPayErrorMessage?: string\n showPaymentSkippedWarningPage: boolean\n}\n\nexport type ConditionWrapperValue =\n | string\n | {\n name: string\n conditions: Condition[]\n }\n\nexport type ConditionRawData = {\n name: string\n displayName: string\n value: ConditionWrapperValue\n}\n\n/**\n * `FormDefinition` is a typescript representation of `Schema`\n */\nexport type FormDefinition = {\n pages: Array<Page | RepeatingFieldPage>\n conditions: ConditionRawData[]\n lists: List[]\n sections: Section[]\n startPage?: Page['path'] | undefined\n name?: string | undefined\n feedback?: Feedback\n phaseBanner?: PhaseBanner\n fees: Fee[]\n skipSummary?: boolean | undefined\n outputs: Output[]\n declaration?: string | undefined\n metadata?: Record<string, any>\n payApiKey?: string | MultipleApiKeys | undefined\n specialPages?: SpecialPages\n paymentReferenceFormat?: string\n feeOptions: FeeOptions\n}\n"],"mappings":"AAgIA,OAAO,SAASA,gBAAgBA,CAC9BC,SAA+C,EACjB;EAC9B,MAAMC,GAAG,GAAGD,SAA4B;EACxC,OAAOC,GAAG,CAACC,IAAI,KAAKC,SAAS,IAAIF,GAAG,CAACG,UAAU,KAAKD,SAAS;AAC/D;;AAgCA;AACA;AACA"}
@@ -1,19 +0,0 @@
1
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
3
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- export class FormConfiguration {
5
- constructor(Key, DisplayName, LastModified, feedbackForm) {
6
- _defineProperty(this, "Key", void 0);
7
- _defineProperty(this, "DisplayName", void 0);
8
- _defineProperty(this, "LastModified", void 0);
9
- _defineProperty(this, "feedbackForm", void 0);
10
- if (!Key) {
11
- throw Error('Form configuration must have a key');
12
- }
13
- this.Key = Key;
14
- this.DisplayName = DisplayName || Key;
15
- this.LastModified = LastModified;
16
- this.feedbackForm = feedbackForm || false;
17
- }
18
- }
19
- //# sourceMappingURL=form-configuration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-configuration.js","names":["FormConfiguration","constructor","Key","DisplayName","LastModified","feedbackForm","_defineProperty","Error"],"sources":["../../../src/form/form-configuration.ts"],"sourcesContent":["export class FormConfiguration {\n Key: string\n DisplayName: string\n LastModified: string | undefined\n feedbackForm: boolean | undefined\n\n constructor(\n Key: string,\n DisplayName?: string,\n LastModified?: string,\n feedbackForm?: boolean\n ) {\n if (!Key) {\n throw Error('Form configuration must have a key')\n }\n this.Key = Key\n this.DisplayName = DisplayName || Key\n this.LastModified = LastModified\n this.feedbackForm = feedbackForm || false\n }\n}\n"],"mappings":";;;AAAA,OAAO,MAAMA,iBAAiB,CAAC;EAM7BC,WAAWA,CACTC,GAAW,EACXC,WAAoB,EACpBC,YAAqB,EACrBC,YAAsB,EACtB;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACA,IAAI,CAACJ,GAAG,EAAE;MACR,MAAMK,KAAK,CAAC,oCAAoC,CAAC;IACnD;IACA,IAAI,CAACL,GAAG,GAAGA,GAAG;IACd,IAAI,CAACC,WAAW,GAAGA,WAAW,IAAID,GAAG;IACrC,IAAI,CAACE,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACC,YAAY,GAAGA,YAAY,IAAI,KAAK;EAC3C;AACF"}
@@ -1,2 +0,0 @@
1
- export { FormConfiguration } from "./form-configuration.js";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["FormConfiguration"],"sources":["../../../src/form/index.ts"],"sourcesContent":["export { FormConfiguration } from '~/src/form/form-configuration.js'\n"],"mappings":"AAAA,SAASA,iBAAiB"}
@@ -1,9 +0,0 @@
1
- export * from "./schema/index.js";
2
- export * from "./data-model/index.js";
3
- export * from "./utils/logger.js";
4
- export * from "./form/index.js";
5
- export * from "./components/index.js";
6
- export * from "./conditions/index.js";
7
- export * from "./utils/helpers.js";
8
- export * from "./migration/index.js";
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/schema/index.js'\nexport * from '~/src/data-model/index.js'\nexport * from '~/src/utils/logger.js'\nexport * from '~/src/form/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/migration/index.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/data-model/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
@@ -1,2 +0,0 @@
1
- export { whichMigrations } from "./whichMigrations.js";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["whichMigrations"],"sources":["../../../src/migration/index.ts"],"sourcesContent":["export { whichMigrations } from '~/src/migration/whichMigrations.js'\n"],"mappings":"AAAA,SAASA,eAAe"}
@@ -1,47 +0,0 @@
1
- const _excluded = ["list"];
2
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
3
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
8
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
- function needsUpgrade(data) {
10
- var _data$pages;
11
- return !!((_data$pages = data.pages) !== null && _data$pages !== void 0 ? _data$pages : []).flatMap(page => page.components).find(component => {
12
- var _component$options;
13
- return (_component$options = component.options) === null || _component$options === void 0 ? void 0 : _component$options.list;
14
- });
15
- }
16
- export function migrate(data) {
17
- if (!needsUpgrade(data)) {
18
- return _objectSpread(_objectSpread({}, data), {}, {
19
- version: 2
20
- });
21
- }
22
- const {
23
- pages
24
- } = data;
25
- const newPages = pages.flatMap(page => {
26
- return page.components.map(component => {
27
- var _component$options2;
28
- if (!((_component$options2 = component.options) !== null && _component$options2 !== void 0 && _component$options2.list)) {
29
- return component;
30
- }
31
- const _component$options3 = component.options,
32
- {
33
- list
34
- } = _component$options3,
35
- rest = _objectWithoutProperties(_component$options3, _excluded);
36
- return _objectSpread(_objectSpread({}, component), {}, {
37
- list,
38
- options: _objectSpread({}, rest)
39
- });
40
- });
41
- });
42
- return _objectSpread(_objectSpread({}, data), {}, {
43
- pages: newPages,
44
- version: 2
45
- });
46
- }
47
- //# sourceMappingURL=migration.0-2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration.0-2.js","names":["needsUpgrade","data","_data$pages","pages","flatMap","page","components","find","component","_component$options","options","list","migrate","_objectSpread","version","newPages","map","_component$options2","_component$options3","rest","_objectWithoutProperties","_excluded"],"sources":["../../../src/migration/migration.0-2.ts"],"sourcesContent":["import { type MigrationScript } from '~/src/migration/types.js'\n\nfunction needsUpgrade(data) {\n return !!(data.pages ?? [])\n .flatMap((page) => page.components)\n .find((component) => component.options?.list)\n}\n\nexport function migrate(data): MigrationScript {\n if (!needsUpgrade(data)) {\n return { ...data, version: 2 }\n }\n const { pages } = data\n const newPages = pages.flatMap((page) => {\n return page.components.map((component) => {\n if (!component.options?.list) {\n return component\n }\n const { list, ...rest } = component.options\n return { ...component, list, options: { ...rest } }\n })\n })\n\n return {\n ...data,\n pages: newPages,\n version: 2\n }\n}\n"],"mappings":";;;;;;;;AAEA,SAASA,YAAYA,CAACC,IAAI,EAAE;EAAA,IAAAC,WAAA;EAC1B,OAAO,CAAC,CAAC,EAAAA,WAAA,GAACD,IAAI,CAACE,KAAK,cAAAD,WAAA,cAAAA,WAAA,GAAI,EAAE,EACvBE,OAAO,CAAEC,IAAI,IAAKA,IAAI,CAACC,UAAU,CAAC,CAClCC,IAAI,CAAEC,SAAS;IAAA,IAAAC,kBAAA;IAAA,QAAAA,kBAAA,GAAKD,SAAS,CAACE,OAAO,cAAAD,kBAAA,uBAAjBA,kBAAA,CAAmBE,IAAI;EAAA,EAAC;AACjD;AAEA,OAAO,SAASC,OAAOA,CAACX,IAAI,EAAmB;EAC7C,IAAI,CAACD,YAAY,CAACC,IAAI,CAAC,EAAE;IACvB,OAAAY,aAAA,CAAAA,aAAA,KAAYZ,IAAI;MAAEa,OAAO,EAAE;IAAC;EAC9B;EACA,MAAM;IAAEX;EAAM,CAAC,GAAGF,IAAI;EACtB,MAAMc,QAAQ,GAAGZ,KAAK,CAACC,OAAO,CAAEC,IAAI,IAAK;IACvC,OAAOA,IAAI,CAACC,UAAU,CAACU,GAAG,CAAER,SAAS,IAAK;MAAA,IAAAS,mBAAA;MACxC,IAAI,GAAAA,mBAAA,GAACT,SAAS,CAACE,OAAO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