@iapps/ng-dhis2-ui 1.0.1 → 1.0.3

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.
Files changed (106) hide show
  1. package/esm2022/index.mjs +4 -1
  2. package/esm2022/lib/modules/button/button.component.mjs +2 -2
  3. package/esm2022/lib/modules/header-bar/header-bar.component.mjs +7 -8
  4. package/esm2022/lib/modules/organisation-unit-selector/components/OrgUnitDimension.mjs +212 -0
  5. package/esm2022/lib/modules/organisation-unit-selector/components/index.mjs +6 -0
  6. package/esm2022/lib/modules/organisation-unit-selector/components/styles/OrgUnitDimension.style.mjs +83 -0
  7. package/esm2022/lib/modules/organisation-unit-selector/components/utils/index.mjs +6 -0
  8. package/esm2022/lib/modules/organisation-unit-selector/components/utils/ouIdHelper/index.mjs +18 -0
  9. package/esm2022/lib/modules/organisation-unit-selector/components/utils/ouLevelUtils/index.mjs +27 -0
  10. package/esm2022/lib/modules/organisation-unit-selector/index.mjs +6 -0
  11. package/esm2022/lib/modules/organisation-unit-selector/models/index.mjs +5 -0
  12. package/esm2022/lib/modules/organisation-unit-selector/models/organisation-unit-config.model.mjs +16 -0
  13. package/esm2022/lib/modules/organisation-unit-selector/organisation-unit-selector.component.mjs +78 -0
  14. package/esm2022/lib/modules/organisation-unit-selector/organisation-unit-selector.module.mjs +19 -0
  15. package/esm2022/lib/modules/period-selector/components/FixedPeriodFilter.mjs +44 -0
  16. package/esm2022/lib/modules/period-selector/components/PeriodDimension.mjs +41 -0
  17. package/esm2022/lib/modules/period-selector/components/PeriodTransfer.mjs +110 -0
  18. package/esm2022/lib/modules/period-selector/components/RelativePeriodFilter.mjs +28 -0
  19. package/esm2022/lib/modules/period-selector/components/utils/fixedPeriods.mjs +308 -0
  20. package/esm2022/lib/modules/period-selector/components/utils/index.mjs +5 -0
  21. package/esm2022/lib/modules/period-selector/components/utils/periodTypes.mjs +23 -0
  22. package/esm2022/lib/modules/period-selector/components/utils/relativePeriods.mjs +139 -0
  23. package/esm2022/lib/modules/period-selector/index.mjs +6 -0
  24. package/esm2022/lib/modules/period-selector/period-selector.component.mjs +66 -0
  25. package/esm2022/lib/modules/period-selector/period-selector.module.mjs +19 -0
  26. package/esm2022/lib/modules/react-wrapper/index.mjs +6 -0
  27. package/esm2022/lib/modules/react-wrapper/react-wrapper.component.mjs +53 -0
  28. package/esm2022/lib/modules/react-wrapper/react-wrapper.module.mjs +18 -0
  29. package/esm2022/lib/shared/assets/AssignedCategoriesIcon.mjs +12 -0
  30. package/esm2022/lib/shared/assets/DimensionItemIcons/PeriodIcon.mjs +4 -0
  31. package/esm2022/lib/shared/components/TransferOption.mjs +130 -0
  32. package/esm2022/lib/shared/components/index.mjs +2 -3
  33. package/esm2022/lib/shared/index.mjs +7 -0
  34. package/esm2022/lib/shared/styles/DimensionSelector.style.mjs +39 -0
  35. package/esm2022/lib/shared/styles/index.mjs +5 -0
  36. package/esm2022/lib/shared/utils/axis.mjs +25 -0
  37. package/esm2022/lib/shared/utils/axisGetDimension.mjs +5 -0
  38. package/esm2022/lib/shared/utils/axisHasDimension.mjs +3 -0
  39. package/esm2022/lib/shared/utils/dimension.mjs +52 -0
  40. package/esm2022/lib/shared/utils/dimensionGetItems.mjs +6 -0
  41. package/esm2022/lib/shared/utils/dimensionIs.mjs +3 -0
  42. package/esm2022/lib/shared/utils/dimensionIsEmpty.mjs +5 -0
  43. package/esm2022/lib/shared/utils/dimensionIsValid.mjs +16 -0
  44. package/esm2022/lib/shared/utils/dimensionSelectorHelper.mjs +4 -0
  45. package/esm2022/lib/shared/utils/index.mjs +15 -0
  46. package/esm2022/lib/shared/utils/layoutGetAllAxes.mjs +7 -0
  47. package/esm2022/lib/shared/utils/layoutGetAllDimensions.mjs +6 -0
  48. package/esm2022/lib/shared/utils/layoutGetDimension.mjs +4 -0
  49. package/esm2022/lib/shared/utils/layoutReplaceDimension.mjs +17 -0
  50. package/esm2022/lib/shared/utils/list.mjs +15 -0
  51. package/esm2022/lib/shared/utils/predefinedDimensions.mjs +45 -0
  52. package/fesm2022/iapps-ng-dhis2-ui.mjs +1652 -77
  53. package/fesm2022/iapps-ng-dhis2-ui.mjs.map +1 -1
  54. package/index.d.ts +3 -0
  55. package/lib/modules/button/button.component.d.ts +1 -1
  56. package/lib/modules/header-bar/header-bar.component.d.ts +1 -4
  57. package/lib/modules/organisation-unit-selector/components/OrgUnitDimension.d.ts +26 -0
  58. package/lib/modules/organisation-unit-selector/components/index.d.ts +2 -0
  59. package/lib/modules/organisation-unit-selector/components/styles/OrgUnitDimension.style.d.ts +1 -0
  60. package/lib/modules/organisation-unit-selector/components/utils/index.d.ts +2 -0
  61. package/lib/modules/organisation-unit-selector/components/utils/ouIdHelper/index.d.ts +10 -0
  62. package/lib/modules/organisation-unit-selector/components/utils/ouLevelUtils/index.d.ts +1 -0
  63. package/lib/modules/organisation-unit-selector/index.d.ts +2 -0
  64. package/lib/modules/organisation-unit-selector/models/index.d.ts +1 -0
  65. package/lib/modules/organisation-unit-selector/models/organisation-unit-config.model.d.ts +12 -0
  66. package/lib/modules/organisation-unit-selector/organisation-unit-selector.component.d.ts +26 -0
  67. package/lib/modules/organisation-unit-selector/organisation-unit-selector.module.d.ts +9 -0
  68. package/lib/modules/period-selector/components/FixedPeriodFilter.d.ts +18 -0
  69. package/lib/modules/period-selector/components/PeriodDimension.d.ts +15 -0
  70. package/lib/modules/period-selector/components/PeriodTransfer.d.ts +28 -0
  71. package/lib/modules/period-selector/components/RelativePeriodFilter.d.ts +11 -0
  72. package/lib/modules/period-selector/components/utils/fixedPeriods.d.ts +17 -0
  73. package/lib/modules/period-selector/components/utils/index.d.ts +4 -0
  74. package/lib/modules/period-selector/components/utils/periodTypes.d.ts +19 -0
  75. package/lib/modules/period-selector/components/utils/relativePeriods.d.ts +17 -0
  76. package/lib/modules/period-selector/index.d.ts +2 -0
  77. package/lib/modules/period-selector/period-selector.component.d.ts +21 -0
  78. package/lib/modules/period-selector/period-selector.module.d.ts +9 -0
  79. package/lib/modules/react-wrapper/index.d.ts +2 -0
  80. package/lib/modules/react-wrapper/react-wrapper.module.d.ts +8 -0
  81. package/lib/shared/assets/AssignedCategoriesIcon.d.ts +2 -0
  82. package/lib/shared/assets/DimensionItemIcons/PeriodIcon.d.ts +3 -0
  83. package/lib/shared/components/TransferOption.d.ts +19 -0
  84. package/lib/shared/components/index.d.ts +1 -2
  85. package/lib/shared/index.d.ts +3 -0
  86. package/lib/shared/styles/DimensionSelector.style.d.ts +2 -0
  87. package/lib/shared/styles/index.d.ts +1 -0
  88. package/lib/shared/utils/axis.d.ts +11 -0
  89. package/lib/shared/utils/axisGetDimension.d.ts +1 -0
  90. package/lib/shared/utils/axisHasDimension.d.ts +1 -0
  91. package/lib/shared/utils/dimension.d.ts +45 -0
  92. package/lib/shared/utils/dimensionGetItems.d.ts +1 -0
  93. package/lib/shared/utils/dimensionIs.d.ts +1 -0
  94. package/lib/shared/utils/dimensionIsEmpty.d.ts +1 -0
  95. package/lib/shared/utils/dimensionIsValid.d.ts +1 -0
  96. package/lib/shared/utils/dimensionSelectorHelper.d.ts +3 -0
  97. package/lib/shared/utils/index.d.ts +11 -0
  98. package/lib/shared/utils/layoutGetAllAxes.d.ts +1 -0
  99. package/lib/shared/utils/layoutGetAllDimensions.d.ts +1 -0
  100. package/lib/shared/utils/layoutGetDimension.d.ts +1 -0
  101. package/lib/shared/utils/layoutReplaceDimension.d.ts +1 -0
  102. package/lib/shared/utils/list.d.ts +1 -0
  103. package/lib/shared/utils/predefinedDimensions.d.ts +65 -0
  104. package/package.json +1 -1
  105. package/esm2022/lib/shared/components/react-component-wrapper/react-wrapper.component.mjs +0 -53
  106. /package/lib/{shared/components/react-component-wrapper → modules/react-wrapper}/react-wrapper.component.d.ts +0 -0
