@ajf/material 15.3.2 → 15.3.4

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 (44) hide show
  1. package/esm2020/form-builder/form-builder-service.mjs +37 -1
  2. package/esm2020/form-builder/node-properties.mjs +12 -5
  3. package/esm2020/forms/field-service.mjs +6 -1
  4. package/esm2020/forms/forms-module.mjs +8 -1
  5. package/esm2020/forms/range-field.mjs +2 -2
  6. package/esm2020/forms/signature-field.mjs +50 -0
  7. package/esm2020/node-icon/node-icon.mjs +3 -1
  8. package/esm2020/reports/chart-widget.mjs +1 -1
  9. package/esm2020/reports/report.mjs +5 -4
  10. package/esm2020/reports/table-widget.mjs +1 -1
  11. package/esm2020/reports/widget.mjs +1 -1
  12. package/esm2020/signature/ajf-material-signature.mjs +5 -0
  13. package/esm2020/signature/public_api.mjs +24 -0
  14. package/esm2020/signature/signature-module.mjs +61 -0
  15. package/esm2020/signature/signature.mjs +77 -0
  16. package/fesm2015/ajf-material-form-builder.mjs +48 -4
  17. package/fesm2015/ajf-material-form-builder.mjs.map +1 -1
  18. package/fesm2015/ajf-material-forms.mjs +60 -5
  19. package/fesm2015/ajf-material-forms.mjs.map +1 -1
  20. package/fesm2015/ajf-material-node-icon.mjs +2 -0
  21. package/fesm2015/ajf-material-node-icon.mjs.map +1 -1
  22. package/fesm2015/ajf-material-reports.mjs +5 -5
  23. package/fesm2015/ajf-material-reports.mjs.map +1 -1
  24. package/fesm2015/ajf-material-signature.mjs +164 -0
  25. package/fesm2015/ajf-material-signature.mjs.map +1 -0
  26. package/fesm2020/ajf-material-form-builder.mjs +47 -4
  27. package/fesm2020/ajf-material-form-builder.mjs.map +1 -1
  28. package/fesm2020/ajf-material-forms.mjs +58 -5
  29. package/fesm2020/ajf-material-forms.mjs.map +1 -1
  30. package/fesm2020/ajf-material-node-icon.mjs +2 -0
  31. package/fesm2020/ajf-material-node-icon.mjs.map +1 -1
  32. package/fesm2020/ajf-material-reports.mjs +5 -5
  33. package/fesm2020/ajf-material-reports.mjs.map +1 -1
  34. package/fesm2020/ajf-material-signature.mjs +163 -0
  35. package/fesm2020/ajf-material-signature.mjs.map +1 -0
  36. package/form-builder/form-builder-service.d.ts +7 -0
  37. package/form-builder/node-properties.d.ts +1 -0
  38. package/forms/forms-module.d.ts +35 -33
  39. package/forms/signature-field.d.ts +36 -0
  40. package/package.json +10 -2
  41. package/signature/index.d.ts +5 -0
  42. package/signature/public_api.d.ts +23 -0
  43. package/signature/signature-module.d.ts +13 -0
  44. package/signature/signature.d.ts +37 -0
