@iapps/ng-dhis2-ui 1.1.54 → 1.1.55
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/fesm2022/iapps-ng-dhis2-ui.mjs +305 -262
- package/fesm2022/iapps-ng-dhis2-ui.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/modules/event-form/event-form.component.d.ts +21 -0
- package/lib/modules/event-form/event-form.module.d.ts +9 -0
- package/lib/modules/event-form/index.d.ts +2 -0
- package/lib/modules/form/components/base-form-field.component.d.ts +8 -23
- package/lib/modules/form/containers/form/form.component.d.ts +14 -10
- package/lib/modules/form/containers/form-field/form-field.component.d.ts +10 -5
- package/lib/modules/form/containers/section-form/section-form.component.d.ts +1 -1
- package/lib/modules/form/hooks/field-validation.hook.d.ts +2 -2
- package/lib/modules/form/interfaces/form-field.interface.d.ts +4 -0
- package/lib/modules/form/models/form-field.model.d.ts +7 -1
- package/lib/modules/form/models/form-metadata-rule.model.d.ts +9 -2
- package/lib/modules/form/models/form-metadata-section.model.d.ts +2 -0
- package/lib/modules/form/models/form-metadata.model.d.ts +3 -3
- package/lib/modules/form/models/form-value.model.d.ts +4 -4
- package/lib/modules/form/utils/field-type.util.d.ts +1 -1
- package/lib/modules/form/utils/field.util.d.ts +1 -1
- package/lib/modules/form/utils/form.util.d.ts +3 -2
- package/lib/modules/tracker-form/tracker-form.component.d.ts +1 -0
- package/lib/shared/utils/predefinedDimensions.d.ts +6 -6
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i1$1 from '@angular/common';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { NgModule, Directive, Input, ContentChild, Component, EventEmitter, Output, inject, NgZone, input, ChangeDetectionStrategy, Injectable, model, signal,
|
|
4
|
+
import { NgModule, Directive, Input, ContentChild, Component, EventEmitter, Output, inject, NgZone, input, ChangeDetectionStrategy, Injectable, model, computed, signal, effect, ViewChildren } from '@angular/core';
|
|
5
5
|
import { useDataQuery, useConfig, useAlert, clearSensitiveCaches, DataProvider, useDataEngine, Provider } from '@dhis2/app-runtime';
|
|
6
6
|
import * as i1 from '@iapps/ngx-dhis2-http-client';
|
|
7
7
|
import { NgxDhis2HttpClientService } from '@iapps/ngx-dhis2-http-client';
|
|
@@ -25,8 +25,8 @@ import { Layer } from '@dhis2-ui/layer';
|
|
|
25
25
|
import { CircularLoader } from '@dhis2-ui/loader';
|
|
26
26
|
import { MenuItem, MenuDivider } from '@dhis2-ui/menu';
|
|
27
27
|
import parse from 'html-react-parser';
|
|
28
|
-
import { Button as Button$1, IconDimensionData16, IconClock16, IconDimensionOrgUnit16, spacers as spacers$1, colors as colors$1, IconEdit16, theme as theme$1, Tooltip, IconChevronRight16, SingleSelectField, SingleSelectOption, InputField as InputField$1, TabBar, Tab, Transfer, Modal as Modal$1, ModalTitle as ModalTitle$1, ModalContent as ModalContent$1, ModalActions as ModalActions$1, ButtonStrip as ButtonStrip$1, Checkbox, OrganisationUnitTree, MultiSelect, MultiSelectOption, IconWarningFilled16, Layer as Layer$1, Popper, FlyoutMenu, MenuItem as MenuItem$1, IconMore24, CircularLoader as CircularLoader$1, IconFilter16, DataTable, TableHead, DataTableRow, DataTableColumnHeader, TableBody, DataTableCell, TableFoot, Pagination,
|
|
29
|
-
import { isObject, isString, sortBy, isArray, find, camelCase, flatten,
|
|
28
|
+
import { Button as Button$1, IconDimensionData16, IconClock16, IconDimensionOrgUnit16, spacers as spacers$1, colors as colors$1, IconEdit16, theme as theme$1, Tooltip, IconChevronRight16, SingleSelectField, SingleSelectOption, InputField as InputField$1, TabBar, Tab, Transfer, Modal as Modal$1, ModalTitle as ModalTitle$1, ModalContent as ModalContent$1, ModalActions as ModalActions$1, ButtonStrip as ButtonStrip$1, Checkbox, OrganisationUnitTree, MultiSelect, MultiSelectOption, IconWarningFilled16, Layer as Layer$1, Popper, FlyoutMenu, MenuItem as MenuItem$1, IconMore24, CircularLoader as CircularLoader$1, IconFilter16, DataTable, TableHead, DataTableRow, DataTableColumnHeader, TableBody, DataTableCell, TableFoot, Pagination, FileInputField, FileListItem, Chip, MultiSelectField, TextAreaField } from '@dhis2/ui';
|
|
29
|
+
import { isObject, isString, sortBy, isArray, find, camelCase, flatten, isUndefined, debounce, head, isEmpty } from 'lodash';
|
|
30
30
|
import cx from 'classnames';
|
|
31
31
|
import { getNowInCalendar, generateFixedPeriods } from '@dhis2/multi-calendar-dates';
|
|
32
32
|
import { map as map$1, switchMap } from 'rxjs/operators';
|
|
@@ -4061,6 +4061,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
|
|
|
4061
4061
|
}]
|
|
4062
4062
|
}] });
|
|
4063
4063
|
|
|
4064
|
+
// Copyright 2025 UDSM DHIS2 Lab. All rights reserved.
|
|
4065
|
+
// Use of this source code is governed by a BSD-style
|
|
4066
|
+
// license that can be found in the LICENSE file.
|
|
4067
|
+
const useFieldValidation = (props) => {
|
|
4068
|
+
const { form, touched, field, value } = props;
|
|
4069
|
+
const hasError = useMemo(() => {
|
|
4070
|
+
return touched && (form.get(field.id) || form.get(field.key))?.invalid;
|
|
4071
|
+
}, [value, touched]);
|
|
4072
|
+
const validationError = useMemo(() => {
|
|
4073
|
+
if (!touched) {
|
|
4074
|
+
return undefined;
|
|
4075
|
+
}
|
|
4076
|
+
const error = (form.get(field.id) || form.get(field.key))?.errors;
|
|
4077
|
+
if (!error) {
|
|
4078
|
+
return undefined;
|
|
4079
|
+
}
|
|
4080
|
+
if (error['min']) {
|
|
4081
|
+
return `${field.label || 'Value'} should not be less than ${error['min'].min}!`;
|
|
4082
|
+
}
|
|
4083
|
+
else if (error['max']) {
|
|
4084
|
+
return `${field.label || 'Value'} should not be greater than ${error['max'].max}!`;
|
|
4085
|
+
}
|
|
4086
|
+
else if (error['pattern']) {
|
|
4087
|
+
if (field.type === 'email') {
|
|
4088
|
+
return `The email address provided is not valid`;
|
|
4089
|
+
}
|
|
4090
|
+
else if (field.type === 'tel') {
|
|
4091
|
+
return 'Phone number provided is not valid';
|
|
4092
|
+
}
|
|
4093
|
+
else {
|
|
4094
|
+
return `${field.label || 'Value'} should have appropriate format`;
|
|
4095
|
+
}
|
|
4096
|
+
}
|
|
4097
|
+
return error['required']
|
|
4098
|
+
? `${field.label || 'Value'} is required`
|
|
4099
|
+
: undefined;
|
|
4100
|
+
}, [hasError]);
|
|
4101
|
+
return { hasError, validationError };
|
|
4102
|
+
};
|
|
4103
|
+
|
|
4104
|
+
// Copyright 2025 UDSM DHIS2 Lab. All rights reserved.
|
|
4105
|
+
// Use of this source code is governed by a BSD-style
|
|
4106
|
+
// license that can be found in the LICENSE file.
|
|
4107
|
+
|
|
4064
4108
|
class FormField {
|
|
4065
4109
|
constructor(options = {}) {
|
|
4066
4110
|
this.value = options.value || '';
|
|
@@ -4074,11 +4118,10 @@ class FormField {
|
|
|
4074
4118
|
this.controlType = options.controlType;
|
|
4075
4119
|
this.type = options.type || '';
|
|
4076
4120
|
this.options = options.options || [];
|
|
4077
|
-
this.disabled = options.disabled
|
|
4121
|
+
this.disabled = options.disabled ?? false;
|
|
4078
4122
|
this.placeholder = options.placeholder || '';
|
|
4079
4123
|
this.min = options.min;
|
|
4080
|
-
this.max =
|
|
4081
|
-
options.max || (this.controlType === 'date' ? new Date() : undefined);
|
|
4124
|
+
this.max = this.setMax(options);
|
|
4082
4125
|
this.maxLength = options.maxLength;
|
|
4083
4126
|
this.hidden = options.hidden || false;
|
|
4084
4127
|
this.unique = options.unique || false;
|
|
@@ -4103,6 +4146,16 @@ class FormField {
|
|
|
4103
4146
|
options.availableOptionsLabel ?? 'Available options';
|
|
4104
4147
|
this.selectedOptionsLabel =
|
|
4105
4148
|
options.availableOptionsLabel ?? 'Selected options';
|
|
4149
|
+
this.allowFutureDate = options.allowFutureDate;
|
|
4150
|
+
}
|
|
4151
|
+
setMax(field) {
|
|
4152
|
+
if (field.controlType !== 'date') {
|
|
4153
|
+
return field.max;
|
|
4154
|
+
}
|
|
4155
|
+
if (field.allowFutureDate) {
|
|
4156
|
+
return undefined;
|
|
4157
|
+
}
|
|
4158
|
+
return format(new Date(), 'yyyy-MM-dd');
|
|
4106
4159
|
}
|
|
4107
4160
|
}
|
|
4108
4161
|
|
|
@@ -4583,8 +4636,9 @@ class FormFieldGroup {
|
|
|
4583
4636
|
}
|
|
4584
4637
|
|
|
4585
4638
|
class MetadataRuleAction {
|
|
4586
|
-
constructor(ruleAction) {
|
|
4639
|
+
constructor(ruleAction, ruleVariables) {
|
|
4587
4640
|
this.ruleAction = ruleAction;
|
|
4641
|
+
this.ruleVariables = ruleVariables;
|
|
4588
4642
|
}
|
|
4589
4643
|
get field() {
|
|
4590
4644
|
return (this.ruleAction.dataElement?.id ||
|
|
@@ -4593,10 +4647,36 @@ class MetadataRuleAction {
|
|
|
4593
4647
|
get actionType() {
|
|
4594
4648
|
return this.ruleAction.programRuleActionType;
|
|
4595
4649
|
}
|
|
4650
|
+
get assignedData() {
|
|
4651
|
+
const regex = /(A|#|V)\{([^}]+)\}/g;
|
|
4652
|
+
return this.ruleAction?.data?.replace(regex, (match, _, dataVariable) => {
|
|
4653
|
+
const ruleVariableObject = this.ruleVariables?.find((variable) => variable.name === dataVariable);
|
|
4654
|
+
if (!ruleVariableObject) {
|
|
4655
|
+
return `{${dataVariable}}`;
|
|
4656
|
+
}
|
|
4657
|
+
const code = camelCase(ruleVariableObject?.dataElement?.code) ||
|
|
4658
|
+
ruleVariableObject?.dataElement?.id ||
|
|
4659
|
+
camelCase(ruleVariableObject?.trackedEntityAttribute?.code) ||
|
|
4660
|
+
ruleVariableObject?.trackedEntityAttribute?.id;
|
|
4661
|
+
return `{${code}}`;
|
|
4662
|
+
});
|
|
4663
|
+
}
|
|
4664
|
+
get displayedContent() {
|
|
4665
|
+
return this.ruleAction.displayContent;
|
|
4666
|
+
}
|
|
4667
|
+
get options() {
|
|
4668
|
+
if (this.ruleAction.option) {
|
|
4669
|
+
return [this.ruleAction.option];
|
|
4670
|
+
}
|
|
4671
|
+
return this.ruleAction.optionGroup?.options || [];
|
|
4672
|
+
}
|
|
4596
4673
|
toJson() {
|
|
4597
4674
|
return {
|
|
4598
4675
|
field: this.field,
|
|
4599
4676
|
actionType: this.actionType,
|
|
4677
|
+
assignedData: this.assignedData,
|
|
4678
|
+
displayedContent: this.ruleAction.displayContent,
|
|
4679
|
+
options: this.options,
|
|
4600
4680
|
};
|
|
4601
4681
|
}
|
|
4602
4682
|
}
|
|
@@ -4606,10 +4686,10 @@ class MetadataRule {
|
|
|
4606
4686
|
this.ruleVariables = ruleVariables;
|
|
4607
4687
|
}
|
|
4608
4688
|
get actions() {
|
|
4609
|
-
return (this.rule?.programRuleActions || []).map((action) => new MetadataRuleAction(action));
|
|
4689
|
+
return (this.rule?.programRuleActions || []).map((action) => new MetadataRuleAction(action, this.ruleVariables));
|
|
4610
4690
|
}
|
|
4611
4691
|
get condition() {
|
|
4612
|
-
const regex = /(A
|
|
4692
|
+
const regex = /(A|#|V)\{([^}]+)\}/g;
|
|
4613
4693
|
return this.rule?.condition?.replace(regex, (match, _, ruleVariable) => {
|
|
4614
4694
|
const ruleVariableObject = this.ruleVariables?.find((variable) => variable.name === ruleVariable);
|
|
4615
4695
|
const code = camelCase(ruleVariableObject?.dataElement?.code) ||
|
|
@@ -4638,6 +4718,7 @@ class FormMetadataSection {
|
|
|
4638
4718
|
formName: (programTrackedEntityAttribute['trackedEntityAttribute'] || {})['name'],
|
|
4639
4719
|
sortOrder: programTrackedEntityAttribute['sortOrder'],
|
|
4640
4720
|
mandatory: programTrackedEntityAttribute['mandatory'],
|
|
4721
|
+
allowFutureDate: programTrackedEntityAttribute['allowFutureDate'],
|
|
4641
4722
|
metaType: 'ATTRIBUTE',
|
|
4642
4723
|
};
|
|
4643
4724
|
});
|
|
@@ -4650,6 +4731,7 @@ class FormMetadataSection {
|
|
|
4650
4731
|
...(stageDataElement['dataElement'] ||
|
|
4651
4732
|
{}),
|
|
4652
4733
|
mandatory: stageDataElement['compulsory'],
|
|
4734
|
+
allowFutureDate: stageDataElement['allowFutureDate'],
|
|
4653
4735
|
stepId: programStage['id'],
|
|
4654
4736
|
metaType: 'DATA_ELEMENT',
|
|
4655
4737
|
};
|
|
@@ -4824,6 +4906,7 @@ class FormMetaData {
|
|
|
4824
4906
|
code: 'enrollmentDate',
|
|
4825
4907
|
key: 'enrollmentDate',
|
|
4826
4908
|
required: true,
|
|
4909
|
+
disabled: this.params.disableEnrollmentDate,
|
|
4827
4910
|
}),
|
|
4828
4911
|
program.displayIncidentDate
|
|
4829
4912
|
? new DateField({
|
|
@@ -4908,6 +4991,7 @@ class FormMetaData {
|
|
|
4908
4991
|
code: 'enrollmentDate',
|
|
4909
4992
|
key: 'enrollmentDate',
|
|
4910
4993
|
required: true,
|
|
4994
|
+
disabled: this.params.disableEnrollmentDate,
|
|
4911
4995
|
}),
|
|
4912
4996
|
program.displayIncidentDate
|
|
4913
4997
|
? new DateField({
|
|
@@ -4997,47 +5081,62 @@ class FormValue {
|
|
|
4997
5081
|
// Copyright 2025 UDSM DHIS2 Lab. All rights reserved.
|
|
4998
5082
|
// Use of this source code is governed by a BSD-style
|
|
4999
5083
|
// license that can be found in the LICENSE file.
|
|
5000
|
-
const
|
|
5001
|
-
const {
|
|
5002
|
-
const
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
const
|
|
5006
|
-
if (
|
|
5007
|
-
return undefined;
|
|
5008
|
-
}
|
|
5009
|
-
const error = (form.get(field.id) || form.get(field.key))?.errors;
|
|
5010
|
-
if (!error) {
|
|
5084
|
+
const FileUploadField = (props) => {
|
|
5085
|
+
const { label, id, uploadUrl, performUpload, validationText, required, hasError, onChange, onUploadSuccess, } = props;
|
|
5086
|
+
const d2 = window?.d2Web;
|
|
5087
|
+
const [file, setFile] = useState(null);
|
|
5088
|
+
const [uploading, setUploading] = useState();
|
|
5089
|
+
const valid = useMemo(() => {
|
|
5090
|
+
if (isUndefined(hasError)) {
|
|
5011
5091
|
return undefined;
|
|
5012
5092
|
}
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5093
|
+
return !hasError;
|
|
5094
|
+
}, [hasError]);
|
|
5095
|
+
const uploadFile = async (fileItem) => {
|
|
5096
|
+
if (fileItem) {
|
|
5097
|
+
setUploading(true);
|
|
5098
|
+
const formData = new FormData();
|
|
5099
|
+
formData.append('file', fileItem);
|
|
5100
|
+
try {
|
|
5101
|
+
const fileUploadResponse = await d2.httpInstance.post(uploadUrl, formData);
|
|
5102
|
+
setUploading(false);
|
|
5103
|
+
const fileId = fileUploadResponse?.data?.response?.fileResource
|
|
5104
|
+
?.id;
|
|
5105
|
+
if (fileId) {
|
|
5106
|
+
onUploadSuccess(fileId);
|
|
5107
|
+
}
|
|
5022
5108
|
}
|
|
5023
|
-
|
|
5024
|
-
|
|
5109
|
+
catch (error) {
|
|
5110
|
+
setUploading(false);
|
|
5111
|
+
}
|
|
5112
|
+
}
|
|
5113
|
+
};
|
|
5114
|
+
return (React__default.createElement(FileInputField, { accept: "*", buttonLabel: "Upload a file", label: label, name: id, required: required, validationText: validationText, onChange: (event) => {
|
|
5115
|
+
const fileItem = (event?.files || [])[0];
|
|
5116
|
+
setFile(fileItem);
|
|
5117
|
+
if (performUpload) {
|
|
5118
|
+
uploadFile(fileItem);
|
|
5025
5119
|
}
|
|
5026
5120
|
else {
|
|
5027
|
-
|
|
5121
|
+
onChange(file);
|
|
5028
5122
|
}
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5123
|
+
// this.ngZone.run(() => {
|
|
5124
|
+
// this.form().get(this.field().id) ||
|
|
5125
|
+
// this.form()
|
|
5126
|
+
// .get(this.field().key)
|
|
5127
|
+
// ?.setValue((event?.files || [])[0]);
|
|
5128
|
+
// this.update.emit({
|
|
5129
|
+
// form: this.form(),
|
|
5130
|
+
// value: (event?.files || [])[0],
|
|
5131
|
+
// });
|
|
5132
|
+
// });
|
|
5133
|
+
// setValue((event?.files || [])[0]);
|
|
5134
|
+
// setTouched(true);
|
|
5135
|
+
} }, file && (React__default.createElement(FileListItem, { cancelText: "Cancel", label: file.name, loading: uploading, onRemove: () => {
|
|
5136
|
+
setFile(null);
|
|
5137
|
+
}, removeText: "Remove" }))));
|
|
5035
5138
|
};
|
|
5036
5139
|
|
|
5037
|
-
// Copyright 2025 UDSM DHIS2 Lab. All rights reserved.
|
|
5038
|
-
// Use of this source code is governed by a BSD-style
|
|
5039
|
-
// license that can be found in the LICENSE file.
|
|
5040
|
-
|
|
5041
5140
|
// Copyright 2025 UDSM DHIS2 Lab. All rights reserved.
|
|
5042
5141
|
// Use of this source code is governed by a BSD-style
|
|
5043
5142
|
// license that can be found in the LICENSE file.
|
|
@@ -5222,65 +5321,6 @@ const OrgUnitFormField = (props) => {
|
|
|
5222
5321
|
React__default.createElement(CircularLoader$1, { small: true }))) : (React__default.createElement("div", { className: classes.orgUnitTreeContainer, style: { maxHeight: '200px', overflowY: 'auto' } }, renderOrgUnitTree()))))))));
|
|
5223
5322
|
};
|
|
5224
5323
|
|
|
5225
|
-
// Copyright 2025 UDSM DHIS2 Lab. All rights reserved.
|
|
5226
|
-
// Use of this source code is governed by a BSD-style
|
|
5227
|
-
// license that can be found in the LICENSE file.
|
|
5228
|
-
const FileUploadField = (props) => {
|
|
5229
|
-
const { label, id, uploadUrl, performUpload, validationText, required, hasError, onChange, onUploadSuccess, } = props;
|
|
5230
|
-
const d2 = window?.d2Web;
|
|
5231
|
-
const [file, setFile] = useState(null);
|
|
5232
|
-
const [uploading, setUploading] = useState();
|
|
5233
|
-
const valid = useMemo(() => {
|
|
5234
|
-
if (isUndefined(hasError)) {
|
|
5235
|
-
return undefined;
|
|
5236
|
-
}
|
|
5237
|
-
return !hasError;
|
|
5238
|
-
}, [hasError]);
|
|
5239
|
-
const uploadFile = async (fileItem) => {
|
|
5240
|
-
if (fileItem) {
|
|
5241
|
-
setUploading(true);
|
|
5242
|
-
const formData = new FormData();
|
|
5243
|
-
formData.append('file', fileItem);
|
|
5244
|
-
try {
|
|
5245
|
-
const fileUploadResponse = await d2.httpInstance.post(uploadUrl, formData);
|
|
5246
|
-
setUploading(false);
|
|
5247
|
-
const fileId = fileUploadResponse?.data?.response?.fileResource
|
|
5248
|
-
?.id;
|
|
5249
|
-
if (fileId) {
|
|
5250
|
-
onUploadSuccess(fileId);
|
|
5251
|
-
}
|
|
5252
|
-
}
|
|
5253
|
-
catch (error) {
|
|
5254
|
-
setUploading(false);
|
|
5255
|
-
}
|
|
5256
|
-
}
|
|
5257
|
-
};
|
|
5258
|
-
return (React__default.createElement(FileInputField, { accept: "*", buttonLabel: "Upload a file", label: label, name: id, required: required, validationText: validationText, onChange: (event) => {
|
|
5259
|
-
const fileItem = (event?.files || [])[0];
|
|
5260
|
-
setFile(fileItem);
|
|
5261
|
-
if (performUpload) {
|
|
5262
|
-
uploadFile(fileItem);
|
|
5263
|
-
}
|
|
5264
|
-
else {
|
|
5265
|
-
onChange(file);
|
|
5266
|
-
}
|
|
5267
|
-
// this.ngZone.run(() => {
|
|
5268
|
-
// this.form().get(this.field().id) ||
|
|
5269
|
-
// this.form()
|
|
5270
|
-
// .get(this.field().key)
|
|
5271
|
-
// ?.setValue((event?.files || [])[0]);
|
|
5272
|
-
// this.update.emit({
|
|
5273
|
-
// form: this.form(),
|
|
5274
|
-
// value: (event?.files || [])[0],
|
|
5275
|
-
// });
|
|
5276
|
-
// });
|
|
5277
|
-
// setValue((event?.files || [])[0]);
|
|
5278
|
-
// setTouched(true);
|
|
5279
|
-
} }, file && (React__default.createElement(FileListItem, { cancelText: "Cancel", label: file.name, loading: uploading, onRemove: () => {
|
|
5280
|
-
setFile(null);
|
|
5281
|
-
}, removeText: "Remove" }))));
|
|
5282
|
-
};
|
|
5283
|
-
|
|
5284
5324
|
// Copyright 2024 UDSM DHIS2 Lab. All rights reserved.
|
|
5285
5325
|
// Use of this source code is governed by a BSD-style
|
|
5286
5326
|
// license that can be found in the LICENSE file.
|
|
@@ -5294,43 +5334,10 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
5294
5334
|
this.fieldConfig = input(new FieldConfig());
|
|
5295
5335
|
this.form = model.required();
|
|
5296
5336
|
this.isValid = input();
|
|
5297
|
-
this.
|
|
5337
|
+
this.isValueAssigned = input();
|
|
5298
5338
|
this.value = model();
|
|
5299
5339
|
this.value$ = toObservable(this.value);
|
|
5300
|
-
this.
|
|
5301
|
-
const { onSelectOrgUnit, selectedOrgUnits } = props;
|
|
5302
|
-
const [selected, setSelected] = useState(selectedOrgUnits);
|
|
5303
|
-
const [rootOrgUnits, setRootOrgUnits] = useState();
|
|
5304
|
-
const [config, setConfig] = useState();
|
|
5305
|
-
useEffect(() => {
|
|
5306
|
-
zip(this.getAppConfig(), this.getRootOrgUnits()).subscribe({
|
|
5307
|
-
next: ([appConfig, rootOrgUnits]) => {
|
|
5308
|
-
setConfig(appConfig);
|
|
5309
|
-
setRootOrgUnits(rootOrgUnits);
|
|
5310
|
-
},
|
|
5311
|
-
error: (error) => console.error(error),
|
|
5312
|
-
});
|
|
5313
|
-
}, []);
|
|
5314
|
-
return config ? (React__default.createElement(Provider, { config: config, plugin: false, parentAlertsAdd: undefined, showAlertsInPlugin: false }, React__default.createElement(Modal$1, { position: "middle", large: true },
|
|
5315
|
-
React__default.createElement(ModalTitle$1, null,
|
|
5316
|
-
"Select ",
|
|
5317
|
-
this.field().label),
|
|
5318
|
-
React__default.createElement(ModalContent$1, null,
|
|
5319
|
-
React__default.createElement(OrgUnitDimension, { selected: selected, allowSingleSelection: true, hideGroupSelect: this.orgUnitSelectionConfig.hideGroupSelect, hideLevelSelect: this.orgUnitSelectionConfig.hideLevelSelect, hideUserOrgUnits: this.orgUnitSelectionConfig.hideUserOrgUnits, onSelect: (selectionEvent) => {
|
|
5320
|
-
setSelected(selectionEvent.items);
|
|
5321
|
-
onSelectOrgUnit(selectionEvent.items);
|
|
5322
|
-
}, orgUnitGroupPromise: this.getOrgUnitGroups(), orgUnitLevelPromise: this.getOrgUnitLevels(), roots: rootOrgUnits }))))) : (React__default.createElement(CircularLoader$1, { small: true }));
|
|
5323
|
-
};
|
|
5324
|
-
this.showOrgUnitTree = signal(false);
|
|
5325
|
-
this.orgUnitSelectionConfig = {
|
|
5326
|
-
hideGroupSelect: true,
|
|
5327
|
-
hideLevelSelect: true,
|
|
5328
|
-
hideUserOrgUnits: true,
|
|
5329
|
-
allowSingleSelection: true,
|
|
5330
|
-
usageType: 'DATA_ENTRY',
|
|
5331
|
-
};
|
|
5332
|
-
this.selectedOrgUnit = signal(null);
|
|
5333
|
-
this.selectedOrgUnit$ = toObservable(this.selectedOrgUnit);
|
|
5340
|
+
this.isValueAssigned$ = toObservable(this.isValueAssigned);
|
|
5334
5341
|
this.label = computed(() => {
|
|
5335
5342
|
return !this.fieldConfig()?.hideLabel ? this.field().label : undefined;
|
|
5336
5343
|
});
|
|
@@ -5359,10 +5366,16 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
5359
5366
|
return () => {
|
|
5360
5367
|
const [value, setValue] = useState(this.form().get(this.field().id)?.value ||
|
|
5361
5368
|
this.form().get(this.field().key)?.value);
|
|
5362
|
-
const [displayValue, setDisplayValue] = useState(null);
|
|
5363
5369
|
const [selected, setSelected] = useState();
|
|
5364
5370
|
const [touched, setTouched] = useState(false);
|
|
5365
|
-
const [
|
|
5371
|
+
const [disabled, setDisabled] = useState(this.field()?.disabled ?? this.field()?.generated ?? false);
|
|
5372
|
+
useEffect(() => {
|
|
5373
|
+
if (this.isValueAssigned()) {
|
|
5374
|
+
setDisabled(true);
|
|
5375
|
+
setValue(this.form().get(this.field().id)?.value ||
|
|
5376
|
+
this.form().get(this.field().key)?.value);
|
|
5377
|
+
}
|
|
5378
|
+
}, [this.isValueAssigned()]);
|
|
5366
5379
|
const onChange = (payload) => setSelected(payload.selected);
|
|
5367
5380
|
const arrayValue = useMemo(() => {
|
|
5368
5381
|
if (value && value.length > 0) {
|
|
@@ -5425,10 +5438,7 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
5425
5438
|
this.update.emit({ form: this.form(), value });
|
|
5426
5439
|
} }));
|
|
5427
5440
|
case 'checkbox':
|
|
5428
|
-
return (React__default.createElement(Checkbox, { checked: Boolean(value), error: hasError, label: this.label(), name: this.field().id, disabled:
|
|
5429
|
-
this.field()?.generated ||
|
|
5430
|
-
this.field()?.unique ||
|
|
5431
|
-
false, onChange: (event) => {
|
|
5441
|
+
return (React__default.createElement(Checkbox, { checked: Boolean(value), error: hasError, label: this.label(), name: this.field().id, disabled: disabled, onChange: (event) => {
|
|
5432
5442
|
this.ngZone.run(() => {
|
|
5433
5443
|
(this.form().get(this.field().id) ||
|
|
5434
5444
|
this.form().get(this.field().key))?.setValue(event.checked);
|
|
@@ -5441,10 +5451,7 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
5441
5451
|
});
|
|
5442
5452
|
} }));
|
|
5443
5453
|
case 'dropdown':
|
|
5444
|
-
return (React__default.createElement(SingleSelectField, { filterable: (this.field().options || []).length > 5, clearable: true, error: hasError, validationText: validationError, inputWidth: this.fieldConfig()?.inputWidth, disabled: this.field()
|
|
5445
|
-
this.field()?.generated ||
|
|
5446
|
-
this.field()?.unique ||
|
|
5447
|
-
false, required: this.field().required, className: "select", label: this.label(), selected: value, onChange: (event) => {
|
|
5454
|
+
return (React__default.createElement(SingleSelectField, { filterable: (this.field().options || []).length > 5, clearable: true, error: hasError, validationText: validationError, inputWidth: this.fieldConfig()?.inputWidth, disabled: disabled, required: this.field().required, className: "select", label: this.label(), selected: value, onChange: (event) => {
|
|
5448
5455
|
this.ngZone.run(() => {
|
|
5449
5456
|
(this.form().get(this.field().id) ||
|
|
5450
5457
|
this.form().get(this.field().key))?.setValue(event.selected);
|
|
@@ -5457,10 +5464,7 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
5457
5464
|
setTouched(true);
|
|
5458
5465
|
} }, (this.field().options || []).map((option) => (React__default.createElement(SingleSelectOption, { key: crypto.randomUUID() || option.key, label: option.label, value: option.value })))));
|
|
5459
5466
|
case 'multi-dropdown':
|
|
5460
|
-
return (React__default.createElement(MultiSelectField, { clearText: "Clear", clearable: true, empty: "No data found", filterable: (this.field().options || []).length > 5, filterPlaceholder: "Type to filter options", error: hasError, validationText: validationError, inputWidth: this.fieldConfig()?.inputWidth, disabled: this.field()
|
|
5461
|
-
this.field()?.generated ||
|
|
5462
|
-
this.field()?.unique ||
|
|
5463
|
-
false, label: this.label(), required: this.field().required, loadingText: "Loading options", noMatchText: "No options found", onChange: (event) => {
|
|
5467
|
+
return (React__default.createElement(MultiSelectField, { clearText: "Clear", clearable: true, empty: "No data found", filterable: (this.field().options || []).length > 5, filterPlaceholder: "Type to filter options", error: hasError, validationText: validationError, inputWidth: this.fieldConfig()?.inputWidth, disabled: disabled, label: this.label(), required: this.field().required, loadingText: "Loading options", noMatchText: "No options found", onChange: (event) => {
|
|
5464
5468
|
const selectedValue = (event.selected || []).join(',');
|
|
5465
5469
|
this.ngZone.run(() => {
|
|
5466
5470
|
(this.form().get(this.field().id) ||
|
|
@@ -5488,13 +5492,7 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
5488
5492
|
setTouched(true);
|
|
5489
5493
|
} })));
|
|
5490
5494
|
default:
|
|
5491
|
-
return (React__default.createElement(InputField$1, { error: hasError, validationText: validationError, type: this.field().type, inputWidth: this.fieldConfig()?.inputWidth, required: this.field().required, name: this.field().id, label: this.label(), min: this.field().min?.toString(), max: this.field().max?.toString(), placeholder: this.placeholder(), value: value, disabled:
|
|
5492
|
-
this.field()?.generated ||
|
|
5493
|
-
this.field()?.unique ||
|
|
5494
|
-
false, readOnly: this.field()?.disabled ||
|
|
5495
|
-
this.field()?.generated ||
|
|
5496
|
-
this.field()?.unique ||
|
|
5497
|
-
false, onChange: (event) => {
|
|
5495
|
+
return (React__default.createElement(InputField$1, { error: hasError, validationText: validationError, type: this.field().type, inputWidth: this.fieldConfig()?.inputWidth, required: this.field().required, name: this.field().id, label: this.label(), min: this.field().min?.toString(), max: this.field().max?.toString(), placeholder: this.placeholder(), value: value, readOnly: disabled, onChange: (event) => {
|
|
5498
5496
|
this.ngZone.run(() => {
|
|
5499
5497
|
(this.form().get(this.field().id) ||
|
|
5500
5498
|
this.form().get(this.field().key))?.setValue(event.value);
|
|
@@ -5516,54 +5514,8 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
5516
5514
|
onChange(event) {
|
|
5517
5515
|
this.value.set(event);
|
|
5518
5516
|
}
|
|
5519
|
-
onSelectOrgUnit(selectedOrgUnits) {
|
|
5520
|
-
this.showOrgUnitTree.set(false);
|
|
5521
|
-
if ((selectedOrgUnits || [])[0]) {
|
|
5522
|
-
this.selectedOrgUnit.set(selectedOrgUnits[0]);
|
|
5523
|
-
}
|
|
5524
|
-
}
|
|
5525
|
-
onCancelOrgUnit() {
|
|
5526
|
-
this.showOrgUnitTree.set(false);
|
|
5527
|
-
}
|
|
5528
|
-
getAppConfig() {
|
|
5529
|
-
return this.httpClient.systemInfo().pipe(map((response) => {
|
|
5530
|
-
const systemInfo = response;
|
|
5531
|
-
return {
|
|
5532
|
-
baseUrl: (document?.location?.host?.includes('localhost')
|
|
5533
|
-
? `${document.location.protocol}//${document.location.host}`
|
|
5534
|
-
: systemInfo['contextPath']),
|
|
5535
|
-
apiVersion: Number(((systemInfo['version'] || '')?.split('.') || [])[1]),
|
|
5536
|
-
};
|
|
5537
|
-
}));
|
|
5538
|
-
}
|
|
5539
|
-
getOrgUnitAttributeByUsage(usageType) {
|
|
5540
|
-
switch (usageType) {
|
|
5541
|
-
case 'DATA_ENTRY':
|
|
5542
|
-
return 'organisationUnits';
|
|
5543
|
-
case 'DATA_VIEW':
|
|
5544
|
-
return 'dataViewOrganisationUnits';
|
|
5545
|
-
default:
|
|
5546
|
-
return 'organisationUnits';
|
|
5547
|
-
}
|
|
5548
|
-
}
|
|
5549
|
-
getRootOrgUnits() {
|
|
5550
|
-
const orgUnitAttribute = this.getOrgUnitAttributeByUsage(this.orgUnitSelectionConfig.usageType);
|
|
5551
|
-
return this.httpClient
|
|
5552
|
-
.me()
|
|
5553
|
-
.pipe(map((user) => (user ? user[orgUnitAttribute] : []).map((orgUnit) => orgUnit.id)));
|
|
5554
|
-
}
|
|
5555
|
-
getOrgUnitGroups() {
|
|
5556
|
-
return firstValueFrom(this.httpClient
|
|
5557
|
-
.get('organisationUnitGroups.json?fields=id,displayName,name&paging=false')
|
|
5558
|
-
.pipe(map((res) => res?.['organisationUnitGroups'])));
|
|
5559
|
-
}
|
|
5560
|
-
getOrgUnitLevels() {
|
|
5561
|
-
return firstValueFrom(this.httpClient
|
|
5562
|
-
.get('organisationUnitLevels.json?fields=id,level,displayName,name&paging=false')
|
|
5563
|
-
.pipe(map((res) => res?.['organisationUnitLevels'])));
|
|
5564
|
-
}
|
|
5565
5517
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: BaseFormFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5566
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.8", type: BaseFormFieldComponent, isStandalone: true, inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, fieldConfig: { classPropertyName: "fieldConfig", publicName: "fieldConfig", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, isValid: { classPropertyName: "isValid", publicName: "isValid", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { form: "formChange", value: "valueChange", update: "update", immediateUpdate: "immediateUpdate" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
|
|
5518
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.8", type: BaseFormFieldComponent, isStandalone: true, inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, fieldConfig: { classPropertyName: "fieldConfig", publicName: "fieldConfig", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, isValid: { classPropertyName: "isValid", publicName: "isValid", isSignal: true, isRequired: false, transformFunction: null }, isValueAssigned: { classPropertyName: "isValueAssigned", publicName: "isValueAssigned", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { form: "formChange", value: "valueChange", update: "update", immediateUpdate: "immediateUpdate" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
|
|
5567
5519
|
}
|
|
5568
5520
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: BaseFormFieldComponent, decorators: [{
|
|
5569
5521
|
type: Directive
|
|
@@ -5589,6 +5541,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
|
|
|
5589
5541
|
class FormFieldComponent {
|
|
5590
5542
|
constructor() {
|
|
5591
5543
|
this.field = input.required();
|
|
5544
|
+
this.programRuleActions = input([]);
|
|
5592
5545
|
this.maxDate = new Date();
|
|
5593
5546
|
this.color = 'primary';
|
|
5594
5547
|
this.fieldUpdate = new EventEmitter();
|
|
@@ -5599,6 +5552,10 @@ class FormFieldComponent {
|
|
|
5599
5552
|
this.runtimeOptions = [];
|
|
5600
5553
|
this.fieldFilterControl = new FormControl();
|
|
5601
5554
|
this._onDestroy = new Subject();
|
|
5555
|
+
this.isValueAssigned = signal(false);
|
|
5556
|
+
this.ruleProcessor = effect(() => {
|
|
5557
|
+
this.#processRules(this.programRuleActions());
|
|
5558
|
+
});
|
|
5602
5559
|
}
|
|
5603
5560
|
ngOnChanges(changes) {
|
|
5604
5561
|
if (changes && changes['dataEntities'] && this.field()?.dependentField) {
|
|
@@ -5623,9 +5580,33 @@ class FormFieldComponent {
|
|
|
5623
5580
|
this.optionSearchTerm = this.fieldFilterControl.value;
|
|
5624
5581
|
});
|
|
5625
5582
|
}
|
|
5583
|
+
#processRules(ruleActions) {
|
|
5584
|
+
ruleActions
|
|
5585
|
+
.filter((ruleAction) => ruleAction.field === this.field().id)
|
|
5586
|
+
.forEach((ruleAction) => {
|
|
5587
|
+
switch (ruleAction.actionType) {
|
|
5588
|
+
case 'ASSIGN': {
|
|
5589
|
+
if (ruleAction.assignedData) {
|
|
5590
|
+
const currentValue = this.form?.get(this.field().key)?.value;
|
|
5591
|
+
if (currentValue != ruleAction.assignedData) {
|
|
5592
|
+
this.form
|
|
5593
|
+
?.get(this.field().key)
|
|
5594
|
+
?.setValue(ruleAction.assignedData);
|
|
5595
|
+
this.isValueAssigned.set(true);
|
|
5596
|
+
this.onValueChange();
|
|
5597
|
+
}
|
|
5598
|
+
}
|
|
5599
|
+
break;
|
|
5600
|
+
}
|
|
5601
|
+
default:
|
|
5602
|
+
break;
|
|
5603
|
+
}
|
|
5604
|
+
});
|
|
5605
|
+
}
|
|
5626
5606
|
ngOnDestroy() {
|
|
5627
5607
|
this._onDestroy.next();
|
|
5628
5608
|
this._onDestroy.complete();
|
|
5609
|
+
this.ruleProcessor.destroy();
|
|
5629
5610
|
}
|
|
5630
5611
|
get isValid() {
|
|
5631
5612
|
return this.form?.controls[this.field().id]?.valid;
|
|
@@ -5728,12 +5709,12 @@ class FormFieldComponent {
|
|
|
5728
5709
|
this._runtimeOptions = [...options];
|
|
5729
5710
|
}
|
|
5730
5711
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5731
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.8", type: FormFieldComponent, isStandalone: false, selector: "ng-dhis2-ui-form-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, fieldConfig: { classPropertyName: "fieldConfig", publicName: "fieldConfig", isSignal: false, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: false, isRequired: false, transformFunction: null }, isCheckBoxButton: { classPropertyName: "isCheckBoxButton", publicName: "isCheckBoxButton", isSignal: false, isRequired: false, transformFunction: null }, fieldClass: { classPropertyName: "fieldClass", publicName: "fieldClass", isSignal: false, isRequired: false, transformFunction: null }, programRuleActions: { classPropertyName: "programRuleActions", publicName: "programRuleActions", isSignal:
|
|
5712
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.8", type: FormFieldComponent, isStandalone: false, selector: "ng-dhis2-ui-form-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, fieldConfig: { classPropertyName: "fieldConfig", publicName: "fieldConfig", isSignal: false, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: false, isRequired: false, transformFunction: null }, isCheckBoxButton: { classPropertyName: "isCheckBoxButton", publicName: "isCheckBoxButton", isSignal: false, isRequired: false, transformFunction: null }, fieldClass: { classPropertyName: "fieldClass", publicName: "fieldClass", isSignal: false, isRequired: false, transformFunction: null }, programRuleActions: { classPropertyName: "programRuleActions", publicName: "programRuleActions", isSignal: true, isRequired: false, transformFunction: null }, dataEntities: { classPropertyName: "dataEntities", publicName: "dataEntities", isSignal: false, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: false, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { fieldUpdate: "fieldUpdate", immediateFieldUpdate: "immediateFieldUpdate", runtimeOptionChange: "runtimeOptionChange" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"field()\" class=\"form-field-item\">\n <ng-dhis2-ui-form-field-item\n [field]=\"field()\"\n [isValueAssigned]=\"isValueAssigned()\"\n [fieldConfig]=\"fieldConfig\"\n [(form)]=\"form\"\n [value]=\"value()\"\n (update)=\"onValueChange()\"\n (immediateUpdate)=\"onImmediateChange($event)\"\n />\n</div>\n", styles: [".form-field-item{margin-bottom:16px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FormFieldItemComponent, selector: "ng-dhis2-ui-form-field-item" }] }); }
|
|
5732
5713
|
}
|
|
5733
5714
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
5734
5715
|
type: Component,
|
|
5735
|
-
args: [{ selector: 'ng-dhis2-ui-form-field', standalone: false, template: "<div *ngIf=\"field()\" class=\"form-field-item\">\n <ng-dhis2-ui-form-field-item\n [field]=\"field()\"\n [fieldConfig]=\"fieldConfig\"\n [(form)]=\"form\"\n [value]=\"value()\"\n (update)=\"onValueChange()\"\n (immediateUpdate)=\"onImmediateChange($event)\"\n />\n</div>\n", styles: [".form-field-item{margin-bottom:16px}\n"] }]
|
|
5736
|
-
}], propDecorators: { fieldConfig: [{
|
|
5716
|
+
args: [{ selector: 'ng-dhis2-ui-form-field', standalone: false, template: "<div *ngIf=\"field()\" class=\"form-field-item\">\n <ng-dhis2-ui-form-field-item\n [field]=\"field()\"\n [isValueAssigned]=\"isValueAssigned()\"\n [fieldConfig]=\"fieldConfig\"\n [(form)]=\"form\"\n [value]=\"value()\"\n (update)=\"onValueChange()\"\n (immediateUpdate)=\"onImmediateChange($event)\"\n />\n</div>\n", styles: [".form-field-item{margin-bottom:16px}\n"] }]
|
|
5717
|
+
}], ctorParameters: () => [], propDecorators: { fieldConfig: [{
|
|
5737
5718
|
type: Input
|
|
5738
5719
|
}], form: [{
|
|
5739
5720
|
type: Input
|
|
@@ -5741,8 +5722,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
|
|
|
5741
5722
|
type: Input
|
|
5742
5723
|
}], fieldClass: [{
|
|
5743
5724
|
type: Input
|
|
5744
|
-
}], programRuleActions: [{
|
|
5745
|
-
type: Input
|
|
5746
5725
|
}], dataEntities: [{
|
|
5747
5726
|
type: Input
|
|
5748
5727
|
}], minDate: [{
|
|
@@ -5758,18 +5737,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
|
|
|
5758
5737
|
}] } });
|
|
5759
5738
|
|
|
5760
5739
|
class FormComponent {
|
|
5761
|
-
constructor() {
|
|
5762
|
-
this.formConfig = input();
|
|
5763
|
-
this.configuration = computed(() => {
|
|
5764
|
-
if (!this.formConfig()) {
|
|
5765
|
-
return new FormConfig({
|
|
5766
|
-
direction: this.isFormHorizontal ? 'horizontal' : 'vertical',
|
|
5767
|
-
});
|
|
5768
|
-
}
|
|
5769
|
-
return this.formConfig();
|
|
5770
|
-
});
|
|
5771
|
-
this.formUpdate = new EventEmitter();
|
|
5772
|
-
}
|
|
5773
5740
|
get sanitizedFields() {
|
|
5774
5741
|
return (this.fields || []).filter((field) => {
|
|
5775
5742
|
if (field.hidden) {
|
|
@@ -5782,17 +5749,14 @@ class FormComponent {
|
|
|
5782
5749
|
if (!elementItem) {
|
|
5783
5750
|
return true;
|
|
5784
5751
|
}
|
|
5785
|
-
const availableRule = head((this.programRuleActions || []).filter((ruleAction) => {
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
(ruleAction.programRuleActionType === 'HIDEFIELD' ||
|
|
5789
|
-
ruleAction.actionType === 'HIDEFIELD'));
|
|
5752
|
+
const availableRule = head((this.programRuleActions() || []).filter((ruleAction) => {
|
|
5753
|
+
return (ruleAction.field === elementItem.id &&
|
|
5754
|
+
ruleAction.actionType === 'HIDEFIELD');
|
|
5790
5755
|
}));
|
|
5791
5756
|
if (!availableRule) {
|
|
5792
5757
|
return true;
|
|
5793
5758
|
}
|
|
5794
|
-
|
|
5795
|
-
return actionType !== 'HIDEFIELD';
|
|
5759
|
+
return availableRule.actionType !== 'HIDEFIELD';
|
|
5796
5760
|
});
|
|
5797
5761
|
}
|
|
5798
5762
|
get layoutCssClass() {
|
|
@@ -5808,29 +5772,44 @@ class FormComponent {
|
|
|
5808
5772
|
}
|
|
5809
5773
|
return 'col-sm-4';
|
|
5810
5774
|
}
|
|
5811
|
-
|
|
5812
|
-
this.
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
}
|
|
5820
|
-
const availableRule = head((programRuleActions || []).filter((rule) => {
|
|
5821
|
-
return (rule[type] &&
|
|
5822
|
-
rule[type].id === elementItem.id &&
|
|
5823
|
-
rule.programRuleActionType === 'HIDEFIELD');
|
|
5824
|
-
}));
|
|
5825
|
-
if (!availableRule) {
|
|
5826
|
-
return true;
|
|
5775
|
+
constructor() {
|
|
5776
|
+
this.formConfig = input();
|
|
5777
|
+
this.programRuleActions = input([]);
|
|
5778
|
+
this.configuration = computed(() => {
|
|
5779
|
+
if (!this.formConfig()) {
|
|
5780
|
+
return new FormConfig({
|
|
5781
|
+
direction: this.isFormHorizontal ? 'horizontal' : 'vertical',
|
|
5782
|
+
});
|
|
5827
5783
|
}
|
|
5828
|
-
return (
|
|
5784
|
+
return this.formConfig();
|
|
5785
|
+
});
|
|
5786
|
+
this.formUpdate = new EventEmitter();
|
|
5787
|
+
this.ruleProcessor = effect(() => {
|
|
5788
|
+
this.#processRules(this.programRuleActions());
|
|
5829
5789
|
});
|
|
5830
5790
|
}
|
|
5831
|
-
ngOnChanges() {
|
|
5791
|
+
ngOnChanges(changes) {
|
|
5832
5792
|
this.values = this.form.getRawValue();
|
|
5833
5793
|
}
|
|
5794
|
+
#processRules(ruleActions) {
|
|
5795
|
+
ruleActions.forEach((ruleAction) => {
|
|
5796
|
+
switch (ruleAction.actionType) {
|
|
5797
|
+
case 'HIDEFIELD': {
|
|
5798
|
+
const fieldToRemove = this.fields.find((field) => field.id === ruleAction.field);
|
|
5799
|
+
if (fieldToRemove) {
|
|
5800
|
+
const currentValue = this.form.get(fieldToRemove.key)?.value;
|
|
5801
|
+
if (currentValue != null) {
|
|
5802
|
+
this.form.get(fieldToRemove.key)?.setValue(null);
|
|
5803
|
+
this.onFieldUpdate(this.form, fieldToRemove);
|
|
5804
|
+
}
|
|
5805
|
+
}
|
|
5806
|
+
break;
|
|
5807
|
+
}
|
|
5808
|
+
default:
|
|
5809
|
+
break;
|
|
5810
|
+
}
|
|
5811
|
+
});
|
|
5812
|
+
}
|
|
5834
5813
|
onSubmit() {
|
|
5835
5814
|
this.formUpdate.emit(this.form.getRawValue());
|
|
5836
5815
|
}
|
|
@@ -5853,13 +5832,16 @@ class FormComponent {
|
|
|
5853
5832
|
fieldToUpdate?.onUpdateRuntimeOptions(parentOption?.options || []);
|
|
5854
5833
|
}
|
|
5855
5834
|
}
|
|
5835
|
+
ngOnDestroy() {
|
|
5836
|
+
this.ruleProcessor.destroy();
|
|
5837
|
+
}
|
|
5856
5838
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: FormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5857
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.8", type: FormComponent, isStandalone: false, selector: "ng-dhis2-ui-form", inputs: { formConfig: { classPropertyName: "formConfig", publicName: "formConfig", isSignal: true, isRequired: false, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: false, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: false, isRequired: false, transformFunction: null }, isFormHorizontal: { classPropertyName: "isFormHorizontal", publicName: "isFormHorizontal", isSignal: false, isRequired: false, transformFunction: null }, showSaveButton: { classPropertyName: "showSaveButton", publicName: "showSaveButton", isSignal: false, isRequired: false, transformFunction: null }, fieldsData: { classPropertyName: "fieldsData", publicName: "fieldsData", isSignal: false, isRequired: false, transformFunction: null }, fieldClass: { classPropertyName: "fieldClass", publicName: "fieldClass", isSignal: false, isRequired: false, transformFunction: null }, shouldRenderAsCheckBoxesButton: { classPropertyName: "shouldRenderAsCheckBoxesButton", publicName: "shouldRenderAsCheckBoxesButton", isSignal: false, isRequired: false, transformFunction: null }, programRuleActions: { classPropertyName: "programRuleActions", publicName: "programRuleActions", isSignal:
|
|
5839
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.8", type: FormComponent, isStandalone: false, selector: "ng-dhis2-ui-form", inputs: { formConfig: { classPropertyName: "formConfig", publicName: "formConfig", isSignal: true, isRequired: false, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: false, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: false, isRequired: false, transformFunction: null }, isFormHorizontal: { classPropertyName: "isFormHorizontal", publicName: "isFormHorizontal", isSignal: false, isRequired: false, transformFunction: null }, showSaveButton: { classPropertyName: "showSaveButton", publicName: "showSaveButton", isSignal: false, isRequired: false, transformFunction: null }, fieldsData: { classPropertyName: "fieldsData", publicName: "fieldsData", isSignal: false, isRequired: false, transformFunction: null }, fieldClass: { classPropertyName: "fieldClass", publicName: "fieldClass", isSignal: false, isRequired: false, transformFunction: null }, shouldRenderAsCheckBoxesButton: { classPropertyName: "shouldRenderAsCheckBoxesButton", publicName: "shouldRenderAsCheckBoxesButton", isSignal: false, isRequired: false, transformFunction: null }, programRuleActions: { classPropertyName: "programRuleActions", publicName: "programRuleActions", isSignal: true, isRequired: false, transformFunction: null }, dataEntities: { classPropertyName: "dataEntities", publicName: "dataEntities", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { formUpdate: "formUpdate" }, viewQueries: [{ propertyName: "fieldComponents", predicate: FormFieldComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"form\" class=\"{{ configuration().directionClassName }}\">\n <!-- form name -->\n <div class=\"form-name\">\n <h2>{{ configuration().formName }}</h2>\n </div>\n <div\n *ngFor=\"let field of sanitizedFields\"\n class=\"form-field-{{ configuration().direction }}\"\n >\n <ng-dhis2-ui-form-field\n [field]=\"field\"\n [fieldConfig]=\"configuration().fieldConfig\"\n [form]=\"form\"\n [fieldClass]=\"fieldClass\"\n [dataEntities]=\"dataEntities\"\n [programRuleActions]=\"programRuleActions()\"\n [isCheckBoxButton]=\"shouldRenderAsCheckBoxesButton\"\n (fieldUpdate)=\"onFieldUpdate($event, field)\"\n (runtimeOptionChange)=\"onRunTimeOptionUpdate($event)\"\n />\n </div>\n</form>\n", styles: [".form-horizontal{display:flex;flex-wrap:wrap;gap:16px;width:100%}.hidden-field{display:none}.units-and-ranges span{margin-left:1%;font-weight:600}.for-warning{margin-left:8px}.form-field-vertical{margin-bottom:8px}.form-field-horizontal{flex:1;margin-bottom:8px;width:100%}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: FormFieldComponent, selector: "ng-dhis2-ui-form-field", inputs: ["field", "fieldConfig", "form", "isCheckBoxButton", "fieldClass", "programRuleActions", "dataEntities", "minDate", "maxDate"], outputs: ["fieldUpdate", "immediateFieldUpdate", "runtimeOptionChange"] }] }); }
|
|
5858
5840
|
}
|
|
5859
5841
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: FormComponent, decorators: [{
|
|
5860
5842
|
type: Component,
|
|
5861
|
-
args: [{ selector: 'ng-dhis2-ui-form', standalone: false, template: "<form [formGroup]=\"form\" class=\"{{ configuration().directionClassName }}\">\n <!-- form name -->\n <div class=\"form-name\">\n <h2>{{ configuration().formName }}</h2>\n </div>\n <div\n *ngFor=\"let field of sanitizedFields\"\n class=\"form-field-{{ configuration().direction }}\"\n >\n <ng-dhis2-ui-form-field\n [field]=\"field\"\n [fieldConfig]=\"configuration().fieldConfig\"\n [form]=\"form\"\n [fieldClass]=\"fieldClass\"\n [dataEntities]=\"dataEntities\"\n [programRuleActions]=\"programRuleActions\"\n [isCheckBoxButton]=\"shouldRenderAsCheckBoxesButton\"\n (fieldUpdate)=\"onFieldUpdate($event, field)\"\n (runtimeOptionChange)=\"onRunTimeOptionUpdate($event)\"\n />\n </div>\n</form>\n", styles: [".form-horizontal{display:flex;flex-wrap:wrap;gap:16px;width:100%}.hidden-field{display:none}.units-and-ranges span{margin-left:1%;font-weight:600}.for-warning{margin-left:8px}.form-field-vertical{margin-bottom:8px}.form-field-horizontal{flex:1;margin-bottom:8px;width:100%}\n"] }]
|
|
5862
|
-
}], propDecorators: { fields: [{
|
|
5843
|
+
args: [{ selector: 'ng-dhis2-ui-form', standalone: false, template: "<form [formGroup]=\"form\" class=\"{{ configuration().directionClassName }}\">\n <!-- form name -->\n <div class=\"form-name\">\n <h2>{{ configuration().formName }}</h2>\n </div>\n <div\n *ngFor=\"let field of sanitizedFields\"\n class=\"form-field-{{ configuration().direction }}\"\n >\n <ng-dhis2-ui-form-field\n [field]=\"field\"\n [fieldConfig]=\"configuration().fieldConfig\"\n [form]=\"form\"\n [fieldClass]=\"fieldClass\"\n [dataEntities]=\"dataEntities\"\n [programRuleActions]=\"programRuleActions()\"\n [isCheckBoxButton]=\"shouldRenderAsCheckBoxesButton\"\n (fieldUpdate)=\"onFieldUpdate($event, field)\"\n (runtimeOptionChange)=\"onRunTimeOptionUpdate($event)\"\n />\n </div>\n</form>\n", styles: [".form-horizontal{display:flex;flex-wrap:wrap;gap:16px;width:100%}.hidden-field{display:none}.units-and-ranges span{margin-left:1%;font-weight:600}.for-warning{margin-left:8px}.form-field-vertical{margin-bottom:8px}.form-field-horizontal{flex:1;margin-bottom:8px;width:100%}\n"] }]
|
|
5844
|
+
}], ctorParameters: () => [], propDecorators: { fields: [{
|
|
5863
5845
|
type: Input
|
|
5864
5846
|
}], form: [{
|
|
5865
5847
|
type: Input
|
|
@@ -5873,8 +5855,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
|
|
|
5873
5855
|
type: Input
|
|
5874
5856
|
}], shouldRenderAsCheckBoxesButton: [{
|
|
5875
5857
|
type: Input
|
|
5876
|
-
}], programRuleActions: [{
|
|
5877
|
-
type: Input
|
|
5878
5858
|
}], dataEntities: [{
|
|
5879
5859
|
type: Input
|
|
5880
5860
|
}], formUpdate: [{
|
|
@@ -5968,7 +5948,7 @@ class SectionFormComponent {
|
|
|
5968
5948
|
this.formGroups = {};
|
|
5969
5949
|
this.formValueEntity = {};
|
|
5970
5950
|
this.repeatableFormValueEntity = {};
|
|
5971
|
-
this.ruleActions = [];
|
|
5951
|
+
this.ruleActions = signal([]);
|
|
5972
5952
|
this.save = new EventEmitter();
|
|
5973
5953
|
this.formUpdate = new EventEmitter();
|
|
5974
5954
|
this.cancel = new EventEmitter();
|
|
@@ -5993,10 +5973,10 @@ class SectionFormComponent {
|
|
|
5993
5973
|
});
|
|
5994
5974
|
});
|
|
5995
5975
|
this.inValid.set(this.checkIfInValid());
|
|
5996
|
-
this.ruleActions
|
|
5976
|
+
this.ruleActions.set(new ProgramRuleEngine()
|
|
5997
5977
|
.setRules(this.formMetaData().rules)
|
|
5998
5978
|
.setDataValues(this.#getDataValue())
|
|
5999
|
-
.execute();
|
|
5979
|
+
.execute());
|
|
6000
5980
|
}
|
|
6001
5981
|
}
|
|
6002
5982
|
onUpdateRepeatableStage(repeatableData, fieldGroup) {
|
|
@@ -6012,10 +5992,10 @@ class SectionFormComponent {
|
|
|
6012
5992
|
this.formValueEntity[fieldGroupId] = formValue;
|
|
6013
5993
|
this.inValid.set(this.checkIfInValid());
|
|
6014
5994
|
const dataValues = this.#getDataValue();
|
|
6015
|
-
this.ruleActions
|
|
5995
|
+
this.ruleActions.set(new ProgramRuleEngine()
|
|
6016
5996
|
.setRules(this.formMetaData().rules)
|
|
6017
5997
|
.setDataValues(dataValues)
|
|
6018
|
-
.execute();
|
|
5998
|
+
.execute());
|
|
6019
5999
|
this.formUpdate.emit(dataValues);
|
|
6020
6000
|
}
|
|
6021
6001
|
onSubmit() {
|
|
@@ -6058,11 +6038,11 @@ class SectionFormComponent {
|
|
|
6058
6038
|
return valueValidity || repeatableDataValidity;
|
|
6059
6039
|
}
|
|
6060
6040
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: SectionFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6061
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.8", type: SectionFormComponent, isStandalone: false, selector: "ng-dhis2-ui-section-form", inputs: { loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, formMetaData: { classPropertyName: "formMetaData", publicName: "formMetaData", isSignal: true, isRequired: true, transformFunction: null }, dataValueEntities: { classPropertyName: "dataValueEntities", publicName: "dataValueEntities", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { save: "save", formUpdate: "formUpdate", cancel: "cancel" }, ngImport: i0, template: "<ng-container *ngIf=\"formMetaData()\">\n <ng-container *ngFor=\"let formSection of formMetaData().sections\">\n @if(formSection?.name; as sectionName) {\n <div class=\"form__section-name\">\n {{ sectionName }}\n </div>\n }\n <div class=\"form__section-content\">\n <ng-container *ngIf=\"formSection\">\n <div *ngFor=\"let fieldGroup of formSection?.fieldGroups\">\n <ng-container *ngIf=\"formGroups[fieldGroup.id] as formGroup\">\n <div\n *ngIf=\"fieldGroup.name && !fieldGroup.repeatableStage\"\n class=\"form__field-group-name\"\n >\n {{ fieldGroup?.name }}\n </div>\n <div *ngIf=\"fieldGroup.fields\">\n <!-- Single stage form section -->\n <ng-container *ngIf=\"!fieldGroup.repeatableStage\">\n <ng-dhis2-ui-form\n *ngIf=\"fieldGroup.fields.length > 0\"\n [fields]=\"fieldGroup.fields\"\n [form]=\"formGroup\"\n [dataEntities]=\"dataValueEntities()\"\n [programRuleActions]=\"ruleActions\"\n [isFormHorizontal]=\"fieldGroup.isFormHorizontal || false\"\n (formUpdate)=\"onFormUpdate($event, fieldGroup.id)\"\n ></ng-dhis2-ui-form>\n </ng-container>\n\n <!-- Repeatable stage form section -->\n <ng-container *ngIf=\"fieldGroup.repeatableStage\">\n @if(fieldGroup.repeatDependentField) {\n\n <ng-container *ngIf=\"fieldGroup.repeatDependentField\">\n <ng-container\n *ngIf=\"{\n numberOfRows:\n dataValueEntities()[fieldGroup.repeatDependentField]\n } as dataParams\"\n >\n <ng-dhis2-ui-repeatable-form\n *ngIf=\"\n dataParams.numberOfRows &&\n dataParams.numberOfRows !== '0'\n \"\n [fieldGroup]=\"fieldGroup\"\n [dataEntities]=\"dataValueEntities()\"\n [form]=\"formGroup\"\n [program]=\"formSection.program || ''\"\n [programStage]=\"fieldGroup.repeatableStage\"\n [programRuleActions]=\"ruleActions\"\n [numberOfRows]=\"+dataParams.numberOfRows\"\n [repeatDependentField]=\"\n fieldGroup.repeatDependentField || ''\n \"\n [events]=\"dataValueEntities()[fieldGroup.dataKey!]\"\n (repeatableStageUpdate)=\"\n onUpdateRepeatableStage($event, fieldGroup)\n \"\n ></ng-dhis2-ui-repeatable-form\n ></ng-container>\n </ng-container>\n } @else {\n <ng-dhis2-ui-repeatable-form\n [fieldGroup]=\"fieldGroup\"\n [dataEntities]=\"dataValueEntities()\"\n [form]=\"formGroup\"\n [program]=\"formSection.program || ''\"\n [programStage]=\"fieldGroup.repeatableStage\"\n [programRuleActions]=\"ruleActions\"\n [numberOfRows]=\"1\"\n [repeatDependentField]=\"fieldGroup.repeatDependentField || ''\"\n [events]=\"dataValueEntities()[fieldGroup.dataKey!]\"\n (repeatableStageUpdate)=\"\n onUpdateRepeatableStage($event, fieldGroup)\n \"\n ></ng-dhis2-ui-repeatable-form>\n }\n </ng-container>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </div>\n </ng-container>\n</ng-container>\n", styles: [".form__section-name{font-size:16px;font-weight:600;margin-bottom:16px}.form__section-content{margin-bottom:24px}.form__field-group-name{font-size:14px;font-weight:500;padding-bottom:8px;border-bottom:solid 1px rgb(232,237,242);margin-bottom:16px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FormComponent, selector: "ng-dhis2-ui-form", inputs: ["formConfig", "fields", "form", "isFormHorizontal", "showSaveButton", "fieldsData", "fieldClass", "shouldRenderAsCheckBoxesButton", "programRuleActions", "dataEntities"], outputs: ["formUpdate"] }, { kind: "component", type: RepeatableFormComponent, selector: "ng-dhis2-ui-repeatable-form", inputs: ["formObject", "formData", "fieldGroup", "form", "numberOfRows", "programRuleActions", "events", "program", "programStage", "repeatDependentField", "dataEntities"], outputs: ["eventsChange", "repeatableStageUpdate"] }] }); }
|
|
6041
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.8", type: SectionFormComponent, isStandalone: false, selector: "ng-dhis2-ui-section-form", inputs: { loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, formMetaData: { classPropertyName: "formMetaData", publicName: "formMetaData", isSignal: true, isRequired: true, transformFunction: null }, dataValueEntities: { classPropertyName: "dataValueEntities", publicName: "dataValueEntities", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { save: "save", formUpdate: "formUpdate", cancel: "cancel" }, ngImport: i0, template: "<ng-container *ngIf=\"formMetaData()\">\n <ng-container *ngFor=\"let formSection of formMetaData().sections\">\n @if(formSection?.name; as sectionName) {\n <div class=\"form__section-name\">\n {{ sectionName }}\n </div>\n }\n <div class=\"form__section-content\">\n <ng-container *ngIf=\"formSection\">\n <div *ngFor=\"let fieldGroup of formSection?.fieldGroups\">\n <ng-container *ngIf=\"formGroups[fieldGroup.id] as formGroup\">\n <div\n *ngIf=\"fieldGroup.name && !fieldGroup.repeatableStage\"\n class=\"form__field-group-name\"\n >\n {{ fieldGroup?.name }}\n </div>\n <div *ngIf=\"fieldGroup.fields\">\n <!-- Single stage form section -->\n <ng-container *ngIf=\"!fieldGroup.repeatableStage\">\n <ng-dhis2-ui-form\n *ngIf=\"fieldGroup.fields.length > 0\"\n [fields]=\"fieldGroup.fields\"\n [form]=\"formGroup\"\n [dataEntities]=\"dataValueEntities()\"\n [programRuleActions]=\"ruleActions()\"\n [isFormHorizontal]=\"fieldGroup.isFormHorizontal || false\"\n (formUpdate)=\"onFormUpdate($event, fieldGroup.id)\"\n ></ng-dhis2-ui-form>\n </ng-container>\n\n <!-- Repeatable stage form section -->\n <ng-container *ngIf=\"fieldGroup.repeatableStage\">\n @if(fieldGroup.repeatDependentField) {\n\n <ng-container *ngIf=\"fieldGroup.repeatDependentField\">\n <ng-container\n *ngIf=\"{\n numberOfRows:\n dataValueEntities()[fieldGroup.repeatDependentField]\n } as dataParams\"\n >\n <ng-dhis2-ui-repeatable-form\n *ngIf=\"\n dataParams.numberOfRows &&\n dataParams.numberOfRows !== '0'\n \"\n [fieldGroup]=\"fieldGroup\"\n [dataEntities]=\"dataValueEntities()\"\n [form]=\"formGroup\"\n [program]=\"formSection.program || ''\"\n [programStage]=\"fieldGroup.repeatableStage\"\n [programRuleActions]=\"ruleActions()\"\n [numberOfRows]=\"+dataParams.numberOfRows\"\n [repeatDependentField]=\"\n fieldGroup.repeatDependentField || ''\n \"\n [events]=\"dataValueEntities()[fieldGroup.dataKey!]\"\n (repeatableStageUpdate)=\"\n onUpdateRepeatableStage($event, fieldGroup)\n \"\n ></ng-dhis2-ui-repeatable-form\n ></ng-container>\n </ng-container>\n } @else {\n <ng-dhis2-ui-repeatable-form\n [fieldGroup]=\"fieldGroup\"\n [dataEntities]=\"dataValueEntities()\"\n [form]=\"formGroup\"\n [program]=\"formSection.program || ''\"\n [programStage]=\"fieldGroup.repeatableStage\"\n [programRuleActions]=\"ruleActions()\"\n [numberOfRows]=\"1\"\n [repeatDependentField]=\"fieldGroup.repeatDependentField || ''\"\n [events]=\"dataValueEntities()[fieldGroup.dataKey!]\"\n (repeatableStageUpdate)=\"\n onUpdateRepeatableStage($event, fieldGroup)\n \"\n ></ng-dhis2-ui-repeatable-form>\n }\n </ng-container>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </div>\n </ng-container>\n</ng-container>\n", styles: [".form__section-name{font-size:16px;font-weight:600;margin-bottom:16px}.form__section-content{margin-bottom:24px}.form__field-group-name{font-size:14px;font-weight:500;padding-bottom:8px;border-bottom:solid 1px rgb(232,237,242);margin-bottom:16px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FormComponent, selector: "ng-dhis2-ui-form", inputs: ["formConfig", "fields", "form", "isFormHorizontal", "showSaveButton", "fieldsData", "fieldClass", "shouldRenderAsCheckBoxesButton", "programRuleActions", "dataEntities"], outputs: ["formUpdate"] }, { kind: "component", type: RepeatableFormComponent, selector: "ng-dhis2-ui-repeatable-form", inputs: ["formObject", "formData", "fieldGroup", "form", "numberOfRows", "programRuleActions", "events", "program", "programStage", "repeatDependentField", "dataEntities"], outputs: ["eventsChange", "repeatableStageUpdate"] }] }); }
|
|
6062
6042
|
}
|
|
6063
6043
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: SectionFormComponent, decorators: [{
|
|
6064
6044
|
type: Component,
|
|
6065
|
-
args: [{ selector: 'ng-dhis2-ui-section-form', standalone: false, template: "<ng-container *ngIf=\"formMetaData()\">\n <ng-container *ngFor=\"let formSection of formMetaData().sections\">\n @if(formSection?.name; as sectionName) {\n <div class=\"form__section-name\">\n {{ sectionName }}\n </div>\n }\n <div class=\"form__section-content\">\n <ng-container *ngIf=\"formSection\">\n <div *ngFor=\"let fieldGroup of formSection?.fieldGroups\">\n <ng-container *ngIf=\"formGroups[fieldGroup.id] as formGroup\">\n <div\n *ngIf=\"fieldGroup.name && !fieldGroup.repeatableStage\"\n class=\"form__field-group-name\"\n >\n {{ fieldGroup?.name }}\n </div>\n <div *ngIf=\"fieldGroup.fields\">\n <!-- Single stage form section -->\n <ng-container *ngIf=\"!fieldGroup.repeatableStage\">\n <ng-dhis2-ui-form\n *ngIf=\"fieldGroup.fields.length > 0\"\n [fields]=\"fieldGroup.fields\"\n [form]=\"formGroup\"\n [dataEntities]=\"dataValueEntities()\"\n [programRuleActions]=\"ruleActions\"\n [isFormHorizontal]=\"fieldGroup.isFormHorizontal || false\"\n (formUpdate)=\"onFormUpdate($event, fieldGroup.id)\"\n ></ng-dhis2-ui-form>\n </ng-container>\n\n <!-- Repeatable stage form section -->\n <ng-container *ngIf=\"fieldGroup.repeatableStage\">\n @if(fieldGroup.repeatDependentField) {\n\n <ng-container *ngIf=\"fieldGroup.repeatDependentField\">\n <ng-container\n *ngIf=\"{\n numberOfRows:\n dataValueEntities()[fieldGroup.repeatDependentField]\n } as dataParams\"\n >\n <ng-dhis2-ui-repeatable-form\n *ngIf=\"\n dataParams.numberOfRows &&\n dataParams.numberOfRows !== '0'\n \"\n [fieldGroup]=\"fieldGroup\"\n [dataEntities]=\"dataValueEntities()\"\n [form]=\"formGroup\"\n [program]=\"formSection.program || ''\"\n [programStage]=\"fieldGroup.repeatableStage\"\n [programRuleActions]=\"ruleActions\"\n [numberOfRows]=\"+dataParams.numberOfRows\"\n [repeatDependentField]=\"\n fieldGroup.repeatDependentField || ''\n \"\n [events]=\"dataValueEntities()[fieldGroup.dataKey!]\"\n (repeatableStageUpdate)=\"\n onUpdateRepeatableStage($event, fieldGroup)\n \"\n ></ng-dhis2-ui-repeatable-form\n ></ng-container>\n </ng-container>\n } @else {\n <ng-dhis2-ui-repeatable-form\n [fieldGroup]=\"fieldGroup\"\n [dataEntities]=\"dataValueEntities()\"\n [form]=\"formGroup\"\n [program]=\"formSection.program || ''\"\n [programStage]=\"fieldGroup.repeatableStage\"\n [programRuleActions]=\"ruleActions\"\n [numberOfRows]=\"1\"\n [repeatDependentField]=\"fieldGroup.repeatDependentField || ''\"\n [events]=\"dataValueEntities()[fieldGroup.dataKey!]\"\n (repeatableStageUpdate)=\"\n onUpdateRepeatableStage($event, fieldGroup)\n \"\n ></ng-dhis2-ui-repeatable-form>\n }\n </ng-container>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </div>\n </ng-container>\n</ng-container>\n", styles: [".form__section-name{font-size:16px;font-weight:600;margin-bottom:16px}.form__section-content{margin-bottom:24px}.form__field-group-name{font-size:14px;font-weight:500;padding-bottom:8px;border-bottom:solid 1px rgb(232,237,242);margin-bottom:16px}\n"] }]
|
|
6045
|
+
args: [{ selector: 'ng-dhis2-ui-section-form', standalone: false, template: "<ng-container *ngIf=\"formMetaData()\">\n <ng-container *ngFor=\"let formSection of formMetaData().sections\">\n @if(formSection?.name; as sectionName) {\n <div class=\"form__section-name\">\n {{ sectionName }}\n </div>\n }\n <div class=\"form__section-content\">\n <ng-container *ngIf=\"formSection\">\n <div *ngFor=\"let fieldGroup of formSection?.fieldGroups\">\n <ng-container *ngIf=\"formGroups[fieldGroup.id] as formGroup\">\n <div\n *ngIf=\"fieldGroup.name && !fieldGroup.repeatableStage\"\n class=\"form__field-group-name\"\n >\n {{ fieldGroup?.name }}\n </div>\n <div *ngIf=\"fieldGroup.fields\">\n <!-- Single stage form section -->\n <ng-container *ngIf=\"!fieldGroup.repeatableStage\">\n <ng-dhis2-ui-form\n *ngIf=\"fieldGroup.fields.length > 0\"\n [fields]=\"fieldGroup.fields\"\n [form]=\"formGroup\"\n [dataEntities]=\"dataValueEntities()\"\n [programRuleActions]=\"ruleActions()\"\n [isFormHorizontal]=\"fieldGroup.isFormHorizontal || false\"\n (formUpdate)=\"onFormUpdate($event, fieldGroup.id)\"\n ></ng-dhis2-ui-form>\n </ng-container>\n\n <!-- Repeatable stage form section -->\n <ng-container *ngIf=\"fieldGroup.repeatableStage\">\n @if(fieldGroup.repeatDependentField) {\n\n <ng-container *ngIf=\"fieldGroup.repeatDependentField\">\n <ng-container\n *ngIf=\"{\n numberOfRows:\n dataValueEntities()[fieldGroup.repeatDependentField]\n } as dataParams\"\n >\n <ng-dhis2-ui-repeatable-form\n *ngIf=\"\n dataParams.numberOfRows &&\n dataParams.numberOfRows !== '0'\n \"\n [fieldGroup]=\"fieldGroup\"\n [dataEntities]=\"dataValueEntities()\"\n [form]=\"formGroup\"\n [program]=\"formSection.program || ''\"\n [programStage]=\"fieldGroup.repeatableStage\"\n [programRuleActions]=\"ruleActions()\"\n [numberOfRows]=\"+dataParams.numberOfRows\"\n [repeatDependentField]=\"\n fieldGroup.repeatDependentField || ''\n \"\n [events]=\"dataValueEntities()[fieldGroup.dataKey!]\"\n (repeatableStageUpdate)=\"\n onUpdateRepeatableStage($event, fieldGroup)\n \"\n ></ng-dhis2-ui-repeatable-form\n ></ng-container>\n </ng-container>\n } @else {\n <ng-dhis2-ui-repeatable-form\n [fieldGroup]=\"fieldGroup\"\n [dataEntities]=\"dataValueEntities()\"\n [form]=\"formGroup\"\n [program]=\"formSection.program || ''\"\n [programStage]=\"fieldGroup.repeatableStage\"\n [programRuleActions]=\"ruleActions()\"\n [numberOfRows]=\"1\"\n [repeatDependentField]=\"fieldGroup.repeatDependentField || ''\"\n [events]=\"dataValueEntities()[fieldGroup.dataKey!]\"\n (repeatableStageUpdate)=\"\n onUpdateRepeatableStage($event, fieldGroup)\n \"\n ></ng-dhis2-ui-repeatable-form>\n }\n </ng-container>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </div>\n </ng-container>\n</ng-container>\n", styles: [".form__section-name{font-size:16px;font-weight:600;margin-bottom:16px}.form__section-content{margin-bottom:24px}.form__field-group-name{font-size:14px;font-weight:500;padding-bottom:8px;border-bottom:solid 1px rgb(232,237,242);margin-bottom:16px}\n"] }]
|
|
6066
6046
|
}], ctorParameters: () => [], propDecorators: { save: [{
|
|
6067
6047
|
type: Output
|
|
6068
6048
|
}], formUpdate: [{
|
|
@@ -6461,18 +6441,22 @@ class TrackerFormComponent {
|
|
|
6461
6441
|
this.formMetaData = new FormMetaData({
|
|
6462
6442
|
programs: [program],
|
|
6463
6443
|
programStage: this.programStage(),
|
|
6444
|
+
disableEnrollmentDate: true,
|
|
6464
6445
|
}).toJson();
|
|
6465
|
-
console.log(this.formMetaData, this.instance.enrollmentDate);
|
|
6466
6446
|
}
|
|
6467
6447
|
}
|
|
6448
|
+
onFormUpdate(values) {
|
|
6449
|
+
const instance = this.instance;
|
|
6450
|
+
instance?.updateDataValues(values);
|
|
6451
|
+
}
|
|
6468
6452
|
onSave(event) { }
|
|
6469
6453
|
onCancel() { }
|
|
6470
6454
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: TrackerFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6471
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.8", type: TrackerFormComponent, isStandalone: false, selector: "ng-dhis2-ui-tracker-form", inputs: { program: { classPropertyName: "program", publicName: "program", isSignal: true, isRequired: true, transformFunction: null }, programStage: { classPropertyName: "programStage", publicName: "programStage", isSignal: true, isRequired: false, transformFunction: null }, trackedEntity: { classPropertyName: "trackedEntity", publicName: "trackedEntity", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if(formMetaData) {\n<ng-dhis2-ui-section-form\n [formMetaData]=\"formMetaData\"\n [dataValueEntities]=\"instance\"\n (save)=\"onSave($event)\"\n (cancel)=\"onCancel()\"\n/>\n}\n", dependencies: [{ kind: "component", type: SectionFormComponent, selector: "ng-dhis2-ui-section-form", inputs: ["loading", "formMetaData", "dataValueEntities"], outputs: ["save", "formUpdate", "cancel"] }] }); }
|
|
6455
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.8", type: TrackerFormComponent, isStandalone: false, selector: "ng-dhis2-ui-tracker-form", inputs: { program: { classPropertyName: "program", publicName: "program", isSignal: true, isRequired: true, transformFunction: null }, programStage: { classPropertyName: "programStage", publicName: "programStage", isSignal: true, isRequired: false, transformFunction: null }, trackedEntity: { classPropertyName: "trackedEntity", publicName: "trackedEntity", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if(formMetaData) {\n<ng-dhis2-ui-section-form\n [formMetaData]=\"formMetaData\"\n [dataValueEntities]=\"instance\"\n (formUpdate)=\"onFormUpdate($event)\"\n (save)=\"onSave($event)\"\n (cancel)=\"onCancel()\"\n/>\n}\n", dependencies: [{ kind: "component", type: SectionFormComponent, selector: "ng-dhis2-ui-section-form", inputs: ["loading", "formMetaData", "dataValueEntities"], outputs: ["save", "formUpdate", "cancel"] }] }); }
|
|
6472
6456
|
}
|
|
6473
6457
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: TrackerFormComponent, decorators: [{
|
|
6474
6458
|
type: Component,
|
|
6475
|
-
args: [{ selector: 'ng-dhis2-ui-tracker-form', standalone: false, template: "@if(formMetaData) {\n<ng-dhis2-ui-section-form\n [formMetaData]=\"formMetaData\"\n [dataValueEntities]=\"instance\"\n (save)=\"onSave($event)\"\n (cancel)=\"onCancel()\"\n/>\n}\n" }]
|
|
6459
|
+
args: [{ selector: 'ng-dhis2-ui-tracker-form', standalone: false, template: "@if(formMetaData) {\n<ng-dhis2-ui-section-form\n [formMetaData]=\"formMetaData\"\n [dataValueEntities]=\"instance\"\n (formUpdate)=\"onFormUpdate($event)\"\n (save)=\"onSave($event)\"\n (cancel)=\"onCancel()\"\n/>\n}\n" }]
|
|
6476
6460
|
}] });
|
|
6477
6461
|
|
|
6478
6462
|
class TrackerFormModule {
|
|
@@ -6493,9 +6477,68 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
|
|
|
6493
6477
|
// Use of this source code is governed by a BSD-style
|
|
6494
6478
|
// license that can be found in the LICENSE file.
|
|
6495
6479
|
|
|
6480
|
+
class EventFormComponent {
|
|
6481
|
+
constructor() {
|
|
6482
|
+
this.program = input.required();
|
|
6483
|
+
this.programStage = input.required();
|
|
6484
|
+
this.eventId = input();
|
|
6485
|
+
this.enrollment = input();
|
|
6486
|
+
this.trackedEntity = input();
|
|
6487
|
+
this.d2 = window.d2Web;
|
|
6488
|
+
}
|
|
6489
|
+
async ngOnInit() {
|
|
6490
|
+
this.eventQuery = this.d2.eventModule.event
|
|
6491
|
+
.setProgram(this.program())
|
|
6492
|
+
.setProgramStage(this.programStage())
|
|
6493
|
+
.setEnrollment(this.enrollment())
|
|
6494
|
+
.setTrackedEntity(this.trackedEntity());
|
|
6495
|
+
const program = await this.eventQuery.getMetaData();
|
|
6496
|
+
this.instance = this.eventId()
|
|
6497
|
+
? (await this.eventQuery.setEvent(this.eventId()).get())
|
|
6498
|
+
.data || (await this.eventQuery.create())
|
|
6499
|
+
: await this.eventQuery.create();
|
|
6500
|
+
if (program) {
|
|
6501
|
+
this.formMetaData = new FormMetaData({
|
|
6502
|
+
programs: [program],
|
|
6503
|
+
programStage: this.programStage(),
|
|
6504
|
+
}).toJson();
|
|
6505
|
+
}
|
|
6506
|
+
}
|
|
6507
|
+
onFormUpdate(values) {
|
|
6508
|
+
const instance = this.instance;
|
|
6509
|
+
instance?.updateDataValues(values);
|
|
6510
|
+
}
|
|
6511
|
+
onSave(event) { }
|
|
6512
|
+
onCancel() { }
|
|
6513
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: EventFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6514
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.8", type: EventFormComponent, isStandalone: false, selector: "ng-dhis2-ui-event-form", inputs: { program: { classPropertyName: "program", publicName: "program", isSignal: true, isRequired: true, transformFunction: null }, programStage: { classPropertyName: "programStage", publicName: "programStage", isSignal: true, isRequired: true, transformFunction: null }, eventId: { classPropertyName: "eventId", publicName: "eventId", isSignal: true, isRequired: false, transformFunction: null }, enrollment: { classPropertyName: "enrollment", publicName: "enrollment", isSignal: true, isRequired: false, transformFunction: null }, trackedEntity: { classPropertyName: "trackedEntity", publicName: "trackedEntity", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if(formMetaData) {\n<ng-dhis2-ui-section-form\n [formMetaData]=\"formMetaData\"\n [dataValueEntities]=\"instance\"\n (formUpdate)=\"onFormUpdate($event)\"\n (save)=\"onSave($event)\"\n (cancel)=\"onCancel()\"\n/>\n}\n", dependencies: [{ kind: "component", type: SectionFormComponent, selector: "ng-dhis2-ui-section-form", inputs: ["loading", "formMetaData", "dataValueEntities"], outputs: ["save", "formUpdate", "cancel"] }] }); }
|
|
6515
|
+
}
|
|
6516
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: EventFormComponent, decorators: [{
|
|
6517
|
+
type: Component,
|
|
6518
|
+
args: [{ selector: 'ng-dhis2-ui-event-form', standalone: false, template: "@if(formMetaData) {\n<ng-dhis2-ui-section-form\n [formMetaData]=\"formMetaData\"\n [dataValueEntities]=\"instance\"\n (formUpdate)=\"onFormUpdate($event)\"\n (save)=\"onSave($event)\"\n (cancel)=\"onCancel()\"\n/>\n}\n" }]
|
|
6519
|
+
}] });
|
|
6520
|
+
|
|
6521
|
+
class EventFormModule {
|
|
6522
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: EventFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
6523
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.8", ngImport: i0, type: EventFormModule, declarations: [EventFormComponent], imports: [CommonModule, D2FormModule], exports: [EventFormComponent] }); }
|
|
6524
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: EventFormModule, imports: [CommonModule, D2FormModule] }); }
|
|
6525
|
+
}
|
|
6526
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: EventFormModule, decorators: [{
|
|
6527
|
+
type: NgModule,
|
|
6528
|
+
args: [{
|
|
6529
|
+
imports: [CommonModule, D2FormModule],
|
|
6530
|
+
declarations: [EventFormComponent],
|
|
6531
|
+
exports: [EventFormComponent],
|
|
6532
|
+
}]
|
|
6533
|
+
}] });
|
|
6534
|
+
|
|
6535
|
+
// Copyright 2025 UDSM DHIS2 Lab. All rights reserved.
|
|
6536
|
+
// Use of this source code is governed by a BSD-style
|
|
6537
|
+
// license that can be found in the LICENSE file.
|
|
6538
|
+
|
|
6496
6539
|
/**
|
|
6497
6540
|
* Generated bundle index. Do not edit.
|
|
6498
6541
|
*/
|
|
6499
6542
|
|
|
6500
|
-
export { Boolean$1 as Boolean, BreadcrumbComponent, BreadcrumbModule, ButtonComponent, ButtonModule, CheckBox, D2FormModule, DataTableUIComponent, DataTableUIModule, DateField, DateRangeValue, Dropdown, FieldConfig, FieldControlTypeUtil, FieldDropdown, FieldType, FieldUtil, FormComponent, FormConfig, FormField, FormFieldComponent, FormFieldGroup, FormFieldTypeUtil, FormMetaData, FormMetadataSection, FormUtil, FormValue, FormValueUtil, HeaderBarComponent, HeaderBarModule, LineListModule, LineListTableComponent, MetadataRule, MetadataRuleAction, OrganisationUnitSelectionConfig, OrganisationUnitSelectorComponent, OrganisationUnitSelectorModalComponent, OrganisationUnitSelectorModule, PeriodSelectorComponent, PeriodSelectorModalComponent, PeriodSelectorModule, ReactWrapperModule, RepeatableFormComponent, SectionFormComponent, SelectionFiltersComponent, SelectionFiltersUiModule, TrackerFormComponent, TrackerFormModule, TranslationUtil };
|
|
6543
|
+
export { Boolean$1 as Boolean, BreadcrumbComponent, BreadcrumbModule, ButtonComponent, ButtonModule, CheckBox, D2FormModule, DataTableUIComponent, DataTableUIModule, DateField, DateRangeValue, Dropdown, EventFormComponent, EventFormModule, FieldConfig, FieldControlTypeUtil, FieldDropdown, FieldType, FieldUtil, FormComponent, FormConfig, FormField, FormFieldComponent, FormFieldGroup, FormFieldTypeUtil, FormMetaData, FormMetadataSection, FormUtil, FormValue, FormValueUtil, HeaderBarComponent, HeaderBarModule, LineListModule, LineListTableComponent, MetadataRule, MetadataRuleAction, OrganisationUnitSelectionConfig, OrganisationUnitSelectorComponent, OrganisationUnitSelectorModalComponent, OrganisationUnitSelectorModule, PeriodSelectorComponent, PeriodSelectorModalComponent, PeriodSelectorModule, ReactWrapperModule, RepeatableFormComponent, SectionFormComponent, SelectionFiltersComponent, SelectionFiltersUiModule, TrackerFormComponent, TrackerFormModule, TranslationUtil };
|
|
6501
6544
|
//# sourceMappingURL=iapps-ng-dhis2-ui.mjs.map
|