项目作者: hisptz

项目描述 :
Container for DHIS2 selection filters .i.e. Data, Period, Organisation uni and other based on angular 6+
高级语言: TypeScript
项目地址: git://github.com/hisptz/ngx-dhis2-selection-filters.git
创建时间: 2019-04-19T10:17:42Z
项目社区:https://github.com/hisptz/ngx-dhis2-selection-filters

开源协议:GNU Lesser General Public License v3.0

下载


DHIS2 Selection Filters Library

Build Status
Greenkeeper badge
Maintainability
Test Coverage
dependencies Status
devDependencies Status
Commitizen friendly

Container for DHIS2 selection filters .i.e. Data, Period, Organisation uni and other based on angular 6+

Installation

npm i @iapps/ngx-dhis2-selection-filters

Usage

If the module is to be imported in the app.module or any other feature module, then import as

import { NgxDhis2SelectionFiltersModule } from '@iapps/ngx-dhis2-selection-filters';

then add this in the imports

  1. imports: [
  2. ...
  3. NgxDhis2SelectionFiltersModule,
  4. ...
  5. ]

Once imported, dhis2 selection filters can be called in as

  1. <ngx-dhis2-selection-filters
  2. (filterUpdate)="onFilterUpdateAction($event)"
  3. [dataSelections]="dataSelections"
  4. [selectionFilterConfig]="selectionFilterConfig">
  5. </ngx-dhis2-selection-filters>

Inputs

Input Description
dataSelections This is a list of selected dimensions data, period organisation collectively
selectionFilterConfig This when passed overrides default configuration for the selection filters

Input models

dataSelections, List as based on the following model

Item Description
dimension Specify dimension type eg pe, ou, dx etc
items List of selected items based on dimension

orgUnitFilterConfig

Item Description Default value
showDataFilter Specify whether to show or hide data(dx) selection filter true
showPeriodFilter (optional) Specify whether to show or hide period(pe) selection filter true
showOrgUnitFilter (optional) Specify whether to show or hide organisation unit(ou) selection filter none
showLayout (optional) Specify whether to show or hide layout selection filter false
showDynamicDimension (optional) Specify whether to show or hide dynamic dimension selection filter true
orgUnitFilterConfig Org unit filter configurations, @iapps/ngx-dhis2-org-unit-filter">Read more

Outputs

Output Description
filterUpdate This emitted data selection as based on what has been updated

Selection Filter Component Output

  1. [
  2. {
  3. "dimension": "ou",
  4. "items": [
  5. {
  6. "id": "PMa2VCrupOd",
  7. "name": "Kambia",
  8. "level": 2,
  9. "type": "ORGANISATION_UNIT"
  10. },
  11. {
  12. "id": "at6UHUQatSo",
  13. "name": "Western Area",
  14. "level": 2,
  15. "type": "ORGANISATION_UNIT"
  16. },
  17. {
  18. "id": "TEQlaapDQoK",
  19. "name": "Port Loko",
  20. "level": 2,
  21. "type": "ORGANISATION_UNIT"
  22. }
  23. ]
  24. },
  25. {
  26. "dimension": "dx",
  27. "items": [
  28. {
  29. "id": "PMa2VCewpOd",
  30. "name": "ANC Coverage",
  31. "type": "INDICATOR"
  32. }
  33. ]
  34. }, {
  35. "dimension": "pe",
  36. "items": [
  37. {
  38. "id": "LAST_YEAR",
  39. "name": "Last year",
  40. "type": "RelativeYearly"
  41. }
  42. ]
  43. },
  44. {
  45. "dimension": "vrg",
  46. "items": [
  47. {
  48. "name": "ANC",
  49. "id": "UPxlctvalPn"
  50. }
  51. ],
  52. "periodType": {
  53. "id": "Monthly",
  54. "name": "Monthly",
  55. "rank": 3
  56. },
  57. "changed": true,
  58. "layout": "filters"
  59. }
  60. ]

LICENCE

GitHub