@openmrs/ngx-formentry 3.2.1-pre.241 → 3.2.1-pre.245

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 (36) hide show
  1. package/bundles/openmrs-ngx-formentry.umd.js +109 -86
  2. package/bundles/openmrs-ngx-formentry.umd.js.map +1 -1
  3. package/components/custom-component-wrapper/custom-component-wrapper..module.d.ts +2 -1
  4. package/components/custom-control-wrapper/custom-control-wrapper..module.d.ts +2 -1
  5. package/components/date-time-picker/date-time-picker.module.d.ts +2 -1
  6. package/components/ngx-datetime-picker/ngx-datetime-picker.module.d.ts +2 -1
  7. package/components/ngx-pick-datetime/lib/date-time/date-time-picker-intl.service.d.ts +7 -4
  8. package/components/ngx-pick-datetime/lib/date-time/date-time.module.d.ts +2 -1
  9. package/components/ngx-remote-select/ngx-remote-select.module.d.ts +2 -1
  10. package/esm2015/components/custom-component-wrapper/custom-component-wrapper..module.js +5 -4
  11. package/esm2015/components/custom-component-wrapper/custom-component-wrapper.component.js +3 -2
  12. package/esm2015/components/custom-control-wrapper/custom-control-wrapper..module.js +5 -4
  13. package/esm2015/components/custom-control-wrapper/custom-control-wrapper.component.js +3 -2
  14. package/esm2015/components/date-time-picker/date-time-picker.component.js +3 -2
  15. package/esm2015/components/date-time-picker/date-time-picker.module.js +5 -4
  16. package/esm2015/components/ngx-datetime-picker/ngx-datetime-picker.component.js +3 -2
  17. package/esm2015/components/ngx-datetime-picker/ngx-datetime-picker.module.js +8 -4
  18. package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time-picker-intl.service.js +11 -8
  19. package/esm2015/components/ngx-pick-datetime/lib/date-time/date-time.module.js +21 -4
  20. package/esm2015/components/ngx-remote-select/ngx-remote-select.component.js +3 -2
  21. package/esm2015/components/ngx-remote-select/ngx-remote-select.module.js +5 -4
  22. package/esm2015/form-entry/error-renderer/error-renderer.component.js +3 -2
  23. package/esm2015/form-entry/form-factory/form-node.js +8 -5
  24. package/esm2015/form-entry/form-factory/form.factory.js +8 -5
  25. package/esm2015/form-entry/form-factory/validation.factory.js +29 -14
  26. package/esm2015/form-entry/form-renderer/form-renderer.component.js +2 -2
  27. package/esm2015/form-entry/pipes/time-ago.pipe.js +18 -15
  28. package/fesm2015/openmrs-ngx-formentry.js +107 -80
  29. package/fesm2015/openmrs-ngx-formentry.js.map +1 -1
  30. package/form-entry/form-factory/form-node.d.ts +3 -1
  31. package/form-entry/form-factory/form.factory.d.ts +3 -1
  32. package/form-entry/form-factory/validation.factory.d.ts +3 -1
  33. package/form-entry/pipes/time-ago.pipe.d.ts +4 -2
  34. package/package.json +1 -1
  35. package/esm2015/form-entry/utils/messages.js +0 -12
  36. package/form-entry/utils/messages.d.ts +0 -11
@@ -2,6 +2,7 @@ import { FormFactory } from './form.factory';
2
2
  import { Form } from './form';
3
3
  import { QuestionBase, RepeatingQuestion } from '../question-models/models';
4
4
  import { AfeFormControl, AfeFormArray, AfeFormGroup } from '../../abstract-controls-extension';
