@ajf/material 18.1.0 → 18.1.2

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 (42) hide show
  1. package/audio/index.d.ts +22 -0
  2. package/audio/src/audio-module.d.ts +12 -0
  3. package/audio/src/audio.d.ts +41 -0
  4. package/audio/src/public_api.d.ts +23 -0
  5. package/esm2022/audio/ajf-material-audio.mjs +5 -0
  6. package/esm2022/audio/index.mjs +23 -0
  7. package/esm2022/audio/src/audio-module.mjs +43 -0
  8. package/esm2022/audio/src/audio.mjs +122 -0
  9. package/esm2022/audio/src/public_api.mjs +24 -0
  10. package/esm2022/form-builder/form-builder-service.mjs +5 -1
  11. package/esm2022/form-builder/form-builder.mjs +2 -2
  12. package/esm2022/form-builder/node-entry.mjs +4 -4
  13. package/esm2022/forms/audio-field.mjs +44 -0
  14. package/esm2022/forms/display-field.mjs +49 -0
  15. package/esm2022/forms/field-service.mjs +9 -3
  16. package/esm2022/forms/form.mjs +10 -4
  17. package/esm2022/forms/forms-module.mjs +20 -6
  18. package/esm2022/forms/range-field.mjs +15 -7
  19. package/esm2022/forms/text-field.mjs +27 -9
  20. package/esm2022/signature/signature.mjs +48 -16
  21. package/esm2022/time/time-module.mjs +6 -4
  22. package/esm2022/time/time.mjs +10 -6
  23. package/fesm2022/ajf-material-audio.mjs +212 -0
  24. package/fesm2022/ajf-material-audio.mjs.map +1 -0
  25. package/fesm2022/ajf-material-form-builder.mjs +9 -5
  26. package/fesm2022/ajf-material-form-builder.mjs.map +1 -1
  27. package/fesm2022/ajf-material-forms.mjs +172 -45
  28. package/fesm2022/ajf-material-forms.mjs.map +1 -1
  29. package/fesm2022/ajf-material-signature.mjs +47 -15
  30. package/fesm2022/ajf-material-signature.mjs.map +1 -1
  31. package/fesm2022/ajf-material-time.mjs +14 -8
  32. package/fesm2022/ajf-material-time.mjs.map +1 -1
  33. package/forms/audio-field.d.ts +30 -0
  34. package/forms/display-field.d.ts +35 -0
  35. package/forms/form.d.ts +2 -1
  36. package/forms/forms-module.d.ts +52 -48
  37. package/forms/range-field.d.ts +1 -0
  38. package/forms/text-field.d.ts +8 -2
  39. package/package.json +8 -2
  40. package/signature/signature.d.ts +13 -1
  41. package/time/time-module.d.ts +6 -4
  42. package/time/time.d.ts +2 -0
@@ -2,11 +2,12 @@ import { AjfSignature } from '@ajf/core/signature';
2
2
  import * as i0 from '@angular/core';
