@forgeroute/ui 0.4.78 → 0.4.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/forgeroute-ui-charts.mjs +30 -22
- package/fesm2022/forgeroute-ui-charts.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-maps.mjs +26 -18
- package/fesm2022/forgeroute-ui-maps.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-messaging.mjs +625 -544
- package/fesm2022/forgeroute-ui-messaging.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-offline.mjs +3036 -0
- package/fesm2022/forgeroute-ui-offline.mjs.map +1 -0
- package/fesm2022/forgeroute-ui-pdf.mjs +104 -71
- package/fesm2022/forgeroute-ui-pdf.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-stripe.mjs +291 -156
- package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
- package/fesm2022/forgeroute-ui.mjs +13952 -5665
- package/fesm2022/forgeroute-ui.mjs.map +1 -1
- package/package.json +5 -1
- package/types/forgeroute-ui-charts.d.ts +10 -4
- package/types/forgeroute-ui-maps.d.ts +5 -2
- package/types/forgeroute-ui-messaging.d.ts +57 -36
- package/types/forgeroute-ui-offline.d.ts +887 -0
- package/types/forgeroute-ui-pdf.d.ts +24 -12
- package/types/forgeroute-ui-stripe.d.ts +72 -54
- package/types/forgeroute-ui.d.ts +3257 -334
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isPlatformBrowser } from "@angular/common";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, InjectionToken, Injector, PLATFORM_ID, afterNextRender, computed, effect, inject, input, makeEnvironmentProviders, output, signal, untracked } from "@angular/core";
|
|
4
|
-
import { AlertComponent, ButtonComponent, DetailCardComponent, HintComponent, IconComponent, ModalComponent, SectionHeaderComponent, SkeletonComponent, StackComponent, TextInputComponent } from "@forgeroute/ui";
|
|
4
|
+
import { AlertComponent, ButtonComponent, DetailCardComponent, HintComponent, IconComponent, ModalComponent, SectionHeaderComponent, SkeletonComponent, StackComponent, TextInputComponent, UiLabelsService } from "@forgeroute/ui";
|
|
5
5
|
import * as i1 from "@angular/forms";
|
|
6
6
|
import { FormsModule } from "@angular/forms";
|
|
7
7
|
const PDF_VIEWER_WORKER_SRC = new InjectionToken("PDF_VIEWER_WORKER_SRC", {
|
|
@@ -43,6 +43,7 @@ var PdfViewerUnsupportedError = class extends Error {
|
|
|
43
43
|
};
|
|
44
44
|
var PdfViewerComponent = class PdfViewerComponent {
|
|
45
45
|
constructor() {
|
|
46
|
+
this.labels = inject(UiLabelsService);
|
|
46
47
|
this.src = input(null, ...ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []);
|
|
47
48
|
this.data = input(null, ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
48
49
|
this.httpHeaders = input({}, ...ngDevMode ? [{ debugName: "httpHeaders" }] : /* istanbul ignore next */ []);
|
|
@@ -53,10 +54,26 @@ var PdfViewerComponent = class PdfViewerComponent {
|
|
|
53
54
|
this.fields = input([], ...ngDevMode ? [{ debugName: "fields" }] : /* istanbul ignore next */ []);
|
|
54
55
|
this.hotspots = input([], ...ngDevMode ? [{ debugName: "hotspots" }] : /* istanbul ignore next */ []);
|
|
55
56
|
this.ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
56
|
-
this.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
this.loadingTextInput = input(null, {
|
|
58
|
+
...ngDevMode ? { debugName: "loadingTextInput" } : /* istanbul ignore next */ {},
|
|
59
|
+
alias: "loadingText"
|
|
60
|
+
});
|
|
61
|
+
this.loadingText = computed(() => this.loadingTextInput() ?? this.labels.t("pdfPdfViewer.loadingText"), ...ngDevMode ? [{ debugName: "loadingText" }] : /* istanbul ignore next */ []);
|
|
62
|
+
this.errorTextInput = input(null, {
|
|
63
|
+
...ngDevMode ? { debugName: "errorTextInput" } : /* istanbul ignore next */ {},
|
|
64
|
+
alias: "errorText"
|
|
65
|
+
});
|
|
66
|
+
this.errorText = computed(() => this.errorTextInput() ?? this.labels.t("pdfPdfViewer.errorText"), ...ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []);
|
|
67
|
+
this.unsupportedTextInput = input(null, {
|
|
68
|
+
...ngDevMode ? { debugName: "unsupportedTextInput" } : /* istanbul ignore next */ {},
|
|
69
|
+
alias: "unsupportedText"
|
|
70
|
+
});
|
|
71
|
+
this.unsupportedText = computed(() => this.unsupportedTextInput() ?? this.labels.t("pdfViewer.unsupported"), ...ngDevMode ? [{ debugName: "unsupportedText" }] : /* istanbul ignore next */ []);
|
|
72
|
+
this.openTextInput = input(null, {
|
|
73
|
+
...ngDevMode ? { debugName: "openTextInput" } : /* istanbul ignore next */ {},
|
|
74
|
+
alias: "openText"
|
|
75
|
+
});
|
|
76
|
+
this.openText = computed(() => this.openTextInput() ?? this.labels.t("pdfPdfViewer.openText"), ...ngDevMode ? [{ debugName: "openText" }] : /* istanbul ignore next */ []);
|
|
60
77
|
this.checkBrowserSupport = input(true, ...ngDevMode ? [{ debugName: "checkBrowserSupport" }] : /* istanbul ignore next */ []);
|
|
61
78
|
this.hotspotActivate = output();
|
|
62
79
|
this.loaded = output();
|
|
@@ -233,7 +250,7 @@ var PdfViewerComponent = class PdfViewerComponent {
|
|
|
233
250
|
const worker = this.workerSrc() || this.tokenWorkerSrc;
|
|
234
251
|
if (worker) pdfjs.GlobalWorkerOptions.workerSrc = worker;
|
|
235
252
|
else if (!pdfjs.GlobalWorkerOptions.workerSrc) {
|
|
236
|
-
this.fail(/* @__PURE__ */ new Error(WORKER_MISSING),
|
|
253
|
+
this.fail(/* @__PURE__ */ new Error(WORKER_MISSING), this.labels.t("pdfViewer.workerMissing"));
|
|
237
254
|
return;
|
|
238
255
|
}
|
|
239
256
|
const params = data != null ? { data: data instanceof Uint8Array ? data.slice() : new Uint8Array(data.slice(0)) } : { url: src };
|
|
@@ -449,29 +466,29 @@ var PdfViewerComponent = class PdfViewerComponent {
|
|
|
449
466
|
isRequired: false,
|
|
450
467
|
transformFunction: null
|
|
451
468
|
},
|
|
452
|
-
|
|
453
|
-
classPropertyName: "
|
|
469
|
+
loadingTextInput: {
|
|
470
|
+
classPropertyName: "loadingTextInput",
|
|
454
471
|
publicName: "loadingText",
|
|
455
472
|
isSignal: true,
|
|
456
473
|
isRequired: false,
|
|
457
474
|
transformFunction: null
|
|
458
475
|
},
|
|
459
|
-
|
|
460
|
-
classPropertyName: "
|
|
476
|
+
errorTextInput: {
|
|
477
|
+
classPropertyName: "errorTextInput",
|
|
461
478
|
publicName: "errorText",
|
|
462
479
|
isSignal: true,
|
|
463
480
|
isRequired: false,
|
|
464
481
|
transformFunction: null
|
|
465
482
|
},
|
|
466
|
-
|
|
467
|
-
classPropertyName: "
|
|
483
|
+
unsupportedTextInput: {
|
|
484
|
+
classPropertyName: "unsupportedTextInput",
|
|
468
485
|
publicName: "unsupportedText",
|
|
469
486
|
isSignal: true,
|
|
470
487
|
isRequired: false,
|
|
471
488
|
transformFunction: null
|
|
472
489
|
},
|
|
473
|
-
|
|
474
|
-
classPropertyName: "
|
|
490
|
+
openTextInput: {
|
|
491
|
+
classPropertyName: "openTextInput",
|
|
475
492
|
publicName: "openText",
|
|
476
493
|
isSignal: true,
|
|
477
494
|
isRequired: false,
|
|
@@ -503,7 +520,7 @@ var PdfViewerComponent = class PdfViewerComponent {
|
|
|
503
520
|
<div class="pv-state pv-unsupported">
|
|
504
521
|
<p class="pv-unsupported-text">{{ unsupportedText() }}</p>
|
|
505
522
|
@if (openUrl(); as url) {
|
|
506
|
-
<a class="pv-open" [href]="url" target="_blank" rel="noopener">{{ openText() }}<span class="pv-sr"> (
|
|
523
|
+
<a class="pv-open" [href]="url" target="_blank" rel="noopener">{{ openText() }}<span class="pv-sr"> {{ labels.t('dataTable.opensInNewTab') }}</span></a>
|
|
507
524
|
}
|
|
508
525
|
</div>
|
|
509
526
|
}
|
|
@@ -511,7 +528,7 @@ var PdfViewerComponent = class PdfViewerComponent {
|
|
|
511
528
|
<div class="pv-pages">
|
|
512
529
|
@for (p of views(); track p.number) {
|
|
513
530
|
<div class="pv-page" [style.width.px]="p.cssWidth">
|
|
514
|
-
<canvas class="pv-canvas" role="img" [attr.aria-label]="'
|
|
531
|
+
<canvas class="pv-canvas" role="img" [attr.aria-label]="labels.t('pdfViewer.pageOf', { n: p.number, total: views().length })"
|
|
515
532
|
[attr.width]="p.canvasWidth" [attr.height]="p.canvasHeight"></canvas>
|
|
516
533
|
@for (f of p.fields; track $index) {
|
|
517
534
|
<div class="pv-field pv-tone-{{ f.tone }}"
|
|
@@ -524,7 +541,7 @@ var PdfViewerComponent = class PdfViewerComponent {
|
|
|
524
541
|
<div class="pv-hotspot" [attr.data-state]="h.hotspot.state" [attr.data-testid]="'pdf-hotspot-' + h.hotspot.id"
|
|
525
542
|
[style.left.%]="h.left" [style.top.%]="h.top" [style.width.%]="h.width" [style.height.%]="h.height">
|
|
526
543
|
@if (h.hotspot.state === 'signed' && h.hotspot.image) {
|
|
527
|
-
<img class="pv-hotspot-image" [src]="h.hotspot.image" [alt]="h.hotspot.imageAlt || '
|
|
544
|
+
<img class="pv-hotspot-image" [src]="h.hotspot.image" [alt]="h.hotspot.imageAlt || labels.t('pdfDocumentSignModal.appliedSignature')" />
|
|
528
545
|
} @else {
|
|
529
546
|
<button type="button" class="pv-hotspot-button" [class.pv-hotspot-ready]="h.hotspot.state === 'ready'"
|
|
530
547
|
[disabled]="h.hotspot.state !== 'ready'" [attr.aria-label]="h.hotspot.ariaLabel || null"
|
|
@@ -569,7 +586,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
569
586
|
<div class="pv-state pv-unsupported">
|
|
570
587
|
<p class="pv-unsupported-text">{{ unsupportedText() }}</p>
|
|
571
588
|
@if (openUrl(); as url) {
|
|
572
|
-
<a class="pv-open" [href]="url" target="_blank" rel="noopener">{{ openText() }}<span class="pv-sr"> (
|
|
589
|
+
<a class="pv-open" [href]="url" target="_blank" rel="noopener">{{ openText() }}<span class="pv-sr"> {{ labels.t('dataTable.opensInNewTab') }}</span></a>
|
|
573
590
|
}
|
|
574
591
|
</div>
|
|
575
592
|
}
|
|
@@ -577,7 +594,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
577
594
|
<div class="pv-pages">
|
|
578
595
|
@for (p of views(); track p.number) {
|
|
579
596
|
<div class="pv-page" [style.width.px]="p.cssWidth">
|
|
580
|
-
<canvas class="pv-canvas" role="img" [attr.aria-label]="'
|
|
597
|
+
<canvas class="pv-canvas" role="img" [attr.aria-label]="labels.t('pdfViewer.pageOf', { n: p.number, total: views().length })"
|
|
581
598
|
[attr.width]="p.canvasWidth" [attr.height]="p.canvasHeight"></canvas>
|
|
582
599
|
@for (f of p.fields; track $index) {
|
|
583
600
|
<div class="pv-field pv-tone-{{ f.tone }}"
|
|
@@ -590,7 +607,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
590
607
|
<div class="pv-hotspot" [attr.data-state]="h.hotspot.state" [attr.data-testid]="'pdf-hotspot-' + h.hotspot.id"
|
|
591
608
|
[style.left.%]="h.left" [style.top.%]="h.top" [style.width.%]="h.width" [style.height.%]="h.height">
|
|
592
609
|
@if (h.hotspot.state === 'signed' && h.hotspot.image) {
|
|
593
|
-
<img class="pv-hotspot-image" [src]="h.hotspot.image" [alt]="h.hotspot.imageAlt || '
|
|
610
|
+
<img class="pv-hotspot-image" [src]="h.hotspot.image" [alt]="h.hotspot.imageAlt || labels.t('pdfDocumentSignModal.appliedSignature')" />
|
|
594
611
|
} @else {
|
|
595
612
|
<button type="button" class="pv-hotspot-button" [class.pv-hotspot-ready]="h.hotspot.state === 'ready'"
|
|
596
613
|
[disabled]="h.hotspot.state !== 'ready'" [attr.aria-label]="h.hotspot.ariaLabel || null"
|
|
@@ -692,7 +709,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
692
709
|
required: false
|
|
693
710
|
}]
|
|
694
711
|
}],
|
|
695
|
-
|
|
712
|
+
loadingTextInput: [{
|
|
696
713
|
type: i0.Input,
|
|
697
714
|
args: [{
|
|
698
715
|
isSignal: true,
|
|
@@ -700,7 +717,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
700
717
|
required: false
|
|
701
718
|
}]
|
|
702
719
|
}],
|
|
703
|
-
|
|
720
|
+
errorTextInput: [{
|
|
704
721
|
type: i0.Input,
|
|
705
722
|
args: [{
|
|
706
723
|
isSignal: true,
|
|
@@ -708,7 +725,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
708
725
|
required: false
|
|
709
726
|
}]
|
|
710
727
|
}],
|
|
711
|
-
|
|
728
|
+
unsupportedTextInput: [{
|
|
712
729
|
type: i0.Input,
|
|
713
730
|
args: [{
|
|
714
731
|
isSignal: true,
|
|
@@ -716,7 +733,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
716
733
|
required: false
|
|
717
734
|
}]
|
|
718
735
|
}],
|
|
719
|
-
|
|
736
|
+
openTextInput: [{
|
|
720
737
|
type: i0.Input,
|
|
721
738
|
args: [{
|
|
722
739
|
isSignal: true,
|
|
@@ -760,12 +777,21 @@ function provideForgeroutePdf(options) {
|
|
|
760
777
|
}
|
|
761
778
|
var DocumentViewerModalComponent = class DocumentViewerModalComponent {
|
|
762
779
|
constructor() {
|
|
780
|
+
this.labels = inject(UiLabelsService);
|
|
763
781
|
this.open = input(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
|
|
764
|
-
this.
|
|
782
|
+
this.fileNameInput = input(null, {
|
|
783
|
+
...ngDevMode ? { debugName: "fileNameInput" } : /* istanbul ignore next */ {},
|
|
784
|
+
alias: "fileName"
|
|
785
|
+
});
|
|
786
|
+
this.fileName = computed(() => this.fileNameInput() ?? this.labels.t("pdfDocumentViewerModal.fileName"), ...ngDevMode ? [{ debugName: "fileName" }] : /* istanbul ignore next */ []);
|
|
765
787
|
this.data = input(null, ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
766
788
|
this.loading = input(false, ...ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []);
|
|
767
789
|
this.error = input("", ...ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []);
|
|
768
|
-
this.
|
|
790
|
+
this.loadingTextInput = input(null, {
|
|
791
|
+
...ngDevMode ? { debugName: "loadingTextInput" } : /* istanbul ignore next */ {},
|
|
792
|
+
alias: "loadingText"
|
|
793
|
+
});
|
|
794
|
+
this.loadingText = computed(() => this.loadingTextInput() ?? this.labels.t("pdfDocumentViewerModal.loadingText"), ...ngDevMode ? [{ debugName: "loadingText" }] : /* istanbul ignore next */ []);
|
|
769
795
|
this.closed = output();
|
|
770
796
|
this.hasData = computed(() => !!this.data() && !this.loading() && !this.error(), ...ngDevMode ? [{ debugName: "hasData" }] : /* istanbul ignore next */ []);
|
|
771
797
|
}
|
|
@@ -832,8 +858,8 @@ var DocumentViewerModalComponent = class DocumentViewerModalComponent {
|
|
|
832
858
|
isRequired: false,
|
|
833
859
|
transformFunction: null
|
|
834
860
|
},
|
|
835
|
-
|
|
836
|
-
classPropertyName: "
|
|
861
|
+
fileNameInput: {
|
|
862
|
+
classPropertyName: "fileNameInput",
|
|
837
863
|
publicName: "fileName",
|
|
838
864
|
isSignal: true,
|
|
839
865
|
isRequired: false,
|
|
@@ -860,8 +886,8 @@ var DocumentViewerModalComponent = class DocumentViewerModalComponent {
|
|
|
860
886
|
isRequired: false,
|
|
861
887
|
transformFunction: null
|
|
862
888
|
},
|
|
863
|
-
|
|
864
|
-
classPropertyName: "
|
|
889
|
+
loadingTextInput: {
|
|
890
|
+
classPropertyName: "loadingTextInput",
|
|
865
891
|
publicName: "loadingText",
|
|
866
892
|
isSignal: true,
|
|
867
893
|
isRequired: false,
|
|
@@ -873,12 +899,10 @@ var DocumentViewerModalComponent = class DocumentViewerModalComponent {
|
|
|
873
899
|
template: `
|
|
874
900
|
<ui-modal [open]="open()" [title]="fileName()" maxWidth="64rem" dialogTestId="document-viewer" (close)="closed.emit()">
|
|
875
901
|
<div class="dvm-actions" modal-header-end>
|
|
876
|
-
<ui-button variant="secondary" size="sm" data-testid="document-viewer-download" [disabled]="!hasData()" ariaLabel="
|
|
877
|
-
<ui-icon name="download" [interactive]="false" />
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
<ui-icon name="print" [interactive]="false" /> Print
|
|
881
|
-
</ui-button>
|
|
902
|
+
<ui-button variant="secondary" size="sm" data-testid="document-viewer-download" [disabled]="!hasData()" [ariaLabel]="labels.t('pdfDocumentViewerModal.downloadDocument')" (click)="download()">
|
|
903
|
+
<ui-icon name="download" [interactive]="false" />{{ labels.t('common.download') }}</ui-button>
|
|
904
|
+
<ui-button variant="secondary" size="sm" data-testid="document-viewer-print" [disabled]="!hasData()" [ariaLabel]="labels.t('pdfDocumentViewerModal.printDocument')" (click)="print()">
|
|
905
|
+
<ui-icon name="print" [interactive]="false" />{{ labels.t('common.print') }}</ui-button>
|
|
882
906
|
</div>
|
|
883
907
|
@if (loading()) {
|
|
884
908
|
<div class="dvm-state" role="status" aria-live="polite" data-testid="document-viewer-loading">
|
|
@@ -1046,12 +1070,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1046
1070
|
template: `
|
|
1047
1071
|
<ui-modal [open]="open()" [title]="fileName()" maxWidth="64rem" dialogTestId="document-viewer" (close)="closed.emit()">
|
|
1048
1072
|
<div class="dvm-actions" modal-header-end>
|
|
1049
|
-
<ui-button variant="secondary" size="sm" data-testid="document-viewer-download" [disabled]="!hasData()" ariaLabel="
|
|
1050
|
-
<ui-icon name="download" [interactive]="false" />
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
<ui-icon name="print" [interactive]="false" /> Print
|
|
1054
|
-
</ui-button>
|
|
1073
|
+
<ui-button variant="secondary" size="sm" data-testid="document-viewer-download" [disabled]="!hasData()" [ariaLabel]="labels.t('pdfDocumentViewerModal.downloadDocument')" (click)="download()">
|
|
1074
|
+
<ui-icon name="download" [interactive]="false" />{{ labels.t('common.download') }}</ui-button>
|
|
1075
|
+
<ui-button variant="secondary" size="sm" data-testid="document-viewer-print" [disabled]="!hasData()" [ariaLabel]="labels.t('pdfDocumentViewerModal.printDocument')" (click)="print()">
|
|
1076
|
+
<ui-icon name="print" [interactive]="false" />{{ labels.t('common.print') }}</ui-button>
|
|
1055
1077
|
</div>
|
|
1056
1078
|
@if (loading()) {
|
|
1057
1079
|
<div class="dvm-state" role="status" aria-live="polite" data-testid="document-viewer-loading">
|
|
@@ -1077,7 +1099,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1077
1099
|
required: false
|
|
1078
1100
|
}]
|
|
1079
1101
|
}],
|
|
1080
|
-
|
|
1102
|
+
fileNameInput: [{
|
|
1081
1103
|
type: i0.Input,
|
|
1082
1104
|
args: [{
|
|
1083
1105
|
isSignal: true,
|
|
@@ -1109,7 +1131,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1109
1131
|
required: false
|
|
1110
1132
|
}]
|
|
1111
1133
|
}],
|
|
1112
|
-
|
|
1134
|
+
loadingTextInput: [{
|
|
1113
1135
|
type: i0.Input,
|
|
1114
1136
|
args: [{
|
|
1115
1137
|
isSignal: true,
|
|
@@ -1123,27 +1145,30 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1123
1145
|
}]
|
|
1124
1146
|
}
|
|
1125
1147
|
});
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1148
|
+
function defaultTexts(uiText) {
|
|
1149
|
+
return {
|
|
1150
|
+
title: uiText("pdfDocumentSignModal.title"),
|
|
1151
|
+
loading: uiText("pdfDocumentSignModal.loading"),
|
|
1152
|
+
step1: uiText("pdfDocumentSignModal.step1"),
|
|
1153
|
+
namePlaceholder: uiText("pdfDocumentSignModal.namePlaceholder"),
|
|
1154
|
+
previewEmpty: uiText("pdfDocumentSignModal.previewEmpty"),
|
|
1155
|
+
saveSignature: uiText("pdfDocumentSignModal.saveSignature"),
|
|
1156
|
+
change: uiText("pdfDocumentSignModal.change"),
|
|
1157
|
+
step2: uiText("pdfDocumentSignModal.step2"),
|
|
1158
|
+
signHere: uiText("pdfDocumentSignModal.signHere"),
|
|
1159
|
+
addSignatureFirst: uiText("pdfDocumentSignModal.addSignatureFirst"),
|
|
1160
|
+
allSigned: uiText("pdfDocumentSignModal.allSigned"),
|
|
1161
|
+
cancel: uiText("common.cancel"),
|
|
1162
|
+
complete: uiText("pdfDocumentSignModal.complete"),
|
|
1163
|
+
submitting: uiText("pdfDocumentSignModal.submitting"),
|
|
1164
|
+
noFields: uiText("pdfDocumentSignModal.noFields")
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1143
1167
|
const SIGNATURE_WIDTH = 600;
|
|
1144
1168
|
const SIGNATURE_HEIGHT = 60;
|
|
1145
1169
|
var DocumentSignModalComponent = class DocumentSignModalComponent {
|
|
1146
1170
|
constructor() {
|
|
1171
|
+
this.labels = inject(UiLabelsService);
|
|
1147
1172
|
this.open = input(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
|
|
1148
1173
|
this.data = input(null, ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
1149
1174
|
this.fields = input([], ...ngDevMode ? [{ debugName: "fields" }] : /* istanbul ignore next */ []);
|
|
@@ -1157,9 +1182,13 @@ var DocumentSignModalComponent = class DocumentSignModalComponent {
|
|
|
1157
1182
|
this.signatureCreated = output();
|
|
1158
1183
|
this.closed = output();
|
|
1159
1184
|
this.t = computed(() => ({
|
|
1160
|
-
...
|
|
1185
|
+
...defaultTexts((key) => this.labels.t(key)),
|
|
1161
1186
|
...this.texts()
|
|
1162
1187
|
}), ...ngDevMode ? [{ debugName: "t" }] : /* istanbul ignore next */ []);
|
|
1188
|
+
this.changeAriaLabel = computed(() => {
|
|
1189
|
+
const change = this.t().change;
|
|
1190
|
+
return change === this.labels.t("pdfDocumentSignModal.change") ? this.labels.t("pdfDocumentSignModal.changeSignature") : this.labels.t("pdfDocumentSignModal.changeNamed", { change });
|
|
1191
|
+
}, ...ngDevMode ? [{ debugName: "changeAriaLabel" }] : /* istanbul ignore next */ []);
|
|
1163
1192
|
this.typedName = signal("", ...ngDevMode ? [{ debugName: "typedName" }] : /* istanbul ignore next */ []);
|
|
1164
1193
|
this.signature = signal(null, ...ngDevMode ? [{ debugName: "signature" }] : /* istanbul ignore next */ []);
|
|
1165
1194
|
this.applied = signal({}, ...ngDevMode ? [{ debugName: "applied" }] : /* istanbul ignore next */ []);
|
|
@@ -1174,7 +1203,10 @@ var DocumentSignModalComponent = class DocumentSignModalComponent {
|
|
|
1174
1203
|
const image = this.signature();
|
|
1175
1204
|
return fields.map((f, i) => {
|
|
1176
1205
|
const applied = this.applied()[f.id];
|
|
1177
|
-
const label =
|
|
1206
|
+
const label = this.labels.t("pdfDocumentSignModal.signField", {
|
|
1207
|
+
n: i + 1,
|
|
1208
|
+
total: fields.length
|
|
1209
|
+
});
|
|
1178
1210
|
return {
|
|
1179
1211
|
id: f.id,
|
|
1180
1212
|
page: f.page,
|
|
@@ -1185,9 +1217,9 @@ var DocumentSignModalComponent = class DocumentSignModalComponent {
|
|
|
1185
1217
|
state: applied ? "signed" : image ? "ready" : "blocked",
|
|
1186
1218
|
label: this.t().signHere,
|
|
1187
1219
|
blockedLabel: this.t().addSignatureFirst,
|
|
1188
|
-
ariaLabel: image ? label :
|
|
1220
|
+
ariaLabel: image ? label : this.labels.t("pdfDocumentSignModal.signFieldDisabled", { label }),
|
|
1189
1221
|
image: applied ?? null,
|
|
1190
|
-
imageAlt: "
|
|
1222
|
+
imageAlt: this.labels.t("pdfDocumentSignModal.appliedSignature")
|
|
1191
1223
|
};
|
|
1192
1224
|
});
|
|
1193
1225
|
}, ...ngDevMode ? [{ debugName: "hotspots" }] : /* istanbul ignore next */ []);
|
|
@@ -1397,8 +1429,8 @@ var DocumentSignModalComponent = class DocumentSignModalComponent {
|
|
|
1397
1429
|
</ui-stack>
|
|
1398
1430
|
} @else {
|
|
1399
1431
|
<ui-stack gap="sm">
|
|
1400
|
-
<div class="ds-saved"><img [src]="signature()!" alt="
|
|
1401
|
-
<ui-button variant="secondary" [ariaLabel]="
|
|
1432
|
+
<div class="ds-saved"><img [src]="signature()!" [attr.alt]="labels.t('pdfDocumentSignModal.yourSavedSignature')" class="ds-saved-img"></div>
|
|
1433
|
+
<ui-button variant="secondary" [ariaLabel]="changeAriaLabel()" data-testid="redraw-signature" (click)="changeSignature()">
|
|
1402
1434
|
<ui-icon name="edit" [size]="16" [interactive]="false" /> {{ t().change }}
|
|
1403
1435
|
</ui-button>
|
|
1404
1436
|
</ui-stack>
|
|
@@ -1414,7 +1446,7 @@ var DocumentSignModalComponent = class DocumentSignModalComponent {
|
|
|
1414
1446
|
}
|
|
1415
1447
|
|
|
1416
1448
|
<ui-hint modal-footer-left role="status" aria-live="polite" aria-atomic="true" data-testid="sign-progress">
|
|
1417
|
-
@if (fields().length === 0) { {{ t().noFields }} } @else if (allSigned()) { {{ t().allSigned }} } @else { {{ signedCount()
|
|
1449
|
+
@if (fields().length === 0) { {{ t().noFields }} } @else if (allSigned()) { {{ t().allSigned }} } @else { {{ labels.t('pdfDocumentSignModal.progress', { count: signedCount(), total: fields().length }) }} }
|
|
1418
1450
|
</ui-hint>
|
|
1419
1451
|
<ui-stack modal-footer-right direction="horizontal" gap="sm" [wrap]="true">
|
|
1420
1452
|
<ui-button variant="secondary" data-testid="sign-cancel" (click)="cancel()"><ui-icon name="close" [size]="16" [interactive]="false" /> {{ t().cancel }}</ui-button>
|
|
@@ -1520,6 +1552,7 @@ var DocumentSignModalComponent = class DocumentSignModalComponent {
|
|
|
1520
1552
|
"editIcon",
|
|
1521
1553
|
"editAriaLabel",
|
|
1522
1554
|
"fill",
|
|
1555
|
+
"noPadding",
|
|
1523
1556
|
"maxBodyHeight",
|
|
1524
1557
|
"selectable",
|
|
1525
1558
|
"selected",
|
|
@@ -1753,8 +1786,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1753
1786
|
</ui-stack>
|
|
1754
1787
|
} @else {
|
|
1755
1788
|
<ui-stack gap="sm">
|
|
1756
|
-
<div class="ds-saved"><img [src]="signature()!" alt="
|
|
1757
|
-
<ui-button variant="secondary" [ariaLabel]="
|
|
1789
|
+
<div class="ds-saved"><img [src]="signature()!" [attr.alt]="labels.t('pdfDocumentSignModal.yourSavedSignature')" class="ds-saved-img"></div>
|
|
1790
|
+
<ui-button variant="secondary" [ariaLabel]="changeAriaLabel()" data-testid="redraw-signature" (click)="changeSignature()">
|
|
1758
1791
|
<ui-icon name="edit" [size]="16" [interactive]="false" /> {{ t().change }}
|
|
1759
1792
|
</ui-button>
|
|
1760
1793
|
</ui-stack>
|
|
@@ -1770,7 +1803,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1770
1803
|
}
|
|
1771
1804
|
|
|
1772
1805
|
<ui-hint modal-footer-left role="status" aria-live="polite" aria-atomic="true" data-testid="sign-progress">
|
|
1773
|
-
@if (fields().length === 0) { {{ t().noFields }} } @else if (allSigned()) { {{ t().allSigned }} } @else { {{ signedCount()
|
|
1806
|
+
@if (fields().length === 0) { {{ t().noFields }} } @else if (allSigned()) { {{ t().allSigned }} } @else { {{ labels.t('pdfDocumentSignModal.progress', { count: signedCount(), total: fields().length }) }} }
|
|
1774
1807
|
</ui-hint>
|
|
1775
1808
|
<ui-stack modal-footer-right direction="horizontal" gap="sm" [wrap]="true">
|
|
1776
1809
|
<ui-button variant="secondary" data-testid="sign-cancel" (click)="cancel()"><ui-icon name="close" [size]="16" [interactive]="false" /> {{ t().cancel }}</ui-button>
|