@iapps/ng-dhis2-ui 1.1.0 → 1.1.1

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 (49) hide show
  1. package/fesm2022/iapps-ng-dhis2-ui.mjs +1770 -245
  2. package/fesm2022/iapps-ng-dhis2-ui.mjs.map +1 -1
  3. package/index.d.ts +1 -0
  4. package/lib/modules/form/components/base-form-field.component.d.ts +53 -0
  5. package/lib/modules/form/components/form-field-item.component.d.ts +6 -0
  6. package/lib/modules/form/containers/form/form.component.d.ts +32 -0
  7. package/lib/modules/form/containers/form-field/form-field.component.d.ts +50 -0
  8. package/lib/modules/form/containers/repeatable-form/repeatable-form.component.d.ts +31 -0
  9. package/lib/modules/form/containers/section-form/section-form.component.d.ts +31 -0
  10. package/lib/modules/form/form.module.d.ts +14 -0
  11. package/lib/modules/form/index.d.ts +8 -0
  12. package/lib/modules/form/interfaces/field-control-type.interface.d.ts +1 -0
  13. package/lib/modules/form/interfaces/field-dropdown.interface.d.ts +7 -0
  14. package/lib/modules/form/interfaces/field-type.interface.d.ts +15 -0
  15. package/lib/modules/form/interfaces/form-configuration.model.d.ts +63 -0
  16. package/lib/modules/form/interfaces/form-field-group.interface.d.ts +14 -0
  17. package/lib/modules/form/interfaces/form-field-meta-type.interface.d.ts +1 -0
  18. package/lib/modules/form/interfaces/form-field.interface.d.ts +40 -0
  19. package/lib/modules/form/interfaces/form-metadata-section.interface.d.ts +10 -0
  20. package/lib/modules/form/interfaces/form-metadata.interface.d.ts +11 -0
  21. package/lib/modules/form/interfaces/index.d.ts +9 -0
  22. package/lib/modules/form/models/boolean.model.d.ts +5 -0
  23. package/lib/modules/form/models/check-box.model.d.ts +5 -0
  24. package/lib/modules/form/models/date-field.model.d.ts +7 -0
  25. package/lib/modules/form/models/date-range-value.model.d.ts +4 -0
  26. package/lib/modules/form/models/dropdown-option.model.d.ts +6 -0
  27. package/lib/modules/form/models/dropdown.model.d.ts +5 -0
  28. package/lib/modules/form/models/field-config.model.d.ts +5 -0
  29. package/lib/modules/form/models/field-dropdown.model.d.ts +10 -0
  30. package/lib/modules/form/models/fields-data.model.d.ts +8 -0
  31. package/lib/modules/form/models/form-config.model.d.ts +10 -0
  32. package/lib/modules/form/models/form-field-group.model.d.ts +21 -0
  33. package/lib/modules/form/models/form-field.model.d.ts +41 -0
  34. package/lib/modules/form/models/form-metadata-rule.model.d.ts +28 -0
  35. package/lib/modules/form/models/form-metadata-section.model.d.ts +28 -0
  36. package/lib/modules/form/models/form-metadata.model.d.ts +20 -0
  37. package/lib/modules/form/models/form-value.model.d.ts +17 -0
  38. package/lib/modules/form/models/form.model.d.ts +14 -0
  39. package/lib/modules/form/models/index.d.ts +17 -0
  40. package/lib/modules/form/utils/field-control-type.util.d.ts +4 -0
  41. package/lib/modules/form/utils/field-type.util.d.ts +3 -0
  42. package/lib/modules/form/utils/field.util.d.ts +9 -0
  43. package/lib/modules/form/utils/form-value.util.d.ts +4 -0
  44. package/lib/modules/form/utils/form.util.d.ts +8 -0
  45. package/lib/modules/form/utils/index.d.ts +5 -0
  46. package/lib/shared/components/index.d.ts +1 -2
  47. package/lib/shared/utils/predefinedDimensions.d.ts +6 -6
  48. package/package.json +1 -1
  49. /package/lib/shared/components/{TransferOption.d.ts → transfer-option.component.d.ts} +0 -0