3
3
  import { forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
4
4
  import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
5
- import * as i1 from '@angular/material/button';
5
+ import * as i1 from '@angular/platform-browser';
6
+ import * as i2 from '@angular/material/button';
6
7
  import { MatButtonModule } from '@angular/material/button';
7
- import * as i2 from '@angular/material/icon';
8
+ import * as i3 from '@angular/material/icon';
8
9
  import { MatIconModule } from '@angular/material/icon';
9
- import * as i3 from '@ngneat/transloco';
10
+ import * as i4 from '@ngneat/transloco';
10
11
  import { AjfCommonModule } from '@ajf/core/common';
11
12
  import { AjfTranslocoModule } from '@ajf/core/transloco';
12
13
  import { CommonModule } from '@angular/common';
@@ -41,45 +42,76 @@ const SIGNATURE_CONTROL_VALUE_ACCESSOR = {
41
42
  * Ajf signature component.
42
43
  */
43
44
  class AjfSignatureComponent extends AjfSignature {
44
- constructor(cdr, renderer) {
45
+ constructor(cdr, renderer, _sanitizer) {
45
46
  super(cdr, renderer);
47
+ this._sanitizer = _sanitizer;
46
48
  }
47
49
  ngAfterViewInit() {
48
50
  this.sigPadElement = this.sigPad.nativeElement;
49
51
  this.context = this.sigPadElement?.getContext('2d') ?? null;
50
52
  }
53
+ /**
54
+ * Clears the signature value and preview (keeps the old url to delete old signature from storage)
55
+ */
51
56
  clear() {
52
57
  if (this.context != null && this.sigPadElement != null) {
53
58
  this.context.clearRect(0, 0, this.sigPadElement.width, this.sigPadElement.height);
54
59
  this.context.beginPath();
55
60
  }
56
61
  this.isDrawn = false;
57
- this.value = null;
62
+ this.value = {
63
+ name: 'signature.webp',
64
+ type: 'image/webp',
65
+ signature: true,
66
+ size: undefined,
67
+ content: undefined,
68
+ url: this.value?.url ?? undefined,
69
+ deleteUrl: true,
70
+ };
58
71
  }
72
+ /**
73
+ * Accepts the new signature from the canvas and sets it as field value (keeps the old url to delete old signature from storage)
74
+ */
59
75
  accept() {
60
76
  if (this.sigPadElement != null) {
61
- const signaturDataUrl = this.sigPadElement.toDataURL('image/png');
62
- const head = 'data:image/png;base64,';
63
- const imgFileSize = Math.round(((signaturDataUrl.length - head.length) * 3) / 4).toString();
77
+ const signatureDataUrl = this.sigPadElement.toDataURL('image/webp', 0.5);
78
+ const head = 'data:image/webp;base64,';
79
+ const imgFileSize = Math.round(((signatureDataUrl.length - head.length) * 3) / 4);
64
80
  this.value = {
65
- name: 'signature.png',
66
- type: 'image/png',
81
+ name: 'signature.webp',
82
+ type: 'image/webp',
67
83
  signature: true,
68
84
  size: imgFileSize,
69
- content: signaturDataUrl,
85
+ content: signatureDataUrl,
86
+ url: this.value?.url ?? undefined,
87
+ deleteUrl: false,
70
88
  };
71
89
  }
72
90
  }
91
+ /**
92
+ * Sanitizes signature image url
93
+ */
94
+ get safeImageSrc() {
95
+ if (!this.value)
96
+ return null;
97
+ if (!this.value.content && this.value.deleteUrl)
98
+ return null;
99
+ const rawUrl = this.value.content && this.value.content.length ? this.value.content : this.value.url;
100
+ if (!rawUrl)
101
+ return null;
102
+ const sanitizedUrl = this._sanitizer.bypassSecurityTrustUrl(rawUrl);
103
+ return sanitizedUrl;
104
+ }
73
105
  ngOnDestroy() {
74
106
  return;
75
107
  }
76
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfSignatureComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
77
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfSignatureComponent, selector: "ajf-signature", providers: [SIGNATURE_CONTROL_VALUE_ACCESSOR], usesInheritance: true, ngImport: i0, template: "<div class=\"ajf-signature-container\">\n <p class=\"ajf-signature-text\">{{'Please sign here'|transloco}}</p>\n <canvas\n class=\"ajf-signature-canvas\"\n #sigPad\n (mousedown)=\"onMouseDown($event)\"\n (mousemove)=\"onMouseMove($event)\"\n (touchstart)=\"onMouseDown($event)\"\n (touchmove)=\"onMouseMove($event)\"\n ></canvas>\n <div class=\"ajf-signature-actions\">\n <button mat-fab (click)=\"clear()\" class=\"ajf-signature-action-clear\">\n <mat-icon>close</mat-icon>\n </button>\n <button mat-fab (click)=\"accept()\" color=\"primary\" [disabled]=\"!isDrawn\" class=\"ajf-signature-action-accept\">\n <mat-icon>check</mat-icon>\n </button>\n </div>\n\n <img class=\"ajf-signature-preview\" [src]=\"value?.content\" />\n</div>\n", styles: ["ajf-signature{display:block}ajf-signature .ajf-signature-container{width:100%;display:flex;flex-flow:column wrap;justify-content:center;align-items:center}ajf-signature .ajf-signature-container .ajf-signature-preview{max-width:200px;max-height:100px;margin:auto;padding:5px}ajf-signature .ajf-signature-container .ajf-signature-canvas{margin:auto;border-radius:10px;border:2px solid rgba(0,0,0,.4)}ajf-signature .ajf-signature-container .ajf-signature-actions{flex:1 0 auto;display:flex;flex-flow:row wrap;justify-content:space-around}ajf-signature .ajf-signature-container .ajf-signature-actions .mdc-fab{margin:10px}ajf-signature .ajf-signature-container .ajf-signature-actions .mdc-fab .mat-icon{margin-left:0!important}ajf-signature .ajf-signature-container .ajf-signature-actions .ajf-signature-action-clear{background-color:#f53d3d99}ajf-signature .ajf-signature-container .ajf-signature-actions .ajf-signature-action-accept{background-color:#32db6499}ajf-signature .ajf-signature-container .ajf-signature-actions .ajf-signature-action-accept[disabled=true]{background-color:#0000001f;color:#00000061}\n"], dependencies: [{ kind: "component", type: i1.MatFabButton, selector: "button[mat-fab]", inputs: ["extended"], exportAs: ["matButton"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: i3.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
108
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfSignatureComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
109
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfSignatureComponent, selector: "ajf-signature", providers: [SIGNATURE_CONTROL_VALUE_ACCESSOR], usesInheritance: true, ngImport: i0, template: "<div class=\"ajf-signature-container\">\n <p class=\"ajf-signature-text\">{{'Please sign here'|transloco}}</p>\n <canvas\n class=\"ajf-signature-canvas\"\n #sigPad\n (mousedown)=\"onMouseDown($event)\"\n (mousemove)=\"onMouseMove($event)\"\n (touchstart)=\"onMouseDown($event)\"\n (touchmove)=\"onMouseMove($event)\"\n ></canvas>\n <div class=\"ajf-signature-actions\">\n <button mat-fab (click)=\"clear()\" class=\"ajf-signature-action-clear\">\n <mat-icon>close</mat-icon>\n </button>\n <button mat-fab (click)=\"accept()\" color=\"primary\" [disabled]=\"!isDrawn\" class=\"ajf-signature-action-accept\">\n <mat-icon>check</mat-icon>\n </button>\n </div>\n\n <img class=\"ajf-signature-preview\" [src]=\"safeImageSrc\" />\n</div>\n", styles: ["ajf-signature{display:block}ajf-signature .ajf-signature-container{width:100%;display:flex;flex-flow:column wrap;justify-content:center;align-items:center}ajf-signature .ajf-signature-container .ajf-signature-preview{max-width:200px;max-height:100px;margin:auto;padding:5px}ajf-signature .ajf-signature-container .ajf-signature-canvas{margin:auto;border-radius:10px;border:2px solid rgba(0,0,0,.4)}ajf-signature .ajf-signature-container .ajf-signature-actions{flex:1 0 auto;display:flex;flex-flow:row wrap;justify-content:space-around}ajf-signature .ajf-signature-container .ajf-signature-actions .mdc-fab{margin:10px}ajf-signature .ajf-signature-container .ajf-signature-actions .mdc-fab .mat-icon{margin-left:0!important}ajf-signature .ajf-signature-container .ajf-signature-actions .ajf-signature-action-clear{background-color:#f53d3d99}ajf-signature .ajf-signature-container .ajf-signature-actions .ajf-signature-action-accept{background-color:#32db6499}ajf-signature .ajf-signature-container .ajf-signature-actions .ajf-signature-action-accept[disabled=true]{background-color:#0000001f;color:#00000061}\n"], dependencies: [{ kind: "component", type: i2.MatFabButton, selector: "button[mat-fab]", inputs: ["extended"], exportAs: ["matButton"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: i4.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
78
110
  }
79
111
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfSignatureComponent, decorators: [{
80
112
  type: Component,
81
- args: [{ selector: 'ajf-signature', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [SIGNATURE_CONTROL_VALUE_ACCESSOR], template: "<div class=\"ajf-signature-container\">\n <p class=\"ajf-signature-text\">{{'Please sign here'|transloco}}</p>\n <canvas\n class=\"ajf-signature-canvas\"\n #sigPad\n (mousedown)=\"onMouseDown($event)\"\n (mousemove)=\"onMouseMove($event)\"\n (touchstart)=\"onMouseDown($event)\"\n (touchmove)=\"onMouseMove($event)\"\n ></canvas>\n <div class=\"ajf-signature-actions\">\n <button mat-fab (click)=\"clear()\" class=\"ajf-signature-action-clear\">\n <mat-icon>close</mat-icon>\n </button>\n <button mat-fab (click)=\"accept()\" color=\"primary\" [disabled]=\"!isDrawn\" class=\"ajf-signature-action-accept\">\n <mat-icon>check</mat-icon>\n </button>\n </div>\n\n <img class=\"ajf-signature-preview\" [src]=\"value?.content\" />\n</div>\n", styles: ["ajf-signature{display:block}ajf-signature .ajf-signature-container{width:100%;display:flex;flex-flow:column wrap;justify-content:center;align-items:center}ajf-signature .ajf-signature-container .ajf-signature-preview{max-width:200px;max-height:100px;margin:auto;padding:5px}ajf-signature .ajf-signature-container .ajf-signature-canvas{margin:auto;border-radius:10px;border:2px solid rgba(0,0,0,.4)}ajf-signature .ajf-signature-container .ajf-signature-actions{flex:1 0 auto;display:flex;flex-flow:row wrap;justify-content:space-around}ajf-signature .ajf-signature-container .ajf-signature-actions .mdc-fab{margin:10px}ajf-signature .ajf-signature-container .ajf-signature-actions .mdc-fab .mat-icon{margin-left:0!important}ajf-signature .ajf-signature-container .ajf-signature-actions .ajf-signature-action-clear{background-color:#f53d3d99}ajf-signature .ajf-signature-container .ajf-signature-actions .ajf-signature-action-accept{background-color:#32db6499}ajf-signature .ajf-signature-container .ajf-signature-actions .ajf-signature-action-accept[disabled=true]{background-color:#0000001f;color:#00000061}\n"] }]
82
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }] });
113
+ args: [{ selector: 'ajf-signature', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [SIGNATURE_CONTROL_VALUE_ACCESSOR], template: "<div class=\"ajf-signature-container\">\n <p class=\"ajf-signature-text\">{{'Please sign here'|transloco}}</p>\n <canvas\n class=\"ajf-signature-canvas\"\n #sigPad\n (mousedown)=\"onMouseDown($event)\"\n (mousemove)=\"onMouseMove($event)\"\n (touchstart)=\"onMouseDown($event)\"\n (touchmove)=\"onMouseMove($event)\"\n ></canvas>\n <div class=\"ajf-signature-actions\">\n <button mat-fab (click)=\"clear()\" class=\"ajf-signature-action-clear\">\n <mat-icon>close</mat-icon>\n </button>\n <button mat-fab (click)=\"accept()\" color=\"primary\" [disabled]=\"!isDrawn\" class=\"ajf-signature-action-accept\">\n <mat-icon>check</mat-icon>\n </button>\n </div>\n\n <img class=\"ajf-signature-preview\" [src]=\"safeImageSrc\" />\n</div>\n", styles: ["ajf-signature{display:block}ajf-signature .ajf-signature-container{width:100%;display:flex;flex-flow:column wrap;justify-content:center;align-items:center}ajf-signature .ajf-signature-container .ajf-signature-preview{max-width:200px;max-height:100px;margin:auto;padding:5px}ajf-signature .ajf-signature-container .ajf-signature-canvas{margin:auto;border-radius:10px;border:2px solid rgba(0,0,0,.4)}ajf-signature .ajf-signature-container .ajf-signature-actions{flex:1 0 auto;display:flex;flex-flow:row wrap;justify-content:space-around}ajf-signature .ajf-signature-container .ajf-signature-actions .mdc-fab{margin:10px}ajf-signature .ajf-signature-container .ajf-signature-actions .mdc-fab .mat-icon{margin-left:0!important}ajf-signature .ajf-signature-container .ajf-signature-actions .ajf-signature-action-clear{background-color:#f53d3d99}ajf-signature .ajf-signature-container .ajf-signature-actions .ajf-signature-action-accept{background-color:#32db6499}ajf-signature .ajf-signature-container .ajf-signature-actions .ajf-signature-action-accept[disabled=true]{background-color:#0000001f;color:#00000061}\n"] }]
114
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i1.DomSanitizer }] });
83
115
 
84
116
  /**
85
117
  * @license
@@ -1 +1 @@
1
- {"version":3,"file":"ajf-material-signature.mjs","sources":["../../../projects/material/signature/src/signature.ts","../../../projects/material/signature/src/signature.html","../../../projects/material/signature/src/signature-module.ts","../../../projects/material/signature/src/public_api.ts","../../../projects/material/signature/src/ajf-material-signature.ts"],"sourcesContent":["/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfSignature} from '@ajf/core/signature';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n OnDestroy,\n Renderer2,\n ViewEncapsulation,\n} from '@angular/core';\nimport {NG_VALUE_ACCESSOR} from '@angular/forms';\n\nexport const SIGNATURE_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AjfSignatureComponent),\n multi: true,\n};\n\n/**\n * Ajf signature component.\n */\n@Component({\n selector: 'ajf-signature',\n templateUrl: 'signature.html',\n styleUrls: ['signature.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [SIGNATURE_CONTROL_VALUE_ACCESSOR],\n})\nexport class AjfSignatureComponent extends AjfSignature implements OnDestroy, AfterViewInit {\n constructor(cdr: ChangeDetectorRef, renderer: Renderer2) {\n super(cdr, renderer);\n }\n\n ngAfterViewInit(): void {\n this.sigPadElement = this.sigPad.nativeElement;\n this.context = this.sigPadElement?.getContext('2d') ?? null;\n }\n\n clear() {\n if (this.context != null && this.sigPadElement != null) {\n this.context.clearRect(0, 0, this.sigPadElement.width, this.sigPadElement.height);\n this.context.beginPath();\n }\n this.isDrawn = false;\n this.value = null;\n }\n\n accept() {\n if (this.sigPadElement != null) {\n const signaturDataUrl = this.sigPadElement.toDataURL('image/png');\n const head = 'data:image/png;base64,';\n const imgFileSize = Math.round(((signaturDataUrl.length - head.length) * 3) / 4).toString();\n this.value = {\n name: 'signature.png',\n type: 'image/png',\n signature: true,\n size: imgFileSize,\n content: signaturDataUrl,\n };\n }\n }\n\n ngOnDestroy(): void {\n return;\n }\n}\n","<div class=\"ajf-signature-container\">\n <p class=\"ajf-signature-text\">{{'Please sign here'|transloco}}</p>\n <canvas\n class=\"ajf-signature-canvas\"\n #sigPad\n (mousedown)=\"onMouseDown($event)\"\n (mousemove)=\"onMouseMove($event)\"\n (touchstart)=\"onMouseDown($event)\"\n (touchmove)=\"onMouseMove($event)\"\n ></canvas>\n <div class=\"ajf-signature-actions\">\n <button mat-fab (click)=\"clear()\" class=\"ajf-signature-action-clear\">\n <mat-icon>close</mat-icon>\n </button>\n <button mat-fab (click)=\"accept()\" color=\"primary\" [disabled]=\"!isDrawn\" class=\"ajf-signature-action-accept\">\n <mat-icon>check</mat-icon>\n </button>\n </div>\n\n <img class=\"ajf-signature-preview\" [src]=\"value?.content\" />\n</div>\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCommonModule} from '@ajf/core/common';\nimport {AjfTranslocoModule} from '@ajf/core/transloco';\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatButtonModule} from '@angular/material/button';\nimport {MatIconModule} from '@angular/material/icon';\n\nimport {AjfSignatureComponent} from './signature';\nimport {FormsModule} from '@angular/forms';\n\n@NgModule({\n imports: [\n AjfCommonModule,\n AjfTranslocoModule,\n CommonModule,\n FormsModule,\n MatButtonModule,\n MatIconModule,\n ],\n declarations: [AjfSignatureComponent],\n exports: [AjfSignatureComponent],\n})\nexport class AjfSignatureModule {}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nexport * from './signature';\nexport * from './signature-module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;AAoBG;AAeU,MAAA,gCAAgC,GAAQ;AACnD,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,qBAAqB,CAAC;AACpD,IAAA,KAAK,EAAE,IAAI;;AAGb;;AAEG;AASG,MAAO,qBAAsB,SAAQ,YAAY,CAAA;IACrD,WAAY,CAAA,GAAsB,EAAE,QAAmB,EAAA;AACrD,QAAA,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC;;IAGtB,eAAe,GAAA;QACb,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa;AAC9C,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI;;IAG7D,KAAK,GAAA;AACH,QAAA,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,EAAE;YACtD,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,E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A,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAV3B,eAAe;YACf,kBAAkB;YAClB,YAAY;YACZ,WAAW;YACX,eAAe;YACf,aAAa,CAAA,EAAA,CAAA,CAAA;;4FAKJ,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAZ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,eAAe;wBACf,kBAAkB;wBAClB,YAAY;wBACZ,WAAW;wBACX,eAAe;wBACf,aAAa;AACd,qBAAA;oBACD,YAAY,EAAE,CAAC,qBAAqB,CAAC;oBACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;AACjC,iBAAA;;;AC3CD;;;;;;;;;;;;;;;;;;;;AAoBG;;ACpBH;;AAEG;;;;"}
1
+ {"version":3,"file":"ajf-material-signature.mjs","sources":["../../../projects/material/signature/src/signature.ts","../../../projects/material/signature/src/signature.html","../../../projects/material/signature/src/signature-module.ts","../../../projects/material/signature/src/public_api.ts","../../../projects/material/signature/src/ajf-material-signature.ts"],"sourcesContent":["/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfSignature} from '@ajf/core/signature';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n OnDestroy,\n Renderer2,\n ViewEncapsulation,\n} from '@angular/core';\nimport {NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {DomSanitizer, SafeUrl} from '@angular/platform-browser';\n\nexport const SIGNATURE_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AjfSignatureComponent),\n multi: true,\n};\n\n/**\n * Ajf signature component.\n */\n@Component({\n selector: 'ajf-signature',\n templateUrl: 'signature.html',\n styleUrls: ['signature.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [SIGNATURE_CONTROL_VALUE_ACCESSOR],\n})\nexport class AjfSignatureComponent extends AjfSignature implements OnDestroy, AfterViewInit {\n constructor(cdr: ChangeDetectorRef, renderer: Renderer2, private _sanitizer: DomSanitizer) {\n super(cdr, renderer);\n }\n\n ngAfterViewInit(): void {\n this.sigPadElement = this.sigPad.nativeElement;\n this.context = this.sigPadElement?.getContext('2d') ?? null;\n }\n\n /**\n * Clears the signature value and preview (keeps the old url to delete old signature from storage)\n */\n clear() {\n if (this.context != null && this.sigPadElement != null) {\n this.context.clearRect(0, 0, this.sigPadElement.width, this.sigPadElement.height);\n this.context.beginPath();\n }\n this.isDrawn = false;\n this.value = {\n name: 'signature.webp',\n type: 'image/webp',\n signature: true,\n size: undefined,\n content: undefined,\n url: this.value?.url ?? undefined,\n deleteUrl: true,\n };\n }\n\n /**\n * Accepts the new signature from the canvas and sets it as field value (keeps the old url to delete old signature from storage)\n */\n accept() {\n if (this.sigPadElement != null) {\n const signatureDataUrl = this.sigPadElement.toDataURL('image/webp', 0.5);\n\n const head = 'data:image/webp;base64,';\n const imgFileSize = Math.round(((signatureDataUrl.length - head.length) * 3) / 4);\n\n this.value = {\n name: 'signature.webp',\n type: 'image/webp',\n signature: true,\n size: imgFileSize,\n content: signatureDataUrl,\n url: this.value?.url ?? undefined,\n deleteUrl: false,\n };\n }\n }\n\n /**\n * Sanitizes signature image url\n */\n get safeImageSrc(): SafeUrl | string | null {\n if (!this.value) return null;\n if (!this.value.content && this.value.deleteUrl) return null;\n\n const rawUrl =\n this.value.content && this.value.content.length ? this.value.content : this.value.url;\n if (!rawUrl) return null;\n\n const sanitizedUrl = this._sanitizer.bypassSecurityTrustUrl(rawUrl);\n return sanitizedUrl;\n }\n\n ngOnDestroy(): void {\n return;\n }\n}\n","<div class=\"ajf-signature-container\">\n <p class=\"ajf-signature-text\">{{'Please sign here'|transloco}}</p>\n <canvas\n class=\"ajf-signature-canvas\"\n #sigPad\n (mousedown)=\"onMouseDown($event)\"\n (mousemove)=\"onMouseMove($event)\"\n (touchstart)=\"onMouseDown($event)\"\n (touchmove)=\"onMouseMove($event)\"\n ></canvas>\n <div class=\"ajf-signature-actions\">\n <button mat-fab (click)=\"clear()\" class=\"ajf-signature-action-clear\">\n <mat-icon>close</mat-icon>\n </button>\n <button mat-fab (click)=\"accept()\" color=\"primary\" [disabled]=\"!isDrawn\" class=\"ajf-signature-action-accept\">\n <mat-icon>check</mat-icon>\n </button>\n </div>\n\n <img class=\"ajf-signature-preview\" [src]=\"safeImageSrc\" />\n</div>\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfCommonModule} from '@ajf/core/common';\nimport {AjfTranslocoModule} from '@ajf/core/transloco';\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatButtonModule} from '@angular/material/button';\nimport {MatIconModule} from '@angular/material/icon';\n\nimport {AjfSignatureComponent} from './signature';\nimport {FormsModule} from '@angular/forms';\n\n@NgModule({\n imports: [\n AjfCommonModule,\n AjfTranslocoModule,\n CommonModule,\n FormsModule,\n MatButtonModule,\n MatIconModule,\n ],\n declarations: [AjfSignatureComponent],\n exports: [AjfSignatureComponent],\n})\nexport class AjfSignatureModule {}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nexport * from './signature';\nexport * from './signature-module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;AAoBG;AAgBU,MAAA,gCAAgC,GAAQ;AACnD,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,qBAAqB,CAAC;AACpD,IAAA,KAAK,EAAE,IAAI;;AAGb;;AAEG;AASG,MAAO,qBAAsB,SAAQ,YAAY,CAAA;AACrD,IAAA,WAAA,CAAY,GAAsB,EAAE,QAAmB,EAAU,UAAwB,EAAA;AACvF,QAAA,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC;QAD2C,IAAU,CAAA,UAAA,GAAV,UAAU;;IAI3E,e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AW;YACX,eAAe;AACf,YAAA,aAAa,aAGL,qBAAqB,CAAA,EAAA,CAAA,CAAA;AAEpB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAV3B,eAAe;YACf,kBAAkB;YAClB,YAAY;YACZ,WAAW;YACX,eAAe;YACf,aAAa,CAAA,EAAA,CAAA,CAAA;;4FAKJ,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAZ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,eAAe;wBACf,kBAAkB;wBAClB,YAAY;wBACZ,WAAW;wBACX,eAAe;wBACf,aAAa;AACd,qBAAA;oBACD,YAAY,EAAE,CAAC,qBAAqB,CAAC;oBACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;AACjC,iBAAA;;;AC3CD;;;;;;;;;;;;;;;;;;;;AAoBG;;ACpBH;;AAEG;;;;"}
@@ -1,12 +1,16 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
3
- import * as i1 from '@angular/forms';
3
+ import * as i2 from '@angular/forms';
4
4
  import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
5
- import * as i2 from '@angular/material/form-field';
5
+ import * as i3 from '@angular/material/form-field';
6
6
  import { MatFormFieldModule } from '@angular/material/form-field';
7
- import * as i3 from '@angular/material/input';
8
7
  import { MatInputModule } from '@angular/material/input';
9
8
  import { AjfTime as AjfTime$1 } from '@ajf/core/time';
9
+ import * as i1 from '@angular/common';
10
+ import { CommonModule } from '@angular/common';
11
+ import * as i4 from '@angular/material/select';
12
+ import { MatSelectModule } from '@angular/material/select';
13
+ import * as i5 from '@angular/material/core';
10
14
 
11
15
  /**
12
16
  * @license
@@ -37,13 +41,15 @@ const AJF_TIME_CONTROL_VALUE_ACCESSOR = {
37
41
  class AjfTime extends AjfTime$1 {
38
42
  constructor() {
39
43
  super();
44
+ this.hoursList = Array.from({ length: 24 }, (_, i) => i);
45
+ this.minutesList = Array.from({ length: 60 }, (_, i) => i);
40
46
  }
41
47
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfTime, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
42
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfTime, selector: "ajf-time", providers: [AJF_TIME_CONTROL_VALUE_ACCESSOR], usesInheritance: true, ngImport: i0, template: "<div>\n <mat-form-field>\n <input\n matInput\n min=\"0\"\n max=\"23\"\n (focus)=\"focusHandler()\"\n [(ngModel)]=\"hours\"\n type=\"number\">\n </mat-form-field>\n :\n <mat-form-field>\n <input\n matInput\n min=\"0\"\n max=\"59\"\n (focus)=\"focusHandler()\"\n [(ngModel)]=\"minutes\"\n type=\"number\">\n </mat-form-field>\n</div>\n", styles: ["ajf-time .mat-mdc-form-field{width:3.5em;text-align:center}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
48
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AjfTime, selector: "ajf-time", providers: [AJF_TIME_CONTROL_VALUE_ACCESSOR], usesInheritance: true, ngImport: i0, template: "<div>\n <mat-form-field>\n <mat-select [(ngModel)]=\"hours\" (opened)=\"focusHandler()\" placeholder=\"HH\">\n <mat-option *ngFor=\"let h of hoursList\" [value]=\"h\">\n {{ h | number:'2.0' }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n :\n <mat-form-field>\n <mat-select [(ngModel)]=\"minutes\" (opened)=\"focusHandler()\" placeholder=\"MM\">\n <mat-option *ngFor=\"let m of minutesList\" [value]=\"m\">\n {{ m | number:'2.0' }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n</div>", styles: ["ajf-time .mat-mdc-form-field{width:4.5em;text-align:center}ajf-time .mat-mdc-select{margin:0!important}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
43
49
  }
44
50
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfTime, decorators: [{
45
51
  type: Component,
46
- args: [{ selector: 'ajf-time', providers: [AJF_TIME_CONTROL_VALUE_ACCESSOR], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div>\n <mat-form-field>\n <input\n matInput\n min=\"0\"\n max=\"23\"\n (focus)=\"focusHandler()\"\n [(ngModel)]=\"hours\"\n type=\"number\">\n </mat-form-field>\n :\n <mat-form-field>\n <input\n matInput\n min=\"0\"\n max=\"59\"\n (focus)=\"focusHandler()\"\n [(ngModel)]=\"minutes\"\n type=\"number\">\n </mat-form-field>\n</div>\n", styles: ["ajf-time .mat-mdc-form-field{width:3.5em;text-align:center}\n"] }]
52
+ args: [{ selector: 'ajf-time', providers: [AJF_TIME_CONTROL_VALUE_ACCESSOR], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div>\n <mat-form-field>\n <mat-select [(ngModel)]=\"hours\" (opened)=\"focusHandler()\" placeholder=\"HH\">\n <mat-option *ngFor=\"let h of hoursList\" [value]=\"h\">\n {{ h | number:'2.0' }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n :\n <mat-form-field>\n <mat-select [(ngModel)]=\"minutes\" (opened)=\"focusHandler()\" placeholder=\"MM\">\n <mat-option *ngFor=\"let m of minutesList\" [value]=\"m\">\n {{ m | number:'2.0' }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n</div>", styles: ["ajf-time .mat-mdc-form-field{width:4.5em;text-align:center}ajf-time .mat-mdc-select{margin:0!important}\n"] }]
47
53
  }], ctorParameters: () => [] });
48
54
 
49
55
  /**
@@ -69,13 +75,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
69
75
  */
70
76
  class AjfTimeModule {
71
77
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
72
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: AjfTimeModule, declarations: [AjfTime], imports: [FormsModule, MatFormFieldModule, MatInputModule], exports: [AjfTime] }); }
73
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfTimeModule, imports: [FormsModule, MatFormFieldModule, MatInputModule] }); }
78
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: AjfTimeModule, declarations: [AjfTime], imports: [CommonModule, FormsModule, MatFormFieldModule, MatInputModule, MatSelectModule], exports: [AjfTime] }); }
79
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfTimeModule, imports: [CommonModule, FormsModule, MatFormFieldModule, MatInputModule, MatSelectModule] }); }
74
80
  }