@@ -0,0 +1,163 @@
1
+ import { AjfSignature } from '@ajf/core/signature';
2
+ import * as i0 from '@angular/core';
3
+ import { forwardRef, Component, ViewEncapsulation, ChangeDetectionStrategy, NgModule } from '@angular/core';
4
+ import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
5
+ import * as i1 from '@angular/material/button';
6
+ import { MatButtonModule } from '@angular/material/button';
7
+ import * as i2 from '@angular/material/icon';
8
+ import { MatIconModule } from '@angular/material/icon';
9
+ import * as i3 from '@ngneat/transloco';
10
+ import { AjfCommonModule } from '@ajf/core/common';
11
+ import { AjfTranslocoModule } from '@ajf/core/transloco';
12
+ import { CommonModule } from '@angular/common';
13
+
14
+ /**
15
+ * @license
16
+ * Copyright (C) Gnucoop soc. coop.
17
+ *
18
+ * This file is part of the Advanced JSON forms (ajf).
19
+ *
20
+ * Advanced JSON forms (ajf) is free software: you can redistribute it and/or
21
+ * modify it under the terms of the GNU Affero General Public License as
22
+ * published by the Free Software Foundation, either version 3 of the License,
23
+ * or (at your option) any later version.
24
+ *
25
+ * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,
26
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
28
+ * General Public License for more details.
29
+ *
30
+ * You should have received a copy of the GNU Affero General Public License
31
+ * along with Advanced JSON forms (ajf).
32
+ * If not, see http://www.gnu.org/licenses/.
33
+ *
34
+ */
35
+ const SIGNATURE_CONTROL_VALUE_ACCESSOR = {
36
+ provide: NG_VALUE_ACCESSOR,
37
+ useExisting: forwardRef(() => AjfSignatureComponent),
38
+ multi: true,
39
+ };
40
+ /**
41
+ * Ajf signature component.
42
+ */
43
+ class AjfSignatureComponent extends AjfSignature {
44
+ constructor(cdr, renderer) {
45
+ super(cdr, renderer);
46
+ }
47
+ ngAfterViewInit() {
48
+ this.sigPadElement = this.sigPad.nativeElement;
49
+ this.context = this.sigPadElement?.getContext('2d') ?? null;
50
+ }
51
+ clear() {
52
+ if (this.context != null && this.sigPadElement != null) {
53
+ this.context.clearRect(0, 0, this.sigPadElement.width, this.sigPadElement.height);
54
+ this.context.beginPath();
55
+ }
56
+ this.isDrawn = false;
57
+ this.value = null;
58
+ }
59
+ accept() {
60
+ 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();
64
+ this.value = {
65
+ name: 'signature.png',
66
+ type: 'image/png',
67
+ signature: true,
68
+ size: imgFileSize,
69
+ content: signaturDataUrl,
70
+ };
71
+ }
72
+ }
73
+ ngOnDestroy() {
74
+ return;
75
+ }
76
+ }
77
+ AjfSignatureComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AjfSignatureComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
78
+ AjfSignatureComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", 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: ["disabled", "disableRipple", "color", "tabIndex", "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 });
79
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AjfSignatureComponent, decorators: [{
80
+ 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: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }]; } });
83
+
84
+ /**
85
+ * @license
86
+ * Copyright (C) Gnucoop soc. coop.
87
+ *
88
+ * This file is part of the Advanced JSON forms (ajf).
89
+ *
90
+ * Advanced JSON forms (ajf) is free software: you can redistribute it and/or
91
+ * modify it under the terms of the GNU Affero General Public License as
92
+ * published by the Free Software Foundation, either version 3 of the License,
93
+ * or (at your option) any later version.
94
+ *
95
+ * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,
96
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
97
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
98
+ * General Public License for more details.
99
+ *
100
+ * You should have received a copy of the GNU Affero General Public License
101
+ * along with Advanced JSON forms (ajf).
102
+ * If not, see http://www.gnu.org/licenses/.
103
+ *
104
+ */
105
+ class AjfSignatureModule {
106
+ }
107
+ AjfSignatureModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AjfSignatureModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
108
+ AjfSignatureModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: AjfSignatureModule, declarations: [AjfSignatureComponent], imports: [AjfCommonModule,
109
+ AjfTranslocoModule,
110
+ CommonModule,
111
+ FormsModule,
112
+ MatButtonModule,
113
+ MatIconModule], exports: [AjfSignatureComponent] });
114
+ AjfSignatureModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AjfSignatureModule, imports: [AjfCommonModule,
115
+ AjfTranslocoModule,
116
+ CommonModule,
117
+ FormsModule,
118
+ MatButtonModule,
119
+ MatIconModule] });
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AjfSignatureModule, decorators: [{
121
+ type: NgModule,
122
+ args: [{
123
+ imports: [
124
+ AjfCommonModule,
125
+ AjfTranslocoModule,
126
+ CommonModule,
127
+ FormsModule,
128
+ MatButtonModule,
129
+ MatIconModule,
130
+ ],
131
+ declarations: [AjfSignatureComponent],
132
+ exports: [AjfSignatureComponent],
133
+ }]
134
+ }] });
135
+
136
+ /**
137
+ * @license
138
+ * Copyright (C) Gnucoop soc. coop.
139
+ *
140
+ * This file is part of the Advanced JSON forms (ajf).
141
+ *
142
+ * Advanced JSON forms (ajf) is free software: you can redistribute it and/or
143
+ * modify it under the terms of the GNU Affero General Public License as
144
+ * published by the Free Software Foundation, either version 3 of the License,
145
+ * or (at your option) any later version.
146
+ *
147
+ * Advanced JSON forms (ajf) is distributed in the hope that it will be useful,
148
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
149
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
150
+ * General Public License for more details.
151
+ *
152
+ * You should have received a copy of the GNU Affero General Public License
153
+ * along with Advanced JSON forms (ajf).
154
+ * If not, see http://www.gnu.org/licenses/.
155
+ *
156
+ */
157
+
158
+ /**
159
+ * Generated bundle index. Do not edit.
160
+ */
161
+
162
+ export { AjfSignatureComponent, AjfSignatureModule, SIGNATURE_CONTROL_VALUE_ACCESSOR };
163
+ //# sourceMappingURL=ajf-material-signature.mjs.map
@@ -0,0 +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;EACX;AAEF;;AAEG;AASG,MAAO,qBAAsB,SAAQ,YAAY,CAAA;IACrD,WAAY,CAAA,GAAsB,EAAE,QAAmB,EAAA;AACrD,QAAA,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;KACtB;IAED,eAAe,GAAA;QACb,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;AAC/C,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;KAC7D;IAED,KAAK,GAAA;QACH,IAAI,IAAI,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AA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAlB,kBAAkB,EAAA,YAAA,EAAA,CAHd,qBAAqB,CAAA,EAAA,OAAA,EAAA,CAPlC,eAAe;QACf,kBAAkB;QAClB,YAAY;QACZ,WAAW;QACX,eAAe;AACf,QAAA,aAAa,aAGL,qBAAqB,CAAA,EAAA,CAAA,CAAA;AAEpB,kBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAV3B,eAAe;QACf,kBAAkB;QAClB,YAAY;QACZ,WAAW;QACX,eAAe;QACf,aAAa,CAAA,EAAA,CAAA,CAAA;2FAKJ,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,CAAA;;;AC3CD;;;;;;;;;;;;;;;;;;;;AAoBG;;ACpBH;;AAEG;;;;"}
@@ -161,6 +161,13 @@ export declare class AjfFormBuilderService {
161
161
  choices: any[];
162
162
  }): void;
