@iapps/ng-dhis2-ui 1.3.5 → 1.3.7
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.
|
@@ -3379,7 +3379,7 @@ const OrgUnitSelector = ({ hide, setHide, selectedOrgUnit, setSelectedOrgUnit, s
|
|
|
3379
3379
|
React__default.createElement(ButtonStrip$1, { end: true },
|
|
3380
3380
|
React__default.createElement(Button$1, { onClick: () => setHide(true), secondary: true }, "Close")))));
|
|
3381
3381
|
|
|
3382
|
-
const FilterToolbar = ({ orgUnitLabel, selectedOrgUnit, setSelectedOrgUnit, setOrgUnitState, defaultOrgUnit, setHide, startDateState, setStartDateState, endDateState, setEndDateState,
|
|
3382
|
+
const FilterToolbar = ({ orgUnit: { orgUnitLabel, selectedOrgUnit, setSelectedOrgUnit, setOrgUnitState, defaultOrgUnit, setHide, setTempOrgUnitState, tempOrgUnitState, SetOrgUnitModalVisible, handleOrgUnitFilter, prevSelectedOrgUnit, setPrevSelectedOrgUnit, }, dates: { startDateState, setStartDateState, endDateState, setEndDateState, setTempStartDateState, setTempEndDateState, tempStartDateState, tempEndDateState, showEnrollmentDates, handleStartDateFilter, handleEndDateFilter, }, filters: { visibleFilters, dateStates, inputValues, setInputValues, handleInputChange, handleInputChangeForSelectField, handleDateSelect, showAllFilters, setShowAllFilters, dataQueryFiltersState, setDataQueryFiltersState, handleAdditionalFilters, setDateStates, prevInputValues, setPrevInputValues, setTempDataQueryFiltersState, prevDateStates, setPrevDateStates, }, }) => {
|
|
3383
3383
|
const [isOpen, setIsOpen] = useState(false);
|
|
3384
3384
|
const [isOpenOrgUnitDropdown, setIsOpenOrgUnitDropdown] = useState(false);
|
|
3385
3385
|
const [openDropdownKey, setOpenDropdownKey] = useState(null);
|
|
@@ -3688,49 +3688,6 @@ function formatDateForDisplay(dateString) {
|
|
|
3688
3688
|
return 'dd-mm-yyyy';
|
|
3689
3689
|
}
|
|
3690
3690
|
}
|
|
3691
|
-
// case 'date':
|
|
3692
|
-
// case 'date-time':
|
|
3693
|
-
// return (
|
|
3694
|
-
// // <InputField
|
|
3695
|
-
// // error={hasError}
|
|
3696
|
-
// // validationText={validationError}
|
|
3697
|
-
// // type={this.field().type as any}
|
|
3698
|
-
// // inputWidth={inputWidth}
|
|
3699
|
-
// // required={this.field().required}
|
|
3700
|
-
// // name={this.field().id}
|
|
3701
|
-
// // label={this.label()}
|
|
3702
|
-
// // min={this.field().min?.toString()}
|
|
3703
|
-
// // max={this.field().max?.toString()}
|
|
3704
|
-
// // placeholder={this.placeholder()}
|
|
3705
|
-
// // value={value}
|
|
3706
|
-
// // readOnly={disabled}
|
|
3707
|
-
// // onChange={(event: any) => {
|
|
3708
|
-
// // onValueChange(event.value);
|
|
3709
|
-
// // }}
|
|
3710
|
-
// // onBlur={() => {
|
|
3711
|
-
// // checkValueUniqueness();
|
|
3712
|
-
// // }}
|
|
3713
|
-
// // />
|
|
3714
|
-
// <CalendarInput
|
|
3715
|
-
// label={this.label()}
|
|
3716
|
-
// error={hasError}
|
|
3717
|
-
// validationText={validationError}
|
|
3718
|
-
// date={value}
|
|
3719
|
-
// readOnly={disabled}
|
|
3720
|
-
// min={this.field().min?.toString()}
|
|
3721
|
-
// max={this.field().max?.toString()}
|
|
3722
|
-
// placeholder={this.placeholder()}
|
|
3723
|
-
// onDateSelect={(selectedDate: any) => {
|
|
3724
|
-
// onValueChange(selectedDate.calendarDateString);
|
|
3725
|
-
// }}
|
|
3726
|
-
// disabled={disabled}
|
|
3727
|
-
// inputWidth={inputWidth}
|
|
3728
|
-
// required={this.field().required}
|
|
3729
|
-
// calendar="gregory"
|
|
3730
|
-
// locale="en-GB"
|
|
3731
|
-
// timeZone="Africa/Dar_es_Salaam"
|
|
3732
|
-
// />
|
|
3733
|
-
// );
|
|
3734
3691
|
|
|
3735
3692
|
const TableHeader = ({ columns, allSelected, onSelectAll, selectable, showActionButtons, }) => {
|
|
3736
3693
|
const handleCheckboxChange = () => {
|
|
@@ -4332,7 +4289,7 @@ const formatMultiTextOptionValue = (value, options = []) => {
|
|
|
4332
4289
|
return codes.map((code) => optionByCode.get(code)?.name || code).join(', ');
|
|
4333
4290
|
};
|
|
4334
4291
|
|
|
4335
|
-
const getTrackedEntityTableData = (response, programId, pager, metaData, searcheableDataElements, customDisplayInReportsIds, columnNameSource = 'NAME', columnMetadataDisplayMode) => {
|
|
4292
|
+
const getTrackedEntityTableData = (response, programId, pager, metaData, searcheableDataElements, customDisplayInReportsIds, columnNameSource = 'NAME', columnMetadataDisplayMode, orgUnitAndDateColumnsPosition = 'start') => {
|
|
4336
4293
|
const getColumnLabel = (item) => columnNameSource === 'FORM_NAME'
|
|
4337
4294
|
? item?.formName || item?.name || 'Default'
|
|
4338
4295
|
: item?.name || item?.formName || 'Default';
|
|
@@ -4411,7 +4368,7 @@ const getTrackedEntityTableData = (response, programId, pager, metaData, searche
|
|
|
4411
4368
|
color: option.style?.color,
|
|
4412
4369
|
})) ?? [],
|
|
4413
4370
|
}));
|
|
4414
|
-
const
|
|
4371
|
+
const orgUnitAndDateColumns = [
|
|
4415
4372
|
{
|
|
4416
4373
|
label: orgUnitLabel || 'Registering unit',
|
|
4417
4374
|
key: 'orgUnit',
|
|
@@ -4424,9 +4381,11 @@ const getTrackedEntityTableData = (response, programId, pager, metaData, searche
|
|
|
4424
4381
|
},
|
|
4425
4382
|
]
|
|
4426
4383
|
: []),
|
|
4427
|
-
...attributeColumns,
|
|
4428
|
-
...dataElementColumns,
|
|
4429
4384
|
];
|
|
4385
|
+
const entityColumns = [...attributeColumns, ...dataElementColumns];
|
|
4386
|
+
const tableColumns = orgUnitAndDateColumnsPosition === 'end'
|
|
4387
|
+
? [...entityColumns, ...orgUnitAndDateColumns]
|
|
4388
|
+
: [...orgUnitAndDateColumns, ...entityColumns];
|
|
4430
4389
|
const tableFilters = metaData.searchableTrackedEntityAttributes
|
|
4431
4390
|
.sort((a, b) => a.sortOrder - b.sortOrder)
|
|
4432
4391
|
.map((attr) => ({
|
|
@@ -4897,6 +4856,7 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
4897
4856
|
this.showDownloadButton = false;
|
|
4898
4857
|
this.searcheableDataElements = [];
|
|
4899
4858
|
this.columnNameSource = 'NAME';
|
|
4859
|
+
this.orgUnitAndDateColumnsPosition = 'start';
|
|
4900
4860
|
this.reactStateUpdaters = null;
|
|
4901
4861
|
this.setReactStateUpdaters = (updaters) => {
|
|
4902
4862
|
this.reactStateUpdaters = updaters;
|
|
@@ -5103,7 +5063,7 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
5103
5063
|
pager: pager,
|
|
5104
5064
|
orgUnitsMap: fetchedOrgUnits,
|
|
5105
5065
|
};
|
|
5106
|
-
const { columns, data, filteredEntityColumns, orgUnitLabel } = getTrackedEntityTableData({ data: trackedEntityResponse }, this.programId, pager, metaData, this.searcheableDataElements, this.customDisplayInReportsIds, this.columnNameSource, this.columnMetadataDisplayMode);
|
|
5066
|
+
const { columns, data, filteredEntityColumns, orgUnitLabel } = getTrackedEntityTableData({ data: trackedEntityResponse }, this.programId, pager, metaData, this.searcheableDataElements, this.customDisplayInReportsIds, this.columnNameSource, this.columnMetadataDisplayMode, this.orgUnitAndDateColumnsPosition);
|
|
5107
5067
|
setFilteredColumns((prev) => filteredEntityColumns.length > 0 ? filteredEntityColumns : prev);
|
|
5108
5068
|
let updatedFilterableColumnIds;
|
|
5109
5069
|
if (Array.isArray(this.filterableColumnIds) &&
|
|
@@ -5366,48 +5326,53 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
5366
5326
|
tempOrgUnitState: tempOrgUnitState,
|
|
5367
5327
|
}), this.showFilters &&
|
|
5368
5328
|
React__default.createElement(FilterToolbar, {
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5329
|
+
orgUnit: {
|
|
5330
|
+
orgUnitLabel,
|
|
5331
|
+
selectedOrgUnit,
|
|
5332
|
+
setSelectedOrgUnit,
|
|
5333
|
+
setOrgUnitState,
|
|
5334
|
+
defaultOrgUnit,
|
|
5335
|
+
setHide,
|
|
5336
|
+
setTempOrgUnitState,
|
|
5337
|
+
tempOrgUnitState,
|
|
5338
|
+
SetOrgUnitModalVisible: setOrgUnitModalVisible,
|
|
5339
|
+
handleOrgUnitFilter,
|
|
5340
|
+
prevSelectedOrgUnit,
|
|
5341
|
+
setPrevSelectedOrgUnit,
|
|
5342
|
+
},
|
|
5343
|
+
dates: {
|
|
5344
|
+
startDateState,
|
|
5345
|
+
setStartDateState,
|
|
5346
|
+
endDateState,
|
|
5347
|
+
setEndDateState,
|
|
5348
|
+
setTempStartDateState,
|
|
5349
|
+
setTempEndDateState,
|
|
5350
|
+
tempStartDateState,
|
|
5351
|
+
tempEndDateState,
|
|
5352
|
+
showEnrollmentDates: this.showEnrollmentDates,
|
|
5353
|
+
handleStartDateFilter,
|
|
5354
|
+
handleEndDateFilter,
|
|
5355
|
+
},
|
|
5356
|
+
filters: {
|
|
5357
|
+
visibleFilters,
|
|
5358
|
+
dateStates,
|
|
5359
|
+
inputValues,
|
|
5360
|
+
setInputValues,
|
|
5361
|
+
handleInputChange,
|
|
5362
|
+
handleInputChangeForSelectField,
|
|
5363
|
+
handleDateSelect,
|
|
5364
|
+
showAllFilters,
|
|
5365
|
+
setShowAllFilters,
|
|
5366
|
+
dataQueryFiltersState,
|
|
5367
|
+
setDataQueryFiltersState,
|
|
5368
|
+
handleAdditionalFilters,
|
|
5369
|
+
setDateStates,
|
|
5370
|
+
prevInputValues,
|
|
5371
|
+
setPrevInputValues,
|
|
5372
|
+
setTempDataQueryFiltersState,
|
|
5373
|
+
prevDateStates,
|
|
5374
|
+
setPrevDateStates,
|
|
5375
|
+
},
|
|
5411
5376
|
}), React__default.createElement('div', { className: 'line-list-table-scroll' }, React__default.createElement(LineListTable, {
|
|
5412
5377
|
columns: columns,
|
|
5413
5378
|
data: data,
|
|
@@ -5471,7 +5436,7 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
5471
5436
|
this.render();
|
|
5472
5437
|
}
|
|
5473
5438
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: LineListTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5474
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: LineListTableComponent, isStandalone: false, selector: "ng-dhis2-ui-line-list", inputs: { triggerToken: "triggerToken", programId: "programId", orgUnit: "orgUnit", programStageId: "programStageId", actionOptions: "actionOptions", actionOptionOrientation: "actionOptionOrientation", attributeFilters: "attributeFilters", useOuModeWithOlderDHIS2Instance: "useOuModeWithOlderDHIS2Instance", startDate: "startDate", endDate: "endDate", dataQueryFilters: "dataQueryFilters", lineListRowActionFilterConfig: "lineListRowActionFilterConfig", hydrateForActionFiltering: "hydrateForActionFiltering", ouMode: "ouMode", isButtonLoading: "isButtonLoading", buttonFilter: "buttonFilter", filterRootOrgUnit: "filterRootOrgUnit", showFilters: "showFilters", isOptionSetNameVisible: "isOptionSetNameVisible", allowRowsSelection: "allowRowsSelection", enrollmentStatus: "enrollmentStatus", filterableColumnIds: "filterableColumnIds", triggerRefetch: "triggerRefetch", eventStatus: "eventStatus", showActionButtons: "showActionButtons", showEnrollmentDates: "showEnrollmentDates", showDownloadButton: "showDownloadButton", searcheableDataElements: "searcheableDataElements", columnNameSource: "columnNameSource", customDisplayInReportsIds: "customDisplayInReportsIds", columnMetadataDisplayMode: "columnMetadataDisplayMode" }, outputs: { actionSelected: "actionSelected", rowsSelected: "rowsSelected" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: ["@charset \"UTF-8\";::ng-deep .line-list-root{width:100%;max-width:100%;min-width:0}::ng-deep .line-list-download-toolbar{position:sticky;left:0;z-index:2;display:flex;justify-content:flex-end;width:100%;max-width:100%;box-sizing:border-box;background:#fff}::ng-deep .line-list-table-scroll{width:100%;max-width:100%;overflow-x:auto}::ng-deep .custom-input{display:flex!important;gap:4px!important;align-items:center!important;border:1px solid #9fadba!important;border-radius:4px!important;margin:0;padding:0 0 0 8px;background-color:#fff!important}::ng-deep .custom-input div{margin:0!important}::ng-deep .custom-input label{font-size:12px;padding-right:0}::ng-deep .custom-input input{border:none!important;font-size:12px!important;display:flex;align-items:center;padding-left:4px;height:40px;outline:none!important;box-shadow:none!important}::ng-deep .custom-input input:focus{border:none!important;box-shadow:none!important}::ng-deep .custom-input [data-test=calendar-clear-button]{background-color:#f2f2f2!important;color:#870808!important;border-radius:6px!important;padding:4px 10px!important;font-size:0!important}::ng-deep .custom-input [data-test=calendar-clear-button]:before{content:\"\\2715\";font-size:14px;color:#870808}::ng-deep .custom-input [data-test=calendar-clear-button]:hover{background-color:#ddd}::ng-deep .calendar-input-wrapper{position:relative}::ng-deep .calendar-input-wrapper .custom-input{position:relative;width:100%;display:flex;align-items:center}::ng-deep .calendar-input-wrapper [data-test=calendar-clear-button]{right:8px;bottom:14px;margin:auto;display:flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:0!important;background-color:#a0adba!important;border-radius:50%;padding:2px;cursor:pointer}::ng-deep .calendar-input-wrapper [data-test=calendar-clear-button]:before{content:\"\\2715\";font-size:10px;color:#f0f0f0}::ng-deep .calendar-input-wrapper input{padding-right:40px!important;height:40px;line-height:40px;box-sizing:border-box}::ng-deep .custom-input label{color:gray!important;opacity:1}::ng-deep .table-top-toolbar{background-color:var(--colors-grey100)!important;color:var(--colors-grey900)!important}::ng-deep .custom-select-input{display:flex!important;gap:4px!important;align-items:center!important;border:1px solid #9fadba!important;border-radius:4px!important;margin:0;padding:0 0 0 8px;background-color:#fff!important}::ng-deep .custom-select-input div{margin:0!important}::ng-deep .custom-select-input [data-test=dhis2-uiwidgets-singleselectfield-label]{font-size:12px;color:gray!important}::ng-deep .custom-select-input [data-test=dhis2-uicore-select-input]{border:none!important;font-size:12px!important;display:flex;align-items:center;padding-left:4px;height:40px;outline:none!important;box-shadow:none!important}::ng-deep .custom-select-input [data-test=dhis2-uicore-select-input]:focus-within{box-shadow:none!important}::ng-deep .custom-select-input input:focus{border:none!important;box-shadow:none!important}\n"], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
5439
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: LineListTableComponent, isStandalone: false, selector: "ng-dhis2-ui-line-list", inputs: { triggerToken: "triggerToken", programId: "programId", orgUnit: "orgUnit", programStageId: "programStageId", actionOptions: "actionOptions", actionOptionOrientation: "actionOptionOrientation", attributeFilters: "attributeFilters", useOuModeWithOlderDHIS2Instance: "useOuModeWithOlderDHIS2Instance", startDate: "startDate", endDate: "endDate", dataQueryFilters: "dataQueryFilters", lineListRowActionFilterConfig: "lineListRowActionFilterConfig", hydrateForActionFiltering: "hydrateForActionFiltering", ouMode: "ouMode", isButtonLoading: "isButtonLoading", buttonFilter: "buttonFilter", filterRootOrgUnit: "filterRootOrgUnit", showFilters: "showFilters", isOptionSetNameVisible: "isOptionSetNameVisible", allowRowsSelection: "allowRowsSelection", enrollmentStatus: "enrollmentStatus", filterableColumnIds: "filterableColumnIds", triggerRefetch: "triggerRefetch", eventStatus: "eventStatus", showActionButtons: "showActionButtons", showEnrollmentDates: "showEnrollmentDates", showDownloadButton: "showDownloadButton", searcheableDataElements: "searcheableDataElements", columnNameSource: "columnNameSource", orgUnitAndDateColumnsPosition: "orgUnitAndDateColumnsPosition", customDisplayInReportsIds: "customDisplayInReportsIds", columnMetadataDisplayMode: "columnMetadataDisplayMode" }, outputs: { actionSelected: "actionSelected", rowsSelected: "rowsSelected" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: ["@charset \"UTF-8\";::ng-deep .line-list-root{width:100%;max-width:100%;min-width:0}::ng-deep .line-list-download-toolbar{position:sticky;left:0;z-index:2;display:flex;justify-content:flex-end;width:100%;max-width:100%;box-sizing:border-box;background:#fff}::ng-deep .line-list-table-scroll{width:100%;max-width:100%;overflow-x:auto}::ng-deep .custom-input{display:flex!important;gap:4px!important;align-items:center!important;border:1px solid #9fadba!important;border-radius:4px!important;margin:0;padding:0 0 0 8px;background-color:#fff!important}::ng-deep .custom-input div{margin:0!important}::ng-deep .custom-input label{font-size:12px;padding-right:0}::ng-deep .custom-input input{border:none!important;font-size:12px!important;display:flex;align-items:center;padding-left:4px;height:40px;outline:none!important;box-shadow:none!important}::ng-deep .custom-input input:focus{border:none!important;box-shadow:none!important}::ng-deep .custom-input [data-test=calendar-clear-button]{background-color:#f2f2f2!important;color:#870808!important;border-radius:6px!important;padding:4px 10px!important;font-size:0!important}::ng-deep .custom-input [data-test=calendar-clear-button]:before{content:\"\\2715\";font-size:14px;color:#870808}::ng-deep .custom-input [data-test=calendar-clear-button]:hover{background-color:#ddd}::ng-deep .calendar-input-wrapper{position:relative}::ng-deep .calendar-input-wrapper .custom-input{position:relative;width:100%;display:flex;align-items:center}::ng-deep .calendar-input-wrapper [data-test=calendar-clear-button]{right:8px;bottom:14px;margin:auto;display:flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:0!important;background-color:#a0adba!important;border-radius:50%;padding:2px;cursor:pointer}::ng-deep .calendar-input-wrapper [data-test=calendar-clear-button]:before{content:\"\\2715\";font-size:10px;color:#f0f0f0}::ng-deep .calendar-input-wrapper input{padding-right:40px!important;height:40px;line-height:40px;box-sizing:border-box}::ng-deep .custom-input label{color:gray!important;opacity:1}::ng-deep .table-top-toolbar{background-color:var(--colors-grey100)!important;color:var(--colors-grey900)!important}::ng-deep .custom-select-input{display:flex!important;gap:4px!important;align-items:center!important;border:1px solid #9fadba!important;border-radius:4px!important;margin:0;padding:0 0 0 8px;background-color:#fff!important}::ng-deep .custom-select-input div{margin:0!important}::ng-deep .custom-select-input [data-test=dhis2-uiwidgets-singleselectfield-label]{font-size:12px;color:gray!important}::ng-deep .custom-select-input [data-test=dhis2-uicore-select-input]{border:none!important;font-size:12px!important;display:flex;align-items:center;padding-left:4px;height:40px;outline:none!important;box-shadow:none!important}::ng-deep .custom-select-input [data-test=dhis2-uicore-select-input]:focus-within{box-shadow:none!important}::ng-deep .custom-select-input input:focus{border:none!important;box-shadow:none!important}\n"], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
5475
5440
|
}
|
|
5476
5441
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: LineListTableComponent, decorators: [{
|
|
5477
5442
|
type: Component,
|
|
@@ -5538,6 +5503,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
5538
5503
|
type: Input
|
|
5539
5504
|
}], columnNameSource: [{
|
|
5540
5505
|
type: Input
|
|
5506
|
+
}], orgUnitAndDateColumnsPosition: [{
|
|
5507
|
+
type: Input
|
|
5541
5508
|
}], customDisplayInReportsIds: [{
|
|
5542
5509
|
type: Input
|
|
5543
5510
|
}], columnMetadataDisplayMode: [{
|
|
@@ -9139,7 +9106,7 @@ class BaseFormFieldComponent extends ReactWrapperModule {
|
|
|
9139
9106
|
case 'transfer':
|
|
9140
9107
|
return (React__default.createElement(Transfer, { filterable: true, filterPlaceholder: "Search", selected: selected, leftHeader: React__default.createElement("div", { style: { fontSize: 14, padding: '8px 4px' } }, f.availableOptionsLabel), rightHeader: React__default.createElement("div", { style: { fontSize: 14, padding: '8px 4px' } }, f.selectedOptionsLabel), options: f.options, onChange: (event) => onValueChange(event.selected) }));
|
|
9141
9108
|
case 'checkbox':
|
|
9142
|
-
return (React__default.createElement(Checkbox, { checked: Boolean(value), error: hasError, label: this.label(), name: f.id, disabled: disabled, onChange: (event) => onValueChange(event.checked), onBlur: () => checkValueUniqueness() }));
|
|
9109
|
+
return (React__default.createElement(Checkbox, { checked: Boolean(value), error: hasError, label: this.label(), name: f.id, disabled: disabled, onChange: (event) => onValueChange(event.checked ? true : null), onBlur: () => checkValueUniqueness() }));
|
|
9143
9110
|
case 'dropdown':
|
|
9144
9111
|
return (React__default.createElement(FieldSet, null,
|
|
9145
9112
|
React__default.createElement(FormFieldLabel, { field: this.field(), fieldConfig: this.fieldConfig() }),
|
|
@@ -11895,6 +11862,7 @@ class ProgramEntryFormConfig {
|
|
|
11895
11862
|
this.cancelButtonLabel = 'Cancel';
|
|
11896
11863
|
this.fieldDescriptionLabel = 'Description';
|
|
11897
11864
|
this.updateTeiOrgUnit = false;
|
|
11865
|
+
this.enableCustomFieldConfigurations = false;
|
|
11898
11866
|
Object.assign(this, config);
|
|
11899
11867
|
}
|
|
11900
11868
|
}
|
|
@@ -12981,8 +12949,10 @@ class ProgramEntryFormMetaData {
|
|
|
12981
12949
|
};
|
|
12982
12950
|
}
|
|
12983
12951
|
async #getCustomFieldConfigurations() {
|
|
12952
|
+
console.log('Fetching custom field configurations...');
|
|
12984
12953
|
try {
|
|
12985
12954
|
const response = await this.d2.httpInstance.get('dataStore/field-extensions?fields=id,fieldOptionsDependsOn,optionSet&paging=false', { useIndexDb: true });
|
|
12955
|
+
console.log('Fetching custom field configurations...', response?.data);
|
|
12986
12956
|
const responseData = response?.data;
|
|
12987
12957
|
const entries = Array.isArray(responseData)
|
|
12988
12958
|
? responseData
|
|
@@ -13012,8 +12982,9 @@ class ProgramEntryFormMetaData {
|
|
|
13012
12982
|
if (program) {
|
|
13013
12983
|
this.program = program;
|
|
13014
12984
|
// TODO FIND ANOTHER WAY TO PASS IN CUSTOM FIELD CONFIGURATIONS, AVOID TIGHT COUPLING HERE
|
|
13015
|
-
|
|
13016
|
-
|
|
12985
|
+
this.customFieldConfigurations = this.config.enableCustomFieldConfigurations === true
|
|
12986
|
+
? await this.#getCustomFieldConfigurations()
|
|
12987
|
+
: {};
|
|
13017
12988
|
if (this.config?.formFieldExtensions &&
|
|
13018
12989
|
this.config.formFieldExtensions.length > 0 &&
|
|
13019
12990
|
this.config.formFieldExtensions[0]?.optionsSourceCode) {
|