5
+ import { TranslateService } from '@ngx-translate/core';
5
6
  export interface ChildNodeCreatedListener {
6
7
  addChildNodeCreatedListener(func: any): any;
7
8
  fireChildNodeCreatedListener(node: GroupNode): any;
@@ -38,12 +39,13 @@ export declare class GroupNode extends NodeBase {
38
39
  setChild(key: string, node: NodeBase): void;
39
40
  }
40
41
  export declare class ArrayNode extends NodeBase implements ChildNodeCreatedListener {
42
+ translate: TranslateService;
41
43
  private formFactory?;
42
44
  private childNodeCreatedEvents;
43
45
  private _children;
44
46
  createChildFunc: CreateArrayChildNodeFunction;
45
47
  removeChildFunc: RemoveArrayChildNodeFunction;
46
- constructor(question: QuestionBase, control?: AfeFormControl | AfeFormArray | AfeFormGroup, parentControl?: AfeFormControl | AfeFormArray | AfeFormGroup, formFactory?: FormFactory, form?: Form, parentPath?: string);
48
+ constructor(question: QuestionBase, translate: TranslateService, control?: AfeFormControl | AfeFormArray | AfeFormGroup, parentControl?: AfeFormControl | AfeFormArray | AfeFormGroup, formFactory?: FormFactory, form?: Form, parentPath?: string);
47
49
  get children(): GroupNode[];
48
50
  createChildNode(): GroupNode;
49
51
  removeAt(index: number): GroupNode;
@@ -1,3 +1,4 @@
1
+ import { TranslateService } from '@ngx-translate/core';
1
2
  import { LeafNode, GroupNode, ArrayNode, NodeBase } from './form-node';
2
3
  import { QuestionBase, NestedQuestion, RepeatingQuestion } from '../question-models/models';
3
4
  import { FormControlService } from './form-control.service';
@@ -10,9 +11,10 @@ export declare class FormFactory {
10
11
  controlService: FormControlService;
11
12
  questionFactroy: QuestionFactory;
12
13
  controlRelationsFactory: ControlRelationsFactory;
14
+ translate: TranslateService;
13
15
  private nodeIndex;
14
16
  hd: any;
15
- constructor(controlService: FormControlService, questionFactroy: QuestionFactory, controlRelationsFactory: ControlRelationsFactory);
17
+ constructor(controlService: FormControlService, questionFactroy: QuestionFactory, controlRelationsFactory: ControlRelationsFactory, translate: TranslateService);
16
18
  createForm(schema: any, dataSource?: any): Form;
17
19
  buildRelations(rootNode: GroupNode): void;
18
20
  createNode(question: QuestionBase | NestedQuestion, parentNode?: GroupNode, parentControl?: AfeFormGroup, form?: Form): NodeBase;
@@ -1,10 +1,12 @@
1
+ import { TranslateService } from '@ngx-translate/core';
1
2
  import { ConditionalRequiredValidator } from '../validators/conditional-required.validator';
2
3
  import { ConditionalAnsweredValidator } from '../validators/conditional-answered.validator';
3
4
  import { JsExpressionValidator } from '../validators/js-expression.validator';
4
5
  import { QuestionBase } from '../question-models/question-base';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class ValidationFactory {
7
- constructor();
8
+ private translate;
9
+ constructor(translate: TranslateService);
8
10
  getValidators(question: QuestionBase, form?: any): any[];
9
11
  get conditionalRequiredValidator(): ConditionalRequiredValidator;
10
12
  get conditionalAnsweredValidator(): ConditionalAnsweredValidator;
@@ -1,11 +1,13 @@
1
1
  import { PipeTransform, NgZone, ChangeDetectorRef, OnDestroy } from '@angular/core';
2
+ import { TranslateService } from '@ngx-translate/core';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class TimeAgoPipe implements PipeTransform, OnDestroy {
4
5
  private changeDetectorRef;
5
6
  private ngZone;
7
+ translate: TranslateService;
6
8
  private timer;
7
- constructor(changeDetectorRef: ChangeDetectorRef, ngZone: NgZone);
8
- transform(value: string): string;
9
+ constructor(changeDetectorRef: ChangeDetectorRef, ngZone: NgZone, translate: TranslateService);
10
+ transform(value: string): any;
9
11
  ngOnDestroy(): void;
10
12
  private removeTimer;
11
13
  private getSecondsUntilUpdate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/ngx-formentry",
3
- "version": "3.2.1-pre.241",
3
+ "version": "3.2.1-pre.245",
4
4
  "dependencies": {
5
5
  "tslib": "^2.2.0"
6
6
  },
@@ -1,12 +0,0 @@
1
- export class Messages {
2
- }
3
- Messages.REQUIRED_FIELD_MSG = 'This field is required!';
4
- Messages.INVALID_DATE_MSG = 'Provided date is invalid!';
5
- Messages.FUTURE_DATE_RESTRICTION_MSG = 'Future date is not allowed!';
6
- Messages.MIN_LENGTH_MSG = 'Min Length should be {minLength}';
7
- Messages.MAX_LENGTH_MSG = 'Max Length should be {maxLength}';
8
- Messages.MAX_DATE_MSG = 'Max Date should be {maxDate}';
9
- Messages.MIN_DATE_MSG = 'Min Date should be {minDate}';
10
- Messages.MAX_MSG = 'Max value should be {max}';
11
- Messages.MIN_MSG = 'Min value should be {min}';
12
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtZm9ybWVudHJ5L3NyYy9mb3JtLWVudHJ5L3V0aWxzL21lc3NhZ2VzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sT0FBTyxRQUFROztBQUNJLDJCQUFrQixHQUFHLHlCQUF5QixDQUFDO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Ugc2hvdWxkIGJlIHttaW5EYXRlfSc7XG5cbiAgcHVibGljIHN0YXRpYyByZWFkb25seSBNQVhfTVNHID0gJ01heCB2YWx1ZSBzaG91bGQgYmUge21heH0nO1xuXG4gIHB1YmxpYyBzdGF0aWMgcmVhZG9ubHkgTUlOX01TRyA9ICdNaW4gdmFsdWUgc2hvdWxkIGJlIHttaW59Jztcbn1cbiJdfQ==
@@ -1,11 +0,0 @@
1
- export declare class Messages {
2
- static readonly REQUIRED_FIELD_MSG = "This field is required!";
3
- static readonly INVALID_DATE_MSG = "Provided date is invalid!";
4
- static readonly FUTURE_DATE_RESTRICTION_MSG = "Future date is not allowed!";
5
- static readonly MIN_LENGTH_MSG = "Min Length should be {minLength}";
6
- static readonly MAX_LENGTH_MSG = "Max Length should be {maxLength}";
7
- static readonly MAX_DATE_MSG = "Max Date should be {maxDate}";
8
- static readonly MIN_DATE_MSG = "Min Date should be {minDate}";
9
- static readonly MAX_MSG = "Max value should be {max}";
10
- static readonly MIN_MSG = "Min value should be {min}";
11
- }