@iapps/ng-dhis2-ui 1.1.69 → 1.1.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.
- package/fesm2022/iapps-ng-dhis2-ui.mjs +262 -383
- package/fesm2022/iapps-ng-dhis2-ui.mjs.map +1 -1
- 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/line-list/components/data-table-actions/data-table-actions.d.ts +7 -0
- package/lib/modules/line-list/components/data-table-actions/index.d.ts +1 -0
- package/lib/modules/line-list/components/dropdown-menu/dropdown-menu.d.ts +3 -10
- package/lib/modules/line-list/containers/line-list.component.d.ts +4 -3
- package/lib/modules/line-list/index.d.ts +1 -0
- package/lib/modules/line-list/models/action-option-orientation.model.d.ts +1 -0
- package/lib/modules/line-list/models/dropdown-menu.model.d.ts +9 -0
- package/lib/modules/line-list/models/index.d.ts +3 -0
- package/lib/modules/line-list/models/line-list-action-option.model.d.ts +5 -0
- package/package.json +1 -1
|
@@ -3195,13 +3195,237 @@ const DropdownMenu$1 = (props) => {
|
|
|
3195
3195
|
const ref = useRef();
|
|
3196
3196
|
const [visible, setVisible] = useState(false);
|
|
3197
3197
|
const { dropdownOptions, onClick } = props;
|
|
3198
|
-
return (React__default.createElement("div", { ref: ref, style: { display:
|
|
3198
|
+
return (React__default.createElement("div", { ref: ref, style: { display: 'inline-block' } },
|
|
3199
3199
|
React__default.createElement(Button$1, { small: true, secondary: true, icon: React__default.createElement(IconMore24, { color: colors$1.grey600 }), onClick: () => setVisible(true) }),
|
|
3200
3200
|
visible && (React__default.createElement(ContextMenu$1, { dropDownOptions: dropdownOptions, anchorRef: ref, onClose: () => setVisible(false), onMenuClick: (dropDownOption) => {
|
|
3201
3201
|
onClick(dropDownOption);
|
|
3202
3202
|
} }))));
|
|
3203
3203
|
};
|
|
3204
3204
|
|
|
3205
|
+
// Copyright 2025 UDSM DHIS2 Lab. All rights reserved.
|
|
3206
|
+
// Use of this source code is governed by a BSD-style
|
|
3207
|
+
// license that can be found in the LICENSE file.
|
|
3208
|
+
const DataTableActions = (props) => {
|
|
3209
|
+
const { actionOptions, actionOptionOrientation, onClick } = props;
|
|
3210
|
+
switch (actionOptionOrientation) {
|
|
3211
|
+
case 'BUTTON':
|
|
3212
|
+
return (React__default.createElement(ButtonStrip$1, null, actionOptions.map((option) => (React__default.createElement(Button$1, { key: option.label, onClick: () => onClick(option), icon: option.icon ? React__default.createElement(option.icon, null) : React__default.createElement(React__default.Fragment, null), small: true, destructive: option.destructive }, !option.iconOnly ? option.label : '')))));
|
|
3213
|
+
case 'DROPDOWN':
|
|
3214
|
+
return (React__default.createElement(DropdownMenu$1, { dropdownOptions: actionOptions, onClick: (option) => {
|
|
3215
|
+
onClick(option);
|
|
3216
|
+
} }));
|
|
3217
|
+
case 'LINK':
|
|
3218
|
+
return (React__default.createElement("div", { style: {
|
|
3219
|
+
display: 'flex',
|
|
3220
|
+
gap: 16,
|
|
3221
|
+
alignItems: 'center',
|
|
3222
|
+
} }, actionOptions.map((option) => (React__default.createElement("a", { style: {
|
|
3223
|
+
cursor: 'pointer',
|
|
3224
|
+
textDecoration: 'underline',
|
|
3225
|
+
fontSize: 14,
|
|
3226
|
+
display: 'flex',
|
|
3227
|
+
alignItems: 'center',
|
|
3228
|
+
gap: 4,
|
|
3229
|
+
color: option.destructive ? colors$1.red700 : colors$1.grey900,
|
|
3230
|
+
}, key: option.label, onClick: (event) => {
|
|
3231
|
+
event.stopPropagation();
|
|
3232
|
+
onClick(option);
|
|
3233
|
+
} },
|
|
3234
|
+
option.icon ? React__default.createElement(option.icon, null) : React__default.createElement(React__default.Fragment, null),
|
|
3235
|
+
!option.iconOnly ? React__default.createElement("span", null, option.label) : React__default.createElement(React__default.Fragment, null))))));
|
|
3236
|
+
default:
|
|
3237
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
3238
|
+
}
|
|
3239
|
+
};
|
|
3240
|
+
|
|
3241
|
+
// Copyright 2025 UDSM DHIS2 Lab. All rights reserved.
|
|
3242
|
+
// Use of this source code is governed by a BSD-style
|
|
3243
|
+
// license that can be found in the LICENSE file.
|
|
3244
|
+
|
|
3245
|
+
// Copyright 2025 UDSM DHIS2 Lab. All rights reserved.
|
|
3246
|
+
// Use of this source code is governed by a BSD-style
|
|
3247
|
+
// license that can be found in the LICENSE file.
|
|
3248
|
+
// @flow
|
|
3249
|
+
const orgUnitFieldStyles$1 = {
|
|
3250
|
+
container: {
|
|
3251
|
+
border: '1px solid',
|
|
3252
|
+
borderColor: colors$1.grey400,
|
|
3253
|
+
borderRadius: '3px',
|
|
3254
|
+
height: '100%',
|
|
3255
|
+
width: '100%',
|
|
3256
|
+
zIndex: 0,
|
|
3257
|
+
backgroundColor: 'white',
|
|
3258
|
+
},
|
|
3259
|
+
searchField: {
|
|
3260
|
+
height: '40px',
|
|
3261
|
+
overflow: 'hidden',
|
|
3262
|
+
borderBottomLeftRadius: 0,
|
|
3263
|
+
borderBottomRightRadius: 0,
|
|
3264
|
+
boxShadow: 'none',
|
|
3265
|
+
border: 'none',
|
|
3266
|
+
},
|
|
3267
|
+
debounceFieldContainer: {
|
|
3268
|
+
padding: '8px',
|
|
3269
|
+
background: colors$1.grey100,
|
|
3270
|
+
borderTopLeftRadius: '3px',
|
|
3271
|
+
borderTopRightRadius: '3px',
|
|
3272
|
+
},
|
|
3273
|
+
orgUnitTreeContainer: {
|
|
3274
|
+
borderBottomLeftRadius: '3px',
|
|
3275
|
+
borderBottomRightRadius: '3px',
|
|
3276
|
+
overflow: 'auto',
|
|
3277
|
+
},
|
|
3278
|
+
orgUnitTreeLoader: {
|
|
3279
|
+
padding: '8px',
|
|
3280
|
+
},
|
|
3281
|
+
orgUnitFieldLabel: {
|
|
3282
|
+
marginBottom: '8px',
|
|
3283
|
+
display: 'block',
|
|
3284
|
+
boxSizing: 'border-box',
|
|
3285
|
+
fontSize: '14px',
|
|
3286
|
+
lineHeight: '19px',
|
|
3287
|
+
color: 'rgb(33, 41, 52)',
|
|
3288
|
+
padding: '0',
|
|
3289
|
+
},
|
|
3290
|
+
orgUnitFieldRequiredLabel: {
|
|
3291
|
+
paddingInlineStart: '4px',
|
|
3292
|
+
},
|
|
3293
|
+
};
|
|
3294
|
+
const OrgUnitFormField$1 = (props) => {
|
|
3295
|
+
const { onSelectOrgUnit, label, required, selected, disabled, key } = props;
|
|
3296
|
+
const d2 = window?.d2Web;
|
|
3297
|
+
const classes = useDynamicStyles$2(orgUnitFieldStyles$1);
|
|
3298
|
+
const config = useMemo(() => {
|
|
3299
|
+
return d2.systemInfo?.toInitObject();
|
|
3300
|
+
}, []);
|
|
3301
|
+
const rootOrgUnits = useMemo(() => {
|
|
3302
|
+
return d2.currentUser?.organisationUnits || [];
|
|
3303
|
+
}, []);
|
|
3304
|
+
const getExpandedItems = () => {
|
|
3305
|
+
if (rootOrgUnits && rootOrgUnits.length === 1) {
|
|
3306
|
+
return [`/${rootOrgUnits[0].id}`];
|
|
3307
|
+
}
|
|
3308
|
+
else if (rootOrgUnits?.length > 1) {
|
|
3309
|
+
return rootOrgUnits.map((root) => root.path);
|
|
3310
|
+
}
|
|
3311
|
+
return undefined;
|
|
3312
|
+
};
|
|
3313
|
+
const initiallyExpanded = getExpandedItems();
|
|
3314
|
+
const [searchText, setSearchText] = useState(undefined);
|
|
3315
|
+
const [loading, setLoading] = useState(true);
|
|
3316
|
+
const [searchLoading, setSearchLoading] = useState();
|
|
3317
|
+
const [searchData, setSearchData] = useState();
|
|
3318
|
+
const [selectedOrgUnit, setSelectedOrgUnit] = useState();
|
|
3319
|
+
const [expanded, setExpanded] = useState(initiallyExpanded);
|
|
3320
|
+
const [showOrgUnitTree, setShowOrgUnitTree] = useState(!selected);
|
|
3321
|
+
useEffect(() => {
|
|
3322
|
+
setLoading(true);
|
|
3323
|
+
if (selected) {
|
|
3324
|
+
d2.httpInstance
|
|
3325
|
+
.get(`organisationUnits/${selected}.json?fields=id,displayName,path,code,ancestors[id,displayName]`)
|
|
3326
|
+
.then((response) => {
|
|
3327
|
+
if (response.data) {
|
|
3328
|
+
setSelectedOrgUnit(response.data);
|
|
3329
|
+
handleExpand({ path: response.data['path'] });
|
|
3330
|
+
setLoading(false);
|
|
3331
|
+
}
|
|
3332
|
+
});
|
|
3333
|
+
}
|
|
3334
|
+
else {
|
|
3335
|
+
setShowOrgUnitTree(true);
|
|
3336
|
+
setLoading(false);
|
|
3337
|
+
}
|
|
3338
|
+
}, []);
|
|
3339
|
+
const highlighted = useMemo(() => {
|
|
3340
|
+
if (selectedOrgUnit) {
|
|
3341
|
+
return [selectedOrgUnit['path']];
|
|
3342
|
+
}
|
|
3343
|
+
return undefined;
|
|
3344
|
+
}, [selectedOrgUnit]);
|
|
3345
|
+
const selectedOrgUnitLabel = useMemo(() => {
|
|
3346
|
+
if (selectedOrgUnit) {
|
|
3347
|
+
return [
|
|
3348
|
+
...(selectedOrgUnit['ancestors'] || []),
|
|
3349
|
+
selectedOrgUnit,
|
|
3350
|
+
]
|
|
3351
|
+
.map((orgUnit) => orgUnit['displayName'])
|
|
3352
|
+
.join(' / ');
|
|
3353
|
+
}
|
|
3354
|
+
return '';
|
|
3355
|
+
}, [selectedOrgUnit]);
|
|
3356
|
+
const handleExpand = ({ path }) => {
|
|
3357
|
+
if (expanded && !expanded.includes(path)) {
|
|
3358
|
+
setExpanded([...expanded, path]);
|
|
3359
|
+
}
|
|
3360
|
+
};
|
|
3361
|
+
const handleCollapse = ({ path }) => {
|
|
3362
|
+
const pathIndex = expanded?.indexOf(path);
|
|
3363
|
+
if (pathIndex && pathIndex !== -1 && expanded) {
|
|
3364
|
+
const updatedExpanded = pathIndex === 0
|
|
3365
|
+
? expanded.slice(1)
|
|
3366
|
+
: [...expanded.slice(0, pathIndex), ...expanded.slice(pathIndex + 1)];
|
|
3367
|
+
setExpanded(updatedExpanded);
|
|
3368
|
+
}
|
|
3369
|
+
};
|
|
3370
|
+
const handleOrgUnitSearch = async (query) => {
|
|
3371
|
+
setSearchLoading(true);
|
|
3372
|
+
try {
|
|
3373
|
+
const searchResponse = await d2.httpInstance.get(`organisationUnits.json?fields=id,displayName,path,publicAccess,access,lastUpdated,children[id,displayName,publicAccess,access,path,children::isNotEmpty]&paging=true&query=${query}&withinUserSearchHierarchy=true&pageSize=15`);
|
|
3374
|
+
setSearchData((searchResponse.data || {})['organisationUnits']);
|
|
3375
|
+
setSearchLoading(false);
|
|
3376
|
+
}
|
|
3377
|
+
catch (e) {
|
|
3378
|
+
setSearchLoading(false);
|
|
3379
|
+
}
|
|
3380
|
+
};
|
|
3381
|
+
const debouncedSearch = useCallback(debounce((value) => {
|
|
3382
|
+
handleOrgUnitSearch(value);
|
|
3383
|
+
}, 500), []);
|
|
3384
|
+
const handleFilterChange = (event) => {
|
|
3385
|
+
setSearchText(event.value);
|
|
3386
|
+
debouncedSearch(event.value);
|
|
3387
|
+
};
|
|
3388
|
+
const ready = useMemo(() => {
|
|
3389
|
+
return searchText?.length ? !searchLoading : !loading;
|
|
3390
|
+
}, [searchText, searchLoading, loading]);
|
|
3391
|
+
const renderOrgUnitTree = () => {
|
|
3392
|
+
if (searchText && searchText?.length > 0) {
|
|
3393
|
+
if (searchLoading) {
|
|
3394
|
+
return (React__default.createElement("div", { className: classes.orgUnitTreeLoader },
|
|
3395
|
+
React__default.createElement(CircularLoader$1, { small: true })));
|
|
3396
|
+
}
|
|
3397
|
+
return (ready && (React__default.createElement(OrganisationUnitTree, { key: `${key}-search`, roots: searchData?.map((orgUnit) => orgUnit.id) || [], singleSelection: true, expanded: expanded, handleExpand: handleExpand, handleCollapse: handleCollapse, selected: highlighted, onChange: (event) => {
|
|
3398
|
+
setSelectedOrgUnit(event);
|
|
3399
|
+
setShowOrgUnitTree(false);
|
|
3400
|
+
onSelectOrgUnit(event);
|
|
3401
|
+
} })));
|
|
3402
|
+
}
|
|
3403
|
+
return (React__default.createElement(OrganisationUnitTree, { key: key, roots: rootOrgUnits?.map((orgUnit) => orgUnit.id) || [], singleSelection: true, expanded: expanded, handleExpand: handleExpand, handleCollapse: handleCollapse, selected: highlighted, onChange: (event) => {
|
|
3404
|
+
setSelectedOrgUnit(event);
|
|
3405
|
+
setShowOrgUnitTree(false);
|
|
3406
|
+
onSelectOrgUnit(event);
|
|
3407
|
+
} }));
|
|
3408
|
+
};
|
|
3409
|
+
const handleBlur = () => {
|
|
3410
|
+
// onBlur && onBlur(null);
|
|
3411
|
+
};
|
|
3412
|
+
return (config && (React__default.createElement(Provider, { config: config, plugin: false, parentAlertsAdd: undefined, showAlertsInPlugin: false },
|
|
3413
|
+
React__default.createElement("div", null,
|
|
3414
|
+
label && (React__default.createElement("div", { className: classes.orgUnitFieldLabel },
|
|
3415
|
+
React__default.createElement("span", null, label),
|
|
3416
|
+
required ? (React__default.createElement("span", { className: classes.orgUnitFieldRequiredLabel }, "*")) : (React__default.createElement(React__default.Fragment, null)))),
|
|
3417
|
+
!showOrgUnitTree ? (selectedOrgUnit ? (React__default.createElement(React__default.Fragment, null,
|
|
3418
|
+
React__default.createElement(Tooltip, { content: selectedOrgUnitLabel },
|
|
3419
|
+
React__default.createElement(Chip, { onRemove: () => {
|
|
3420
|
+
setShowOrgUnitTree(true);
|
|
3421
|
+
} }, selectedOrgUnit.displayName)))) : (React__default.createElement("div", { className: classes.orgUnitTreeLoader },
|
|
3422
|
+
React__default.createElement(CircularLoader$1, { small: true })))) : (React__default.createElement("div", { className: classes.container },
|
|
3423
|
+
React__default.createElement("div", { className: classes.debounceFieldContainer },
|
|
3424
|
+
React__default.createElement(InputField$1, { placeholder: "Search", value: searchText, disabled: disabled, onChange: handleFilterChange })),
|
|
3425
|
+
loading ? (React__default.createElement("div", { className: classes.orgUnitTreeLoader },
|
|
3426
|
+
React__default.createElement(CircularLoader$1, { small: true }))) : (React__default.createElement("div", { className: classes.orgUnitTreeContainer, style: { maxHeight: '200px', overflowY: 'auto' } }, renderOrgUnitTree()))))))));
|
|
3427
|
+
};
|
|
3428
|
+
|
|
3205
3429
|
// export function buildFilters(filters: AttributeFilter[]): string {
|
|
3206
3430
|
// return filters
|
|
3207
3431
|
// .map(({ attribute, operator, value }) => `filter=${attribute}:${operator}:${value}`)
|
|
@@ -3849,194 +4073,11 @@ const addActionsColumn = (columns, actionOptions) => {
|
|
|
3849
4073
|
];
|
|
3850
4074
|
};
|
|
3851
4075
|
|
|
3852
|
-
// Copyright 2025 UDSM DHIS2 Lab. All rights reserved.
|
|
3853
|
-
// Use of this source code is governed by a BSD-style
|
|
3854
|
-
// license that can be found in the LICENSE file.
|
|
3855
|
-
// @flow
|
|
3856
|
-
const orgUnitFieldStyles$1 = {
|
|
3857
|
-
container: {
|
|
3858
|
-
border: '1px solid',
|
|
3859
|
-
borderColor: colors$1.grey400,
|
|
3860
|
-
borderRadius: '3px',
|
|
3861
|
-
height: '100%',
|
|
3862
|
-
width: '100%',
|
|
3863
|
-
zIndex: 0,
|
|
3864
|
-
backgroundColor: 'white',
|
|
3865
|
-
},
|
|
3866
|
-
searchField: {
|
|
3867
|
-
height: '40px',
|
|
3868
|
-
overflow: 'hidden',
|
|
3869
|
-
borderBottomLeftRadius: 0,
|
|
3870
|
-
borderBottomRightRadius: 0,
|
|
3871
|
-
boxShadow: 'none',
|
|
3872
|
-
border: 'none',
|
|
3873
|
-
},
|
|
3874
|
-
debounceFieldContainer: {
|
|
3875
|
-
padding: '8px',
|
|
3876
|
-
background: colors$1.grey100,
|
|
3877
|
-
borderTopLeftRadius: '3px',
|
|
3878
|
-
borderTopRightRadius: '3px',
|
|
3879
|
-
},
|
|
3880
|
-
orgUnitTreeContainer: {
|
|
3881
|
-
borderBottomLeftRadius: '3px',
|
|
3882
|
-
borderBottomRightRadius: '3px',
|
|
3883
|
-
overflow: 'auto',
|
|
3884
|
-
},
|
|
3885
|
-
orgUnitTreeLoader: {
|
|
3886
|
-
padding: '8px',
|
|
3887
|
-
},
|
|
3888
|
-
orgUnitFieldLabel: {
|
|
3889
|
-
marginBottom: '8px',
|
|
3890
|
-
display: 'block',
|
|
3891
|
-
boxSizing: 'border-box',
|
|
3892
|
-
fontSize: '14px',
|
|
3893
|
-
lineHeight: '19px',
|
|
3894
|
-
color: 'rgb(33, 41, 52)',
|
|
3895
|
-
padding: '0',
|
|
3896
|
-
},
|
|
3897
|
-
orgUnitFieldRequiredLabel: {
|
|
3898
|
-
paddingInlineStart: '4px',
|
|
3899
|
-
},
|
|
3900
|
-
};
|
|
3901
|
-
const OrgUnitFormField$1 = (props) => {
|
|
3902
|
-
const { onSelectOrgUnit, label, required, selected, disabled, key } = props;
|
|
3903
|
-
const d2 = window?.d2Web;
|
|
3904
|
-
const classes = useDynamicStyles$2(orgUnitFieldStyles$1);
|
|
3905
|
-
const config = useMemo(() => {
|
|
3906
|
-
return d2.systemInfo?.toInitObject();
|
|
3907
|
-
}, []);
|
|
3908
|
-
const rootOrgUnits = useMemo(() => {
|
|
3909
|
-
return d2.currentUser?.organisationUnits || [];
|
|
3910
|
-
}, []);
|
|
3911
|
-
const getExpandedItems = () => {
|
|
3912
|
-
if (rootOrgUnits && rootOrgUnits.length === 1) {
|
|
3913
|
-
return [`/${rootOrgUnits[0].id}`];
|
|
3914
|
-
}
|
|
3915
|
-
else if (rootOrgUnits?.length > 1) {
|
|
3916
|
-
return rootOrgUnits.map((root) => root.path);
|
|
3917
|
-
}
|
|
3918
|
-
return undefined;
|
|
3919
|
-
};
|
|
3920
|
-
const initiallyExpanded = getExpandedItems();
|
|
3921
|
-
const [searchText, setSearchText] = useState(undefined);
|
|
3922
|
-
const [loading, setLoading] = useState(true);
|
|
3923
|
-
const [searchLoading, setSearchLoading] = useState();
|
|
3924
|
-
const [searchData, setSearchData] = useState();
|
|
3925
|
-
const [selectedOrgUnit, setSelectedOrgUnit] = useState();
|
|
3926
|
-
const [expanded, setExpanded] = useState(initiallyExpanded);
|
|
3927
|
-
const [showOrgUnitTree, setShowOrgUnitTree] = useState(!selected);
|
|
3928
|
-
useEffect(() => {
|
|
3929
|
-
setLoading(true);
|
|
3930
|
-
if (selected) {
|
|
3931
|
-
d2.httpInstance
|
|
3932
|
-
.get(`organisationUnits/${selected}.json?fields=id,displayName,path,code,ancestors[id,displayName]`)
|
|
3933
|
-
.then((response) => {
|
|
3934
|
-
if (response.data) {
|
|
3935
|
-
setSelectedOrgUnit(response.data);
|
|
3936
|
-
handleExpand({ path: response.data['path'] });
|
|
3937
|
-
setLoading(false);
|
|
3938
|
-
}
|
|
3939
|
-
});
|
|
3940
|
-
}
|
|
3941
|
-
else {
|
|
3942
|
-
setShowOrgUnitTree(true);
|
|
3943
|
-
setLoading(false);
|
|
3944
|
-
}
|
|
3945
|
-
}, []);
|
|
3946
|
-
const highlighted = useMemo(() => {
|
|
3947
|
-
if (selectedOrgUnit) {
|
|
3948
|
-
return [selectedOrgUnit['path']];
|
|
3949
|
-
}
|
|
3950
|
-
return undefined;
|
|
3951
|
-
}, [selectedOrgUnit]);
|
|
3952
|
-
const selectedOrgUnitLabel = useMemo(() => {
|
|
3953
|
-
if (selectedOrgUnit) {
|
|
3954
|
-
return [
|
|
3955
|
-
...(selectedOrgUnit['ancestors'] || []),
|
|
3956
|
-
selectedOrgUnit,
|
|
3957
|
-
]
|
|
3958
|
-
.map((orgUnit) => orgUnit['displayName'])
|
|
3959
|
-
.join(' / ');
|
|
3960
|
-
}
|
|
3961
|
-
return '';
|
|
3962
|
-
}, [selectedOrgUnit]);
|
|
3963
|
-
const handleExpand = ({ path }) => {
|
|
3964
|
-
if (expanded && !expanded.includes(path)) {
|
|
3965
|
-
setExpanded([...expanded, path]);
|
|
3966
|
-
}
|
|
3967
|
-
};
|
|
3968
|
-
const handleCollapse = ({ path }) => {
|
|
3969
|
-
const pathIndex = expanded?.indexOf(path);
|
|
3970
|
-
if (pathIndex && pathIndex !== -1 && expanded) {
|
|
3971
|
-
const updatedExpanded = pathIndex === 0
|
|
3972
|
-
? expanded.slice(1)
|
|
3973
|
-
: [...expanded.slice(0, pathIndex), ...expanded.slice(pathIndex + 1)];
|
|
3974
|
-
setExpanded(updatedExpanded);
|
|
3975
|
-
}
|
|
3976
|
-
};
|
|
3977
|
-
const handleOrgUnitSearch = async (query) => {
|
|
3978
|
-
setSearchLoading(true);
|
|
3979
|
-
try {
|
|
3980
|
-
const searchResponse = await d2.httpInstance.get(`organisationUnits.json?fields=id,displayName,path,publicAccess,access,lastUpdated,children[id,displayName,publicAccess,access,path,children::isNotEmpty]&paging=true&query=${query}&withinUserSearchHierarchy=true&pageSize=15`);
|
|
3981
|
-
setSearchData((searchResponse.data || {})['organisationUnits']);
|
|
3982
|
-
setSearchLoading(false);
|
|
3983
|
-
}
|
|
3984
|
-
catch (e) {
|
|
3985
|
-
setSearchLoading(false);
|
|
3986
|
-
}
|
|
3987
|
-
};
|
|
3988
|
-
const debouncedSearch = useCallback(debounce((value) => {
|
|
3989
|
-
handleOrgUnitSearch(value);
|
|
3990
|
-
}, 500), []);
|
|
3991
|
-
const handleFilterChange = (event) => {
|
|
3992
|
-
setSearchText(event.value);
|
|
3993
|
-
debouncedSearch(event.value);
|
|
3994
|
-
};
|
|
3995
|
-
const ready = useMemo(() => {
|
|
3996
|
-
return searchText?.length ? !searchLoading : !loading;
|
|
3997
|
-
}, [searchText, searchLoading, loading]);
|
|
3998
|
-
const renderOrgUnitTree = () => {
|
|
3999
|
-
if (searchText && searchText?.length > 0) {
|
|
4000
|
-
if (searchLoading) {
|
|
4001
|
-
return (React__default.createElement("div", { className: classes.orgUnitTreeLoader },
|
|
4002
|
-
React__default.createElement(CircularLoader$1, { small: true })));
|
|
4003
|
-
}
|
|
4004
|
-
return (ready && (React__default.createElement(OrganisationUnitTree, { key: `${key}-search`, roots: searchData?.map((orgUnit) => orgUnit.id) || [], singleSelection: true, expanded: expanded, handleExpand: handleExpand, handleCollapse: handleCollapse, selected: highlighted, onChange: (event) => {
|
|
4005
|
-
setSelectedOrgUnit(event);
|
|
4006
|
-
setShowOrgUnitTree(false);
|
|
4007
|
-
onSelectOrgUnit(event);
|
|
4008
|
-
} })));
|
|
4009
|
-
}
|
|
4010
|
-
return (React__default.createElement(OrganisationUnitTree, { key: key, roots: rootOrgUnits?.map((orgUnit) => orgUnit.id) || [], singleSelection: true, expanded: expanded, handleExpand: handleExpand, handleCollapse: handleCollapse, selected: highlighted, onChange: (event) => {
|
|
4011
|
-
setSelectedOrgUnit(event);
|
|
4012
|
-
setShowOrgUnitTree(false);
|
|
4013
|
-
onSelectOrgUnit(event);
|
|
4014
|
-
} }));
|
|
4015
|
-
};
|
|
4016
|
-
const handleBlur = () => {
|
|
4017
|
-
// onBlur && onBlur(null);
|
|
4018
|
-
};
|
|
4019
|
-
return (config && (React__default.createElement(Provider, { config: config, plugin: false, parentAlertsAdd: undefined, showAlertsInPlugin: false },
|
|
4020
|
-
React__default.createElement("div", null,
|
|
4021
|
-
label && (React__default.createElement("div", { className: classes.orgUnitFieldLabel },
|
|
4022
|
-
React__default.createElement("span", null, label),
|
|
4023
|
-
required ? (React__default.createElement("span", { className: classes.orgUnitFieldRequiredLabel }, "*")) : (React__default.createElement(React__default.Fragment, null)))),
|
|
4024
|
-
!showOrgUnitTree ? (selectedOrgUnit ? (React__default.createElement(React__default.Fragment, null,
|
|
4025
|
-
React__default.createElement(Tooltip, { content: selectedOrgUnitLabel },
|
|
4026
|
-
React__default.createElement(Chip, { onRemove: () => {
|
|
4027
|
-
setShowOrgUnitTree(true);
|
|
4028
|
-
} }, selectedOrgUnit.displayName)))) : (React__default.createElement("div", { className: classes.orgUnitTreeLoader },
|
|
4029
|
-
React__default.createElement(CircularLoader$1, { small: true })))) : (React__default.createElement("div", { className: classes.container },
|
|
4030
|
-
React__default.createElement("div", { className: classes.debounceFieldContainer },
|
|
4031
|
-
React__default.createElement(InputField$1, { placeholder: "Search", value: searchText, disabled: disabled, onChange: handleFilterChange })),
|
|
4032
|
-
loading ? (React__default.createElement("div", { className: classes.orgUnitTreeLoader },
|
|
4033
|
-
React__default.createElement(CircularLoader$1, { small: true }))) : (React__default.createElement("div", { className: classes.orgUnitTreeContainer, style: { maxHeight: '200px', overflowY: 'auto' } }, renderOrgUnitTree()))))))));
|
|
4034
|
-
};
|
|
4035
|
-
|
|
4036
4076
|
// src/app/line-list-table.component.ts
|
|
4037
4077
|
class LineListTableComponent extends ReactWrapperModule {
|
|
4038
4078
|
constructor() {
|
|
4039
4079
|
super(...arguments);
|
|
4080
|
+
this.actionOptionOrientation = 'DROPDOWN';
|
|
4040
4081
|
this.dispatchTeis = false;
|
|
4041
4082
|
this.actionSelected = new EventEmitter();
|
|
4042
4083
|
this.reactStateUpdaters = null;
|
|
@@ -4096,127 +4137,6 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
4096
4137
|
useEffect(() => {
|
|
4097
4138
|
this.setReactStateUpdaters?.(updateRefs.current);
|
|
4098
4139
|
}, []);
|
|
4099
|
-
// TODO: START: Improve the approach of handling observables
|
|
4100
|
-
// useEffect(() => {
|
|
4101
|
-
// setLoading(true);
|
|
4102
|
-
// this.lineListService
|
|
4103
|
-
// .getLineListData(
|
|
4104
|
-
// this.programId,
|
|
4105
|
-
// orgUnitState,
|
|
4106
|
-
// this.programStageId,
|
|
4107
|
-
// pager.page,
|
|
4108
|
-
// pager.pageSize,
|
|
4109
|
-
// attributeFiltersState,
|
|
4110
|
-
// startDateState,
|
|
4111
|
-
// endDateState,
|
|
4112
|
-
// this.ouMode,
|
|
4113
|
-
// this.filterRootOrgUnit,
|
|
4114
|
-
// this.useOuModeWithOlderDHIS2Instance
|
|
4115
|
-
// )
|
|
4116
|
-
// .subscribe((response: LineListResponse) => {
|
|
4117
|
-
// let entityColumns: ColumnDefinition[] = [];
|
|
4118
|
-
// let responsePager: Pager;
|
|
4119
|
-
// let entityData: TableRow[] = [];
|
|
4120
|
-
// let filteredDataColumns: ColumnDefinition[] = [];
|
|
4121
|
-
// if (this.programStageId) {
|
|
4122
|
-
// responsePager = (response.data as EventsResponse).pager;
|
|
4123
|
-
// const { columns, data } = getProgramStageData(
|
|
4124
|
-
// response,
|
|
4125
|
-
// this.programStageId,
|
|
4126
|
-
// pager,
|
|
4127
|
-
// this.isOptionSetNameVisible
|
|
4128
|
-
// );
|
|
4129
|
-
// entityColumns = columns;
|
|
4130
|
-
// entityData = data;
|
|
4131
|
-
// } else if (
|
|
4132
|
-
// 'trackedEntities' in response.data ||
|
|
4133
|
-
// 'instances' in response.data
|
|
4134
|
-
// ) {
|
|
4135
|
-
// const responseData: any = response.data as TrackedEntityResponse;
|
|
4136
|
-
// responsePager = (response.data as TrackedEntityResponse).pager || {
|
|
4137
|
-
// page: responseData.page,
|
|
4138
|
-
// pageSize: responseData.pageSize,
|
|
4139
|
-
// total: responseData.total,
|
|
4140
|
-
// pageCount: responseData.pageCount,
|
|
4141
|
-
// };
|
|
4142
|
-
// const { columns, data, filteredEntityColumns } =
|
|
4143
|
-
// getTrackedEntityData(
|
|
4144
|
-
// response,
|
|
4145
|
-
// this.programId,
|
|
4146
|
-
// pager,
|
|
4147
|
-
// this.isOptionSetNameVisible,
|
|
4148
|
-
// this.filters
|
|
4149
|
-
// );
|
|
4150
|
-
// entityColumns = columns;
|
|
4151
|
-
// entityData = data;
|
|
4152
|
-
// //TODO: Should be done on the parent
|
|
4153
|
-
// const checkValues = [
|
|
4154
|
-
// ...new Set(
|
|
4155
|
-
// (
|
|
4156
|
-
// response.data as TrackedEntityResponse
|
|
4157
|
-
// )?.trackedEntities?.[0]?.enrollments?.[0]?.events?.flatMap(
|
|
4158
|
-
// (event) =>
|
|
4159
|
-
// event.dataValues
|
|
4160
|
-
// .filter((dataValue) =>
|
|
4161
|
-
// /^[A-Za-z]{3}$/.test(dataValue.value)
|
|
4162
|
-
// )
|
|
4163
|
-
// .map((dataValue) => dataValue.value)
|
|
4164
|
-
// ) ??
|
|
4165
|
-
// (
|
|
4166
|
-
// response.data as TrackedEntityResponse
|
|
4167
|
-
// )?.instances?.[0]?.enrollments?.[0]?.events?.flatMap(
|
|
4168
|
-
// (event) =>
|
|
4169
|
-
// event.dataValues
|
|
4170
|
-
// .filter((dataValue) =>
|
|
4171
|
-
// /^[A-Za-z]{3}$/.test(dataValue.value)
|
|
4172
|
-
// )
|
|
4173
|
-
// .map((dataValue) => dataValue.value)
|
|
4174
|
-
// )
|
|
4175
|
-
// ),
|
|
4176
|
-
// ];
|
|
4177
|
-
// if (checkValues) {
|
|
4178
|
-
// // this.firstValue.emit(firstTei);
|
|
4179
|
-
// setCheckValue(checkValues);
|
|
4180
|
-
// setValuesMatch(!checkValues.includes(this.buttonFilter));
|
|
4181
|
-
// }
|
|
4182
|
-
// // setFilteredColumns(filteredEntityColumns);
|
|
4183
|
-
// // Ensure filter inputs do not disappear when no data is returned
|
|
4184
|
-
// // If filteredEntityColumns is empty, keep the previous columns instead of clearing them
|
|
4185
|
-
// setFilteredColumns((prev) =>
|
|
4186
|
-
// filteredEntityColumns.length > 0 ? filteredEntityColumns : prev
|
|
4187
|
-
// );
|
|
4188
|
-
// filteredDataColumns = filteredEntityColumns;
|
|
4189
|
-
// } else {
|
|
4190
|
-
// responsePager = (response.data as EventsResponse).pager;
|
|
4191
|
-
// const { columns, data } = getEventData(
|
|
4192
|
-
// response,
|
|
4193
|
-
// pager,
|
|
4194
|
-
// this.isOptionSetNameVisible
|
|
4195
|
-
// );
|
|
4196
|
-
// entityColumns = columns;
|
|
4197
|
-
// entityData = data;
|
|
4198
|
-
// }
|
|
4199
|
-
// const finalColumns: ColumnDefinition[] = addActionsColumn(
|
|
4200
|
-
// [{ label: '#', key: 'index' }, ...entityColumns],
|
|
4201
|
-
// this.actionOptions
|
|
4202
|
-
// );
|
|
4203
|
-
// setLoading(false);
|
|
4204
|
-
// setColumns(...[finalColumns]);
|
|
4205
|
-
// setData(...[entityData]);
|
|
4206
|
-
// setPager(...[responsePager]);
|
|
4207
|
-
// });
|
|
4208
|
-
// }, [
|
|
4209
|
-
// programIdState,
|
|
4210
|
-
// orgUnitState,
|
|
4211
|
-
// programStageIdState,
|
|
4212
|
-
// attributeFiltersState,
|
|
4213
|
-
// startDateState,
|
|
4214
|
-
// endDateState,
|
|
4215
|
-
// pager.page,
|
|
4216
|
-
// pager.pageSize,
|
|
4217
|
-
// isOptionSetNameVisibleState,
|
|
4218
|
-
// ]);
|
|
4219
|
-
// TODO: END: Improve the approach of handling observables
|
|
4220
4140
|
useEffect(() => {
|
|
4221
4141
|
setLoading(true);
|
|
4222
4142
|
const subscription = this.lineListService
|
|
@@ -4233,8 +4153,8 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
4233
4153
|
entityColumns = columns;
|
|
4234
4154
|
entityData = data;
|
|
4235
4155
|
}
|
|
4236
|
-
else if (
|
|
4237
|
-
|
|
4156
|
+
else if ('trackedEntities' in response.data ||
|
|
4157
|
+
'instances' in response.data) {
|
|
4238
4158
|
const responseData = response.data;
|
|
4239
4159
|
responsePager = responseData.pager || {
|
|
4240
4160
|
page: responseData.page,
|
|
@@ -4266,7 +4186,7 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
4266
4186
|
entityColumns = columns;
|
|
4267
4187
|
entityData = data;
|
|
4268
4188
|
}
|
|
4269
|
-
const finalColumns = addActionsColumn([{ label:
|
|
4189
|
+
const finalColumns = addActionsColumn([{ label: '#', key: 'index' }, ...entityColumns], this.actionOptions);
|
|
4270
4190
|
setLoading(false);
|
|
4271
4191
|
setColumns(finalColumns);
|
|
4272
4192
|
setData(entityData);
|
|
@@ -4286,68 +4206,14 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
4286
4206
|
pager.pageSize,
|
|
4287
4207
|
isOptionSetNameVisibleState,
|
|
4288
4208
|
]);
|
|
4289
|
-
const getDropdownOptions = (row) => {
|
|
4290
|
-
return (this.actionOptions || []).map((option) => ({
|
|
4291
|
-
...option,
|
|
4292
|
-
onClick: () => {
|
|
4293
|
-
option.onClick?.(row);
|
|
4294
|
-
this.actionSelected.emit({ action: option.label, row });
|
|
4295
|
-
},
|
|
4296
|
-
}));
|
|
4297
|
-
};
|
|
4298
|
-
// TODO: START::: Improve the approach on handling observables
|
|
4299
|
-
// const handleApprovalClick = () => {
|
|
4300
|
-
// setIsButtonLoading(true);
|
|
4301
|
-
// this.lineListService
|
|
4302
|
-
// .getLineListData(
|
|
4303
|
-
// this.programId,
|
|
4304
|
-
// this.orgUnit,
|
|
4305
|
-
// this.programStageId,
|
|
4306
|
-
// pager.page,
|
|
4307
|
-
// 1000,
|
|
4308
|
-
// this.attributeFilters,
|
|
4309
|
-
// this.startDate,
|
|
4310
|
-
// this.endDate,
|
|
4311
|
-
// this.ouMode
|
|
4312
|
-
// )
|
|
4313
|
-
// .subscribe((response: LineListResponse) => {
|
|
4314
|
-
// if (
|
|
4315
|
-
// 'trackedEntities' in response.data ||
|
|
4316
|
-
// 'instances' in response.data
|
|
4317
|
-
// ) {
|
|
4318
|
-
// const trackedEntityInstances = (
|
|
4319
|
-
// response.data as TrackedEntityResponse
|
|
4320
|
-
// ).trackedEntities;
|
|
4321
|
-
// // Map TEIs to objects with teiId and enrollmentId
|
|
4322
|
-
// const teiEnrollmentList = trackedEntityInstances
|
|
4323
|
-
// .map((tei) => {
|
|
4324
|
-
// // Find the enrollment where program matches this.programId
|
|
4325
|
-
// const matchingEnrollment = tei.enrollments?.find(
|
|
4326
|
-
// (enrollment) => enrollment.program === this.programId
|
|
4327
|
-
// );
|
|
4328
|
-
// // Return object with teiId and enrollmentId (if found)
|
|
4329
|
-
// return matchingEnrollment
|
|
4330
|
-
// ? {
|
|
4331
|
-
// teiId: tei.trackedEntity,
|
|
4332
|
-
// enrollmentId: matchingEnrollment.enrollment,
|
|
4333
|
-
// }
|
|
4334
|
-
// : null;
|
|
4335
|
-
// })
|
|
4336
|
-
// .filter((item) => item !== null); // Remove null entries (no matching enrollment)
|
|
4337
|
-
// this.approvalSelected.emit(teiEnrollmentList);
|
|
4338
|
-
// } else {
|
|
4339
|
-
// this.approvalSelected.emit([]); // Emit empty array if no TEIs
|
|
4340
|
-
// }
|
|
4341
|
-
// });
|
|
4342
|
-
// };
|
|
4343
|
-
// TODO: END::: Improve the approach on handling observables
|
|
4344
4209
|
const handleApprovalClick = () => {
|
|
4345
4210
|
setIsButtonLoading(true);
|
|
4346
4211
|
const subscription = this.lineListService
|
|
4347
4212
|
.getLineListData(this.programId, this.orgUnit, this.programStageId, pager.page, 1000, this.attributeFilters, this.startDate, this.endDate, this.ouMode)
|
|
4348
4213
|
.pipe(take(1)) // Ensures the observable emits only once
|
|
4349
4214
|
.subscribe((response) => {
|
|
4350
|
-
if (
|
|
4215
|
+
if ('trackedEntities' in response.data ||
|
|
4216
|
+
'instances' in response.data) {
|
|
4351
4217
|
const trackedEntityInstances = response.data.trackedEntities;
|
|
4352
4218
|
// Map TEIs to objects with teiId and enrollmentId
|
|
4353
4219
|
const teiEnrollmentList = trackedEntityInstances
|
|
@@ -4415,15 +4281,7 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
4415
4281
|
React__default.createElement(Modal$1, { hide: hide },
|
|
4416
4282
|
React__default.createElement(ModalTitle$1, null, "Select organization unit"),
|
|
4417
4283
|
React__default.createElement(ModalContent$1, null,
|
|
4418
|
-
React__default.createElement(OrgUnitFormField$1
|
|
4419
|
-
// label="Select organization unit"
|
|
4420
|
-
, {
|
|
4421
|
-
// label="Select organization unit"
|
|
4422
|
-
key: selectedOrgUnit, onSelectOrgUnit: (selectedOrgUnit) => {
|
|
4423
|
-
// console.log(
|
|
4424
|
-
// 'this is the selected org unit key',
|
|
4425
|
-
// selectedOrgUnit
|
|
4426
|
-
// );
|
|
4284
|
+
React__default.createElement(OrgUnitFormField$1, { key: selectedOrgUnit, onSelectOrgUnit: (selectedOrgUnit) => {
|
|
4427
4285
|
setSelectedOrgUnit(selectedOrgUnit.displayName);
|
|
4428
4286
|
setOrgUnitState(selectedOrgUnit.id);
|
|
4429
4287
|
setHide(true);
|
|
@@ -4434,17 +4292,18 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
4434
4292
|
this.showFilters && (React__default.createElement(DataTableToolbar, { className: "table-top-toolbar" },
|
|
4435
4293
|
React__default.createElement("div", { style: {
|
|
4436
4294
|
display: 'flex',
|
|
4295
|
+
alignItems: 'center',
|
|
4437
4296
|
gap: '10px',
|
|
4438
4297
|
flexWrap: 'wrap',
|
|
4439
4298
|
} },
|
|
4440
|
-
React__default.createElement(InputField$1, { key: "location", label: "
|
|
4441
|
-
React__default.createElement(CalendarInput, { label: "Start
|
|
4299
|
+
React__default.createElement(InputField$1, { key: "location", label: "Registraring unit:", value: selectedOrgUnit, clearable: true, onFocus: () => setHide(false), className: "custom-input" }),
|
|
4300
|
+
React__default.createElement(CalendarInput, { label: "Start date:", calendar: "gregory", locale: "en-GB", timeZone: "Africa/Dar_es_Salaam", className: "custom-input", date: startDateState, onDateSelect: (selectedDate) => {
|
|
4442
4301
|
setStartDateState(selectedDate.calendarDateString);
|
|
4443
4302
|
} }),
|
|
4444
|
-
React__default.createElement(CalendarInput, { label: "End
|
|
4303
|
+
React__default.createElement(CalendarInput, { label: "End date:", calendar: "gregory", locale: "en-GB", timeZone: "Africa/Dar_es_Salaam", className: "custom-input", date: endDateState, onDateSelect: (selectedDate) => {
|
|
4445
4304
|
setEndDateState(selectedDate.calendarDateString);
|
|
4446
4305
|
} }),
|
|
4447
|
-
(visibleFilters ?? []).map(({ label, key }) => (React__default.createElement(InputField$1, { key: key, label: `${label}:`, className: "custom-input", value: inputValues[key] || '', onChange: (e) => {
|
|
4306
|
+
(visibleFilters ?? []).map(({ label, key }) => (React__default.createElement(InputField$1, { key: key, label: `${label}:`, className: "custom-input", value: inputValues[key] || '', clearable: true, onChange: (e) => {
|
|
4448
4307
|
if ('target' in e && e.target) {
|
|
4449
4308
|
setInputValues((prevValues) => ({
|
|
4450
4309
|
...prevValues,
|
|
@@ -4468,12 +4327,22 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
4468
4327
|
}
|
|
4469
4328
|
handleInputChange(key, currentValue);
|
|
4470
4329
|
} }))),
|
|
4471
|
-
React__default.createElement(Button$1, { onClick: () => setShowAllFilters(!showAllFilters)
|
|
4330
|
+
React__default.createElement(Button$1, { onClick: () => setShowAllFilters(!showAllFilters) }, showAllFilters ? 'Less Filters' : 'More Filters')))),
|
|
4472
4331
|
React__default.createElement(DataTable, null,
|
|
4473
4332
|
React__default.createElement(TableHead, null,
|
|
4474
4333
|
React__default.createElement(DataTableRow, null, columns.map((col) => (React__default.createElement(DataTableColumnHeader, { key: col.key }, col.label))))),
|
|
4475
|
-
React__default.createElement(TableBody, null, data.length > 0 ? (data.map((row) => (React__default.createElement(DataTableRow, { key: row.index }, columns.map((col) => (React__default.createElement(DataTableCell, { key: col.key }, col.key === 'actions'
|
|
4476
|
-
|
|
4334
|
+
React__default.createElement(TableBody, null, data.length > 0 ? (data.map((row) => (React__default.createElement(DataTableRow, { key: row.index }, columns.map((col) => (React__default.createElement(DataTableCell, { key: col.key }, col.key === 'actions'
|
|
4335
|
+
? this.actionOptions && (React__default.createElement(DataTableActions, { actionOptions: this.actionOptions, actionOptionOrientation: this.actionOptionOrientation, onClick: (option) => {
|
|
4336
|
+
if (option.onClick) {
|
|
4337
|
+
option.onClick(row);
|
|
4338
|
+
}
|
|
4339
|
+
this.actionSelected.emit({
|
|
4340
|
+
action: option.label,
|
|
4341
|
+
row,
|
|
4342
|
+
});
|
|
4343
|
+
} }))
|
|
4344
|
+
: row[col.key] || '--' // Display '--' if value is undefined or null
|
|
4345
|
+
))))))) : (React__default.createElement(DataTableRow, null,
|
|
4477
4346
|
React__default.createElement(DataTableCell, { colSpan: columns.length?.toString(), style: {
|
|
4478
4347
|
textAlign: 'center',
|
|
4479
4348
|
fontWeight: 'bold',
|
|
@@ -4530,11 +4399,11 @@ class LineListTableComponent extends ReactWrapperModule {
|
|
|
4530
4399
|
this.render();
|
|
4531
4400
|
}
|
|
4532
4401
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LineListTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
4533
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.8", type: LineListTableComponent, isStandalone: false, selector: "ng-dhis2-ui-line-list", inputs: { programId: "programId", orgUnit: "orgUnit", programStageId: "programStageId", actionOptions: "actionOptions", attributeFilters: "attributeFilters", useOuModeWithOlderDHIS2Instance: "useOuModeWithOlderDHIS2Instance", startDate: "startDate", endDate: "endDate", filters: "filters", ouMode: "ouMode", dispatchTeis: "dispatchTeis", isButtonLoading: "isButtonLoading", buttonLabel: "buttonLabel", buttonFilter: "buttonFilter", filterRootOrgUnit: "filterRootOrgUnit", showFilters: "showFilters", isOptionSetNameVisible: "isOptionSetNameVisible" }, outputs: { actionSelected: "actionSelected", approvalSelected: "approvalSelected", firstValue: "firstValue" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: ["::ng-deep .custom-input{display:flex!important;gap:4px!important;align-items:center!important;border:1px solid #
|
|
4402
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.8", type: LineListTableComponent, isStandalone: false, selector: "ng-dhis2-ui-line-list", inputs: { programId: "programId", orgUnit: "orgUnit", programStageId: "programStageId", actionOptions: "actionOptions", actionOptionOrientation: "actionOptionOrientation", attributeFilters: "attributeFilters", useOuModeWithOlderDHIS2Instance: "useOuModeWithOlderDHIS2Instance", startDate: "startDate", endDate: "endDate", filters: "filters", ouMode: "ouMode", dispatchTeis: "dispatchTeis", isButtonLoading: "isButtonLoading", buttonLabel: "buttonLabel", buttonFilter: "buttonFilter", filterRootOrgUnit: "filterRootOrgUnit", showFilters: "showFilters", isOptionSetNameVisible: "isOptionSetNameVisible" }, outputs: { actionSelected: "actionSelected", approvalSelected: "approvalSelected", firstValue: "firstValue" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: ["::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 label{color:gray!important;opacity:1}::ng-deep .table-top-toolbar{background-color:var(--colors-grey100)!important;color:var(--colors-grey900)!important}\n"] }); }
|
|
4534
4403
|
}
|
|
4535
4404
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImport: i0, type: LineListTableComponent, decorators: [{
|
|
4536
4405
|
type: Component,
|
|
4537
|
-
args: [{ selector: 'ng-dhis2-ui-line-list', template: '<ng-content></ng-content>', standalone: false, styles: ["::ng-deep .custom-input{display:flex!important;gap:4px!important;align-items:center!important;border:1px solid #
|
|
4406
|
+
args: [{ selector: 'ng-dhis2-ui-line-list', template: '<ng-content></ng-content>', standalone: false, styles: ["::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 label{color:gray!important;opacity:1}::ng-deep .table-top-toolbar{background-color:var(--colors-grey100)!important;color:var(--colors-grey900)!important}\n"] }]
|
|
4538
4407
|
}], propDecorators: { programId: [{
|
|
4539
4408
|
type: Input
|
|
4540
4409
|
}], orgUnit: [{
|
|
@@ -4543,6 +4412,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
|
|
|
4543
4412
|
type: Input
|
|
4544
4413
|
}], actionOptions: [{
|
|
4545
4414
|
type: Input
|
|
4415
|
+
}], actionOptionOrientation: [{
|
|
4416
|
+
type: Input
|
|
4546
4417
|
}], attributeFilters: [{
|
|
4547
4418
|
type: Input
|
|
4548
4419
|
}], useOuModeWithOlderDHIS2Instance: [{
|
|
@@ -4592,6 +4463,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.8", ngImpor
|
|
|
4592
4463
|
}]
|
|
4593
4464
|
}] });
|
|
4594
4465
|
|
|
4466
|
+
// Copyright 2025 UDSM DHIS2 Lab. All rights reserved.
|
|
4467
|
+
// Use of this source code is governed by a BSD-style
|
|
4468
|
+
// license that can be found in the LICENSE file.
|
|
4469
|
+
|
|
4470
|
+
// Copyright 2025 UDSM DHIS2 Lab. All rights reserved.
|
|
4471
|
+
// Use of this source code is governed by a BSD-style
|
|
4472
|
+
// license that can be found in the LICENSE file.
|
|
4473
|
+
|
|
4595
4474
|
const dropdownStyles = {
|
|
4596
4475
|
layer: {
|
|
4597
4476
|
zIndex: '1 !important',
|