163
163
  saveStringIdentifier(identifier: AjfFormStringIdentifier[]): void;
164
+ /**
165
+ * Searches the form nodes for field nodes with choicesOriginRef corresponding
166
+ * to an edited choicesOrigin and updates it with the new name.
167
+ * @param previous_name The choicesOrigin previous name
168
+ * @param new_name The choicesOrigin new name
169
+ */
170
+ private _updateChoicesOriginRefInNodes;
164
171
  private _buildFormBuilderNodesTree;
165
172
  /**
166
173
  * Adds the id of a dropList to be connected with the FormBuilder source list.
@@ -147,6 +147,7 @@ export declare class AjfFbNodeProperties implements OnDestroy {
147
147
  isField(nodeEntry: AjfFormBuilderNodeEntry | null): boolean;
148
148
  isNumericField(node: AjfNode): node is AjfNumberField;
149
149
  isFieldWithChoices(node: AjfNode): node is AjfFieldWithChoices<any>;
150
+ hasChoicesOriginRef(): Observable<boolean>;
150
151
  isRangeField(node: AjfNode): node is AjfRangeField;
151
152
  isTableField(node: AjfNode): node is AjfTableField;
152
153
  save(): void;
@@ -12,41 +12,43 @@ import * as i9 from "./geolocation-field";
12
12
  import * as i10 from "./input-field";
13
13
  import * as i11 from "./multiple-choice-field";
14
14
  import * as i12 from "./range-field";
15
- import * as i13 from "./single-choice-field";
16
- import * as i14 from "./table-field";
17
- import * as i15 from "./text-field";
18
- import * as i16 from "./time-field";
19
- import * as i17 from "./video-url-field";
20
- import * as i18 from "@ajf/material/barcode";
21
- import * as i19 from "@ajf/material/calendar";
22
- import * as i20 from "@ajf/core/common";
23
- import * as i21 from "@ajf/material/checkbox-group";
24
- import * as i22 from "@ajf/material/geolocation";
25
- import * as i23 from "@ajf/material/page-slider";
26
- import * as i24 from "@ajf/material/time";
27
- import * as i25 from "@ajf/core/transloco";
28
- import * as i26 from "@angular/common";
29
- import * as i27 from "@ajf/core/forms";
30
- import * as i28 from "@angular/material/button";
31
- import * as i29 from "@angular/material/button-toggle";
32
- import * as i30 from "@angular/material/card";
33
- import * as i31 from "@angular/material/datepicker";
34
- import * as i32 from "@angular/material/dialog";
35
- import * as i33 from "@angular/material/form-field";
36
- import * as i34 from "@angular/material/icon";
37
- import * as i35 from "@angular/material/input";
38
- import * as i36 from "@angular/material/core";
39
- import * as i37 from "@angular/material/radio";
40
- import * as i38 from "@angular/material/select";
41
- import * as i39 from "@angular/material/slide-toggle";
42
- import * as i40 from "@angular/material/toolbar";
43
- import * as i41 from "@angular/material/tooltip";
44
- import * as i42 from "@angular/forms";
45
- import * as i43 from "@angular/cdk/text-field";
46
- import * as i44 from "@angular/material/slider";
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";
47
49
  export declare class AjfFormsModule {
48
50
  static forRoot(): ModuleWithProviders<AjfFormsModule>;
49
51
  static ɵfac: i0.ɵɵFactoryDeclaration<AjfFormsModule, never>;
50
- 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.AjfSingleChoiceFieldComponent, typeof i14.AjfTableFieldComponent, typeof i15.AjfTextFieldComponent, typeof i16.AjfTimeFieldComponent, typeof i17.AjfVideoUrlFieldComponent], [typeof i18.AjfBarcodeModule, typeof i19.AjfCalendarModule, typeof i20.AjfCommonModule, typeof i21.AjfCheckboxGroupModule, typeof i22.AjfGeolocationModule, typeof i23.AjfPageSliderModule, typeof i24.AjfTimeModule, typeof i25.AjfTranslocoModule, typeof i26.CommonModule, typeof i27.AjfFormsModule, typeof i28.MatButtonModule, typeof i29.MatButtonToggleModule, typeof i30.MatCardModule, typeof i31.MatDatepickerModule, typeof i32.MatDialogModule, typeof i33.MatFormFieldModule, typeof i34.MatIconModule, typeof i35.MatInputModule, typeof i36.MatNativeDateModule, typeof i37.MatRadioModule, typeof i38.MatSelectModule, typeof i39.MatSlideToggleModule, typeof i40.MatToolbarModule, typeof i41.MatTooltipModule, typeof i42.ReactiveFormsModule, typeof i43.TextFieldModule, typeof i44.MatSliderModule], [typeof i7.AjfFormField, typeof i8.AjfFormRenderer]>;
52
+ 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 i7.AjfFormField, typeof i8.AjfFormRenderer]>;
51
53
  static ɵinj: i0.ɵɵInjectorDeclaration<AjfFormsModule>;
52
54
  }
@@ -0,0 +1,36 @@
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 { AjfBaseFieldComponent, AjfFormRendererService } from '@ajf/core/forms';
24
+ import { AjfWarningAlertService } from './warning-alert-service';
25
+ import * as i0 from "@angular/core";
26
+ /**
27
+ * It allows the loading of a Signature canvas image inside an AjfForm.
28
+ *
29
+ * @export
30
+ * @class AjfSignatureFieldComponent
31
+ */
32
+ export declare class AjfSignatureFieldComponent extends AjfBaseFieldComponent {
33
+ constructor(cdr: ChangeDetectorRef, service: AjfFormRendererService, was: AjfWarningAlertService);
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<AjfSignatureFieldComponent, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<AjfSignatureFieldComponent, "ajf-signature-field", never, {}, {}, never, never, false, never>;
36
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ajf/material",
3
- "version": "15.3.2",
3
+ "version": "15.3.4",
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": "15.3.2",
16
+ "@ajf/core": "15.3.4",
17
17
  "@angular/animations": "^15.0.4",
18
18
  "@angular/cdk": "^15.0.3",
19
19
  "@angular/common": "^15.0.4",
@@ -123,6 +123,14 @@
123
123
  "node": "./fesm2015/ajf-material-reports.mjs",
124
124
  "default": "./fesm2020/ajf-material-reports.mjs"
125
125
  },