@@ -1,53 +0,0 @@
1
- import { ContentChild, Directive, ElementRef, Input, } from '@angular/core';
2
- import parse from 'html-react-parser';
3
- import * as React from 'react';
4
- import * as ReactDOM from 'react-dom/client';
5
- import * as i0 from "@angular/core";
6
- window.React = React;
7
- export class ReactWrapperComponent {
8
- constructor(elementRef) {
9
- this.elementRef = elementRef;
10
- }
11
- ngAfterViewInit() {
12
- if (!this.elementRef)
13
- throw new Error('No element ref');
14
- this.reactDomRoot = ReactDOM.createRoot(this.elementRef.nativeElement);
15
- this.render();
16
- }
17
- ngOnChanges() {
18
- if (this.elementRef)
19
- this.render();
20
- }
21
- ngOnDestroy() {
22
- this.reactDomRoot?.unmount();
23
- }
24
- render() {
25
- if (!this.component)
26
- throw new Error('React component must be supplied');
27
- if (!this.reactDomRoot)
28
- return;
29
- const jsxContent = this.content?.nativeElement?.outerHTML
30
- ? parse(this.content?.nativeElement?.outerHTML)
31
- : undefined;
32
- this.reactDomRoot.render(React.createElement(this.component, { ...this.props },
33
- " ",
34
- jsxContent || '',
35
- " "));
36
- }
37
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ReactWrapperComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
38
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ReactWrapperComponent, selector: "ng-dhis2-ui-wrapper", inputs: { props: "props", component: "component" }, queries: [{ propertyName: "content", first: true, predicate: ["ngDhis2UiContent"], descendants: true }], usesOnChanges: true, ngImport: i0 }); }
39
- }
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ReactWrapperComponent, decorators: [{
41
- type: Directive,
42
- args: [{
43
- selector: 'ng-dhis2-ui-wrapper',
44
- }]
45
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { props: [{
46
- type: Input
47
- }], component: [{
48
- type: Input
49
- }], content: [{
50
- type: ContentChild,
51
- args: ['ngDhis2UiContent']
52
- }] } });
53
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVhY3Qtd3JhcHBlci5jb21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