@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.
- package/esm2022/index.mjs +4 -1
- package/esm2022/lib/modules/button/button.component.mjs +2 -2
- package/esm2022/lib/modules/header-bar/header-bar.component.mjs +7 -8
- package/esm2022/lib/modules/organisation-unit-selector/components/OrgUnitDimension.mjs +212 -0
- package/esm2022/lib/modules/organisation-unit-selector/components/index.mjs +6 -0
- package/esm2022/lib/modules/organisation-unit-selector/components/styles/OrgUnitDimension.style.mjs +83 -0
- package/esm2022/lib/modules/organisation-unit-selector/components/utils/index.mjs +6 -0
- package/esm2022/lib/modules/organisation-unit-selector/components/utils/ouIdHelper/index.mjs +18 -0
- package/esm2022/lib/modules/organisation-unit-selector/components/utils/ouLevelUtils/index.mjs +27 -0
- package/esm2022/lib/modules/organisation-unit-selector/index.mjs +6 -0
- package/esm2022/lib/modules/organisation-unit-selector/models/index.mjs +5 -0
- package/esm2022/lib/modules/organisation-unit-selector/models/organisation-unit-config.model.mjs +16 -0
- package/esm2022/lib/modules/organisation-unit-selector/organisation-unit-selector.component.mjs +78 -0
- package/esm2022/lib/modules/organisation-unit-selector/organisation-unit-selector.module.mjs +19 -0
- package/esm2022/lib/modules/period-selector/components/FixedPeriodFilter.mjs +44 -0
- package/esm2022/lib/modules/period-selector/components/PeriodDimension.mjs +41 -0
- package/esm2022/lib/modules/period-selector/components/PeriodTransfer.mjs +110 -0
- package/esm2022/lib/modules/period-selector/components/RelativePeriodFilter.mjs +28 -0
- package/esm2022/lib/modules/period-selector/components/utils/fixedPeriods.mjs +308 -0
- package/esm2022/lib/modules/period-selector/components/utils/index.mjs +5 -0
- package/esm2022/lib/modules/period-selector/components/utils/periodTypes.mjs +23 -0
- package/esm2022/lib/modules/period-selector/components/utils/relativePeriods.mjs +139 -0
- package/esm2022/lib/modules/period-selector/index.mjs +6 -0
- package/esm2022/lib/modules/period-selector/period-selector.component.mjs +66 -0
- package/esm2022/lib/modules/period-selector/period-selector.module.mjs +19 -0
- package/esm2022/lib/modules/react-wrapper/index.mjs +6 -0
- package/esm2022/lib/modules/react-wrapper/react-wrapper.component.mjs +53 -0
- package/esm2022/lib/modules/react-wrapper/react-wrapper.module.mjs +18 -0
- package/esm2022/lib/shared/assets/AssignedCategoriesIcon.mjs +12 -0
- package/esm2022/lib/shared/assets/DimensionItemIcons/PeriodIcon.mjs +4 -0
- package/esm2022/lib/shared/components/TransferOption.mjs +130 -0
- package/esm2022/lib/shared/components/index.mjs +2 -3
- package/esm2022/lib/shared/index.mjs +7 -0
- package/esm2022/lib/shared/styles/DimensionSelector.style.mjs +39 -0
- package/esm2022/lib/shared/styles/index.mjs +5 -0
- package/esm2022/lib/shared/utils/axis.mjs +25 -0
- package/esm2022/lib/shared/utils/axisGetDimension.mjs +5 -0
- package/esm2022/lib/shared/utils/axisHasDimension.mjs +3 -0
- package/esm2022/lib/shared/utils/dimension.mjs +52 -0
- package/esm2022/lib/shared/utils/dimensionGetItems.mjs +6 -0
- package/esm2022/lib/shared/utils/dimensionIs.mjs +3 -0
- package/esm2022/lib/shared/utils/dimensionIsEmpty.mjs +5 -0
- package/esm2022/lib/shared/utils/dimensionIsValid.mjs +16 -0
- package/esm2022/lib/shared/utils/dimensionSelectorHelper.mjs +4 -0
- package/esm2022/lib/shared/utils/index.mjs +15 -0
- package/esm2022/lib/shared/utils/layoutGetAllAxes.mjs +7 -0
- package/esm2022/lib/shared/utils/layoutGetAllDimensions.mjs +6 -0
- package/esm2022/lib/shared/utils/layoutGetDimension.mjs +4 -0
- package/esm2022/lib/shared/utils/layoutReplaceDimension.mjs +17 -0
- package/esm2022/lib/shared/utils/list.mjs +15 -0
- package/esm2022/lib/shared/utils/predefinedDimensions.mjs +45 -0
- package/fesm2022/iapps-ng-dhis2-ui.mjs +1652 -77
- package/fesm2022/iapps-ng-dhis2-ui.mjs.map +1 -1
- package/index.d.ts +3 -0
- package/lib/modules/button/button.component.d.ts +1 -1
- package/lib/modules/header-bar/header-bar.component.d.ts +1 -4
- package/lib/modules/organisation-unit-selector/components/OrgUnitDimension.d.ts +26 -0
- package/lib/modules/organisation-unit-selector/components/index.d.ts +2 -0
- package/lib/modules/organisation-unit-selector/components/styles/OrgUnitDimension.style.d.ts +1 -0
- package/lib/modules/organisation-unit-selector/components/utils/index.d.ts +2 -0
- package/lib/modules/organisation-unit-selector/components/utils/ouIdHelper/index.d.ts +10 -0
- package/lib/modules/organisation-unit-selector/components/utils/ouLevelUtils/index.d.ts +1 -0
- package/lib/modules/organisation-unit-selector/index.d.ts +2 -0
- package/lib/modules/organisation-unit-selector/models/index.d.ts +1 -0
- package/lib/modules/organisation-unit-selector/models/organisation-unit-config.model.d.ts +12 -0
- package/lib/modules/organisation-unit-selector/organisation-unit-selector.component.d.ts +26 -0
- package/lib/modules/organisation-unit-selector/organisation-unit-selector.module.d.ts +9 -0
- package/lib/modules/period-selector/components/FixedPeriodFilter.d.ts +18 -0
- package/lib/modules/period-selector/components/PeriodDimension.d.ts +15 -0
- package/lib/modules/period-selector/components/PeriodTransfer.d.ts +28 -0
- package/lib/modules/period-selector/components/RelativePeriodFilter.d.ts +11 -0
- package/lib/modules/period-selector/components/utils/fixedPeriods.d.ts +17 -0
- package/lib/modules/period-selector/components/utils/index.d.ts +4 -0
- package/lib/modules/period-selector/components/utils/periodTypes.d.ts +19 -0
- package/lib/modules/period-selector/components/utils/relativePeriods.d.ts +17 -0
- package/lib/modules/period-selector/index.d.ts +2 -0
- package/lib/modules/period-selector/period-selector.component.d.ts +21 -0
- package/lib/modules/period-selector/period-selector.module.d.ts +9 -0
- package/lib/modules/react-wrapper/index.d.ts +2 -0
- package/lib/modules/react-wrapper/react-wrapper.module.d.ts +8 -0
- package/lib/shared/assets/AssignedCategoriesIcon.d.ts +2 -0
- package/lib/shared/assets/DimensionItemIcons/PeriodIcon.d.ts +3 -0
- package/lib/shared/components/TransferOption.d.ts +19 -0
- package/lib/shared/components/index.d.ts +1 -2
- package/lib/shared/index.d.ts +3 -0
- package/lib/shared/styles/DimensionSelector.style.d.ts +2 -0
- package/lib/shared/styles/index.d.ts +1 -0
- package/lib/shared/utils/axis.d.ts +11 -0
- package/lib/shared/utils/axisGetDimension.d.ts +1 -0
- package/lib/shared/utils/axisHasDimension.d.ts +1 -0
- package/lib/shared/utils/dimension.d.ts +45 -0
- package/lib/shared/utils/dimensionGetItems.d.ts +1 -0
- package/lib/shared/utils/dimensionIs.d.ts +1 -0
- package/lib/shared/utils/dimensionIsEmpty.d.ts +1 -0
- package/lib/shared/utils/dimensionIsValid.d.ts +1 -0
- package/lib/shared/utils/dimensionSelectorHelper.d.ts +3 -0
- package/lib/shared/utils/index.d.ts +11 -0
- package/lib/shared/utils/layoutGetAllAxes.d.ts +1 -0
- package/lib/shared/utils/layoutGetAllDimensions.d.ts +1 -0
- package/lib/shared/utils/layoutGetDimension.d.ts +1 -0
- package/lib/shared/utils/layoutReplaceDimension.d.ts +1 -0
- package/lib/shared/utils/list.d.ts +1 -0
- package/lib/shared/utils/predefinedDimensions.d.ts +65 -0
- package/package.json +1 -1
- package/esm2022/lib/shared/components/react-component-wrapper/react-wrapper.component.mjs +0 -53
- /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
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