126
+ "./signature": {
127
+ "types": "./signature/index.d.ts",
128
+ "esm2020": "./esm2020/signature/ajf-material-signature.mjs",
129
+ "es2020": "./fesm2020/ajf-material-signature.mjs",
130
+ "es2015": "./fesm2015/ajf-material-signature.mjs",
131
+ "node": "./fesm2015/ajf-material-signature.mjs",
132
+ "default": "./fesm2020/ajf-material-signature.mjs"
133
+ },
126
134
  "./time": {
127
135
  "types": "./time/index.d.ts",
128
136
  "esm2020": "./esm2020/time/ajf-material-time.mjs",
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@ajf/material/signature" />
5
+ export * from './public_api';
@@ -0,0 +1,23 @@
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
+ export * from './signature';
23
+ export * from './signature-module';
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./signature";
3
+ import * as i2 from "@ajf/core/common";
4
+ import * as i3 from "@ajf/core/transloco";
5
+ import * as i4 from "@angular/common";
6
+ import * as i5 from "@angular/forms";
7
+ import * as i6 from "@angular/material/button";
8
+ import * as i7 from "@angular/material/icon";
9
+ export declare class AjfSignatureModule {
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<AjfSignatureModule, never>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AjfSignatureModule, [typeof i1.AjfSignatureComponent], [typeof i2.AjfCommonModule, typeof i3.AjfTranslocoModule, typeof i4.CommonModule, typeof i5.FormsModule, typeof i6.MatButtonModule, typeof i7.MatIconModule], [typeof i1.AjfSignatureComponent]>;
12
+ static ɵinj: i0.ɵɵInjectorDeclaration<AjfSignatureModule>;
13
+ }
@@ -0,0 +1,37 @@
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 { AjfSignature } from '@ajf/core/signature';
23
+ import { AfterViewInit, ChangeDetectorRef, OnDestroy, Renderer2 } from '@angular/core';
24
+ import * as i0 from "@angular/core";
25
+ export declare const SIGNATURE_CONTROL_VALUE_ACCESSOR: any;
26
+ /**
27
+ * Ajf signature component.
28
+ */
29
+ export declare class AjfSignatureComponent extends AjfSignature implements OnDestroy, AfterViewInit {
30
+ constructor(cdr: ChangeDetectorRef, renderer: Renderer2);
31
+ ngAfterViewInit(): void;
32
+ clear(): void;
33
+ accept(): void;
34
+ ngOnDestroy(): void;
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<AjfSignatureComponent, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<AjfSignatureComponent, "ajf-signature", never, {}, {}, never, never, false, never>;
37
+ }