@researchdatabox/sails-ng-common 0.0.1-beta.8936
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/README.md +5 -0
- package/dist/src/config/base-field-component.model.d.ts +26 -0
- package/dist/src/config/base-field-component.model.js +29 -0
- package/dist/src/config/base-field-component.outline.d.ts +100 -0
- package/dist/src/config/base-field-component.outline.js +3 -0
- package/dist/src/config/component/accordion.model.d.ts +103 -0
- package/dist/src/config/component/accordion.model.js +127 -0
- package/dist/src/config/component/accordion.outline.d.ts +150 -0
- package/dist/src/config/component/accordion.outline.js +13 -0
- package/dist/src/config/component/action-row-layout.model.d.ts +28 -0
- package/dist/src/config/component/action-row-layout.model.js +35 -0
- package/dist/src/config/component/action-row-layout.outline.d.ts +36 -0
- package/dist/src/config/component/action-row-layout.outline.js +6 -0
- package/dist/src/config/component/cancel-button.model.d.ts +46 -0
- package/dist/src/config/component/cancel-button.model.js +56 -0
- package/dist/src/config/component/cancel-button.outline.d.ts +69 -0
- package/dist/src/config/component/cancel-button.outline.js +6 -0
- package/dist/src/config/component/checkbox-input.model.d.ts +65 -0
- package/dist/src/config/component/checkbox-input.model.js +78 -0
- package/dist/src/config/component/checkbox-input.outline.d.ts +85 -0
- package/dist/src/config/component/checkbox-input.outline.js +8 -0
- package/dist/src/config/component/checkbox-tree.model.d.ts +66 -0
- package/dist/src/config/component/checkbox-tree.model.js +79 -0
- package/dist/src/config/component/checkbox-tree.outline.d.ts +96 -0
- package/dist/src/config/component/checkbox-tree.outline.js +8 -0
- package/dist/src/config/component/content.model.d.ts +45 -0
- package/dist/src/config/component/content.model.js +55 -0
- package/dist/src/config/component/content.outline.d.ts +64 -0
- package/dist/src/config/component/content.outline.js +6 -0
- package/dist/src/config/component/data-location.model.d.ts +82 -0
- package/dist/src/config/component/data-location.model.js +94 -0
- package/dist/src/config/component/data-location.outline.d.ts +117 -0
- package/dist/src/config/component/data-location.outline.js +6 -0
- package/dist/src/config/component/date-input.model.d.ts +66 -0
- package/dist/src/config/component/date-input.model.js +79 -0
- package/dist/src/config/component/date-input.outline.d.ts +81 -0
- package/dist/src/config/component/date-input.outline.js +8 -0
- package/dist/src/config/component/default-layout.model.d.ts +22 -0
- package/dist/src/config/component/default-layout.model.js +30 -0
- package/dist/src/config/component/default-layout.outline.d.ts +29 -0
- package/dist/src/config/component/default-layout.outline.js +5 -0
- package/dist/src/config/component/delete-button.model.d.ts +46 -0
- package/dist/src/config/component/delete-button.model.js +48 -0
- package/dist/src/config/component/delete-button.outline.d.ts +55 -0
- package/dist/src/config/component/delete-button.outline.js +5 -0
- package/dist/src/config/component/dropdown-input.model.d.ts +64 -0
- package/dist/src/config/component/dropdown-input.model.js +77 -0
- package/dist/src/config/component/dropdown-input.outline.d.ts +84 -0
- package/dist/src/config/component/dropdown-input.outline.js +8 -0
- package/dist/src/config/component/file-upload.model.d.ts +67 -0
- package/dist/src/config/component/file-upload.model.js +81 -0
- package/dist/src/config/component/file-upload.outline.d.ts +93 -0
- package/dist/src/config/component/file-upload.outline.js +8 -0
- package/dist/src/config/component/group.model.d.ts +61 -0
- package/dist/src/config/component/group.model.js +75 -0
- package/dist/src/config/component/group.outline.d.ts +77 -0
- package/dist/src/config/component/group.outline.js +8 -0
- package/dist/src/config/component/inline-layout.model.d.ts +22 -0
- package/dist/src/config/component/inline-layout.model.js +29 -0
- package/dist/src/config/component/inline-layout.outline.d.ts +29 -0
- package/dist/src/config/component/inline-layout.outline.js +5 -0
- package/dist/src/config/component/map.model.d.ts +68 -0
- package/dist/src/config/component/map.model.js +85 -0
- package/dist/src/config/component/map.outline.d.ts +102 -0
- package/dist/src/config/component/map.outline.js +8 -0
- package/dist/src/config/component/pdf-list.model.d.ts +68 -0
- package/dist/src/config/component/pdf-list.model.js +71 -0
- package/dist/src/config/component/pdf-list.outline.d.ts +91 -0
- package/dist/src/config/component/pdf-list.outline.js +6 -0
- package/dist/src/config/component/publish-data-location-refresh.model.d.ts +38 -0
- package/dist/src/config/component/publish-data-location-refresh.model.js +51 -0
- package/dist/src/config/component/publish-data-location-refresh.outline.d.ts +47 -0
- package/dist/src/config/component/publish-data-location-refresh.outline.js +5 -0
- package/dist/src/config/component/publish-data-location-selector.model.d.ts +74 -0
- package/dist/src/config/component/publish-data-location-selector.model.js +100 -0
- package/dist/src/config/component/publish-data-location-selector.outline.d.ts +99 -0
- package/dist/src/config/component/publish-data-location-selector.outline.js +6 -0
- package/dist/src/config/component/question-tree.helper.d.ts +61 -0
- package/dist/src/config/component/question-tree.helper.js +298 -0
- package/dist/src/config/component/question-tree.model.d.ts +64 -0
- package/dist/src/config/component/question-tree.model.js +80 -0
- package/dist/src/config/component/question-tree.outline.d.ts +305 -0
- package/dist/src/config/component/question-tree.outline.js +9 -0
- package/dist/src/config/component/radio-input.model.d.ts +63 -0
- package/dist/src/config/component/radio-input.model.js +76 -0
- package/dist/src/config/component/radio-input.outline.d.ts +83 -0
- package/dist/src/config/component/radio-input.outline.js +8 -0
- package/dist/src/config/component/record-metadata-retriever.model.d.ts +41 -0
- package/dist/src/config/component/record-metadata-retriever.model.js +57 -0
- package/dist/src/config/component/record-metadata-retriever.outline.d.ts +47 -0
- package/dist/src/config/component/record-metadata-retriever.outline.js +5 -0
- package/dist/src/config/component/record-selector.model.d.ts +60 -0
- package/dist/src/config/component/record-selector.model.js +60 -0
- package/dist/src/config/component/record-selector.outline.d.ts +84 -0
- package/dist/src/config/component/record-selector.outline.js +6 -0
- package/dist/src/config/component/repeatable.model.d.ts +90 -0
- package/dist/src/config/component/repeatable.model.js +109 -0
- package/dist/src/config/component/repeatable.outline.d.ts +108 -0
- package/dist/src/config/component/repeatable.outline.js +10 -0
- package/dist/src/config/component/reusable.model.d.ts +42 -0
- package/dist/src/config/component/reusable.model.js +57 -0
- package/dist/src/config/component/reusable.outline.d.ts +49 -0
- package/dist/src/config/component/reusable.outline.js +6 -0
- package/dist/src/config/component/rich-text-editor.model.d.ts +65 -0
- package/dist/src/config/component/rich-text-editor.model.js +79 -0
- package/dist/src/config/component/rich-text-editor.outline.d.ts +86 -0
- package/dist/src/config/component/rich-text-editor.outline.js +8 -0
- package/dist/src/config/component/save-button.model.d.ts +45 -0
- package/dist/src/config/component/save-button.model.js +55 -0
- package/dist/src/config/component/save-button.outline.d.ts +65 -0
- package/dist/src/config/component/save-button.outline.js +6 -0
- package/dist/src/config/component/save-status.model.d.ts +42 -0
- package/dist/src/config/component/save-status.model.js +60 -0
- package/dist/src/config/component/save-status.outline.d.ts +52 -0
- package/dist/src/config/component/save-status.outline.js +6 -0
- package/dist/src/config/component/simple-input.model.d.ts +62 -0
- package/dist/src/config/component/simple-input.model.js +75 -0
- package/dist/src/config/component/simple-input.outline.d.ts +80 -0
- package/dist/src/config/component/simple-input.outline.js +9 -0
- package/dist/src/config/component/tab-content.model.d.ts +63 -0
- package/dist/src/config/component/tab-content.model.js +77 -0
- package/dist/src/config/component/tab-content.outline.d.ts +92 -0
- package/dist/src/config/component/tab-content.outline.js +8 -0
- package/dist/src/config/component/tab-nav-button.model.d.ts +45 -0
- package/dist/src/config/component/tab-nav-button.model.js +55 -0
- package/dist/src/config/component/tab-nav-button.outline.d.ts +64 -0
- package/dist/src/config/component/tab-nav-button.outline.js +6 -0
- package/dist/src/config/component/tab.model.d.ts +71 -0
- package/dist/src/config/component/tab.model.js +84 -0
- package/dist/src/config/component/tab.outline.d.ts +106 -0
- package/dist/src/config/component/tab.outline.js +9 -0
- package/dist/src/config/component/text-area.model.d.ts +63 -0
- package/dist/src/config/component/text-area.model.js +76 -0
- package/dist/src/config/component/text-area.outline.d.ts +81 -0
- package/dist/src/config/component/text-area.outline.js +8 -0
- package/dist/src/config/component/typeahead-input.model.d.ts +78 -0
- package/dist/src/config/component/typeahead-input.model.js +91 -0
- package/dist/src/config/component/typeahead-input.outline.d.ts +107 -0
- package/dist/src/config/component/typeahead-input.outline.js +8 -0
- package/dist/src/config/component/validation-summary.model.d.ts +42 -0
- package/dist/src/config/component/validation-summary.model.js +60 -0
- package/dist/src/config/component/validation-summary.outline.d.ts +57 -0
- package/dist/src/config/component/validation-summary.outline.js +6 -0
- package/dist/src/config/dictionary.model.d.ts +624 -0
- package/dist/src/config/dictionary.model.js +175 -0
- package/dist/src/config/dictionary.outline.d.ts +94 -0
- package/dist/src/config/dictionary.outline.js +3 -0
- package/dist/src/config/field-component.model.d.ts +7 -0
- package/dist/src/config/field-component.model.js +11 -0
- package/dist/src/config/field-component.outline.d.ts +20 -0
- package/dist/src/config/field-component.outline.js +3 -0
- package/dist/src/config/field-layout.model.d.ts +19 -0
- package/dist/src/config/field-layout.model.js +23 -0
- package/dist/src/config/field-layout.outline.d.ts +42 -0
- package/dist/src/config/field-layout.outline.js +3 -0
- package/dist/src/config/field-model.model.d.ts +22 -0
- package/dist/src/config/field-model.model.js +25 -0
- package/dist/src/config/field-model.outline.d.ts +63 -0
- package/dist/src/config/field-model.outline.js +3 -0
- package/dist/src/config/field.model.d.ts +12 -0
- package/dist/src/config/field.model.js +12 -0
- package/dist/src/config/field.outline.d.ts +19 -0
- package/dist/src/config/field.outline.js +3 -0
- package/dist/src/config/form-behaviour.outline.d.ts +128 -0
- package/dist/src/config/form-behaviour.outline.js +40 -0
- package/dist/src/config/form-component.model.d.ts +38 -0
- package/dist/src/config/form-component.model.js +36 -0
- package/dist/src/config/form-component.outline.d.ts +257 -0
- package/dist/src/config/form-component.outline.js +24 -0
- package/dist/src/config/form-config.model.d.ts +33 -0
- package/dist/src/config/form-config.model.js +36 -0
- package/dist/src/config/form-config.outline.d.ts +109 -0
- package/dist/src/config/form-config.outline.js +3 -0
- package/dist/src/config/form-override.model.d.ts +116 -0
- package/dist/src/config/form-override.model.js +1209 -0
- package/dist/src/config/form-override.outline.d.ts +15 -0
- package/dist/src/config/form-override.outline.js +3 -0
- package/dist/src/config/form-types.model.d.ts +6 -0
- package/dist/src/config/form-types.model.js +23 -0
- package/dist/src/config/form-types.outline.d.ts +48 -0
- package/dist/src/config/form-types.outline.js +137 -0
- package/dist/src/config/helpers.d.ts +23 -0
- package/dist/src/config/helpers.js +105 -0
- package/dist/src/config/names/naming-helpers.d.ts +71 -0
- package/dist/src/config/names/naming-helpers.js +72 -0
- package/dist/src/config/names/query-helpers.d.ts +43 -0
- package/dist/src/config/names/query-helpers.js +64 -0
- package/dist/src/config/shared.outline.d.ts +54 -0
- package/dist/src/config/shared.outline.js +41 -0
- package/dist/src/config/visitor/base.model.d.ts +137 -0
- package/dist/src/config/visitor/base.model.js +323 -0
- package/dist/src/config/visitor/base.outline.d.ts +140 -0
- package/dist/src/config/visitor/base.outline.js +3 -0
- package/dist/src/config/visitor/common.model.d.ts +119 -0
- package/dist/src/config/visitor/common.model.js +421 -0
- package/dist/src/handlebars-helpers.d.ts +224 -0
- package/dist/src/handlebars-helpers.js +558 -0
- package/dist/src/index.d.ts +109 -0
- package/dist/src/index.js +136 -0
- package/dist/src/logger.interface.d.ts +14 -0
- package/dist/src/logger.interface.js +3 -0
- package/dist/src/record.model.d.ts +35 -0
- package/dist/src/record.model.js +21 -0
- package/dist/src/report.model.d.ts +21 -0
- package/dist/src/report.model.js +19 -0
- package/dist/src/status.model.d.ts +22 -0
- package/dist/src/status.model.js +28 -0
- package/dist/src/template.outline.d.ts +49 -0
- package/dist/src/template.outline.js +13 -0
- package/dist/src/translation-helpers.d.ts +10 -0
- package/dist/src/translation-helpers.js +30 -0
- package/dist/src/validation/form.model.d.ts +247 -0
- package/dist/src/validation/form.model.js +31 -0
- package/dist/src/validation/helpers.d.ts +14 -0
- package/dist/src/validation/helpers.js +68 -0
- package/dist/src/validation/validators-support.d.ts +41 -0
- package/dist/src/validation/validators-support.js +141 -0
- package/dist/src/validation/validators.d.ts +23 -0
- package/dist/src/validation/validators.js +427 -0
- package/package.json +95 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { ExpressionsConditionKindType } from './form-component.outline';
|
|
2
|
+
/**
|
|
3
|
+
* Form behaviours are the v1 form-level automation primitive described in
|
|
4
|
+
* `support/specs/form-behaviour/implementation_plan.md`.
|
|
5
|
+
*
|
|
6
|
+
* Intent:
|
|
7
|
+
* - allow async, event-driven pipelines at the form level instead of only
|
|
8
|
+
* component-scoped synchronous expressions
|
|
9
|
+
* - keep the configuration serialisable so it can pass through the existing
|
|
10
|
+
* Construct -> Template -> Client visitor pipeline
|
|
11
|
+
*
|
|
12
|
+
* Scope in v1:
|
|
13
|
+
* - built-in processors only: `jsonataTransform`, `fetchMetadata`
|
|
14
|
+
* - built-in actions only: `setValue`, `emitEvent`
|
|
15
|
+
* - event emission is intentionally limited to `field.value.changed`
|
|
16
|
+
*
|
|
17
|
+
* Out of scope in v1:
|
|
18
|
+
* - hook-registered/custom processors and actions
|
|
19
|
+
* - UI-specific actions such as notifications or highlighting
|
|
20
|
+
* - processor-level debounce controls
|
|
21
|
+
*
|
|
22
|
+
* These types are intentionally lightweight outlines rather than runtime
|
|
23
|
+
* classes because the behaviour feature currently relies on plain config data.
|
|
24
|
+
*/
|
|
25
|
+
export declare const FormBehaviourProcessorType: {
|
|
26
|
+
readonly JSONataTransform: "jsonataTransform";
|
|
27
|
+
readonly FetchMetadata: "fetchMetadata";
|
|
28
|
+
};
|
|
29
|
+
export type FormBehaviourProcessorTypeValue = (typeof FormBehaviourProcessorType)[keyof typeof FormBehaviourProcessorType];
|
|
30
|
+
export declare const FormBehaviourActionType: {
|
|
31
|
+
readonly SetValue: "setValue";
|
|
32
|
+
readonly EmitEvent: "emitEvent";
|
|
33
|
+
};
|
|
34
|
+
export type FormBehaviourActionTypeValue = (typeof FormBehaviourActionType)[keyof typeof FormBehaviourActionType];
|
|
35
|
+
export declare const FieldPathKind: {
|
|
36
|
+
readonly ComponentJsonPointer: "componentJsonPointer";
|
|
37
|
+
readonly JSONata: "jsonata";
|
|
38
|
+
readonly Logical: "logical";
|
|
39
|
+
};
|
|
40
|
+
export type FieldPathKindType = (typeof FieldPathKind)[keyof typeof FieldPathKind];
|
|
41
|
+
/**
|
|
42
|
+
* Configuration for the v1 JSONata processor.
|
|
43
|
+
*
|
|
44
|
+
* The server keeps `template` long enough to compile it, while the client uses
|
|
45
|
+
* `hasTemplate` after the raw source has been stripped by the client visitor.
|
|
46
|
+
*/
|
|
47
|
+
export interface FormBehaviourJsonataTransformConfig {
|
|
48
|
+
template?: string;
|
|
49
|
+
hasTemplate?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface FormBehaviourProcessorConfigFrame<TConfig = Record<string, never> | FormBehaviourJsonataTransformConfig> {
|
|
52
|
+
type: FormBehaviourProcessorTypeValue;
|
|
53
|
+
config?: TConfig;
|
|
54
|
+
}
|
|
55
|
+
export type FormBehaviourJsonataTransformProcessorConfig = FormBehaviourProcessorConfigFrame<FormBehaviourJsonataTransformConfig> & {
|
|
56
|
+
type: typeof FormBehaviourProcessorType.JSONataTransform;
|
|
57
|
+
};
|
|
58
|
+
export type FormBehaviourFetchMetadataProcessorConfig = FormBehaviourProcessorConfigFrame<Record<string, never>> & {
|
|
59
|
+
type: typeof FormBehaviourProcessorType.FetchMetadata;
|
|
60
|
+
};
|
|
61
|
+
export type FormBehaviourProcessorConfig = FormBehaviourJsonataTransformProcessorConfig | FormBehaviourFetchMetadataProcessorConfig;
|
|
62
|
+
/**
|
|
63
|
+
* `fieldPath` points at an `angularComponentsJsonPointer`.
|
|
64
|
+
*
|
|
65
|
+
* Resolution modes intentionally mirror the implementation plan:
|
|
66
|
+
* - `componentJsonPointer`: literal pointer resolved at execution time
|
|
67
|
+
* - `jsonata`: compiled template resolved against the current pipeline context
|
|
68
|
+
* - `logical`: repeatable-only identity lock that survives row reindexing
|
|
69
|
+
*
|
|
70
|
+
* Note that `logical` is validated by the runtime and is intentionally not
|
|
71
|
+
* allowed on `onError` actions in v1.
|
|
72
|
+
*/
|
|
73
|
+
export interface FormBehaviourSetValueActionConfig {
|
|
74
|
+
fieldPath: string;
|
|
75
|
+
fieldPathKind?: FieldPathKindType;
|
|
76
|
+
hasFieldPathTemplate?: boolean;
|
|
77
|
+
valueTemplate?: string;
|
|
78
|
+
hasValueTemplate?: boolean;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* v1 keeps emitted events deliberately narrow to avoid inventing another event
|
|
82
|
+
* contract before behaviour usage patterns settle.
|
|
83
|
+
*/
|
|
84
|
+
export interface FormBehaviourEmitEventActionConfig {
|
|
85
|
+
eventType: 'field.value.changed';
|
|
86
|
+
fieldId: string;
|
|
87
|
+
sourceId: string;
|
|
88
|
+
valueTemplate?: string;
|
|
89
|
+
hasValueTemplate?: boolean;
|
|
90
|
+
}
|
|
91
|
+
export interface FormBehaviourActionConfigFrame<TConfig = FormBehaviourSetValueActionConfig | FormBehaviourEmitEventActionConfig> {
|
|
92
|
+
type: FormBehaviourActionTypeValue;
|
|
93
|
+
config: TConfig;
|
|
94
|
+
}
|
|
95
|
+
export type FormBehaviourSetValueAction = FormBehaviourActionConfigFrame<FormBehaviourSetValueActionConfig> & {
|
|
96
|
+
type: typeof FormBehaviourActionType.SetValue;
|
|
97
|
+
};
|
|
98
|
+
export type FormBehaviourEmitEventAction = FormBehaviourActionConfigFrame<FormBehaviourEmitEventActionConfig> & {
|
|
99
|
+
type: typeof FormBehaviourActionType.EmitEvent;
|
|
100
|
+
};
|
|
101
|
+
export type FormBehaviourActionConfig = FormBehaviourSetValueAction | FormBehaviourEmitEventAction;
|
|
102
|
+
/**
|
|
103
|
+
* Top-level behaviour definition stored on `FormConfigFrame.behaviours`.
|
|
104
|
+
*
|
|
105
|
+
* Design notes:
|
|
106
|
+
* - `condition` / `conditionKind` intentionally reuse expression semantics
|
|
107
|
+
* - `debounceMs` applies at subscription level, not per processor
|
|
108
|
+
* - `hasCondition` is a client-side marker added after template stripping
|
|
109
|
+
* - `enabled` exists so a behaviour can remain in config without binding
|
|
110
|
+
*
|
|
111
|
+
* Future work anticipated by the plan:
|
|
112
|
+
* - more processors/actions
|
|
113
|
+
* - hook extensibility
|
|
114
|
+
* - richer UI-facing actions
|
|
115
|
+
*/
|
|
116
|
+
export interface FormBehaviourConfigFrame {
|
|
117
|
+
name: string;
|
|
118
|
+
description?: string;
|
|
119
|
+
condition: string;
|
|
120
|
+
conditionKind?: ExpressionsConditionKindType;
|
|
121
|
+
debounceMs?: number;
|
|
122
|
+
processors?: FormBehaviourProcessorConfig[];
|
|
123
|
+
actions: FormBehaviourActionConfig[];
|
|
124
|
+
onError?: FormBehaviourActionConfig[];
|
|
125
|
+
runOnFormReady?: boolean;
|
|
126
|
+
enabled?: boolean;
|
|
127
|
+
hasCondition?: boolean;
|
|
128
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FieldPathKind = exports.FormBehaviourActionType = exports.FormBehaviourProcessorType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Form behaviours are the v1 form-level automation primitive described in
|
|
6
|
+
* `support/specs/form-behaviour/implementation_plan.md`.
|
|
7
|
+
*
|
|
8
|
+
* Intent:
|
|
9
|
+
* - allow async, event-driven pipelines at the form level instead of only
|
|
10
|
+
* component-scoped synchronous expressions
|
|
11
|
+
* - keep the configuration serialisable so it can pass through the existing
|
|
12
|
+
* Construct -> Template -> Client visitor pipeline
|
|
13
|
+
*
|
|
14
|
+
* Scope in v1:
|
|
15
|
+
* - built-in processors only: `jsonataTransform`, `fetchMetadata`
|
|
16
|
+
* - built-in actions only: `setValue`, `emitEvent`
|
|
17
|
+
* - event emission is intentionally limited to `field.value.changed`
|
|
18
|
+
*
|
|
19
|
+
* Out of scope in v1:
|
|
20
|
+
* - hook-registered/custom processors and actions
|
|
21
|
+
* - UI-specific actions such as notifications or highlighting
|
|
22
|
+
* - processor-level debounce controls
|
|
23
|
+
*
|
|
24
|
+
* These types are intentionally lightweight outlines rather than runtime
|
|
25
|
+
* classes because the behaviour feature currently relies on plain config data.
|
|
26
|
+
*/
|
|
27
|
+
exports.FormBehaviourProcessorType = {
|
|
28
|
+
JSONataTransform: 'jsonataTransform',
|
|
29
|
+
FetchMetadata: 'fetchMetadata',
|
|
30
|
+
};
|
|
31
|
+
exports.FormBehaviourActionType = {
|
|
32
|
+
SetValue: 'setValue',
|
|
33
|
+
EmitEvent: 'emitEvent',
|
|
34
|
+
};
|
|
35
|
+
exports.FieldPathKind = {
|
|
36
|
+
ComponentJsonPointer: 'componentJsonPointer',
|
|
37
|
+
JSONata: 'jsonata',
|
|
38
|
+
Logical: 'logical',
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1iZWhhdmlvdXIub3V0bGluZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb25maWcvZm9ybS1iZWhhdmlvdXIub3V0bGluZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFFQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQXNCRztBQUNVLFFBQUEsMEJBQTBCLEdBQUc7SUFDeEMsZ0JBQWdCLEVBQUUsa0JBQWtCO0lBQ3BDLGFBQWEsRUFBRSxlQUFlO0NBQ3RCLENBQUM7QUFLRSxRQUFBLHVCQUF1QixHQUFHO0lBQ3JDLFFBQVEsRUFBRSxVQUFVO0lBQ3BCLFNBQVMsRUFBRSxXQUFXO0NBQ2QsQ0FBQztBQUlFLFFBQUEsYUFBYSxHQUFHO0lBQzNCLG9CQUFvQixFQUFFLHNCQUFzQjtJQUM1QyxPQUFPLEVBQUUsU0FBUztJQUNsQixPQUFPLEVBQUUsU0FBUztDQUNWLENBQUMifQ==
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { FormConfigVisitorOutline } from "./visitor/base.outline";
|
|
2
|
+
import { FormComponentDefinitionOutline, FormConstraintAuthorizationConfigOutline, FormConstraintConfigOutline, FormExpressionsConfigOutline, FormOverrideConfigFrame } from "./form-component.outline";
|
|
3
|
+
import { FieldComponentDefinitionOutline } from "./field-component.outline";
|
|
4
|
+
import { FieldModelDefinitionOutline } from "./field-model.outline";
|
|
5
|
+
import { FieldLayoutDefinitionOutline } from "./field-layout.outline";
|
|
6
|
+
import { FormModesConfig } from "./shared.outline";
|
|
7
|
+
export declare class FormExpressionsConfig implements FormExpressionsConfigOutline {
|
|
8
|
+
name: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
config: FormExpressionsConfigOutline['config'];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The constraints that must be fulfilled for the form field to be included.
|
|
14
|
+
*/
|
|
15
|
+
export declare class FormConstraintConfig implements FormConstraintConfigOutline {
|
|
16
|
+
authorization?: FormConstraintAuthorizationConfig;
|
|
17
|
+
allowModes?: FormModesConfig[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The options available for the authorization constraints.
|
|
21
|
+
*/
|
|
22
|
+
export declare class FormConstraintAuthorizationConfig implements FormConstraintAuthorizationConfigOutline {
|
|
23
|
+
allowRoles?: string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The form component abstract class is the base for each real component definition class.
|
|
27
|
+
*/
|
|
28
|
+
export declare abstract class FormComponentDefinition implements FormComponentDefinitionOutline {
|
|
29
|
+
name: string;
|
|
30
|
+
abstract component: FieldComponentDefinitionOutline;
|
|
31
|
+
abstract model?: FieldModelDefinitionOutline<unknown>;
|
|
32
|
+
abstract layout?: FieldLayoutDefinitionOutline;
|
|
33
|
+
expressions?: FormExpressionsConfigOutline[];
|
|
34
|
+
module?: string;
|
|
35
|
+
constraints?: FormConstraintConfigOutline;
|
|
36
|
+
overrides?: FormOverrideConfigFrame;
|
|
37
|
+
abstract accept(visitor: FormConfigVisitorOutline): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormComponentDefinition = exports.FormConstraintAuthorizationConfig = exports.FormConstraintConfig = exports.FormExpressionsConfig = void 0;
|
|
4
|
+
class FormExpressionsConfig {
|
|
5
|
+
name = '';
|
|
6
|
+
description;
|
|
7
|
+
config = { template: '' };
|
|
8
|
+
}
|
|
9
|
+
exports.FormExpressionsConfig = FormExpressionsConfig;
|
|
10
|
+
/**
|
|
11
|
+
* The constraints that must be fulfilled for the form field to be included.
|
|
12
|
+
*/
|
|
13
|
+
class FormConstraintConfig {
|
|
14
|
+
authorization;
|
|
15
|
+
allowModes;
|
|
16
|
+
}
|
|
17
|
+
exports.FormConstraintConfig = FormConstraintConfig;
|
|
18
|
+
/**
|
|
19
|
+
* The options available for the authorization constraints.
|
|
20
|
+
*/
|
|
21
|
+
class FormConstraintAuthorizationConfig {
|
|
22
|
+
allowRoles;
|
|
23
|
+
}
|
|
24
|
+
exports.FormConstraintAuthorizationConfig = FormConstraintAuthorizationConfig;
|
|
25
|
+
/**
|
|
26
|
+
* The form component abstract class is the base for each real component definition class.
|
|
27
|
+
*/
|
|
28
|
+
class FormComponentDefinition {
|
|
29
|
+
name = "";
|
|
30
|
+
expressions;
|
|
31
|
+
module;
|
|
32
|
+
constraints;
|
|
33
|
+
overrides;
|
|
34
|
+
}
|
|
35
|
+
exports.FormComponentDefinition = FormComponentDefinition;
|
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1jb21wb25lbnQubW9kZWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29uZmlnL2Zvcm0tY29tcG9uZW50Lm1vZGVsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQVlBLE1BQWEscUJBQXFCO0lBQzlCLElBQUksR0FBVyxFQUFFLENBQUM7SUFDbEIsV0FBVyxDQUFVO0lBQ3JCLE1BQU0sR0FBMkMsRUFBRSxRQUFRLEVBQUUsRUFBRSxFQUFFLENBQUM7Q0FDckU7QUFKRCxzREFJQztBQUVEOztHQUVHO0FBQ0gsTUFBYSxvQkFBb0I7SUFDN0IsYUFBYSxDQUFxQztJQUNsRCxVQUFVLENBQW9CO0NBQ2pDO0FBSEQsb0RBR0M7QUFFRDs7R0FFRztBQUNILE1BQWEsaUNBQWlDO0lBQzFDLFVBQVUsQ0FBWTtDQUN6QjtBQUZELDhFQUVDO0FBR0Q7O0dBRUc7QUFDSCxNQUFzQix1QkFBdUI7SUFDbEMsSUFBSSxHQUFXLEVBQUUsQ0FBQztJQUlsQixXQUFXLENBQWtDO0lBQzdDLE1BQU0sQ0FBVTtJQUNoQixXQUFXLENBQStCO0lBQzFDLFNBQVMsQ0FBMkI7Q0FHOUM7QUFYRCwwREFXQyJ9
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { CanVisit } from "./visitor/base.outline";
|
|
2
|
+
import { FieldModelDefinitionFrame, FieldModelDefinitionOutline } from "./field-model.outline";
|
|
3
|
+
import { FieldComponentDefinitionFrame, FieldComponentDefinitionOutline } from "./field-component.outline";
|
|
4
|
+
import { FormModesConfig } from "./shared.outline";
|
|
5
|
+
import { FieldLayoutDefinitionFrame, FieldLayoutDefinitionOutline } from "./field-layout.outline";
|
|
6
|
+
import { ComponentClassNamesType, LayoutClassNamesType, ModelClassNamesType } from "./dictionary.model";
|
|
7
|
+
/**
|
|
8
|
+
* The kinds of conditions available for expressions.
|
|
9
|
+
*
|
|
10
|
+
* JSONPointer - Uses JSON Pointer syntax to point to a value in the form data. For wiring events between fields, this is often sufficient. This is simple and fast to evaluate.
|
|
11
|
+
*
|
|
12
|
+
* JSONata - Uses the JSONata query and transformation language to evaluate more complex conditions based on data supplied at evaluation time. Template must resolve to a truthy value. This is more powerful but may be slower to evaluate.
|
|
13
|
+
*
|
|
14
|
+
* JSONataQuery - Similar to JSONata, but uses the FormComponent.componentDefQuerySource in addition to those supplied at evaluation time. This is useful for conditions that depend on multiple fields or the structure of the form itself.
|
|
15
|
+
*
|
|
16
|
+
* @see FormExpressionsConfigFrame.conditionKind
|
|
17
|
+
*/
|
|
18
|
+
export declare const ExpressionsConditionKind: {
|
|
19
|
+
readonly JSONPointer: "jsonpointer";
|
|
20
|
+
readonly JSONata: "jsonata";
|
|
21
|
+
readonly JSONataQuery: "jsonata_query";
|
|
22
|
+
};
|
|
23
|
+
export type ExpressionsConditionKindType = typeof ExpressionsConditionKind[keyof typeof ExpressionsConditionKind];
|
|
24
|
+
/**
|
|
25
|
+
* The shared properties for an expression config.
|
|
26
|
+
*
|
|
27
|
+
* Notes:
|
|
28
|
+
* - 'target': Optional property name that will receive the result of the expression.
|
|
29
|
+
* If unspecified, the result is not stored. Note that the template or operation might set values directly.
|
|
30
|
+
* - 'operation' and 'template': Must specify one of these.
|
|
31
|
+
*/
|
|
32
|
+
interface FormExpressionsBaseConfigFrame {
|
|
33
|
+
/**
|
|
34
|
+
* The JSONata template or customised JSONPointer string that resolves to a boolean indicating whether to execute the expression. If unspecified, the expression always executes.
|
|
35
|
+
*/
|
|
36
|
+
condition?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The kind of condition to use.
|
|
39
|
+
*/
|
|
40
|
+
conditionKind?: ExpressionsConditionKindType;
|
|
41
|
+
/**
|
|
42
|
+
* Indicates whether the expression has a template defined. Set when template is stripped prior to sending to client.
|
|
43
|
+
*/
|
|
44
|
+
hasTemplate?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Optional flag to indicate whether the expression will run when the form is ready. Defaults to true.
|
|
47
|
+
*/
|
|
48
|
+
runOnFormReady?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* An expression that requires the operation.
|
|
52
|
+
*/
|
|
53
|
+
interface FormExpressionsOperationConfigFrame {
|
|
54
|
+
/**
|
|
55
|
+
* The name of the entry in the `operations` dictionary to execute.
|
|
56
|
+
* Must be provided.
|
|
57
|
+
*/
|
|
58
|
+
operation: string;
|
|
59
|
+
/**
|
|
60
|
+
* The JSONata template for the expression. This only is populated in the server-side, the client side will retrieve the template from the pre-compiled dictionary.
|
|
61
|
+
* Optional when operation is provided.
|
|
62
|
+
*/
|
|
63
|
+
template?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* An expression that requires the template.
|
|
67
|
+
*/
|
|
68
|
+
interface FormExpressionsTemplateConfigFrame {
|
|
69
|
+
/**
|
|
70
|
+
* The JSONata template for the expression. This only is populated in the server-side, the client side will retrieve the template from the pre-compiled dictionary.
|
|
71
|
+
* Must be provided.
|
|
72
|
+
*/
|
|
73
|
+
template: string;
|
|
74
|
+
/**
|
|
75
|
+
* The name of the entry in the `operations` dictionary to execute.
|
|
76
|
+
* Optional when template is provided.
|
|
77
|
+
*/
|
|
78
|
+
operation?: string;
|
|
79
|
+
}
|
|
80
|
+
export declare const FormExpressionsTargetModelValue: "model.value";
|
|
81
|
+
type FormExpressionsTargetModelValueType = typeof FormExpressionsTargetModelValue;
|
|
82
|
+
interface FormExpressionsTargetModelValueConfigFrame {
|
|
83
|
+
/**
|
|
84
|
+
* The component's model value will receive the result of the expression.
|
|
85
|
+
*/
|
|
86
|
+
target: FormExpressionsTargetModelValueType;
|
|
87
|
+
}
|
|
88
|
+
export declare const FormExpressionsTargetLayoutPrefix: "layout.";
|
|
89
|
+
interface FormExpressionsTargetLayoutConfigFrame {
|
|
90
|
+
/**
|
|
91
|
+
* Layout property name that will receive the result of the expression.
|
|
92
|
+
*/
|
|
93
|
+
target: `layout.${string}`;
|
|
94
|
+
}
|
|
95
|
+
export declare const FormExpressionsTargetComponentPrefix: "component.";
|
|
96
|
+
interface FormExpressionsTargetComponentConfigFrame {
|
|
97
|
+
/**
|
|
98
|
+
* Component property name that will receive the result of the expression.
|
|
99
|
+
*/
|
|
100
|
+
target: `component.${string}`;
|
|
101
|
+
}
|
|
102
|
+
export declare const FormExpressionsTargetValidationGroups: "form.enabledValidationGroups";
|
|
103
|
+
type FormExpressionsTargetValidationGroupsType = typeof FormExpressionsTargetValidationGroups;
|
|
104
|
+
interface FormExpressionsTargetValidationGroupsConfigFrame {
|
|
105
|
+
/**
|
|
106
|
+
* Create an event to change the enabled validation groups to be as the result of the expression specifies.
|
|
107
|
+
*/
|
|
108
|
+
target: FormExpressionsTargetValidationGroupsType;
|
|
109
|
+
}
|
|
110
|
+
export interface FormExpressionsOperationNoTargetConfigFrame extends FormExpressionsBaseConfigFrame, FormExpressionsOperationConfigFrame {
|
|
111
|
+
}
|
|
112
|
+
export interface FormExpressionsTemplateNoTargetConfigFrame extends FormExpressionsBaseConfigFrame, FormExpressionsTemplateConfigFrame {
|
|
113
|
+
}
|
|
114
|
+
export interface FormExpressionsOperationModelValueConfigFrame extends FormExpressionsOperationNoTargetConfigFrame, FormExpressionsTargetModelValueConfigFrame {
|
|
115
|
+
}
|
|
116
|
+
export interface FormExpressionsTemplateModelValueConfigFrame extends FormExpressionsTemplateNoTargetConfigFrame, FormExpressionsTargetModelValueConfigFrame {
|
|
117
|
+
}
|
|
118
|
+
export interface FormExpressionsOperationLayoutConfigFrame extends FormExpressionsOperationNoTargetConfigFrame, FormExpressionsTargetLayoutConfigFrame {
|
|
119
|
+
}
|
|
120
|
+
export interface FormExpressionsTemplateLayoutConfigFrame extends FormExpressionsTemplateNoTargetConfigFrame, FormExpressionsTargetLayoutConfigFrame {
|
|
121
|
+
}
|
|
122
|
+
export interface FormExpressionsOperationComponentConfigFrame extends FormExpressionsOperationNoTargetConfigFrame, FormExpressionsTargetComponentConfigFrame {
|
|
123
|
+
}
|
|
124
|
+
export interface FormExpressionsTemplateComponentConfigFrame extends FormExpressionsTemplateNoTargetConfigFrame, FormExpressionsTargetComponentConfigFrame {
|
|
125
|
+
}
|
|
126
|
+
export interface FormExpressionsOperationValidationGroupsConfigFrame extends FormExpressionsOperationNoTargetConfigFrame, FormExpressionsTargetValidationGroupsConfigFrame {
|
|
127
|
+
}
|
|
128
|
+
export interface FormExpressionsTemplateValidationGroupsConfigFrame extends FormExpressionsTemplateNoTargetConfigFrame, FormExpressionsTargetValidationGroupsConfigFrame {
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* The available form expression configuration structures.
|
|
132
|
+
*/
|
|
133
|
+
export type FormExpressionsOptionsConfigFrame = FormExpressionsOperationNoTargetConfigFrame | FormExpressionsTemplateNoTargetConfigFrame | FormExpressionsOperationModelValueConfigFrame | FormExpressionsTemplateModelValueConfigFrame | FormExpressionsOperationLayoutConfigFrame | FormExpressionsTemplateLayoutConfigFrame | FormExpressionsOperationComponentConfigFrame | FormExpressionsTemplateComponentConfigFrame | FormExpressionsOperationValidationGroupsConfigFrame | FormExpressionsTemplateValidationGroupsConfigFrame;
|
|
134
|
+
/**
|
|
135
|
+
* The expressions for a component.
|
|
136
|
+
*/
|
|
137
|
+
export interface FormExpressionsConfigFrame {
|
|
138
|
+
/**
|
|
139
|
+
* The unique short name of the expression.
|
|
140
|
+
*/
|
|
141
|
+
name: string;
|
|
142
|
+
/**
|
|
143
|
+
* A description of the expression.
|
|
144
|
+
*/
|
|
145
|
+
description?: string;
|
|
146
|
+
/**
|
|
147
|
+
* The configuration for the expression.
|
|
148
|
+
*/
|
|
149
|
+
config: FormExpressionsOptionsConfigFrame;
|
|
150
|
+
}
|
|
151
|
+
export interface FormExpressionsConfigOutline extends FormExpressionsConfigFrame {
|
|
152
|
+
}
|
|
153
|
+
export interface FormConstraintConfigFrame {
|
|
154
|
+
/**
|
|
155
|
+
* The current user must fulfill these authorization constraints.
|
|
156
|
+
* This is only available on the server side.
|
|
157
|
+
* These are checked first.
|
|
158
|
+
*/
|
|
159
|
+
authorization?: FormConstraintAuthorizationConfigFrame;
|
|
160
|
+
/**
|
|
161
|
+
* This form field is included when the displayed form is in one of these modes.
|
|
162
|
+
* If this is not specified, the form field will be included in all modes.
|
|
163
|
+
*/
|
|
164
|
+
allowModes?: FormModesConfig[];
|
|
165
|
+
}
|
|
166
|
+
export interface FormConstraintConfigOutline extends FormConstraintConfigFrame {
|
|
167
|
+
authorization?: FormConstraintAuthorizationConfigOutline;
|
|
168
|
+
}
|
|
169
|
+
export interface FormConstraintAuthorizationConfigFrame {
|
|
170
|
+
/**
|
|
171
|
+
* The current user must have at least one of these roles for the form field to be included.
|
|
172
|
+
*
|
|
173
|
+
* e.g. allowRoles: ['Admin', 'Librarians'],
|
|
174
|
+
*/
|
|
175
|
+
allowRoles?: string[];
|
|
176
|
+
}
|
|
177
|
+
export interface FormConstraintAuthorizationConfigOutline extends FormConstraintAuthorizationConfigFrame {
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* The classes to transform to for each item that requires a class.
|
|
181
|
+
*/
|
|
182
|
+
export type FormOverrideModeClassesConfig = {
|
|
183
|
+
component?: ComponentClassNamesType;
|
|
184
|
+
model?: ModelClassNamesType;
|
|
185
|
+
layout?: LayoutClassNamesType;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* The form mode to class name mapping.
|
|
189
|
+
*/
|
|
190
|
+
export type FormOverrideModesClassConfig = Partial<{
|
|
191
|
+
[key in FormModesConfig]: FormOverrideModeClassesConfig;
|
|
192
|
+
}>;
|
|
193
|
+
/**
|
|
194
|
+
* The available options for overriding the form config.
|
|
195
|
+
*/
|
|
196
|
+
export interface FormOverrideConfigFrame {
|
|
197
|
+
/**
|
|
198
|
+
* Replace the form component name property value with the value of this property.
|
|
199
|
+
*/
|
|
200
|
+
replaceName?: string;
|
|
201
|
+
/**
|
|
202
|
+
* When the form mode is the object key (one of the form modes), set the class as per the value object.
|
|
203
|
+
*/
|
|
204
|
+
formModeClasses?: FormOverrideModesClassConfig;
|
|
205
|
+
/**
|
|
206
|
+
* The name of the reusable form config to insert in place of this element.
|
|
207
|
+
*/
|
|
208
|
+
reusableFormName?: string;
|
|
209
|
+
}
|
|
210
|
+
export interface FormOverrideConfigOutline extends FormOverrideConfigFrame {
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* The form component interface that provides typing for the object literal and schema.
|
|
214
|
+
*/
|
|
215
|
+
export interface FormComponentDefinitionFrame {
|
|
216
|
+
/**
|
|
217
|
+
* top-level field name, applies to field and the component, etc.
|
|
218
|
+
*/
|
|
219
|
+
name: string;
|
|
220
|
+
/**
|
|
221
|
+
* The definition of the model that backs the form field.
|
|
222
|
+
*/
|
|
223
|
+
model?: FieldModelDefinitionFrame<unknown>;
|
|
224
|
+
/**
|
|
225
|
+
* The definition of the client-side component for the form field.
|
|
226
|
+
*/
|
|
227
|
+
component: FieldComponentDefinitionFrame;
|
|
228
|
+
/**
|
|
229
|
+
* The definition of the client-side layout for this form field.
|
|
230
|
+
*/
|
|
231
|
+
layout?: FieldLayoutDefinitionFrame;
|
|
232
|
+
/**
|
|
233
|
+
* A record with string keys and expression template values for defining expressions.
|
|
234
|
+
*/
|
|
235
|
+
expressions?: FormExpressionsConfigFrame[];
|
|
236
|
+
/**
|
|
237
|
+
* For a custom form component definition, module defines where to find the definition.
|
|
238
|
+
*/
|
|
239
|
+
module?: string;
|
|
240
|
+
/**
|
|
241
|
+
* Constraints / prerequisites for this component to be included in the form definition.
|
|
242
|
+
*/
|
|
243
|
+
constraints?: FormConstraintConfigFrame;
|
|
244
|
+
/**
|
|
245
|
+
* Optional ways to extend or replace parts of the form config.
|
|
246
|
+
*/
|
|
247
|
+
overrides?: FormOverrideConfigFrame;
|
|
248
|
+
}
|
|
249
|
+
export interface FormComponentDefinitionOutline extends FormComponentDefinitionFrame, CanVisit {
|
|
250
|
+
model?: FieldModelDefinitionOutline<unknown>;
|
|
251
|
+
component: FieldComponentDefinitionOutline;
|
|
252
|
+
layout?: FieldLayoutDefinitionOutline;
|
|
253
|
+
expressions?: FormExpressionsConfigOutline[];
|
|
254
|
+
constraints?: FormConstraintConfigOutline;
|
|
255
|
+
overrides?: FormOverrideConfigOutline;
|
|
256
|
+
}
|
|
257
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormExpressionsTargetValidationGroups = exports.FormExpressionsTargetComponentPrefix = exports.FormExpressionsTargetLayoutPrefix = exports.FormExpressionsTargetModelValue = exports.ExpressionsConditionKind = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The kinds of conditions available for expressions.
|
|
6
|
+
*
|
|
7
|
+
* JSONPointer - Uses JSON Pointer syntax to point to a value in the form data. For wiring events between fields, this is often sufficient. This is simple and fast to evaluate.
|
|
8
|
+
*
|
|
9
|
+
* JSONata - Uses the JSONata query and transformation language to evaluate more complex conditions based on data supplied at evaluation time. Template must resolve to a truthy value. This is more powerful but may be slower to evaluate.
|
|
10
|
+
*
|
|
11
|
+
* JSONataQuery - Similar to JSONata, but uses the FormComponent.componentDefQuerySource in addition to those supplied at evaluation time. This is useful for conditions that depend on multiple fields or the structure of the form itself.
|
|
12
|
+
*
|
|
13
|
+
* @see FormExpressionsConfigFrame.conditionKind
|
|
14
|
+
*/
|
|
15
|
+
exports.ExpressionsConditionKind = {
|
|
16
|
+
JSONPointer: "jsonpointer",
|
|
17
|
+
JSONata: "jsonata",
|
|
18
|
+
JSONataQuery: "jsonata_query",
|
|
19
|
+
};
|
|
20
|
+
exports.FormExpressionsTargetModelValue = "model.value";
|
|
21
|
+
exports.FormExpressionsTargetLayoutPrefix = "layout.";
|
|
22
|
+
exports.FormExpressionsTargetComponentPrefix = "component.";
|
|
23
|
+
exports.FormExpressionsTargetValidationGroups = "form.enabledValidationGroups";
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1jb21wb25lbnQub3V0bGluZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb25maWcvZm9ybS1jb21wb25lbnQub3V0bGluZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFRQTs7Ozs7Ozs7OztHQVVHO0FBQ1UsUUFBQSx3QkFBd0IsR0FBRztJQUNwQyxXQUFXLEVBQUUsYUFBYTtJQUMxQixPQUFPLEVBQUUsU0FBUztJQUNsQixZQUFZLEVBQUUsZUFBZTtDQUN2QixDQUFDO0FBK0RFLFFBQUEsK0JBQStCLEdBQUcsYUFBc0IsQ0FBQztBQVN6RCxRQUFBLGlDQUFpQyxHQUFHLFNBQWtCLENBQUM7QUFRdkQsUUFBQSxvQ0FBb0MsR0FBRyxZQUFxQixDQUFDO0FBUTdELFFBQUEscUNBQXFDLEdBQUcsOEJBQXVDLENBQUMifQ==
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FormValidationGroups, FormValidatorConfig } from '../validation/form.model';
|
|
2
|
+
import { AvailableFormComponentDefinitionOutlines } from './dictionary.outline';
|
|
3
|
+
import { FormConfigOutline } from './form-config.outline';
|
|
4
|
+
import { FormConfigVisitorOutline } from './visitor/base.outline';
|
|
5
|
+
import { KeyValueStringNested, KeyValueStringProperty } from './shared.outline';
|
|
6
|
+
import { FormExpressionsConfigOutline } from './form-component.outline';
|
|
7
|
+
import { FormBehaviourConfigFrame } from './form-behaviour.outline';
|
|
8
|
+
/**
|
|
9
|
+
* The form definition.
|
|
10
|
+
* */
|
|
11
|
+
export declare class FormConfig implements FormConfigOutline {
|
|
12
|
+
name: string;
|
|
13
|
+
type?: string;
|
|
14
|
+
domElementType?: string;
|
|
15
|
+
domId?: string;
|
|
16
|
+
viewCssClasses?: KeyValueStringProperty;
|
|
17
|
+
editCssClasses?: KeyValueStringProperty;
|
|
18
|
+
defaultComponentConfig?: KeyValueStringNested;
|
|
19
|
+
defaultLayoutComponent?: string;
|
|
20
|
+
enabledValidationGroups?: string[];
|
|
21
|
+
validators: FormValidatorConfig[];
|
|
22
|
+
validationGroups?: FormValidationGroups;
|
|
23
|
+
componentDefinitions: AvailableFormComponentDefinitionOutlines[];
|
|
24
|
+
debugValue: boolean;
|
|
25
|
+
expressions?: FormExpressionsConfigOutline[];
|
|
26
|
+
/**
|
|
27
|
+
* Top-level behaviour config copied during construct and then transformed by
|
|
28
|
+
* the template/client visitors before reaching the Angular runtime.
|
|
29
|
+
*/
|
|
30
|
+
behaviours?: FormBehaviourConfigFrame[];
|
|
31
|
+
attachmentFields?: string[];
|
|
32
|
+
accept(visitor: FormConfigVisitorOutline): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormConfig = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The form definition.
|
|
6
|
+
* */
|
|
7
|
+
class FormConfig {
|
|
8
|
+
name = '';
|
|
9
|
+
type;
|
|
10
|
+
domElementType;
|
|
11
|
+
domId;
|
|
12
|
+
viewCssClasses;
|
|
13
|
+
editCssClasses;
|
|
14
|
+
defaultComponentConfig;
|
|
15
|
+
defaultLayoutComponent;
|
|
16
|
+
enabledValidationGroups = ['all'];
|
|
17
|
+
validators = [];
|
|
18
|
+
validationGroups = {
|
|
19
|
+
all: { description: 'Validate all fields with validators.', initialMembership: 'all' },
|
|
20
|
+
none: { description: 'Validate none of the fields.', initialMembership: 'none' },
|
|
21
|
+
};
|
|
22
|
+
componentDefinitions = [];
|
|
23
|
+
debugValue = false;
|
|
24
|
+
expressions;
|
|
25
|
+
/**
|
|
26
|
+
* Top-level behaviour config copied during construct and then transformed by
|
|
27
|
+
* the template/client visitors before reaching the Angular runtime.
|
|
28
|
+
*/
|
|
29
|
+
behaviours;
|
|
30
|
+
attachmentFields;
|
|
31
|
+
accept(visitor) {
|
|
32
|
+
visitor.visitFormConfig(this);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.FormConfig = FormConfig;
|
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1jb25maWcubW9kZWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29uZmlnL2Zvcm0tY29uZmlnLm1vZGVsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQVFBOztLQUVLO0FBQ0wsTUFBYSxVQUFVO0lBQ2QsSUFBSSxHQUFXLEVBQUUsQ0FBQztJQUNsQixJQUFJLENBQVU7SUFDZCxjQUFjLENBQVU7SUFDeEIsS0FBSyxDQUFVO0lBQ2YsY0FBYyxDQUEwQjtJQUN4QyxjQUFjLENBQTBCO0lBQ3hDLHNCQUFzQixDQUF3QjtJQUM5QyxzQkFBc0IsQ0FBVTtJQUNoQyx1QkFBdUIsR0FBYyxDQUFDLEtBQUssQ0FBQyxDQUFDO0lBQzdDLFVBQVUsR0FBMEIsRUFBRSxDQUFDO0lBQ3ZDLGdCQUFnQixHQUEwQjtRQUMvQyxHQUFHLEVBQUUsRUFBRSxXQUFXLEVBQUUsc0NBQXNDLEVBQUUsaUJBQWlCLEVBQUUsS0FBSyxFQUFFO1FBQ3RGLElBQUksRUFBRSxFQUFFLFdBQVcsRUFBRSw4QkFBOEIsRUFBRSxpQkFBaUIsRUFBRSxNQUFNLEVBQUU7S0FDakYsQ0FBQztJQUNLLG9CQUFvQixHQUErQyxFQUFFLENBQUM7SUFDdEUsVUFBVSxHQUFZLEtBQUssQ0FBQztJQUM1QixXQUFXLENBQWtDO0lBQ3BEOzs7T0FHRztJQUNJLFVBQVUsQ0FBOEI7SUFFeEMsZ0JBQWdCLENBQVk7SUFFbkMsTUFBTSxDQUFDLE9BQWlDO1FBQ3RDLE9BQU8sQ0FBQyxlQUFlLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDaEMsQ0FBQztDQUNGO0FBN0JELGdDQTZCQyJ9
|