@@ -0,0 +1,20 @@
1
+ import { IMetadataRule } from './form-metadata-rule.model';
2
+ import { FormField } from './form-field.model';
3
+ import { Program } from '@iapps/d2-web-sdk';
4
+ import { IFormMetadata, IFormMetadataSection } from '../interfaces';
5
+ export declare class FormMetaData implements IFormMetadata {
6
+ private params;
7
+ id: string;
8
+ name: string;
9
+ description?: string | undefined;
10
+ downloadSqlView?: string | undefined;
11
+ constructor(params: {
12
+ formMetaData: Partial<FormMetaData>;
13
+ programs: Program[];
14
+ locale?: string;
15
+ });
16
+ get sections(): IFormMetadataSection[];
17
+ get fields(): FormField<string>[];
18
+ get rules(): IMetadataRule[];
19
+ toJson(): IFormMetadata;
20
+ }
@@ -0,0 +1,17 @@
1
+ import { FormGroup } from '@angular/forms';
2
+ import { FormField } from './form-field.model';
3
+ export declare class FormValue {
4
+ form: FormGroup;
5
+ fields: FormField<string>[];
6
+ changedField?: FormField<string>;
7
+ constructor(form: FormGroup, fields: FormField<string>[], changedField?: FormField<string>);
8
+ get isValid(): boolean;
9
+ clear(): void;
10
+ getValues(): {
11
+ [id: string]: {
12
+ id: string;
13
+ value: string;
14
+ options: any[];
15
+ };
16
+ };
17
+ }
@@ -0,0 +1,14 @@
1
+ import { DropdownOption } from './dropdown-option.model';
2
+ import { FormField } from './form-field.model';
3
+ export interface EocForm {
4
+ id: string;
5
+ uuid: string;
6
+ name: string;
7
+ setMembers: EocForm[];
8
+ options?: DropdownOption[];
9
+ dataType?: string;
10
+ formClass: string;
11
+ formField?: FormField<string>;
12
+ formFields: FormField<string>[];
13
+ concept?: any;
14
+ }
@@ -0,0 +1,17 @@
1
+ export * from './boolean.model';
2
+ export * from './check-box.model';
3
+ export * from './date-field.model';
4
+ export * from './dropdown-option.model';
5
+ export * from './dropdown.model';
6
+ export * from './form-field.model';
7
+ export * from './fields-data.model';
8
+ export * from './field-config.model';
9
+ export * from './date-range-value.model';
10
+ export * from './field-dropdown.model';
11
+ export * from './form-config.model';
12
+ export * from './form-field-group.model';
13
+ export * from './form-metadata-rule.model';
14
+ export * from './form-metadata-section.model';
15
+ export * from './form-metadata.model';
16
+ export * from './form-value.model';
17
+ export * from './form.model';
@@ -0,0 +1,4 @@
1
+ import { FieldControlType } from '../interfaces';
2
+ export declare class FieldControlTypeUtil {
3
+ static getFieldControlType(valueType: string, hasOptions: boolean): FieldControlType;
4
+ }
@@ -0,0 +1,3 @@
1
+ export declare class FormFieldTypeUtil {
2
+ static getFieldType(valueType: string): "number" | "image" | "org-unit" | "file" | "text";
3
+ }
@@ -0,0 +1,9 @@
1
+ import { FieldControlType } from '../interfaces';
2
+ import { DropdownOption } from '../models';
3
+ export declare class FieldUtil {
4
+ static getFieldDropdownOptions(field: any): DropdownOption[];
5
+ static sanitizeOptions(options: any[]): any;
6
+ static getFieldType(valueType: string): "number" | "date" | "org-unit" | "file" | "tel" | "text";
7
+ static getFieldControlType(valueType: string, hasOptions: boolean): FieldControlType;
8
+ static getOptionEntities?(options: any[]): any;
9
+ }
@@ -0,0 +1,4 @@
1
+ import { FormValue } from '../models';
2
+ export declare class FormValueUtil {
3
+ static getFormDataEntities(formValueEntities: Record<string, FormValue>): {};
4
+ }
@@ -0,0 +1,8 @@
1
+ import { UntypedFormGroup } from '@angular/forms';
2
+ import { FormField } from '../models';
3
+ export declare class FormUtil {
4
+ static getFormGroup(fields: FormField<string>[], dataEntities: any): UntypedFormGroup;
5
+ static getFieldValue(field: FormField<string>, dataEntities: Record<string, any>): any;
6
+ static getFormFields(fields: any[]): FormField<string>[];
7
+ static createField(id: string, label: string, required: boolean, controlType: 'textbox' | 'dropdown' | 'textarea' | 'transfer' | 'search' | 'file', disabled?: boolean, placeholder?: string, options?: Array<any>): FormField<string>;
8
+ }
@@ -0,0 +1,5 @@
1
+ export * from './field.util';
2
+ export * from './field-control-type.util';
3
+ export * from './field-type.util';
4
+ export * from './form.util';
5
+ export * from './form-value.util';
@@ -1,2 +1 @@
1
- export declare const sharedComponents: any[];
2
- export * from './TransferOption';
1
+ export * from './transfer-option.component';
@@ -11,19 +11,19 @@ export declare const getFixedDimensions: () => {
11
11
  id: string;
12
12
  name: any;
13
13
  iconName: string;
14
- icon: React.FC<import("@dhis2/ui-icons").IconProps>;
14
+ icon: any;
15
15
  };
16
16
  pe: {
17
17
  id: string;
18
18
  name: any;
19
19
  iconName: string;
20
- icon: React.FC<import("@dhis2/ui-icons").IconProps>;
20
+ icon: any;
21
21
  };
22
22
  ou: {
23
23
  id: string;
24
24
  name: any;
25
25
  iconName: string;
26
- icon: React.FC<import("@dhis2/ui-icons").IconProps>;
26
+ icon: any;
27
27
  };
28
28
  };
29
29
  export declare const getDynamicDimensions: () => {
@@ -47,19 +47,19 @@ export declare const getPredefinedDimensions: () => {
47
47
  id: string;
48
48
  name: any;
49
49
  iconName: string;
50
- icon: React.FC<import("@dhis2/ui-icons").IconProps>;
50
+ icon: any;
51
51
  };
52
52
  pe: {
53
53
  id: string;
54
54
  name: any;
55
55
  iconName: string;
56
- icon: React.FC<import("@dhis2/ui-icons").IconProps>;
56
+ icon: any;
57
57
  };
58
58
  ou: {
59
59
  id: string;
60
60
  name: any;
61
61
  iconName: string;
62
- icon: React.FC<import("@dhis2/ui-icons").IconProps>;
62
+ icon: any;
63
63
  };
64
64
  };
65
65
  export declare const filterOutPredefinedDimensions: (dimensionIds: string[]) => string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iapps/ng-dhis2-ui",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0",