@iapps/ng-dhis2-ui 1.2.70 → 1.2.71
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.
|
@@ -3305,7 +3305,7 @@ const OrgUnitSelector = ({ hide, setHide, selectedOrgUnit, setSelectedOrgUnit, s
|
|
|
3305
3305
|
const FilterToolbar = ({ orgUnitLabel, selectedOrgUnit, setSelectedOrgUnit, setOrgUnitState, defaultOrgUnit, setHide, startDateState, setStartDateState, endDateState, setEndDateState, visibleFilters, dateStates, inputValues, setInputValues, handleInputChange, handleInputChangeForSelectField, handleDateSelect, prevValue, setPrevValue, showAllFilters, setShowAllFilters, handleSearch, setTempStartDateState, setTempEndDateState, setTempOrgUnitState, tempStartDateState, tempEndDateState, tempOrgUnitState, dataQueryFiltersState, setDataQueryFiltersState, SetOrgUnitModalVisible, showEnrollmentDates, }) => (React__default.createElement(DataTableToolbar, { className: "table-top-toolbar" },
|
|
3306
3306
|
React__default.createElement("div", { style: {
|
|
3307
3307
|
display: 'flex',
|
|
3308
|
-
flexDirection: 'column',
|
|
3308
|
+
// flexDirection: 'column',
|
|
3309
3309
|
gap: '10px',
|
|
3310
3310
|
flexWrap: 'wrap',
|
|
3311
3311
|
} },
|
|
@@ -3339,15 +3339,8 @@ const FilterToolbar = ({ orgUnitLabel, selectedOrgUnit, setSelectedOrgUnit, setO
|
|
|
3339
3339
|
if (selectedDate.calendarDateString === null) {
|
|
3340
3340
|
setEndDateState(selectedDate.calendarDateString);
|
|
3341
3341
|
}
|
|
3342
|
-
} }))),
|
|
3343
|
-
|
|
3344
|
-
React__default.createElement(Button$1, { onClick: () => setShowAllFilters(!showAllFilters) }, showAllFilters ? 'Less Filters' : 'More Filters')),
|
|
3345
|
-
visibleFilters?.length > 0 && (React__default.createElement("div", { style: {
|
|
3346
|
-
display: 'flex',
|
|
3347
|
-
alignItems: 'center',
|
|
3348
|
-
gap: '10px',
|
|
3349
|
-
flexWrap: 'wrap',
|
|
3350
|
-
} }, (visibleFilters ?? []).map(({ label, key, valueType, options }) => {
|
|
3342
|
+
} })))),
|
|
3343
|
+
(visibleFilters ?? []).map(({ label, key, valueType, options }) => {
|
|
3351
3344
|
if (valueType === 'DATE') {
|
|
3352
3345
|
return (React__default.createElement(CalendarInput, { key: key, label: `${label}:`, calendar: "gregory", locale: "en-GB", timeZone: "Africa/Dar_es_Salaam", className: "custom-input", clearable: !!dateStates[key], date: dateStates[key], onDateSelect: (selectedDate) => {
|
|
3353
3346
|
handleDateSelect(key, selectedDate);
|
|
@@ -3388,164 +3381,15 @@ const FilterToolbar = ({ orgUnitLabel, selectedOrgUnit, setSelectedOrgUnit, setO
|
|
|
3388
3381
|
setPrevValue(currentValue);
|
|
3389
3382
|
}
|
|
3390
3383
|
} }));
|
|
3391
|
-
})
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
//
|
|
3395
|
-
|
|
3396
|
-
//
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
// >
|
|
3401
|
-
// <InputField
|
|
3402
|
-
// key="location"
|
|
3403
|
-
// label={orgUnitLabel ? orgUnitLabel : 'registering unit:'}
|
|
3404
|
-
// value={selectedOrgUnit}
|
|
3405
|
-
// onFocus={() => setHide(false)}
|
|
3406
|
-
// className="custom-input"
|
|
3407
|
-
// clearable
|
|
3408
|
-
// onChange={(event: { value: string }) => {
|
|
3409
|
-
// setSelectedOrgUnit(event.value);
|
|
3410
|
-
// setOrgUnitState(defaultOrgUnit);
|
|
3411
|
-
// }}
|
|
3412
|
-
// />
|
|
3413
|
-
// <CalendarInput
|
|
3414
|
-
// label="Start date:"
|
|
3415
|
-
// calendar="gregory"
|
|
3416
|
-
// locale="en-GB"
|
|
3417
|
-
// timeZone="Africa/Dar_es_Salaam"
|
|
3418
|
-
// className="custom-input"
|
|
3419
|
-
// clearable={!!tempStartDateState}
|
|
3420
|
-
// date={tempStartDateState}
|
|
3421
|
-
// onDateSelect={(selectedDate: any) => {
|
|
3422
|
-
// // if (!(selectedDate.calendarDateString === null)) {
|
|
3423
|
-
// setTempStartDateState(selectedDate.calendarDateString);
|
|
3424
|
-
// //}
|
|
3425
|
-
// if (selectedDate.calendarDateString === null) {
|
|
3426
|
-
// setStartDateState(selectedDate.calendarDateString);
|
|
3427
|
-
// }
|
|
3428
|
-
// }}
|
|
3429
|
-
// />
|
|
3430
|
-
// <CalendarInput
|
|
3431
|
-
// label="End date:"
|
|
3432
|
-
// calendar="gregory"
|
|
3433
|
-
// locale="en-GB"
|
|
3434
|
-
// timeZone="Africa/Dar_es_Salaam"
|
|
3435
|
-
// className="custom-input"
|
|
3436
|
-
// clearable={!!tempEndDateState}
|
|
3437
|
-
// date={tempEndDateState}
|
|
3438
|
-
// onDateSelect={(selectedDate: any) => {
|
|
3439
|
-
// // if (!(selectedDate.calendarDateString === null)) {
|
|
3440
|
-
// setTempEndDateState(selectedDate.calendarDateString);
|
|
3441
|
-
// //}
|
|
3442
|
-
// if (selectedDate.calendarDateString === null) {
|
|
3443
|
-
// setEndDateState(selectedDate.calendarDateString);
|
|
3444
|
-
// }
|
|
3445
|
-
// }}
|
|
3446
|
-
// />
|
|
3447
|
-
// <Button onClick={() => handleSearch()}>Search</Button>
|
|
3448
|
-
// <Button onClick={() => setShowAllFilters(!showAllFilters)}>
|
|
3449
|
-
// {showAllFilters ? 'Less Filters' : 'More Filters'}
|
|
3450
|
-
// </Button>
|
|
3451
|
-
// {(visibleFilters ?? []).map(({ label, key, valueType, options }: any) => {
|
|
3452
|
-
// if (valueType === 'DATE') {
|
|
3453
|
-
// return (
|
|
3454
|
-
// <CalendarInput
|
|
3455
|
-
// key={key}
|
|
3456
|
-
// label={`${label}:`}
|
|
3457
|
-
// calendar="gregory"
|
|
3458
|
-
// locale="en-GB"
|
|
3459
|
-
// timeZone="Africa/Dar_es_Salaam"
|
|
3460
|
-
// className="custom-input"
|
|
3461
|
-
// clearable={!!dateStates[key]}
|
|
3462
|
-
// date={dateStates[key]}
|
|
3463
|
-
// onDateSelect={(selectedDate: any) => {
|
|
3464
|
-
// handleDateSelect(key, selectedDate);
|
|
3465
|
-
// const filteredFilters = dataQueryFiltersState.filter(
|
|
3466
|
-
// (f: { attribute: any }) => f.attribute !== key
|
|
3467
|
-
// );
|
|
3468
|
-
// if (selectedDate === null) {
|
|
3469
|
-
// setDataQueryFiltersState(filteredFilters);
|
|
3470
|
-
// }
|
|
3471
|
-
// }}
|
|
3472
|
-
// />
|
|
3473
|
-
// );
|
|
3474
|
-
// }
|
|
3475
|
-
// // const filteredFilters = prevFilters.filter((f) => f.attribute !== key);
|
|
3476
|
-
// if (options && options.options.length > 0) {
|
|
3477
|
-
// return (
|
|
3478
|
-
// <SingleSelectField
|
|
3479
|
-
// key={key}
|
|
3480
|
-
// label={`${label}:`}
|
|
3481
|
-
// selected={inputValues[key] || ''}
|
|
3482
|
-
// className="custom-select-input"
|
|
3483
|
-
// clearable
|
|
3484
|
-
// onChange={({ selected }: { selected: string }) => {
|
|
3485
|
-
// setInputValues((prevValues: any) => ({
|
|
3486
|
-
// ...prevValues,
|
|
3487
|
-
// [key]: selected ?? '',
|
|
3488
|
-
// }));
|
|
3489
|
-
// handleInputChangeForSelectField(key, selected ?? '');
|
|
3490
|
-
// const filteredFilters = dataQueryFiltersState.filter(
|
|
3491
|
-
// (f: { attribute: any }) => f.attribute !== key
|
|
3492
|
-
// );
|
|
3493
|
-
// if (selected === '') {
|
|
3494
|
-
// setDataQueryFiltersState(filteredFilters);
|
|
3495
|
-
// }
|
|
3496
|
-
// }}
|
|
3497
|
-
// >
|
|
3498
|
-
// {(options.options ?? []).map((opt: any) => (
|
|
3499
|
-
// <SingleSelectOption
|
|
3500
|
-
// key={opt.id}
|
|
3501
|
-
// label={opt.name}
|
|
3502
|
-
// value={opt.code}
|
|
3503
|
-
// />
|
|
3504
|
-
// ))}
|
|
3505
|
-
// </SingleSelectField>
|
|
3506
|
-
// );
|
|
3507
|
-
// }
|
|
3508
|
-
// return (
|
|
3509
|
-
// <InputField
|
|
3510
|
-
// key={key}
|
|
3511
|
-
// label={`${label}:`}
|
|
3512
|
-
// className="custom-input"
|
|
3513
|
-
// value={inputValues[key] || ''}
|
|
3514
|
-
// clearable
|
|
3515
|
-
// onChange={(e: any) => {
|
|
3516
|
-
// const currentValue =
|
|
3517
|
-
// 'target' in e ? e.target.value : e.value ?? '';
|
|
3518
|
-
// setInputValues((prevValues: any) => ({
|
|
3519
|
-
// ...prevValues,
|
|
3520
|
-
// [key]: currentValue,
|
|
3521
|
-
// }));
|
|
3522
|
-
// // if (currentValue === '') {
|
|
3523
|
-
// // handleInputChange(key, '');
|
|
3524
|
-
// // }
|
|
3525
|
-
// const filteredFilters = dataQueryFiltersState.filter(
|
|
3526
|
-
// (f: { attribute: any }) => f.attribute !== key
|
|
3527
|
-
// );
|
|
3528
|
-
// if (currentValue === '') {
|
|
3529
|
-
// setDataQueryFiltersState(filteredFilters);
|
|
3530
|
-
// }
|
|
3531
|
-
// }}
|
|
3532
|
-
// onBlur={(e: any) => {
|
|
3533
|
-
// const currentValue =
|
|
3534
|
-
// 'target' in e ? e.target.value : e.value ?? '';
|
|
3535
|
-
// if (currentValue !== '' && currentValue !== prevValue) {
|
|
3536
|
-
// handleInputChange(key, currentValue);
|
|
3537
|
-
// setPrevValue(currentValue);
|
|
3538
|
-
// }
|
|
3539
|
-
// }}
|
|
3540
|
-
// />
|
|
3541
|
-
// );
|
|
3542
|
-
// })}
|
|
3543
|
-
// <div>
|
|
3544
|
-
// {/* <p>hello</p> */}
|
|
3545
|
-
// </div>
|
|
3546
|
-
// </div>
|
|
3547
|
-
// </DataTableToolbar>
|
|
3548
|
-
);
|
|
3384
|
+
}),
|
|
3385
|
+
React__default.createElement("div", { style: {
|
|
3386
|
+
display: 'flex',
|
|
3387
|
+
// alignItems: 'center',
|
|
3388
|
+
gap: '10px',
|
|
3389
|
+
// flexWrap: 'wrap',
|
|
3390
|
+
} },
|
|
3391
|
+
React__default.createElement(Button$1, { onClick: handleSearch }, "Search"),
|
|
3392
|
+
React__default.createElement(Button$1, { onClick: () => setShowAllFilters(!showAllFilters) }, showAllFilters ? 'Less Filters' : 'More Filters')))));
|
|
3549
3393
|
|
|
3550
3394
|
// export const TableHeader = ({
|
|
3551
3395
|
// columns,
|