75
81
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AjfTimeModule, decorators: [{
76
82
  type: NgModule,
77
83
  args: [{
78
- imports: [FormsModule, MatFormFieldModule, MatInputModule],
84
+ imports: [CommonModule, FormsModule, MatFormFieldModule, MatInputModule, MatSelectModule],
79
85
  declarations: [AjfTime],
80
86
  exports: [AjfTime],
81
87
  }]
@@ -1 +1 @@
1
- {"version":3,"file":"ajf-material-time.mjs","sources":["../../../projects/material/time/src/time.ts","../../../projects/material/time/src/time.html","../../../projects/material/time/src/time-module.ts","../../../projects/material/time/src/public_api.ts","../../../projects/material/time/src/ajf-material-time.ts"],"sourcesContent":["/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfTime as Base} from '@ajf/core/time';\nimport {\n ChangeDetectionStrategy,\n Component,\n forwardRef,\n OnDestroy,\n ViewEncapsulation,\n} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\n\nexport const AJF_TIME_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AjfTime),\n multi: true,\n};\n\n@Component({\n selector: 'ajf-time',\n templateUrl: 'time.html',\n styleUrls: ['time.scss'],\n providers: [AJF_TIME_CONTROL_VALUE_ACCESSOR],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AjfTime extends Base implements ControlValueAccessor, OnDestroy {\n constructor() {\n super();\n }\n}\n","<div>\n <mat-form-field>\n <input\n matInput\n min=\"0\"\n max=\"23\"\n (focus)=\"focusHandler()\"\n [(ngModel)]=\"hours\"\n type=\"number\">\n </mat-form-field>\n :\n <mat-form-field>\n <input\n matInput\n min=\"0\"\n max=\"59\"\n (focus)=\"focusHandler()\"\n [(ngModel)]=\"minutes\"\n type=\"number\">\n </mat-form-field>\n</div>\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {NgModule} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {MatFormFieldModule} from '@angular/material/form-field';\nimport {MatInputModule} from '@angular/material/input';\n\nimport {AjfTime} from './time';\n\n@NgModule({\n imports: [FormsModule, MatFormFieldModule, MatInputModule],\n declarations: [AjfTime],\n exports: [AjfTime],\n})\nexport class AjfTimeModule {}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nexport * from './time-module';\nexport * from './time';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["Base"],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;AAoBG;AAYU,MAAA,+BAA+B,GAAQ;AAClD,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,OAAO,CAAC;AACtC,IAAA,KAAK,EAAE,IAAI;;AAWP,MAAO,OAAQ,SAAQA,SAAI,CAAA;AAC/B,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;+GAFE,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAP,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,OAAO,EAJP,QAAA,EAAA,UAAA,EAAA,SAAA,EAAA,CAAC,+BAA+B,CAAC,iDC1C9C,8aAqBA,EAAA,MAAA,EAAA,CAAA,+DAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,8MAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,QAAA,EAAA,iGAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,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AC7B,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,8aAAA,EAAA,MAAA,EAAA,CAAA,+DAAA,CAAA,EAAA;;;AE5CjD;;;;;;;;;;;;;;;;;;;;AAoBG;MAcU,aAAa,CAAA;+GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAb,aAAa,EAAA,YAAA,EAAA,CAHT,OAAO,CADZ,EAAA,OAAA,EAAA,CAAA,WAAW,EAAE,kBAAkB,EAAE,cAAc,CAAA,EAAA,OAAA,EAAA,CAE/C,OAAO,CAAA,EAAA,CAAA,CAAA;AAEN,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,EAJd,OAAA,EAAA,CAAA,WAAW,EAAE,kBAAkB,EAAE,cAAc,CAAA,EAAA,CAAA,CAAA;;4FAI9C,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,WAAW,EAAE,kBAAkB,EAAE,cAAc,CAAC;oBAC1D,YAAY,EAAE,CAAC,OAAO,CAAC;oBACvB,OAAO,EAAE,CAAC,OAAO,CAAC;AACnB,iBAAA;;;ACjCD;;;;;;;;;;;;;;;;;;;;AAoBG;;ACpBH;;AAEG;;;;"}
1
+ {"version":3,"file":"ajf-material-time.mjs","sources":["../../../projects/material/time/src/time.ts","../../../projects/material/time/src/time.html","../../../projects/material/time/src/time-module.ts","../../../projects/material/time/src/public_api.ts","../../../projects/material/time/src/ajf-material-time.ts"],"sourcesContent":["/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {AjfTime as Base} from '@ajf/core/time';\nimport {\n ChangeDetectionStrategy,\n Component,\n forwardRef,\n OnDestroy,\n ViewEncapsulation,\n} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\n\nexport const AJF_TIME_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AjfTime),\n multi: true,\n};\n\n@Component({\n selector: 'ajf-time',\n templateUrl: 'time.html',\n styleUrls: ['time.scss'],\n providers: [AJF_TIME_CONTROL_VALUE_ACCESSOR],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AjfTime extends Base implements ControlValueAccessor, OnDestroy {\n hoursList: number[] = Array.from({length: 24}, (_, i) => i);\n minutesList: number[] = Array.from({length: 60}, (_, i) => i);\n\n constructor() {\n super();\n }\n}\n","<div>\n <mat-form-field>\n <mat-select [(ngModel)]=\"hours\" (opened)=\"focusHandler()\" placeholder=\"HH\">\n <mat-option *ngFor=\"let h of hoursList\" [value]=\"h\">\n {{ h | number:'2.0' }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n :\n <mat-form-field>\n <mat-select [(ngModel)]=\"minutes\" (opened)=\"focusHandler()\" placeholder=\"MM\">\n <mat-option *ngFor=\"let m of minutesList\" [value]=\"m\">\n {{ m | number:'2.0' }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n</div>","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {NgModule} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {MatFormFieldModule} from '@angular/material/form-field';\nimport {MatInputModule} from '@angular/material/input';\n\nimport {AjfTime} from './time';\nimport {MatSelectModule} from '@angular/material/select';\nimport {CommonModule} from '@angular/common';\n\n@NgModule({\n imports: [CommonModule, FormsModule, MatFormFieldModule, MatInputModule, MatSelectModule],\n declarations: [AjfTime],\n exports: [AjfTime],\n})\nexport class AjfTimeModule {}\n","/**\n * @license\n * Copyright (C) Gnucoop soc. coop.\n *\n * This file is part of the Advanced JSON forms (ajf).\n *\n * Advanced JSON forms (ajf) is free software: you can redistribute it and/or\n * modify it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the License,\n * or (at your option) any later version.\n *\n * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero\n * General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with Advanced JSON forms (ajf).\n * If not, see http://www.gnu.org/licenses/.\n *\n */\n\nexport * from './time-module';\nexport * from './time';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["Base"],"mappings":";;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AA;;;ACnCD;;;;;;;;;;;;;;;;;;;;AAoBG;;ACpBH;;AAEG;;;;"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license
3
+ * Copyright (C) Gnucoop soc. coop.
4
+ *
5
+ * This file is part of the Advanced JSON forms (ajf).
6
+ *
7
+ * Advanced JSON forms (ajf) is free software: you can redistribute it and/or
8
+ * modify it under the terms of the GNU Affero General Public License as
9
+ * published by the Free Software Foundation, either version 3 of the License,
10
+ * or (at your option) any later version.
11
+ *
12
+ * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
15
+ * General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Affero General Public License
18
+ * along with Advanced JSON forms (ajf).
19
+ * If not, see http://www.gnu.org/licenses/.
20
+ *
21
+ */
22
+ import { AjfFormRendererService, AjfAudioFieldComponent as CoreComponent } from '@ajf/core/forms';
23
+ import { ChangeDetectorRef } from '@angular/core';
24
+ import { AjfWarningAlertService } from './warning-alert-service';
25
+ import * as i0 from "@angular/core";
26
+ export declare class AjfAudioFieldComponent extends CoreComponent {
27
+ constructor(cdr: ChangeDetectorRef, service: AjfFormRendererService, was: AjfWarningAlertService);
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<AjfAudioFieldComponent, never>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<AjfAudioFieldComponent, "ng-component", never, {}, {}, never, never, false, never>;
30
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license
3
+ * Copyright (C) Gnucoop soc. coop.
4
+ *
5
+ * This file is part of the Advanced JSON forms (ajf).
6
+ *
7
+ * Advanced JSON forms (ajf) is free software: you can redistribute it and/or
8
+ * modify it under the terms of the GNU Affero General Public License as
9
+ * published by the Free Software Foundation, either version 3 of the License,
10
+ * or (at your option) any later version.
11
+ *
12
+ * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
15
+ * General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Affero General Public License
18
+ * along with Advanced JSON forms (ajf).
19
+ * If not, see http://www.gnu.org/licenses/.
20
+ *
21
+ */
22
+ import { ChangeDetectorRef } from '@angular/core';
23
+ import { AjfFormRendererService, AjfInputFieldComponent, AjfWarningAlertService } from '@ajf/core/forms';
24
+ import * as i0 from "@angular/core";
25
+ /**
26
+ * this component show the control value inherited from AjfBaseFieldComponent.
27
+ *
28
+ * @export
29
+ * @class AjfDisplayFieldComponent
30
+ */
31
+ export declare class AjfDisplayFieldComponent extends AjfInputFieldComponent {
32
+ constructor(cdr: ChangeDetectorRef, service: AjfFormRendererService, was: AjfWarningAlertService);
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<AjfDisplayFieldComponent, never>;
34
+ static ɵcmp: i0.ɵɵComponentDeclaration<AjfDisplayFieldComponent, "ajf-display-field", never, {}, {}, never, never, false, never>;
35
+ }
package/forms/form.d.ts CHANGED
@@ -19,7 +19,7 @@
19
19
  * If not, see http://www.gnu.org/licenses/.
20
20
  *
21
21
  */
22
- import { AjfFormRenderer as CoreFormRenderer, AjfFormRendererService } from '@ajf/core/forms';
22
+ import { AjfFormRenderer as CoreFormRenderer, AjfFormRendererService, AjfFieldInstance } from '@ajf/core/forms';
23
23
  import { BooleanInput } from '@angular/cdk/coercion';
24
24
  import { ChangeDetectorRef } from '@angular/core';
25
25
  import * as i0 from "@angular/core";
@@ -28,6 +28,7 @@ export declare class AjfFormRenderer extends CoreFormRenderer {
28
28
  centeredFieldsContent: boolean;
29
29
  maxColumns: 1 | 2 | 3;
30
30
  constructor(rendererService: AjfFormRendererService, changeDetectorRef: ChangeDetectorRef);
31
+ fieldStyle(field: AjfFieldInstance): any;
31
32
  static ngAcceptInputType_fixedOrientation: BooleanInput;
32
33
  static ngAcceptInputType_hasEndMessage: BooleanInput;
33
34
  static ngAcceptInputType_hasStartMessage: BooleanInput;
@@ -1,55 +1,59 @@
1
1
  import { ModuleWithProviders } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
- import * as i1 from "./barcode-field";
4
- import * as i2 from "./boolean-field";
5
- import * as i3 from "./date-field";
6
- import * as i4 from "./date-input-field";
7
- import * as i5 from "./empty-field";
8
- import * as i6 from "./field-warning-dialog";
9
- import * as i7 from "./field";
10
- import * as i8 from "./form";
11
- import * as i9 from "./geolocation-field";
12
- import * as i10 from "./input-field";
13
- import * as i11 from "./multiple-choice-field";
14
- import * as i12 from "./range-field";
15
- import * as i13 from "./signature-field";
16
- import * as i14 from "./single-choice-field";
17
- import * as i15 from "./table-field";
18
- import * as i16 from "./text-field";
19
- import * as i17 from "./time-field";
20
- import * as i18 from "./video-url-field";
21
- import * as i19 from "@ajf/material/barcode";
22
- import * as i20 from "@ajf/material/calendar";
23
- import * as i21 from "@ajf/core/common";
24
- import * as i22 from "@ajf/material/checkbox-group";
25
- import * as i23 from "@ajf/material/geolocation";
26
- import * as i24 from "@ajf/material/page-slider";
27
- import * as i25 from "@ajf/material/signature";
28
- import * as i26 from "@ajf/material/time";
29
- import * as i27 from "@ajf/core/transloco";
30
- import * as i28 from "@angular/common";
31
- import * as i29 from "@ajf/core/forms";
32
- import * as i30 from "@angular/material/button";
33
- import * as i31 from "@angular/material/button-toggle";
34
- import * as i32 from "@angular/material/card";
35
- import * as i33 from "@angular/material/datepicker";
36
- import * as i34 from "@angular/material/dialog";
37
- import * as i35 from "@angular/material/form-field";
38
- import * as i36 from "@angular/material/icon";
39
- import * as i37 from "@angular/material/input";
40
- import * as i38 from "@angular/material/core";
41
- import * as i39 from "@angular/material/radio";
42
- import * as i40 from "@angular/material/select";
43
- import * as i41 from "@angular/material/slide-toggle";
44
- import * as i42 from "@angular/material/toolbar";
45
- import * as i43 from "@angular/material/tooltip";
46
- import * as i44 from "@angular/forms";
47
- import * as i45 from "@angular/cdk/text-field";
48
- import * as i46 from "@angular/material/slider";
49
- import * as i47 from "ngx-mat-select-search";
3
+ import * as i1 from "./audio-field";
4
+ import * as i2 from "./barcode-field";
5
+ import * as i3 from "./boolean-field";
6
+ import * as i4 from "./date-field";
7
+ import * as i5 from "./date-input-field";
8
+ import * as i6 from "./empty-field";
9
+ import * as i7 from "./field-warning-dialog";
10
+ import * as i8 from "./field";
11
+ import * as i9 from "./form";
12
+ import * as i10 from "./geolocation-field";
13
+ import * as i11 from "./input-field";
14
+ import * as i12 from "./multiple-choice-field";
15
+ import * as i13 from "./range-field";
16
+ import * as i14 from "./signature-field";
17
+ import * as i15 from "./single-choice-field";
18
+ import * as i16 from "./table-field";
19
+ import * as i17 from "./text-field";
20
+ import * as i18 from "./time-field";
21
+ import * as i19 from "./video-url-field";
22
+ import * as i20 from "./display-field";
23
+ import * as i21 from "@ajf/material/audio";
24
+ import * as i22 from "@ajf/material/barcode";
25
+ import * as i23 from "@ajf/material/calendar";
26
+ import * as i24 from "@ajf/core/common";
27
+ import * as i25 from "@ajf/material/checkbox-group";
28
+ import * as i26 from "@ajf/material/geolocation";
29
+ import * as i27 from "@ajf/material/page-slider";
30
+ import * as i28 from "@ajf/material/signature";
31
+ import * as i29 from "@ajf/material/time";
32
+ import * as i30 from "@ajf/core/transloco";
33
+ import * as i31 from "@angular/common";
34
+ import * as i32 from "@ajf/core/forms";
35
+ import * as i33 from "@angular/material/button";
36
+ import * as i34 from "@angular/material/button-toggle";
37
+ import * as i35 from "@angular/material/card";
38
+ import * as i36 from "@angular/material/datepicker";
39
+ import * as i37 from "@angular/material/dialog";
40
+ import * as i38 from "@angular/material/form-field";
41
+ import * as i39 from "@angular/material/icon";
42
+ import * as i40 from "@angular/material/input";
43
+ import * as i41 from "@angular/material/core";
44
+ import * as i42 from "@angular/material/radio";
45
+ import * as i43 from "@angular/material/select";
46
+ import * as i44 from "@angular/material/slide-toggle";
47
+ import * as i45 from "@angular/material/toolbar";
48
+ import * as i46 from "@angular/material/tooltip";
49
+ import * as i47 from "@angular/forms";
50
+ import * as i48 from "@angular/cdk/text-field";
51
+ import * as i49 from "@angular/material/slider";
52
+ import * as i50 from "ngx-mat-select-search";
53
+ import * as i51 from "ngx-quill";
50
54
  export declare class AjfFormsModule {
51
55
  static forRoot(): ModuleWithProviders<AjfFormsModule>;
52
56
  static ɵfac: i0.ɵɵFactoryDeclaration<AjfFormsModule, never>;
53
- static ɵmod: i0.ɵɵNgModuleDeclaration<AjfFormsModule, [typeof i1.AjfBarcodeFieldComponent, typeof i2.AjfBooleanFieldComponent, typeof i3.AjfDateFieldComponent, typeof i4.AjfDateInputFieldComponent, typeof i5.AjfEmptyFieldComponent, typeof i6.AjfFieldWarningDialog, typeof i7.AjfFormField, typeof i8.AjfFormRenderer, typeof i9.AjfGeolocationFieldComponent, typeof i10.AjfInputFieldComponent, typeof i11.AjfMultipleChoiceFieldComponent, typeof i12.AjfRangeFieldComponent, typeof i13.AjfSignatureFieldComponent, typeof i14.AjfSingleChoiceFieldComponent, typeof i15.AjfTableFieldComponent, typeof i16.AjfTextFieldComponent, typeof i17.AjfTimeFieldComponent, typeof i18.AjfVideoUrlFieldComponent], [typeof i19.AjfBarcodeModule, typeof i20.AjfCalendarModule, typeof i21.AjfCommonModule, typeof i22.AjfCheckboxGroupModule, typeof i23.AjfGeolocationModule, typeof i24.AjfPageSliderModule, typeof i25.AjfSignatureModule, typeof i26.AjfTimeModule, typeof i27.AjfTranslocoModule, typeof i28.CommonModule, typeof i29.AjfFormsModule, typeof i30.MatButtonModule, typeof i31.MatButtonToggleModule, typeof i32.MatCardModule, typeof i33.MatDatepickerModule, typeof i34.MatDialogModule, typeof i35.MatFormFieldModule, typeof i36.MatIconModule, typeof i37.MatInputModule, typeof i38.MatNativeDateModule, typeof i39.MatRadioModule, typeof i40.MatSelectModule, typeof i41.MatSlideToggleModule, typeof i42.MatToolbarModule, typeof i43.MatTooltipModule, typeof i44.ReactiveFormsModule, typeof i45.TextFieldModule, typeof i46.MatSliderModule, typeof i47.NgxMatSelectSearchModule], [typeof i7.AjfFormField, typeof i8.AjfFormRenderer]>;
57
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AjfFormsModule, [typeof i1.AjfAudioFieldComponent, typeof i2.AjfBarcodeFieldComponent, typeof i3.AjfBooleanFieldComponent, typeof i4.AjfDateFieldComponent, typeof i5.AjfDateInputFieldComponent, typeof i6.AjfEmptyFieldComponent, typeof i7.AjfFieldWarningDialog, typeof i8.AjfFormField, typeof i9.AjfFormRenderer, typeof i10.AjfGeolocationFieldComponent, typeof i11.AjfInputFieldComponent, typeof i12.AjfMultipleChoiceFieldComponent, typeof i13.AjfRangeFieldComponent, typeof i14.AjfSignatureFieldComponent, typeof i15.AjfSingleChoiceFieldComponent, typeof i16.AjfTableFieldComponent, typeof i17.AjfTextFieldComponent, typeof i18.AjfTimeFieldComponent, typeof i19.AjfVideoUrlFieldComponent, typeof i20.AjfDisplayFieldComponent], [typeof i21.AjfAudioModule, typeof i22.AjfBarcodeModule, typeof i23.AjfCalendarModule, typeof i24.AjfCommonModule, typeof i25.AjfCheckboxGroupModule, typeof i26.AjfGeolocationModule, typeof i27.AjfPageSliderModule, typeof i28.AjfSignatureModule, typeof i29.AjfTimeModule, typeof i30.AjfTranslocoModule, typeof i31.CommonModule, typeof i32.AjfFormsModule, typeof i33.MatButtonModule, typeof i34.MatButtonToggleModule, typeof i35.MatCardModule, typeof i36.MatDatepickerModule, typeof i37.MatDialogModule, typeof i38.MatFormFieldModule, typeof i39.MatIconModule, typeof i40.MatInputModule, typeof i41.MatNativeDateModule, typeof i42.MatRadioModule, typeof i43.MatSelectModule, typeof i44.MatSlideToggleModule, typeof i45.MatToolbarModule, typeof i46.MatTooltipModule, typeof i47.ReactiveFormsModule, typeof i48.TextFieldModule, typeof i49.MatSliderModule, typeof i50.NgxMatSelectSearchModule, typeof i51.QuillModule], [typeof i8.AjfFormField, typeof i9.AjfFormRenderer]>;
54
58
  static ɵinj: i0.ɵɵInjectorDeclaration<AjfFormsModule>;
55
59
  }
@@ -26,6 +26,7 @@ import { AjfWarningAlertService } from './warning-alert-service';
26
26
  import * as i0 from "@angular/core";
27
27
  export declare class AjfRangeFieldComponent extends AjfRange {
28
28
  constructor(cdr: ChangeDetectorRef, service: AjfFormRendererService, was: AjfWarningAlertService);
29
+ enumerateStars(): number[];
29
30
  static ɵfac: i0.ɵɵFactoryDeclaration<AjfRangeFieldComponent, never>;
30
31
  static ɵcmp: i0.ɵɵComponentDeclaration<AjfRangeFieldComponent, "ajf-range", never, {}, {}, never, never, false, never>;
31
32
  }
@@ -20,11 +20,17 @@
20
20
  *
21
21
  */
22
22
  import { AjfFormRendererService, AjfInputFieldComponent as CoreComponent } from '@ajf/core/forms';
23
- import { ChangeDetectorRef } from '@angular/core';
23
+ import { ChangeDetectorRef, OnInit } from '@angular/core';
24
24
  import { AjfWarningAlertService } from './warning-alert-service';
25
25
  import * as i0 from "@angular/core";
26
- export declare class AjfTextFieldComponent extends CoreComponent {
26
+ export declare class AjfTextFieldComponent extends CoreComponent implements OnInit {
27
+ quillModules: {
28
+ toolbar: (string[] | {
29
+ list: string;
30
+ }[])[];
31
+ };
27
32
  constructor(cdr: ChangeDetectorRef, service: AjfFormRendererService, was: AjfWarningAlertService);
33
+ ngOnInit(): void;
28
34
  static ɵfac: i0.ɵɵFactoryDeclaration<AjfTextFieldComponent, never>;
29
35
  static ɵcmp: i0.ɵɵComponentDeclaration<AjfTextFieldComponent, "ng-component", never, {}, {}, never, never, false, never>;
30
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ajf/material",
3
- "version": "18.1.0",
3
+ "version": "18.1.2",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "homepage": "https://github.com/gnucoop/ajf#readme",
15
15
  "peerDependencies": {
16
- "@ajf/core": "18.1.0",
16
+ "@ajf/core": "18.1.2",
17
17
  "@angular/animations": "^18.2.13",
18
18
  "@angular/cdk": "^18.2.14",
19
19
  "@angular/common": "^18.2.13",
@@ -37,6 +37,12 @@
37
37
  "esm": "./esm2022/ajf-material.mjs",
38
38
  "default": "./fesm2022/ajf-material.mjs"
39
39
  },
40
+ "./audio": {
41
+ "types": "./audio/index.d.ts",
42
+ "esm2022": "./esm2022/audio/ajf-material-audio.mjs",
43
+ "esm": "./esm2022/audio/ajf-material-audio.mjs",
44
+ "default": "./fesm2022/ajf-material-audio.mjs"
45
+ },
40
46
  "./barcode": {
41
47
  "types": "./barcode/index.d.ts",
42
48
  "esm2022": "./esm2022/barcode/ajf-material-barcode.mjs",
@@ -21,16 +21,28 @@
21
21
  */
22
22
  import { AjfSignature } from '@ajf/core/signature';
23
23
  import { AfterViewInit, ChangeDetectorRef, OnDestroy, Renderer2 } from '@angular/core';
24
+ import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
24
25
  import * as i0 from "@angular/core";
25
26
  export declare const SIGNATURE_CONTROL_VALUE_ACCESSOR: any;
26
27
  /**
27
28
  * Ajf signature component.
28
29
  */
29
30
  export declare class AjfSignatureComponent extends AjfSignature implements OnDestroy, AfterViewInit {
30
- constructor(cdr: ChangeDetectorRef, renderer: Renderer2);
31
+ private _sanitizer;
32
+ constructor(cdr: ChangeDetectorRef, renderer: Renderer2, _sanitizer: DomSanitizer);
31
33
  ngAfterViewInit(): void;
34
+ /**
35
+ * Clears the signature value and preview (keeps the old url to delete old signature from storage)
36
+ */
32
37
  clear(): void;
38
+ /**
39
+ * Accepts the new signature from the canvas and sets it as field value (keeps the old url to delete old signature from storage)
40
+ */
33
41
  accept(): void;
42
+ /**
43
+ * Sanitizes signature image url
44
+ */
45
+ get safeImageSrc(): SafeUrl | string | null;
34
46
  ngOnDestroy(): void;
35
47
  static ɵfac: i0.ɵɵFactoryDeclaration<AjfSignatureComponent, never>;
36
48
  static ɵcmp: i0.ɵɵComponentDeclaration<AjfSignatureComponent, "ajf-signature", never, {}, {}, never, never, false, never>;