@defra/forms-model 3.0.8 → 3.0.10
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.
- package/dist/browser/components/component-types.js.map +1 -1
- package/dist/browser/components/conditional-component-types.js.map +1 -1
- package/dist/browser/components/index.js.map +1 -1
- package/dist/browser/conditions/condition-abstract.js.map +1 -1
- package/dist/browser/conditions/condition-field.js.map +1 -1
- package/dist/browser/conditions/condition-group-def.js.map +1 -1
- package/dist/browser/conditions/condition-group.js.map +1 -1
- package/dist/browser/conditions/condition-model.js.map +1 -1
- package/dist/browser/conditions/condition-operators.js.map +1 -1
- package/dist/browser/conditions/condition-ref.js.map +1 -1
- package/dist/browser/conditions/condition-value-abstract.js.map +1 -1
- package/dist/browser/conditions/condition-values.js.map +1 -1
- package/dist/browser/conditions/condition.js.map +1 -1
- package/dist/browser/conditions/index.js.map +1 -1
- package/dist/browser/conditions/inline-condition-model.js.map +1 -1
- package/dist/browser/conditions/inline-condition-operators.js.map +1 -1
- package/dist/browser/conditions/types.js.map +1 -1
- package/dist/browser/data-model/conditions-wrapper.js.map +1 -1
- package/dist/browser/data-model/index.js +4 -40
- package/dist/browser/data-model/index.js.map +1 -1
- package/dist/browser/data-model/input-wrapper.js.map +1 -1
- package/dist/browser/data-model/types.js.map +1 -1
- package/dist/browser/form/index.js.map +1 -1
- package/dist/browser/index.js +45 -70
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/migration/index.js.map +1 -1
- package/dist/browser/migration/migration.0-2.js.map +1 -1
- package/dist/browser/migration/migration.1-2.js.map +1 -1
- package/dist/browser/migration/whichMigrations.js.map +1 -1
- package/dist/browser/schema/index.js.map +1 -1
- package/dist/module/components/component-types.js.map +1 -1
- package/dist/module/components/conditional-component-types.js.map +1 -1
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/types.js +2 -1
- package/dist/module/conditions/condition-abstract.js.map +1 -1
- package/dist/module/conditions/condition-field.js.map +1 -1
- package/dist/module/conditions/condition-group-def.js.map +1 -1
- package/dist/module/conditions/condition-group.js.map +1 -1
- package/dist/module/conditions/condition-model.js.map +1 -1
- package/dist/module/conditions/condition-operators.js.map +1 -1
- package/dist/module/conditions/condition-ref.js.map +1 -1
- package/dist/module/conditions/condition-value-abstract.js.map +1 -1
- package/dist/module/conditions/condition-values.js.map +1 -1
- package/dist/module/conditions/condition.js.map +1 -1
- package/dist/module/conditions/index.js.map +1 -1
- package/dist/module/conditions/inline-condition-model.js.map +1 -1
- package/dist/module/conditions/inline-condition-operators.js.map +1 -1
- package/dist/module/conditions/types.js +2 -1
- package/dist/module/conditions/types.js.map +1 -1
- package/dist/module/data-model/conditions-wrapper.js.map +1 -1
- package/dist/module/data-model/index.js +0 -37
- package/dist/module/data-model/index.js.map +1 -1
- package/dist/module/data-model/input-wrapper.js.map +1 -1
- package/dist/module/data-model/types.js.map +1 -1
- package/dist/module/form/index.js.map +1 -1
- package/dist/module/index.js +50 -75
- package/dist/module/index.js.map +1 -1
- package/dist/module/migration/index.js.map +1 -1
- package/dist/module/migration/migration.0-2.js.map +1 -1
- package/dist/module/migration/migration.1-2.js.map +1 -1
- package/dist/module/migration/types.js +2 -1
- package/dist/module/migration/whichMigrations.js.map +1 -1
- package/dist/module/schema/index.js.map +1 -1
- package/dist/types/components/component-types.d.ts +1 -1
- package/dist/types/components/component-types.d.ts.map +1 -1
- package/dist/types/components/conditional-component-types.d.ts +1 -1
- package/dist/types/components/conditional-component-types.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +3 -4
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/conditions/condition-abstract.d.ts +1 -1
- package/dist/types/conditions/condition-abstract.d.ts.map +1 -1
- package/dist/types/conditions/condition-field.d.ts +1 -1
- package/dist/types/conditions/condition-field.d.ts.map +1 -1
- package/dist/types/conditions/condition-group-def.d.ts +1 -1
- package/dist/types/conditions/condition-group-def.d.ts.map +1 -1
- package/dist/types/conditions/condition-group.d.ts +2 -2
- package/dist/types/conditions/condition-group.d.ts.map +1 -1
- package/dist/types/conditions/condition-model.d.ts +5 -5
- package/dist/types/conditions/condition-model.d.ts.map +1 -1
- package/dist/types/conditions/condition-operators.d.ts +2 -2
- package/dist/types/conditions/condition-operators.d.ts.map +1 -1
- package/dist/types/conditions/condition-ref.d.ts +2 -2
- package/dist/types/conditions/condition-ref.d.ts.map +1 -1
- package/dist/types/conditions/condition-value-abstract.d.ts +1 -1
- package/dist/types/conditions/condition-value-abstract.d.ts.map +1 -1
- package/dist/types/conditions/condition-values.d.ts +3 -3
- package/dist/types/conditions/condition-values.d.ts.map +1 -1
- package/dist/types/conditions/condition.d.ts +4 -4
- package/dist/types/conditions/condition.d.ts.map +1 -1
- package/dist/types/conditions/index.d.ts +10 -10
- package/dist/types/conditions/index.d.ts.map +1 -1
- package/dist/types/conditions/inline-condition-model.d.ts.map +1 -1
- package/dist/types/conditions/types.d.ts +3 -3
- package/dist/types/conditions/types.d.ts.map +1 -1
- package/dist/types/data-model/conditions-wrapper.d.ts +1 -10
- package/dist/types/data-model/conditions-wrapper.d.ts.map +1 -1
- package/dist/types/data-model/index.d.ts +3 -4
- package/dist/types/data-model/index.d.ts.map +1 -1
- package/dist/types/data-model/input-wrapper.d.ts +2 -2
- package/dist/types/data-model/input-wrapper.d.ts.map +1 -1
- package/dist/types/data-model/types.d.ts +12 -3
- package/dist/types/data-model/types.d.ts.map +1 -1
- package/dist/types/form/index.d.ts +1 -1
- package/dist/types/form/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/migration/index.d.ts +1 -1
- package/dist/types/migration/index.d.ts.map +1 -1
- package/dist/types/migration/migration.0-2.d.ts +1 -1
- package/dist/types/migration/migration.0-2.d.ts.map +1 -1
- package/dist/types/migration/migration.1-2.d.ts +1 -1
- package/dist/types/migration/migration.1-2.d.ts.map +1 -1
- package/dist/types/migration/whichMigrations.d.ts +1 -1
- package/dist/types/migration/whichMigrations.d.ts.map +1 -1
- package/dist/types/schema/index.d.ts +1 -1
- package/dist/types/schema/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/components/component-types.ts +1 -1
- package/src/components/conditional-component-types.ts +1 -1
- package/src/components/index.ts +3 -4
- package/src/conditions/condition-abstract.ts +1 -1
- package/src/conditions/condition-field.ts +2 -1
- package/src/conditions/condition-group-def.ts +1 -1
- package/src/conditions/condition-group.ts +3 -3
- package/src/conditions/condition-model.ts +9 -9
- package/src/conditions/condition-operators.ts +3 -4
- package/src/conditions/condition-ref.ts +2 -2
- package/src/conditions/condition-value-abstract.ts +1 -1
- package/src/conditions/condition-values.ts +7 -3
- package/src/conditions/condition.ts +9 -6
- package/src/conditions/index.ts +10 -10
- package/src/conditions/inline-condition-model.ts +6 -3
- package/src/conditions/inline-condition-operators.ts +1 -1
- package/src/conditions/types.ts +3 -3
- package/src/data-model/conditions-wrapper.ts +5 -15
- package/src/data-model/index.ts +3 -4
- package/src/data-model/input-wrapper.ts +3 -3
- package/src/data-model/types.ts +16 -3
- package/src/form/index.ts +1 -1
- package/src/index.ts +11 -14
- package/src/migration/index.ts +1 -1
- package/src/migration/migration.0-2.ts +1 -1
- package/src/migration/migration.1-2.ts +2 -2
- package/src/migration/whichMigrations.ts +3 -3
- package/src/schema/index.ts +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"input-wrapper.d.ts","sourceRoot":"","sources":["../../../src/data-model/input-wrapper.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"input-wrapper.d.ts","sourceRoot":"","sources":["../../../src/data-model/input-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAGlD,qBAAa,YAAY;;IACvB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAY;IACpC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAY;IACrC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAY;IACpC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;IAEhC,IAAI,EAAE,IAAI,CAAA;gBAGR,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE;IAe/D,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAQpC;CACF"}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import { OutputType } from '
|
1
|
+
import { type ComponentDef } from '../components/types';
|
2
|
+
import { type Condition } from '../conditions/condition';
|
3
|
+
import { type OutputType } from '../data-model/enums';
|
4
4
|
type Toggleable<T> = boolean | T;
|
5
5
|
export interface Next {
|
6
6
|
path: string;
|
@@ -123,6 +123,15 @@ export type FeeOptions = {
|
|
123
123
|
customPayErrorMessage?: string;
|
124
124
|
showPaymentSkippedWarningPage: boolean;
|
125
125
|
};
|
126
|
+
export type ConditionWrapperValue = string | {
|
127
|
+
name: string;
|
128
|
+
conditions: Condition[];
|
129
|
+
};
|
130
|
+
export type ConditionRawData = {
|
131
|
+
name: string;
|
132
|
+
displayName: string;
|
133
|
+
value: ConditionWrapperValue;
|
134
|
+
};
|
126
135
|
/**
|
127
136
|
* `FormDefinition` is a typescript representation of `Schema`
|
128
137
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/data-model/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/data-model/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,KAAK,UAAU,EAAE,M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,EAAE,CAAA;CACxB,CAAA;AAEL,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,qBAAqB,CAAA;CAC7B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,KAAK,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAA;IACvC,UAAU,EAAE,gBAAgB,EAAE,CAAA;IAC9B,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACjC,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAAA;IAChD,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { FormConfiguration } from '
|
1
|
+
export { FormConfiguration } from '../form/form-configuration';
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA"}
|
package/dist/types/index.d.ts
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
export
|
2
|
-
export
|
3
|
-
export
|
4
|
-
export
|
5
|
-
export
|
1
|
+
export * from './schema';
|
2
|
+
export * from './data-model';
|
3
|
+
export * from './utils/logger';
|
4
|
+
export * from './form';
|
5
|
+
export * from './components';
|
6
6
|
export * from './conditions';
|
7
7
|
export * from './utils/helpers';
|
8
8
|
export * from './migration';
|
9
9
|
export type * from './components/types';
|
10
|
+
export type * from './conditions/types';
|
10
11
|
export type * from './data-model/types';
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,mBAAmB,wBAAwB,CAAA;AAC3C,mBAAmB,wBAAwB,CAAA;AAC3C,mBAAmB,wBAAwB,CAAA"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { whichMigrations } from '
|
1
|
+
export { whichMigrations } from '../migration/whichMigrations';
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"migration.0-2.d.ts","sourceRoot":"","sources":["../../../src/migration/migration.0-2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"migration.0-2.d.ts","sourceRoot":"","sources":["../../../src/migration/migration.0-2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAQ5D,wBAAgB,OAAO,CAAC,IAAI,KAAA,GAAG,eAAe,CAoB7C"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"migration.1-2.d.ts","sourceRoot":"","sources":["../../../src/migration/migration.1-2.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"migration.1-2.d.ts","sourceRoot":"","sources":["../../../src/migration/migration.1-2.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAgF5D,wBAAgB,OAAO,CAAC,IAAI,KAAA,GAAG,eAAe,CAuB7C"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"whichMigrations.d.ts","sourceRoot":"","sources":["../../../src/migration/whichMigrations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"whichMigrations.d.ts","sourceRoot":"","sources":["../../../src/migration/whichMigrations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE5D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,wBAc9C"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { Schema, componentSchema } from '
|
1
|
+
export { Schema, componentSchema } from '../schema/schema';
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@defra/forms-model",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.10",
|
4
4
|
"description": "A hapi plugin providing the model for Defra forms",
|
5
5
|
"homepage": "https://github.com/DEFRA/forms-designer/tree/main/model#readme",
|
6
6
|
"repository": {
|
@@ -14,9 +14,9 @@
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
15
15
|
"scripts": {
|
16
16
|
"build": "npm run build:types && npm run build:node && npm run build:browser",
|
17
|
-
"build:browser": "BABEL_ENV=javascripts babel --extensions \".ts\" --ignore \"**/*.test.*\"
|
18
|
-
"build:node": "BABEL_ENV=node babel --extensions \".ts\" --ignore \"**/*.test.*\"
|
19
|
-
"build:types": "tsc --build --force tsconfig.build.json",
|
17
|
+
"build:browser": "BABEL_ENV=javascripts babel --delete-dir-on-start --extensions \".ts\" --ignore \"**/*.test.*\" --copy-files --no-copy-ignored --source-maps --out-dir ./dist/browser ./src",
|
18
|
+
"build:node": "BABEL_ENV=node babel --delete-dir-on-start --extensions \".ts\" --ignore \"**/*.test.*\" --copy-files --no-copy-ignored --source-maps --out-dir ./dist/module ./src",
|
19
|
+
"build:types": "tsc --build --force tsconfig.build.json && tsc-alias --project tsconfig.build.json",
|
20
20
|
"test": "jest --color --coverage --verbose",
|
21
21
|
"test:watch": "jest --color --watch"
|
22
22
|
},
|
package/src/components/index.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
export { ComponentTypes } from '
|
2
|
-
export { ConditionalComponentTypes } from '
|
3
|
-
export { ComponentTypeEnum } from '
|
4
|
-
export type * from './types'
|
1
|
+
export { ComponentTypes } from '~/src/components/component-types'
|
2
|
+
export { ConditionalComponentTypes } from '~/src/components/conditional-component-types'
|
3
|
+
export { ComponentTypeEnum } from '~/src/components/enums'
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { Coordinator } from '
|
2
|
-
import { toPresentationString, toExpression } from '
|
3
|
-
import { ConditionsArray } from '
|
1
|
+
import { Coordinator } from '~/src/conditions/enums'
|
2
|
+
import { toPresentationString, toExpression } from '~/src/conditions/helpers'
|
3
|
+
import { type ConditionsArray } from '~/src/conditions/types'
|
4
4
|
|
5
5
|
export class ConditionGroup {
|
6
6
|
conditions: ConditionsArray
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import { ConditionField } from '
|
2
|
-
import { ConditionGroupDef } from '
|
3
|
-
import { Condition } from '
|
4
|
-
import { ConditionRef } from '
|
5
|
-
import { ConditionGroup } from '
|
6
|
-
import { conditionValueFrom } from '
|
7
|
-
import { Coordinator } from '
|
8
|
-
import { toPresentationString, toExpression } from '
|
9
|
-
import { ConditionsArray } from '
|
1
|
+
import { ConditionField } from '~/src/conditions/condition-field'
|
2
|
+
import { ConditionGroupDef } from '~/src/conditions/condition-group-def'
|
3
|
+
import { Condition } from '~/src/conditions/condition'
|
4
|
+
import { ConditionRef } from '~/src/conditions/condition-ref'
|
5
|
+
import { ConditionGroup } from '~/src/conditions/condition-group'
|
6
|
+
import { conditionValueFrom } from '~/src/conditions/condition-values'
|
7
|
+
import { Coordinator } from '~/src/conditions/enums'
|
8
|
+
import { toPresentationString, toExpression } from '~/src/conditions/helpers'
|
9
|
+
import { type ConditionsArray } from '~/src/conditions/types'
|
10
10
|
|
11
11
|
type ConditionRawObject =
|
12
12
|
| ConditionsModel
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import { ComponentType, ComponentDef } from '
|
2
|
-
import { ConditionValueAbstract } from '
|
3
|
-
|
1
|
+
import { type ComponentType, type ComponentDef } from '~/src/components/types'
|
2
|
+
import { ConditionValueAbstract } from '~/src/conditions/condition-value-abstract'
|
4
3
|
import {
|
5
4
|
timeUnits,
|
6
5
|
dateUnits,
|
@@ -8,7 +7,7 @@ import {
|
|
8
7
|
ConditionValue,
|
9
8
|
DateDirections,
|
10
9
|
RelativeTimeValue
|
11
|
-
} from '
|
10
|
+
} from '~/src/conditions/condition-values'
|
12
11
|
|
13
12
|
type Operator = '==' | '!=' | '>=' | '<=' | '<' | '>'
|
14
13
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { ConditionAbstract } from '
|
2
|
-
import { Coordinator } from '
|
1
|
+
import { ConditionAbstract } from '~/src/conditions/condition-abstract'
|
2
|
+
import { Coordinator } from '~/src/conditions/enums'
|
3
3
|
|
4
4
|
export class ConditionRef extends ConditionAbstract {
|
5
5
|
conditionName: string
|
@@ -1,6 +1,10 @@
|
|
1
|
-
import { ConditionValueAbstract } from '
|
2
|
-
import { Registration } from '
|
3
|
-
import {
|
1
|
+
import { ConditionValueAbstract } from '~/src/conditions/condition-value-abstract'
|
2
|
+
import { Registration } from '~/src/conditions/condition-value-registration'
|
3
|
+
import {
|
4
|
+
type DateTimeUnitValues,
|
5
|
+
type DateUnits,
|
6
|
+
type TimeUnits
|
7
|
+
} from '~/src/conditions/types'
|
4
8
|
|
5
9
|
export class ConditionValue extends ConditionValueAbstract {
|
6
10
|
value: string
|
@@ -1,9 +1,12 @@
|
|
1
|
-
import { ConditionField } from '
|
2
|
-
import { ConditionAbstract } from '
|
3
|
-
import { getExpression } from '
|
4
|
-
import {
|
5
|
-
|
6
|
-
|
1
|
+
import { ConditionField } from '~/src/conditions/condition-field'
|
2
|
+
import { ConditionAbstract } from '~/src/conditions/condition-abstract'
|
3
|
+
import { getExpression } from '~/src/conditions/condition-operators'
|
4
|
+
import {
|
5
|
+
ConditionValue,
|
6
|
+
RelativeTimeValue
|
7
|
+
} from '~/src/conditions/condition-values'
|
8
|
+
import { ConditionValueAbstract } from '~/src/conditions/condition-value-abstract'
|
9
|
+
import { Coordinator } from '~/src/conditions/enums'
|
7
10
|
|
8
11
|
export class Condition extends ConditionAbstract {
|
9
12
|
field: ConditionField
|
package/src/conditions/index.ts
CHANGED
@@ -4,7 +4,7 @@ export {
|
|
4
4
|
getOperatorNames,
|
5
5
|
absoluteDateOrTimeOperatorNames,
|
6
6
|
relativeDateOrTimeOperatorNames
|
7
|
-
} from '
|
7
|
+
} from '~/src/conditions/condition-operators'
|
8
8
|
|
9
9
|
export {
|
10
10
|
timeUnits,
|
@@ -14,14 +14,14 @@ export {
|
|
14
14
|
DateDirections,
|
15
15
|
RelativeTimeValue,
|
16
16
|
conditionValueFrom
|
17
|
-
} from '
|
17
|
+
} from '~/src/conditions/condition-values'
|
18
18
|
|
19
|
-
export { ConditionField } from '
|
20
|
-
export { Condition } from '
|
21
|
-
export { ConditionRef } from '
|
22
|
-
export { ConditionGroup } from '
|
23
|
-
export { ConditionsModel } from '
|
24
|
-
export { ConditionGroupDef } from '
|
25
|
-
export { toExpression, toPresentationString } from '
|
19
|
+
export { ConditionField } from '~/src/conditions/condition-field'
|
20
|
+
export { Condition } from '~/src/conditions/condition'
|
21
|
+
export { ConditionRef } from '~/src/conditions/condition-ref'
|
22
|
+
export { ConditionGroup } from '~/src/conditions/condition-group'
|
23
|
+
export { ConditionsModel } from '~/src/conditions/condition-model'
|
24
|
+
export { ConditionGroupDef } from '~/src/conditions/condition-group-def'
|
25
|
+
export { toExpression, toPresentationString } from '~/src/conditions/helpers'
|
26
26
|
|
27
|
-
export { Coordinator } from '
|
27
|
+
export { Coordinator } from '~/src/conditions/enums'
|
@@ -1,6 +1,9 @@
|
|
1
|
-
import { ComponentTypes } from '
|
2
|
-
import { getExpression } from '
|
3
|
-
import {
|
1
|
+
import { ComponentTypes } from '~/src/components/component-types'
|
2
|
+
import { getExpression } from '~/src/conditions/inline-condition-operators'
|
3
|
+
import {
|
4
|
+
AbstractConditionValue,
|
5
|
+
valueFrom
|
6
|
+
} from '~/src/conditions/inline-condition-values'
|
4
7
|
|
5
8
|
export const coordinators = {
|
6
9
|
AND: 'and',
|
package/src/conditions/types.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { Condition } from '
|
2
|
-
import { ConditionRef } from '
|
3
|
-
import { ConditionGroup } from '
|
1
|
+
import { type Condition } from '~/src/conditions/condition'
|
2
|
+
import { type ConditionRef } from '~/src/conditions/condition-ref'
|
3
|
+
import { type ConditionGroup } from '~/src/conditions/condition-group'
|
4
4
|
|
5
5
|
export type ConditionsArray = (Condition | ConditionGroup | ConditionRef)[]
|
6
6
|
|
@@ -1,18 +1,8 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
| {
|
7
|
-
name: string
|
8
|
-
conditions: Condition[]
|
9
|
-
}
|
10
|
-
|
11
|
-
export type ConditionRawData = {
|
12
|
-
name: string
|
13
|
-
displayName: string
|
14
|
-
value: ConditionWrapperValue
|
15
|
-
}
|
1
|
+
import { ConditionsModel } from '~/src/conditions/condition-model'
|
2
|
+
import {
|
3
|
+
type ConditionRawData,
|
4
|
+
type ConditionWrapperValue
|
5
|
+
} from '~/src/data-model/types'
|
16
6
|
|
17
7
|
export class ConditionsWrapper {
|
18
8
|
name: string
|
package/src/data-model/index.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
export { InputWrapper } from '
|
2
|
-
export { ConditionsWrapper
|
3
|
-
export {
|
4
|
-
export { OutputType } from './enums'
|
1
|
+
export { InputWrapper } from '~/src/data-model/input-wrapper'
|
2
|
+
export { ConditionsWrapper } from '~/src/data-model/conditions-wrapper'
|
3
|
+
export { OutputType } from '~/src/data-model/enums'
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
1
|
+
import { type ComponentDef } from '~/src/components/types'
|
2
|
+
import { type Page } from '~/src/data-model/types'
|
3
|
+
import { clone } from '~/src/utils/helpers'
|
4
4
|
|
5
5
|
export class InputWrapper {
|
6
6
|
name: string | undefined = undefined
|
package/src/data-model/types.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import { OutputType } from '
|
1
|
+
import { type ComponentDef } from '~/src/components/types'
|
2
|
+
import { type Condition } from '~/src/conditions/condition'
|
3
|
+
import { type OutputType } from '~/src/data-model/enums'
|
4
4
|
|
5
5
|
type Toggleable<T> = boolean | T
|
6
6
|
|
@@ -150,6 +150,19 @@ export type FeeOptions = {
|
|
150
150
|
showPaymentSkippedWarningPage: boolean
|
151
151
|
}
|
152
152
|
|
153
|
+
export type ConditionWrapperValue =
|
154
|
+
| string
|
155
|
+
| {
|
156
|
+
name: string
|
157
|
+
conditions: Condition[]
|
158
|
+
}
|
159
|
+
|
160
|
+
export type ConditionRawData = {
|
161
|
+
name: string
|
162
|
+
displayName: string
|
163
|
+
value: ConditionWrapperValue
|
164
|
+
}
|
165
|
+
|
153
166
|
/**
|
154
167
|
* `FormDefinition` is a typescript representation of `Schema`
|
155
168
|
*/
|
package/src/form/index.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { FormConfiguration } from '
|
1
|
+
export { FormConfiguration } from '~/src/form/form-configuration'
|
package/src/index.ts
CHANGED
@@ -1,14 +1,11 @@
|
|
1
|
-
export
|
2
|
-
export
|
3
|
-
export
|
4
|
-
export
|
5
|
-
export
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
export * from '
|
11
|
-
export * from '
|
12
|
-
export * from './migration'
|
13
|
-
export type * from './components/types'
|
14
|
-
export type * from './data-model/types'
|
1
|
+
export * from '~/src/schema'
|
2
|
+
export * from '~/src/data-model'
|
3
|
+
export * from '~/src/utils/logger'
|
4
|
+
export * from '~/src/form'
|
5
|
+
export * from '~/src/components'
|
6
|
+
export * from '~/src/conditions'
|
7
|
+
export * from '~/src/utils/helpers'
|
8
|
+
export * from '~/src/migration'
|
9
|
+
export type * from '~/src/components/types'
|
10
|
+
export type * from '~/src/conditions/types'
|
11
|
+
export type * from '~/src/data-model/types'
|
package/src/migration/index.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { whichMigrations } from '
|
1
|
+
export { whichMigrations } from '~/src/migration/whichMigrations'
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { migrate as V0_TO_V2 } from '
|
2
|
-
import { migrate as V1_TO_V2 } from '
|
3
|
-
import { MigrationScript } from '
|
1
|
+
import { migrate as V0_TO_V2 } from '~/src/migration/migration.0-2'
|
2
|
+
import { migrate as V1_TO_V2 } from '~/src/migration/migration.1-2'
|
3
|
+
import { type MigrationScript } from '~/src/migration/types'
|
4
4
|
|
5
5
|
/**
|
6
6
|
* Returns which migrations that should be run against your Object with the given version
|
package/src/schema/index.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { Schema, componentSchema } from '
|
1
|
+
export { Schema, componentSchema } from '~/src/schema/schema'
|