@beinformed/ui 1.24.1-beta.1 → 1.24.1-beta.4
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/CHANGELOG.md +18 -0
- package/builder/package.json +2 -1
- package/constants/package.json +2 -1
- package/exceptions/package.json +2 -1
- package/hooks/package.json +2 -1
- package/i18n/package.json +2 -1
- package/models/package.json +2 -1
- package/modularui/package.json +2 -1
- package/package.json +3 -2
- package/react/package.json +2 -1
- package/react-client/package.json +2 -1
- package/react-server/package.json +2 -1
- package/react-theme/package.json +2 -1
- package/redux/package.json +2 -1
- package/types/constants/Constants.d.ts +151 -0
- package/types/constants/LayoutHintConfig.d.ts +241 -0
- package/types/constants/LayoutHints.d.ts +78 -0
- package/types/constants/Settings.d.ts +16 -0
- package/types/constants/index.d.ts +3 -0
- package/types/exceptions/ConfigurationException.d.ts +6 -0
- package/types/exceptions/FetchException.d.ts +31 -0
- package/types/exceptions/IllegalArgumentException.d.ts +6 -0
- package/types/exceptions/IllegalReturnException.d.ts +5 -0
- package/types/exceptions/IllegalStateException.d.ts +6 -0
- package/types/exceptions/JsonParseException.d.ts +6 -0
- package/types/exceptions/MissingPropertyException.d.ts +6 -0
- package/types/exceptions/NetworkException.d.ts +9 -0
- package/types/exceptions/NotAllowedUriException.d.ts +6 -0
- package/types/exceptions/NotFoundException.d.ts +10 -0
- package/types/exceptions/ServerRequestException.d.ts +6 -0
- package/types/exceptions/ThemePropertyException.d.ts +6 -0
- package/types/exceptions/TimeoutException.d.ts +7 -0
- package/types/exceptions/UnauthorizedException.d.ts +11 -0
- package/types/exceptions/UnsupportedOperationException.d.ts +6 -0
- package/types/exceptions/index.d.ts +15 -0
- package/types/hooks/useI18n.d.ts +9 -0
- package/types/i18n/Locale.d.ts +53 -0
- package/types/i18n/Locales.d.ts +55 -0
- package/types/i18n/Message.d.ts +6 -0
- package/types/i18n/index.d.ts +5 -0
- package/types/i18n/languages.d.ts +215 -0
- package/types/i18n/translations/beinformed_error_messages_en.nl.d.ts +97 -0
- package/types/i18n/translations/beinformed_error_messages_nl.nl.d.ts +97 -0
- package/types/i18n/types.d.ts +11 -0
- package/types/i18n/withMessage.d.ts +3 -0
- package/types/index.d.ts +6 -0
- package/types/models/actions/ActionCollection.d.ts +29 -0
- package/types/models/actions/ActionModel.d.ts +84 -0
- package/types/models/application/ApplicationModel.d.ts +41 -0
- package/types/models/attributes/AttributeCollection.d.ts +96 -0
- package/types/models/attributes/AttributeContent.d.ts +64 -0
- package/types/models/attributes/AttributeDataHelper.d.ts +67 -0
- package/types/models/attributes/AttributeModel.d.ts +395 -0
- package/types/models/attributes/AttributeSetModel.d.ts +28 -0
- package/types/models/attributes/BooleanAttributeModel.d.ts +65 -0
- package/types/models/attributes/CaptchaAttributeModel.d.ts +10 -0
- package/types/models/attributes/ChoiceAttributeModel.d.ts +76 -0
- package/types/models/attributes/ChoiceAttributeOptionCollection.d.ts +82 -0
- package/types/models/attributes/ChoiceAttributeOptionModel.d.ts +133 -0
- package/types/models/attributes/CompositeAttributeChildCollection.d.ts +56 -0
- package/types/models/attributes/CompositeAttributeModel.d.ts +44 -0
- package/types/models/attributes/DatetimeAttributeModel.d.ts +111 -0
- package/types/models/attributes/HelptextAttributeModel.d.ts +16 -0
- package/types/models/attributes/LabelAttributeModel.d.ts +12 -0
- package/types/models/attributes/MemoAttributeModel.d.ts +14 -0
- package/types/models/attributes/MoneyAttributeModel.d.ts +14 -0
- package/types/models/attributes/NumberAttributeModel.d.ts +49 -0
- package/types/models/attributes/PasswordAttributeModel.d.ts +62 -0
- package/types/models/attributes/StringAttributeModel.d.ts +62 -0
- package/types/models/attributes/UploadAttributeModel.d.ts +54 -0
- package/types/models/attributes/XMLAttributeModel.d.ts +10 -0
- package/types/models/attributes/_createAttribute.d.ts +6 -0
- package/types/models/attributes/input-constraints/BSNConstraint.d.ts +26 -0
- package/types/models/attributes/input-constraints/ConstraintCollection.d.ts +24 -0
- package/types/models/attributes/input-constraints/ConstraintModel.d.ts +34 -0
- package/types/models/attributes/input-constraints/DateBoundaryConstraint.d.ts +109 -0
- package/types/models/attributes/input-constraints/DateTimeDateFormatConstraint.d.ts +36 -0
- package/types/models/attributes/input-constraints/DateTimeTimeFormatConstraint.d.ts +36 -0
- package/types/models/attributes/input-constraints/DatetimeFormatConstraint.d.ts +92 -0
- package/types/models/attributes/input-constraints/FileExtensionConstraint.d.ts +33 -0
- package/types/models/attributes/input-constraints/FileSizeConstraint.d.ts +42 -0
- package/types/models/attributes/input-constraints/IBANConstraint.d.ts +23 -0
- package/types/models/attributes/input-constraints/MandatoryConstraint.d.ts +23 -0
- package/types/models/attributes/input-constraints/MandatoryRangeConstraint.d.ts +36 -0
- package/types/models/attributes/input-constraints/NumberBoundaryConstraint.d.ts +61 -0
- package/types/models/attributes/input-constraints/NumberFormatConstraint.d.ts +52 -0
- package/types/models/attributes/input-constraints/NumberGroupingConstraint.d.ts +46 -0
- package/types/models/attributes/input-constraints/PasswordConfirmConstraint.d.ts +36 -0
- package/types/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.d.ts +23 -0
- package/types/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.d.ts +32 -0
- package/types/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.d.ts +32 -0
- package/types/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.d.ts +35 -0
- package/types/models/attributes/input-constraints/RangeConstraint.d.ts +97 -0
- package/types/models/attributes/input-constraints/RegexConstraint.d.ts +37 -0
- package/types/models/attributes/input-constraints/StringLengthConstraint.d.ts +46 -0
- package/types/models/attributes/input-constraints/XMLConstraint.d.ts +26 -0
- package/types/models/attributes/layouthint-rules/BaseLayoutHintRule.d.ts +46 -0
- package/types/models/attributes/layouthint-rules/DependentAttribute.d.ts +57 -0
- package/types/models/attributes/layouthint-rules/LayoutHintRuleCollection.d.ts +27 -0
- package/types/models/attributes/layouthint-rules/RemainingTotalUploadSize.d.ts +17 -0
- package/types/models/base/BaseCollection.d.ts +89 -0
- package/types/models/base/BaseModel.d.ts +58 -0
- package/types/models/base/ResourceCollection.d.ts +19 -0
- package/types/models/base/ResourceModel.d.ts +93 -0
- package/types/models/caseview/CaseViewModel.d.ts +45 -0
- package/types/models/concepts/BusinessScenarioModel.d.ts +20 -0
- package/types/models/concepts/ConceptDetailModel.d.ts +69 -0
- package/types/models/concepts/ConceptIndexModel.d.ts +36 -0
- package/types/models/concepts/ConceptLinkModel.d.ts +65 -0
- package/types/models/concepts/ConceptRelationCollection.d.ts +34 -0
- package/types/models/concepts/ConceptRelationModel.d.ts +43 -0
- package/types/models/concepts/ConceptTypeDetailModel.d.ts +39 -0
- package/types/models/concepts/SourceReferenceCollection.d.ts +13 -0
- package/types/models/concepts/SourceReferenceModel.d.ts +30 -0
- package/types/models/content/ContentIndexModel.d.ts +34 -0
- package/types/models/content/ContentLinkModel.d.ts +81 -0
- package/types/models/content/ContentModel.d.ts +74 -0
- package/types/models/content/ContentTOCModel.d.ts +37 -0
- package/types/models/content/ContentTypeModel.d.ts +26 -0
- package/types/models/content/SectionModel.d.ts +75 -0
- package/types/models/content/SubSectionModel.d.ts +64 -0
- package/types/models/contentconfiguration/ContentConfiguration.d.ts +28 -0
- package/types/models/contentconfiguration/ContentConfigurationElements.d.ts +47 -0
- package/types/models/contentconfiguration/ContentConfigurationEndResults.d.ts +16 -0
- package/types/models/contentconfiguration/ContentConfigurationQuestions.d.ts +22 -0
- package/types/models/contentconfiguration/ContentConfigurationResults.d.ts +39 -0
- package/types/models/detail/DetailModel.d.ts +72 -0
- package/types/models/error/ErrorCollection.d.ts +51 -0
- package/types/models/error/ErrorModel.d.ts +36 -0
- package/types/models/error/ErrorResponse.d.ts +148 -0
- package/types/models/filters/AssignmentFilterModel.d.ts +35 -0
- package/types/models/filters/BaseFilterModel.d.ts +85 -0
- package/types/models/filters/ConceptIndexFilterModel.d.ts +6 -0
- package/types/models/filters/FilterCollection.d.ts +48 -0
- package/types/models/filters/FilterModel.d.ts +5 -0
- package/types/models/filters/RangeFilterModel.d.ts +6 -0
- package/types/models/form/FormModel.d.ts +309 -0
- package/types/models/form/FormObjectModel.d.ts +168 -0
- package/types/models/grouping/GroupingModel.d.ts +85 -0
- package/types/models/href/Href.d.ts +17 -0
- package/types/models/href/ListHref.d.ts +64 -0
- package/types/models/index.d.ts +94 -0
- package/types/models/layouthint/LayoutHintCollection.d.ts +43 -0
- package/types/models/links/LinkCollection.d.ts +62 -0
- package/types/models/links/LinkModel.d.ts +92 -0
- package/types/models/links/normalizeLinkJSON.d.ts +9 -0
- package/types/models/list/ListDetailModel.d.ts +69 -0
- package/types/models/list/ListHeaderModel.d.ts +64 -0
- package/types/models/list/ListItemCollection.d.ts +21 -0
- package/types/models/list/ListItemModel.d.ts +34 -0
- package/types/models/list/ListModel.d.ts +135 -0
- package/types/models/lookup/LookupOptionCollection.d.ts +11 -0
- package/types/models/lookup/LookupOptionsModel.d.ts +19 -0
- package/types/models/modelcatalog/ModelCatalogModel.d.ts +18 -0
- package/types/models/paging/PagesizeModel.d.ts +25 -0
- package/types/models/paging/PagingModel.d.ts +49 -0
- package/types/models/panels/GroupingPanelModel.d.ts +39 -0
- package/types/models/parameter/Parameter.d.ts +40 -0
- package/types/models/process/ProcessStatusSettingsModel.d.ts +38 -0
- package/types/models/resolveModel.d.ts +7 -0
- package/types/models/search/CaseSearchModel.d.ts +14 -0
- package/types/models/sorting/SortOptionModel.d.ts +48 -0
- package/types/models/sorting/SortingModel.d.ts +42 -0
- package/types/models/tab/TabModel.d.ts +44 -0
- package/types/models/taskgroup/TaskGroupCollection.d.ts +12 -0
- package/types/models/taskgroup/TaskGroupModel.d.ts +15 -0
- package/types/models/types.d.ts +147 -0
- package/types/models/user/UserModel.d.ts +14 -0
- package/types/models/user/UserProfileModel.d.ts +12 -0
- package/types/models/user/UserServicesModel.d.ts +28 -0
- package/types/modularui/Authenticate.d.ts +42 -0
- package/types/modularui/ModularUIError.d.ts +10 -0
- package/types/modularui/ModularUIRequest.d.ts +170 -0
- package/types/modularui/ModularUIResponse.d.ts +56 -0
- package/types/modularui/index.d.ts +3 -0
- package/types/redux/_i18n/types.d.ts +13 -0
- package/types/redux/_modularui/types.d.ts +49 -0
- package/types/redux/_router/types.d.ts +35 -0
- package/types/redux/selectors/i18n.d.ts +4 -0
- package/types/redux/types.d.ts +105 -0
- package/types/utils/browser/Cache.d.ts +45 -0
- package/types/utils/browser/Cookies.d.ts +15 -0
- package/types/utils/datetime/DateTimeUtil.d.ts +164 -0
- package/types/utils/fetch/serverFetch.d.ts +5 -0
- package/types/utils/fetch/types.d.ts +38 -0
- package/types/utils/fetch/universalFetch.d.ts +7 -0
- package/types/utils/fetch/xhr.d.ts +5 -0
- package/types/utils/helpers/checkResource.d.ts +3 -0
- package/types/utils/helpers/createHash.d.ts +8 -0
- package/types/utils/helpers/createUUID.d.ts +4 -0
- package/types/utils/helpers/objects.d.ts +3 -0
- package/types/utils/helpers/sanitizeHtml.d.ts +9 -0
- package/types/utils/helpers/text.d.ts +7 -0
- package/types/utils/index.d.ts +16 -0
- package/types/utils/number/DecimalFormat.d.ts +90 -0
- package/types/utils/number/formatValue.d.ts +4 -0
- package/types/utils/number/parseNumbers.d.ts +9 -0
- package/utils/package.json +2 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assignment filter consists of two filters: assignment type and user filter
|
|
3
|
+
*/
|
|
4
|
+
export default class AssignmentFilterModel extends BaseFilterModel {
|
|
5
|
+
_assignmenttype: AttributeType | null;
|
|
6
|
+
_user: AttributeType | null;
|
|
7
|
+
/**
|
|
8
|
+
*/
|
|
9
|
+
get key(): string;
|
|
10
|
+
/**
|
|
11
|
+
*/
|
|
12
|
+
get contextid(): string;
|
|
13
|
+
/**
|
|
14
|
+
* Creates an assignmenttype model when assignmenttype json is present
|
|
15
|
+
*/
|
|
16
|
+
createAssignmentTypeModel(): AttributeType | null;
|
|
17
|
+
/**
|
|
18
|
+
* Creates an assignmenttype model when userkey json is present
|
|
19
|
+
*/
|
|
20
|
+
createUserModel(): AttributeType | null;
|
|
21
|
+
/**
|
|
22
|
+
* The assignment filter consists of two part. This method return the assignment type attribute
|
|
23
|
+
*/
|
|
24
|
+
get assignmenttype(): AttributeType;
|
|
25
|
+
/**
|
|
26
|
+
* The assignment filter consists of two part. This method return the user identifier attribute
|
|
27
|
+
*/
|
|
28
|
+
get user(): AttributeType;
|
|
29
|
+
/**
|
|
30
|
+
* Reset the values within the filter
|
|
31
|
+
*/
|
|
32
|
+
reset(): AssignmentFilterModel;
|
|
33
|
+
}
|
|
34
|
+
import BaseFilterModel from "../filters/BaseFilterModel";
|
|
35
|
+
import { AttributeType } from "../types";
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for filters
|
|
3
|
+
*/
|
|
4
|
+
export default class BaseFilterModel extends BaseModel {
|
|
5
|
+
_attribute: AttributeType | null;
|
|
6
|
+
_context: Object;
|
|
7
|
+
_listKey: string;
|
|
8
|
+
/**
|
|
9
|
+
* Set key of list this filter belongs to
|
|
10
|
+
*/
|
|
11
|
+
set listkey(arg: string);
|
|
12
|
+
/**
|
|
13
|
+
* Getting key of the list these filters apply to
|
|
14
|
+
*/
|
|
15
|
+
get listkey(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Get the type of a filter.
|
|
18
|
+
*/
|
|
19
|
+
get type(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Create attribute through the attribute factory. Create type based on filter key without the filter suffix
|
|
22
|
+
*/
|
|
23
|
+
createAttribute(type: string, param: string, data: Object, contributions: Object): AttributeType | null;
|
|
24
|
+
/**
|
|
25
|
+
* Set context of filter
|
|
26
|
+
*/
|
|
27
|
+
set context(arg: Object);
|
|
28
|
+
/**
|
|
29
|
+
* Getting context data
|
|
30
|
+
*/
|
|
31
|
+
get context(): Object;
|
|
32
|
+
/**
|
|
33
|
+
* Getting the context label
|
|
34
|
+
*/
|
|
35
|
+
get contextLabel(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Getting the label of the filter
|
|
38
|
+
*/
|
|
39
|
+
get label(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Getting the name of the filter
|
|
42
|
+
*/
|
|
43
|
+
get name(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Getting the param name of the filter
|
|
46
|
+
*/
|
|
47
|
+
get param(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Get attribute of filter
|
|
50
|
+
*/
|
|
51
|
+
get attribute(): AttributeType;
|
|
52
|
+
/**
|
|
53
|
+
* Retrieve the parameters with it's value for this filter
|
|
54
|
+
*/
|
|
55
|
+
get params(): {
|
|
56
|
+
name: string;
|
|
57
|
+
value: string | null;
|
|
58
|
+
}[];
|
|
59
|
+
/**
|
|
60
|
+
* Reset the value of this filter to undefined
|
|
61
|
+
*/
|
|
62
|
+
reset(): FilterType;
|
|
63
|
+
/**
|
|
64
|
+
* Update this filter with input name and value
|
|
65
|
+
*/
|
|
66
|
+
update(attribute: AttributeType, value: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* Inidicates if filter is a quick search filter
|
|
69
|
+
*/
|
|
70
|
+
isQuickSearch(): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Inidiates if filter is active
|
|
73
|
+
*/
|
|
74
|
+
isActive(): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Inidiates if filter is valid
|
|
77
|
+
*/
|
|
78
|
+
get isValid(): boolean;
|
|
79
|
+
/**
|
|
80
|
+
*/
|
|
81
|
+
get readonlyvalue(): string;
|
|
82
|
+
}
|
|
83
|
+
import BaseModel from "../base/BaseModel";
|
|
84
|
+
import { AttributeType } from "../types";
|
|
85
|
+
import { FilterType } from "../types";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contains a collection of filters
|
|
3
|
+
*/
|
|
4
|
+
export default class FilterCollection extends BaseCollection<FilterType> {
|
|
5
|
+
/**
|
|
6
|
+
* Construct a collection of filters
|
|
7
|
+
*/
|
|
8
|
+
constructor(data?: Object, contributions?: Object);
|
|
9
|
+
collection: any;
|
|
10
|
+
/**
|
|
11
|
+
*/
|
|
12
|
+
createFilter(filterKey: string, data: Object, contributions: Object): FilterType;
|
|
13
|
+
/**
|
|
14
|
+
* Call the reset function on all filters
|
|
15
|
+
*
|
|
16
|
+
* @see {FilterType#reset()}
|
|
17
|
+
*/
|
|
18
|
+
reset(): FilterCollection;
|
|
19
|
+
/**
|
|
20
|
+
* Checks if range attribute key equals key
|
|
21
|
+
*/
|
|
22
|
+
checkRangeFilterByAttributeKey(filter: RangeFilterModel, key: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Check if assignment filter attribute matches key
|
|
25
|
+
*/
|
|
26
|
+
checkAssignmentFilterByAttributeKey(filter: AssignmentFilterModel, key: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Getting the filter by name
|
|
29
|
+
*/
|
|
30
|
+
getFilterByAttributeKey(key: string): FilterType | null;
|
|
31
|
+
/**
|
|
32
|
+
* Update Filter by input name and value
|
|
33
|
+
*/
|
|
34
|
+
update(attribute: AttributeType, value: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* Retrieve if all filters are valid
|
|
37
|
+
*/
|
|
38
|
+
get isValid(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Indicates if an active filter is present in the collection
|
|
41
|
+
*/
|
|
42
|
+
hasActiveFilters(): boolean;
|
|
43
|
+
}
|
|
44
|
+
import { FilterType } from "../types";
|
|
45
|
+
import BaseCollection from "../base/BaseCollection";
|
|
46
|
+
import RangeFilterModel from "../filters/RangeFilterModel";
|
|
47
|
+
import AssignmentFilterModel from "../filters/AssignmentFilterModel";
|
|
48
|
+
import { AttributeType } from "../types";
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
export default FormModel;
|
|
2
|
+
/**
|
|
3
|
+
*/
|
|
4
|
+
declare class FormModel extends ResourceModel {
|
|
5
|
+
_lastUpdate: number;
|
|
6
|
+
_completedFormObjects: Array<FormObjectModel>;
|
|
7
|
+
_currentFormObject: FormObjectModel | null;
|
|
8
|
+
_previouslyEnteredFormObjects: Array<FormObjectModel>;
|
|
9
|
+
_mergePreviouslyEnteredObjects: boolean;
|
|
10
|
+
_endResultFormObjects: Array<FormObjectModel>;
|
|
11
|
+
_previousEndResultKeys: Array<string>;
|
|
12
|
+
_useClientsideValidation: boolean;
|
|
13
|
+
_errorCollection: ErrorCollection;
|
|
14
|
+
_redirectLocation: Href;
|
|
15
|
+
_commit: boolean;
|
|
16
|
+
_isFinished: boolean;
|
|
17
|
+
_isComplete: boolean;
|
|
18
|
+
_parameters: Array<Parameter>;
|
|
19
|
+
_tokens: Array<string>;
|
|
20
|
+
/**
|
|
21
|
+
*/
|
|
22
|
+
set lastUpdate(arg: number);
|
|
23
|
+
/**
|
|
24
|
+
*/
|
|
25
|
+
get lastUpdate(): number;
|
|
26
|
+
/**
|
|
27
|
+
*/
|
|
28
|
+
set currentFormObject(arg: FormObjectModel);
|
|
29
|
+
/**
|
|
30
|
+
*/
|
|
31
|
+
get currentFormObject(): FormObjectModel;
|
|
32
|
+
/**
|
|
33
|
+
*/
|
|
34
|
+
set endResultFormObjects(arg: FormObjectModel[]);
|
|
35
|
+
/**
|
|
36
|
+
*/
|
|
37
|
+
get endResultFormObjects(): FormObjectModel[];
|
|
38
|
+
/**
|
|
39
|
+
*/
|
|
40
|
+
set parameters(arg: Parameter[]);
|
|
41
|
+
/**
|
|
42
|
+
*/
|
|
43
|
+
get parameters(): Parameter[];
|
|
44
|
+
/**
|
|
45
|
+
*/
|
|
46
|
+
set isComplete(arg: boolean);
|
|
47
|
+
/**
|
|
48
|
+
* Indicates if form is completely entered
|
|
49
|
+
*/
|
|
50
|
+
get isComplete(): boolean;
|
|
51
|
+
/**
|
|
52
|
+
*/
|
|
53
|
+
get actiontype(): string;
|
|
54
|
+
/**
|
|
55
|
+
* Get form level button labels
|
|
56
|
+
*/
|
|
57
|
+
get buttonLabels(): Object;
|
|
58
|
+
/**
|
|
59
|
+
* @returns button label from contributions;
|
|
60
|
+
*/
|
|
61
|
+
getButtonLabel(buttonType: "cancel" | "previous" | "next" | "finish"): string | null;
|
|
62
|
+
/**
|
|
63
|
+
* Get all applicable objects
|
|
64
|
+
*/
|
|
65
|
+
get allObjects(): FormObjectModel[];
|
|
66
|
+
/**
|
|
67
|
+
*/
|
|
68
|
+
get objectKeys(): string[];
|
|
69
|
+
/**
|
|
70
|
+
*/
|
|
71
|
+
get numberOfExpectedQuestions(): number;
|
|
72
|
+
/**
|
|
73
|
+
* Has questions configured on form
|
|
74
|
+
*/
|
|
75
|
+
get hasNoQuestionsConfigured(): boolean;
|
|
76
|
+
/**
|
|
77
|
+
*/
|
|
78
|
+
addGlobalDynamicSchema(anchor: Object, dynamicschema: Object): Object;
|
|
79
|
+
/**
|
|
80
|
+
*/
|
|
81
|
+
getMissingAnchors(): Array<Object>;
|
|
82
|
+
/**
|
|
83
|
+
* Create form object based on the data and contributions available in this form
|
|
84
|
+
*/
|
|
85
|
+
createFormObject(): FormObjectModel | null;
|
|
86
|
+
/**
|
|
87
|
+
*/
|
|
88
|
+
addEmptyFormObject(formObjectModel?: FormObjectModel | null): void;
|
|
89
|
+
/**
|
|
90
|
+
*/
|
|
91
|
+
getHighestRepeatIndex(formObjectModel: FormObjectModel): number;
|
|
92
|
+
/**
|
|
93
|
+
*/
|
|
94
|
+
addFormObject(formObjectModel: FormObjectModel): void;
|
|
95
|
+
/**
|
|
96
|
+
*/
|
|
97
|
+
set completedFormObjects(arg: FormObjectModel[]);
|
|
98
|
+
/**
|
|
99
|
+
* Completed objects are previously entered questions
|
|
100
|
+
*/
|
|
101
|
+
get completedFormObjects(): FormObjectModel[];
|
|
102
|
+
/**
|
|
103
|
+
* Retrieve a form object by the key
|
|
104
|
+
*/
|
|
105
|
+
getFormObjectByKey(key: string): FormObjectModel | null;
|
|
106
|
+
/**
|
|
107
|
+
* Retrieve a form object by a layouthint
|
|
108
|
+
*/
|
|
109
|
+
getFormObjectByLayoutHint(hint: string): FormObjectModel | null;
|
|
110
|
+
/**
|
|
111
|
+
*/
|
|
112
|
+
removeFormObject(formObjectModel: FormObjectModel | null): void;
|
|
113
|
+
/**
|
|
114
|
+
*/
|
|
115
|
+
set previouslyEnteredFormObjects(arg: FormObjectModel[]);
|
|
116
|
+
/**
|
|
117
|
+
* Previously entered objects are questions that have been entered before,
|
|
118
|
+
* but are currently not applicable for the form.
|
|
119
|
+
* For example because of previous navigation
|
|
120
|
+
*/
|
|
121
|
+
get previouslyEnteredFormObjects(): FormObjectModel[];
|
|
122
|
+
/**
|
|
123
|
+
* Handle end results
|
|
124
|
+
*/
|
|
125
|
+
setEndResultFormObjects(): Array<FormObjectModel>;
|
|
126
|
+
/**
|
|
127
|
+
*/
|
|
128
|
+
get expectsEndResultFormObjects(): boolean;
|
|
129
|
+
/**
|
|
130
|
+
*/
|
|
131
|
+
getEndResultFormObjects(): Array<FormObjectModel>;
|
|
132
|
+
/**
|
|
133
|
+
*/
|
|
134
|
+
set previousEndResultKeys(arg: string[]);
|
|
135
|
+
/**
|
|
136
|
+
*/
|
|
137
|
+
get previousEndResultKeys(): string[];
|
|
138
|
+
/**
|
|
139
|
+
* Error handling
|
|
140
|
+
*/
|
|
141
|
+
get isValid(): boolean;
|
|
142
|
+
/**
|
|
143
|
+
*/
|
|
144
|
+
hasServerErrors(): boolean;
|
|
145
|
+
/**
|
|
146
|
+
*/
|
|
147
|
+
hasErrors(): boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Add an error to the error collection of this form
|
|
150
|
+
*/
|
|
151
|
+
addServerError(error: ErrorResponse): void;
|
|
152
|
+
/**
|
|
153
|
+
* Reset error messages
|
|
154
|
+
*/
|
|
155
|
+
resetErrors(): void;
|
|
156
|
+
/**
|
|
157
|
+
*/
|
|
158
|
+
set errorCollection(arg: ErrorCollection);
|
|
159
|
+
/**
|
|
160
|
+
*/
|
|
161
|
+
get errorCollection(): ErrorCollection;
|
|
162
|
+
/**
|
|
163
|
+
*/
|
|
164
|
+
set commit(arg: boolean);
|
|
165
|
+
/**
|
|
166
|
+
* Indicates if the form needs to be committed
|
|
167
|
+
*/
|
|
168
|
+
get commit(): boolean;
|
|
169
|
+
/**
|
|
170
|
+
*/
|
|
171
|
+
set isFinished(arg: boolean);
|
|
172
|
+
/**
|
|
173
|
+
* Inidicates if form is finished: Form is completely entered and committed
|
|
174
|
+
*/
|
|
175
|
+
get isFinished(): boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Handle success redirects
|
|
178
|
+
*/
|
|
179
|
+
get successRedirect(): Href;
|
|
180
|
+
/**
|
|
181
|
+
*/
|
|
182
|
+
get redirectLocation(): Href;
|
|
183
|
+
/**
|
|
184
|
+
*/
|
|
185
|
+
getSuccessData(): Object;
|
|
186
|
+
/**
|
|
187
|
+
* Href handling
|
|
188
|
+
*/
|
|
189
|
+
setParameters(modularuiResponse: ModularUIResponse): Array<Parameter>;
|
|
190
|
+
/**
|
|
191
|
+
*/
|
|
192
|
+
selfhrefNoCommitParam(): Href;
|
|
193
|
+
/**
|
|
194
|
+
*/
|
|
195
|
+
selfhrefWithCommitParam(): Href;
|
|
196
|
+
/**
|
|
197
|
+
* Replaces all tokens with the given collection of tokens
|
|
198
|
+
*/
|
|
199
|
+
set tokens(arg: string[]);
|
|
200
|
+
/**
|
|
201
|
+
* Handle form tokens to indicate concurrent form use
|
|
202
|
+
*/
|
|
203
|
+
get tokens(): string[];
|
|
204
|
+
/**
|
|
205
|
+
* Removes all tokens from the form
|
|
206
|
+
*/
|
|
207
|
+
removeTokens(): void;
|
|
208
|
+
/**
|
|
209
|
+
* Keep track of changed form
|
|
210
|
+
*/
|
|
211
|
+
isChanged(): boolean;
|
|
212
|
+
/**
|
|
213
|
+
*/
|
|
214
|
+
getFormDataObjects(validOnly?: boolean, validationData?: boolean): Array<Object>;
|
|
215
|
+
/**
|
|
216
|
+
*/
|
|
217
|
+
getFormData(validOnly?: boolean, withConcurrencyToken?: boolean, validationData?: boolean): string;
|
|
218
|
+
/**
|
|
219
|
+
* Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION
|
|
220
|
+
*/
|
|
221
|
+
setUseClientsideValidation(enabled: boolean): void;
|
|
222
|
+
/**
|
|
223
|
+
* Indicates if client side validation is enabled
|
|
224
|
+
* @returns {boolean}
|
|
225
|
+
*/
|
|
226
|
+
useClientsideValidation(): boolean;
|
|
227
|
+
/**
|
|
228
|
+
* Get form data for submitting
|
|
229
|
+
*/
|
|
230
|
+
get formdata(): string;
|
|
231
|
+
/**
|
|
232
|
+
*/
|
|
233
|
+
get validationData(): string;
|
|
234
|
+
/**
|
|
235
|
+
* Form navigation: Go one object back (previous button)
|
|
236
|
+
*/
|
|
237
|
+
get hasPreviousStep(): boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Go one form-object back,
|
|
240
|
+
* for repeating object this means go back
|
|
241
|
+
* until we get at a form object that had
|
|
242
|
+
* a different key than the current form object
|
|
243
|
+
*/
|
|
244
|
+
setPreviousObject(): void;
|
|
245
|
+
/**
|
|
246
|
+
* Form navigation: has next step or is last
|
|
247
|
+
*/
|
|
248
|
+
get hasNextStep(): boolean;
|
|
249
|
+
/**
|
|
250
|
+
* Merge existing form with new form
|
|
251
|
+
*/
|
|
252
|
+
update(receivedForm: ModularUIModel): FormModel;
|
|
253
|
+
lastServerUpdate: any;
|
|
254
|
+
/**
|
|
255
|
+
*/
|
|
256
|
+
updateValidations(data: any): FormModel;
|
|
257
|
+
/**
|
|
258
|
+
* Process finished form
|
|
259
|
+
*/
|
|
260
|
+
handleFinished(receivedForm: FormModel): void;
|
|
261
|
+
_data: any;
|
|
262
|
+
/**
|
|
263
|
+
*/
|
|
264
|
+
handleRootErrors(errors: Array<Object>): void;
|
|
265
|
+
/**
|
|
266
|
+
* Process errors from received form
|
|
267
|
+
*/
|
|
268
|
+
handleErrors(receivedForm: FormModel): void;
|
|
269
|
+
/**
|
|
270
|
+
* Process missing from received form
|
|
271
|
+
*/
|
|
272
|
+
handleMissing(receivedForm: FormModel): void;
|
|
273
|
+
/**
|
|
274
|
+
* Received missing anchors in the response with an object id that is the current form object
|
|
275
|
+
*/
|
|
276
|
+
processMissingErrors(receivedForm: FormModel): FormObjectModel | null;
|
|
277
|
+
/**
|
|
278
|
+
*/
|
|
279
|
+
handleMissingErrors(receivedForm: FormModel): void;
|
|
280
|
+
/**
|
|
281
|
+
*/
|
|
282
|
+
handleNewFormObject(receivedForm: FormModel): void;
|
|
283
|
+
/**
|
|
284
|
+
*/
|
|
285
|
+
set mergePreviouslyEnteredObjects(arg: boolean);
|
|
286
|
+
/**
|
|
287
|
+
* Indicate if a new form object model should be merged with a previousled entered form object model
|
|
288
|
+
* Set this property to false on the form that receives the new form to skip the merge behavior
|
|
289
|
+
*/
|
|
290
|
+
get mergePreviouslyEnteredObjects(): boolean;
|
|
291
|
+
/**
|
|
292
|
+
*/
|
|
293
|
+
handlePreviouslyEnteredFormObjects(receivedCurrentFormObject: FormObjectModel, previouslyEnteredFormObjects: Array<FormObjectModel>): void;
|
|
294
|
+
/**
|
|
295
|
+
*/
|
|
296
|
+
mergeObjects(newObject: FormObjectModel, oldObject: FormObjectModel): FormObjectModel;
|
|
297
|
+
/**
|
|
298
|
+
*/
|
|
299
|
+
findAttribute(findMethod: Function): AttributeType | null;
|
|
300
|
+
}
|
|
301
|
+
import ResourceModel from "../base/ResourceModel";
|
|
302
|
+
import FormObjectModel from "./FormObjectModel";
|
|
303
|
+
import ErrorCollection from "../error/ErrorCollection";
|
|
304
|
+
import Href from "../href/Href";
|
|
305
|
+
import Parameter from "../parameter/Parameter";
|
|
306
|
+
import ErrorResponse from "../error/ErrorResponse";
|
|
307
|
+
import { ModularUIResponse } from "../../modularui";
|
|
308
|
+
import { ModularUIModel } from "../types";
|
|
309
|
+
import { AttributeType } from "../types";
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form Object
|
|
3
|
+
*/
|
|
4
|
+
export default class FormObjectModel extends BaseModel {
|
|
5
|
+
/**
|
|
6
|
+
*/
|
|
7
|
+
static createEmpty(formObjectModel: FormObjectModel): FormObjectModel;
|
|
8
|
+
_attributeCollection: AttributeCollection;
|
|
9
|
+
_contentConfiguration: ContentConfiguration;
|
|
10
|
+
_errorCollection: ErrorCollection;
|
|
11
|
+
_repeatIndex: number;
|
|
12
|
+
_dynamicValidationsLoaded: boolean;
|
|
13
|
+
/**
|
|
14
|
+
*/
|
|
15
|
+
equals(object: FormObjectModel | null, withRepeatIndex?: boolean): boolean;
|
|
16
|
+
/**
|
|
17
|
+
*/
|
|
18
|
+
getAttributeByAttribute(attribute: AttributeType): AttributeType | null;
|
|
19
|
+
/**
|
|
20
|
+
*/
|
|
21
|
+
getAttributeByKey(key: string): AttributeType | null;
|
|
22
|
+
/**
|
|
23
|
+
*/
|
|
24
|
+
hasAttributeByKey(key: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Get elements from both the missing attributes and the result attributes
|
|
27
|
+
*/
|
|
28
|
+
getElements(): Array<Object>;
|
|
29
|
+
/**
|
|
30
|
+
* Map available contributions on the available data. Only use contributions that are needed for the data
|
|
31
|
+
*/
|
|
32
|
+
getApplicableAttributeContributions(): Array<Object>;
|
|
33
|
+
/**
|
|
34
|
+
* Recursevily check if an attribute id occurs in the tree of attribute contributions.
|
|
35
|
+
* The complete leaf of the tree is returned when an attribute id matches
|
|
36
|
+
*/
|
|
37
|
+
getAttributesInData(dataElementIds: Array<string>, attributesContributions: Object): Array<Object>;
|
|
38
|
+
/**
|
|
39
|
+
*/
|
|
40
|
+
getInitialChildModelLinks(): Array<LinkModel>;
|
|
41
|
+
/**
|
|
42
|
+
*/
|
|
43
|
+
setChildModels(models: Array<ModularUIModel>): void;
|
|
44
|
+
/**
|
|
45
|
+
* get key
|
|
46
|
+
*/
|
|
47
|
+
get key(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Get content configuration for form objects
|
|
50
|
+
*/
|
|
51
|
+
get contentConfiguration(): ContentConfiguration;
|
|
52
|
+
/**
|
|
53
|
+
*/
|
|
54
|
+
get hasEndResultConfiguration(): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Indicates if object is dynamic. A dynamic object should be submitted on each attribute change
|
|
57
|
+
*/
|
|
58
|
+
get isDynamic(): boolean;
|
|
59
|
+
/**
|
|
60
|
+
*/
|
|
61
|
+
get hasDynamicValidations(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Indicates if object is repeatable
|
|
64
|
+
*/
|
|
65
|
+
get isRepeatable(): boolean;
|
|
66
|
+
/**
|
|
67
|
+
*/
|
|
68
|
+
set repeatIndex(arg: number);
|
|
69
|
+
/**
|
|
70
|
+
*/
|
|
71
|
+
get repeatIndex(): number;
|
|
72
|
+
/**
|
|
73
|
+
*/
|
|
74
|
+
get maxRepeats(): number;
|
|
75
|
+
/**
|
|
76
|
+
*/
|
|
77
|
+
get hasFixedNrOfRepeats(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
*/
|
|
80
|
+
get isRepeatWithUnknownTotal(): boolean;
|
|
81
|
+
/**
|
|
82
|
+
*/
|
|
83
|
+
get isLastRepeat(): boolean;
|
|
84
|
+
/**
|
|
85
|
+
*/
|
|
86
|
+
get repeatIndexLabel(): string;
|
|
87
|
+
/**
|
|
88
|
+
* Get label of form object
|
|
89
|
+
*/
|
|
90
|
+
get label(): string;
|
|
91
|
+
/**
|
|
92
|
+
* Get introText of form object
|
|
93
|
+
*/
|
|
94
|
+
get introText(): string;
|
|
95
|
+
/**
|
|
96
|
+
* Get assistent of form object
|
|
97
|
+
*/
|
|
98
|
+
get assistent(): string;
|
|
99
|
+
/**
|
|
100
|
+
* Get button labels
|
|
101
|
+
*/
|
|
102
|
+
get buttonLabels(): Object;
|
|
103
|
+
/**
|
|
104
|
+
*/
|
|
105
|
+
set attributeCollection(arg: AttributeCollection);
|
|
106
|
+
/**
|
|
107
|
+
* get attribute collection
|
|
108
|
+
*/
|
|
109
|
+
get attributeCollection(): AttributeCollection;
|
|
110
|
+
/**
|
|
111
|
+
*/
|
|
112
|
+
mergeObject(oldObject: FormObjectModel): void;
|
|
113
|
+
/**
|
|
114
|
+
* Update attribute
|
|
115
|
+
*/
|
|
116
|
+
updateAttribute(attribute: AttributeType, value: any): AttributeType;
|
|
117
|
+
/**
|
|
118
|
+
* Inidicates if Form is changed since a given timestamp (Date.now)
|
|
119
|
+
*/
|
|
120
|
+
isChangedSince(timestamp: number): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Reset all errors on Form Object
|
|
123
|
+
*/
|
|
124
|
+
resetErrors(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Get error messages
|
|
127
|
+
*/
|
|
128
|
+
get errorCollection(): ErrorCollection;
|
|
129
|
+
/**
|
|
130
|
+
* Registers an error that was received from a server response
|
|
131
|
+
*/
|
|
132
|
+
addServerError(error: FormErrorAnchor): void;
|
|
133
|
+
/**
|
|
134
|
+
*/
|
|
135
|
+
hasServerErrors(): boolean;
|
|
136
|
+
/**
|
|
137
|
+
*/
|
|
138
|
+
hasErrors(): boolean;
|
|
139
|
+
/**
|
|
140
|
+
*/
|
|
141
|
+
get isValid(): boolean;
|
|
142
|
+
/**
|
|
143
|
+
*/
|
|
144
|
+
set dynamicValidationsLoaded(arg: boolean);
|
|
145
|
+
/**
|
|
146
|
+
*/
|
|
147
|
+
get dynamicValidationsLoaded(): boolean;
|
|
148
|
+
/**
|
|
149
|
+
*/
|
|
150
|
+
updateValidations(data: any): FormObjectModel;
|
|
151
|
+
/**
|
|
152
|
+
* Generate formdata object for current formobject based on formdata of attributes
|
|
153
|
+
*/
|
|
154
|
+
get formdata(): {};
|
|
155
|
+
/**
|
|
156
|
+
*/
|
|
157
|
+
getFormData(validationData?: boolean): {
|
|
158
|
+
[string]: any;
|
|
159
|
+
} | null;
|
|
160
|
+
}
|
|
161
|
+
import BaseModel from "../base/BaseModel";
|
|
162
|
+
import AttributeCollection from "../attributes/AttributeCollection";
|
|
163
|
+
import ContentConfiguration from "../contentconfiguration/ContentConfiguration";
|
|
164
|
+
import ErrorCollection from "../error/ErrorCollection";
|
|
165
|
+
import { AttributeType } from "../types";
|
|
166
|
+
import LinkModel from "../links/LinkModel";
|
|
167
|
+
import { ModularUIModel } from "../types";
|
|
168
|
+
import { FormErrorAnchor } from "../types";
|