carriera-intern 1.1.130 → 1.1.132
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/carriera-intern.mjs +75 -38
- package/fesm2022/carriera-intern.mjs.map +1 -1
- package/index.d.ts +8 -2
- package/package.json +1 -1
|
@@ -9788,18 +9788,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImpo
|
|
|
9788
9788
|
}]
|
|
9789
9789
|
}] });
|
|
9790
9790
|
|
|
9791
|
+
// Height of a department's contacts block, shared with the departments height pipe
|
|
9792
|
+
function getContactsHeight(departmentId, contactList, selectedIds) {
|
|
9793
|
+
const contactCount = contactList.contacts?.length || 0;
|
|
9794
|
+
if (!contactCount)
|
|
9795
|
+
return 0;
|
|
9796
|
+
// Get the selected contact IDs for this department
|
|
9797
|
+
const selectedContactIds = selectedIds.find((entry) => entry.departmentId === departmentId)
|
|
9798
|
+
?.contactId || [];
|
|
9799
|
+
// Get the visible contact IDs in the current filtered list
|
|
9800
|
+
const visibleContactIds = contactList.contacts?.map((contact) => contact.id) || [];
|
|
9801
|
+
// Only count selected contacts that are currently visible in the filtered list
|
|
9802
|
+
const visibleSelectedContacts = selectedContactIds.filter((contactId) => visibleContactIds.includes(contactId)).length;
|
|
9803
|
+
// Each contact is 26px (+44px when expanded) with 2px vertical margins.
|
|
9804
|
+
// Margins between neighbouring contacts collapse into a single 2px gap,
|
|
9805
|
+
// so there are contactCount + 1 gaps rather than 2 per contact.
|
|
9806
|
+
return (contactCount * 26 + visibleSelectedContacts * 44 + (contactCount + 1) * 2);
|
|
9807
|
+
}
|
|
9791
9808
|
class ContactsHeightPipe {
|
|
9792
9809
|
transform(departmentId, contactList, selectedIds) {
|
|
9793
|
-
|
|
9794
|
-
// Get the selected contact IDs for this department
|
|
9795
|
-
const selectedContactIds = selectedIds.find((entry) => entry.departmentId === departmentId)
|
|
9796
|
-
?.contactId || [];
|
|
9797
|
-
// Get the visible contact IDs in the current filtered list
|
|
9798
|
-
const visibleContactIds = contactList.contacts?.map((contact) => contact.id) || [];
|
|
9799
|
-
// Only count selected contacts that are currently visible in the filtered list
|
|
9800
|
-
const visibleSelectedContacts = selectedContactIds.filter((contactId) => visibleContactIds.includes(contactId)).length;
|
|
9801
|
-
return ((contactCount - visibleSelectedContacts) * 30 +
|
|
9802
|
-
visibleSelectedContacts * 74);
|
|
9810
|
+
return getContactsHeight(departmentId, contactList, selectedIds);
|
|
9803
9811
|
}
|
|
9804
9812
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: ContactsHeightPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
9805
9813
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.32", ngImport: i0, type: ContactsHeightPipe, isStandalone: true, name: "contactsHeight" });
|
|
@@ -9813,7 +9821,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImpo
|
|
|
9813
9821
|
|
|
9814
9822
|
class DepartmentsHeightPipe {
|
|
9815
9823
|
transform(contactLists, selectedIds) {
|
|
9816
|
-
|
|
9824
|
+
if (!contactLists.length) {
|
|
9825
|
+
return 134;
|
|
9826
|
+
}
|
|
9827
|
+
// Padding, header and search, minus 1px since the last department has no divider
|
|
9828
|
+
let totalHeight = 51;
|
|
9817
9829
|
// Calculate height for each visible department
|
|
9818
9830
|
contactLists.forEach((contactList) => {
|
|
9819
9831
|
// Base height for each department (30px) + 1px for the divider
|
|
@@ -9821,22 +9833,9 @@ class DepartmentsHeightPipe {
|
|
|
9821
9833
|
// If department is open (has id in selectedIds), add contacts height calculation
|
|
9822
9834
|
const isDepartmentOpen = selectedIds.some((entry) => entry.departmentId === contactList.department?.id);
|
|
9823
9835
|
if (isDepartmentOpen) {
|
|
9824
|
-
|
|
9825
|
-
// Get the selected contact IDs for this department
|
|
9826
|
-
const selectedContactIds = selectedIds.find((entry) => entry.departmentId === contactList.department?.id)?.contactId || [];
|
|
9827
|
-
// Get the visible contact IDs in the current filtered list
|
|
9828
|
-
const visibleContactIds = contactList.contacts?.map((contact) => contact.id) || [];
|
|
9829
|
-
// Only count selected contacts that are currently visible in the filtered list
|
|
9830
|
-
const visibleSelectedContacts = selectedContactIds.filter((contactId) => visibleContactIds.includes(contactId)).length;
|
|
9831
|
-
// Add contacts height calculation (same logic as contacts height pipe)
|
|
9832
|
-
const contactsHeight = (contactCount - visibleSelectedContacts) * 30 +
|
|
9833
|
-
visibleSelectedContacts * 74;
|
|
9834
|
-
totalHeight += contactsHeight;
|
|
9836
|
+
totalHeight += getContactsHeight(contactList.department?.id, contactList, selectedIds);
|
|
9835
9837
|
}
|
|
9836
9838
|
});
|
|
9837
|
-
if (totalHeight === 52) {
|
|
9838
|
-
return 134;
|
|
9839
|
-
}
|
|
9840
9839
|
return totalHeight;
|
|
9841
9840
|
}
|
|
9842
9841
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DepartmentsHeightPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -12135,8 +12134,12 @@ const PREVIEW_HEIGHT = 81;
|
|
|
12135
12134
|
const EXPORT_SCALE = 2;
|
|
12136
12135
|
const EXPORT_WIDTH = PREVIEW_WIDTH * EXPORT_SCALE;
|
|
12137
12136
|
const EXPORT_HEIGHT = PREVIEW_HEIGHT * EXPORT_SCALE;
|
|
12138
|
-
const
|
|
12137
|
+
const DEFAULT_MOBILE_BREAKPOINT = 575;
|
|
12138
|
+
const PHONE_VIEWPORT_MAX_HEIGHT = 500;
|
|
12139
12139
|
const FULLSCREEN_EDGE_GAP = 20;
|
|
12140
|
+
function phoneViewportQuery(maxWidthPx) {
|
|
12141
|
+
return `(max-width: ${maxWidthPx}px), (max-height: ${PHONE_VIEWPORT_MAX_HEIGHT}px)`;
|
|
12142
|
+
}
|
|
12140
12143
|
const INK_STROKE_STYLE = {
|
|
12141
12144
|
strokeStyle: '#000000',
|
|
12142
12145
|
fillStyle: '#000000',
|
|
@@ -12233,12 +12236,13 @@ function toPadPoint(event, canvas, padSize) {
|
|
|
12233
12236
|
}
|
|
12234
12237
|
|
|
12235
12238
|
// constants
|
|
12236
|
-
function needsFullscreenPad() {
|
|
12239
|
+
function needsFullscreenPad(maxWidthPx) {
|
|
12237
12240
|
if (typeof window === 'undefined') {
|
|
12238
12241
|
return false;
|
|
12239
12242
|
}
|
|
12240
12243
|
const shortSide = Math.min(window.innerWidth, window.innerHeight);
|
|
12241
|
-
return shortSide <=
|
|
12244
|
+
return (shortSide <= PHONE_VIEWPORT_MAX_HEIGHT ||
|
|
12245
|
+
window.matchMedia(phoneViewportQuery(maxWidthPx)).matches);
|
|
12242
12246
|
}
|
|
12243
12247
|
function buildFullscreenStage(vw, vh) {
|
|
12244
12248
|
const margin = FULLSCREEN_EDGE_GAP * 2;
|
|
@@ -12263,7 +12267,7 @@ function cloneStrokes(strokes) {
|
|
|
12263
12267
|
return strokes.map((stroke) => stroke.map((point) => ({ ...point })));
|
|
12264
12268
|
}
|
|
12265
12269
|
|
|
12266
|
-
function createSignatureVm(
|
|
12270
|
+
function createSignatureVm(useSavedSignature) {
|
|
12267
12271
|
const isPadOpen = signal(false, ...(ngDevMode ? [{ debugName: "isPadOpen" }] : []));
|
|
12268
12272
|
const previewSrc = signal(null, ...(ngDevMode ? [{ debugName: "previewSrc" }] : []));
|
|
12269
12273
|
const locksFullscreen = signal(false, ...(ngDevMode ? [{ debugName: "locksFullscreen" }] : []));
|
|
@@ -12272,7 +12276,7 @@ function createSignatureVm(savedSignature) {
|
|
|
12272
12276
|
const isStrokeInProgress = signal(false, ...(ngDevMode ? [{ debugName: "isStrokeInProgress" }] : []));
|
|
12273
12277
|
const padSize = signal({ width: 0, height: 0 }, ...(ngDevMode ? [{ debugName: "padSize" }] : []));
|
|
12274
12278
|
const hasInk = computed(() => !!completedStrokes().length || isStrokeInProgress(), ...(ngDevMode ? [{ debugName: "hasInk" }] : []));
|
|
12275
|
-
const hasExistingSignature = computed(() => !!(
|
|
12279
|
+
const hasExistingSignature = computed(() => !!useSavedSignature(), ...(ngDevMode ? [{ debugName: "hasExistingSignature" }] : []));
|
|
12276
12280
|
const showsPreview = computed(() => !!previewSrc() && !isPadOpen(), ...(ngDevMode ? [{ debugName: "showsPreview" }] : []));
|
|
12277
12281
|
const isFullscreenOpen = computed(() => isPadOpen() && locksFullscreen(), ...(ngDevMode ? [{ debugName: "isFullscreenOpen" }] : []));
|
|
12278
12282
|
return {
|
|
@@ -12298,15 +12302,19 @@ class SignatureComponent {
|
|
|
12298
12302
|
padSizeRef = viewChild('padSize', ...(ngDevMode ? [{ debugName: "padSizeRef" }] : []));
|
|
12299
12303
|
// inputs
|
|
12300
12304
|
savedSignature = input(null, ...(ngDevMode ? [{ debugName: "savedSignature" }] : []));
|
|
12305
|
+
useSavedSignature = input(null, ...(ngDevMode ? [{ debugName: "useSavedSignature" }] : []));
|
|
12301
12306
|
requiredInvalid = input(false, ...(ngDevMode ? [{ debugName: "requiredInvalid" }] : []));
|
|
12307
|
+
isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
12308
|
+
mobileBreakpoint = input(DEFAULT_MOBILE_BREAKPOINT, ...(ngDevMode ? [{ debugName: "mobileBreakpoint" }] : []));
|
|
12302
12309
|
// outputs
|
|
12303
12310
|
signatureChange = output();
|
|
12304
12311
|
// constants
|
|
12305
12312
|
previewWidth = PREVIEW_WIDTH;
|
|
12306
12313
|
previewHeight = PREVIEW_HEIGHT;
|
|
12307
12314
|
// view models
|
|
12308
|
-
viewModel = createSignatureVm(this.
|
|
12315
|
+
viewModel = createSignatureVm(this.useSavedSignature);
|
|
12309
12316
|
// state
|
|
12317
|
+
isMobileViewport = signal(false, ...(ngDevMode ? [{ debugName: "isMobileViewport" }] : []));
|
|
12310
12318
|
canvasContext = null;
|
|
12311
12319
|
confirmedInk = [];
|
|
12312
12320
|
padSizeObserver = null;
|
|
@@ -12315,6 +12323,7 @@ class SignatureComponent {
|
|
|
12315
12323
|
prevPadHeight = 0;
|
|
12316
12324
|
constructor() {
|
|
12317
12325
|
this.setupSavedSignatureSync();
|
|
12326
|
+
this.setupMobileBreakpointWatch();
|
|
12318
12327
|
this.setupPadSizeWatch();
|
|
12319
12328
|
this.setupCanvasSync();
|
|
12320
12329
|
this.setupFullscreenViewport();
|
|
@@ -12329,6 +12338,23 @@ class SignatureComponent {
|
|
|
12329
12338
|
this.viewModel.previewSrc.set(saved ? toSignatureDataUrl(saved) : null);
|
|
12330
12339
|
});
|
|
12331
12340
|
}
|
|
12341
|
+
setupMobileBreakpointWatch() {
|
|
12342
|
+
effect((onCleanup) => {
|
|
12343
|
+
if (typeof window === 'undefined') {
|
|
12344
|
+
return;
|
|
12345
|
+
}
|
|
12346
|
+
const maxWidthPx = this.mobileBreakpoint();
|
|
12347
|
+
const mediaQuery = window.matchMedia(`(max-width: ${maxWidthPx}px)`);
|
|
12348
|
+
const syncViewport = () => {
|
|
12349
|
+
this.isMobileViewport.set(mediaQuery.matches);
|
|
12350
|
+
};
|
|
12351
|
+
syncViewport();
|
|
12352
|
+
mediaQuery.addEventListener('change', syncViewport);
|
|
12353
|
+
onCleanup(() => {
|
|
12354
|
+
mediaQuery.removeEventListener('change', syncViewport);
|
|
12355
|
+
});
|
|
12356
|
+
});
|
|
12357
|
+
}
|
|
12332
12358
|
setupPadSizeWatch() {
|
|
12333
12359
|
effect(() => {
|
|
12334
12360
|
this.watchPadSize(this.padSizeRef()?.nativeElement);
|
|
@@ -12469,14 +12495,20 @@ class SignatureComponent {
|
|
|
12469
12495
|
}
|
|
12470
12496
|
openPad(event) {
|
|
12471
12497
|
event?.stopPropagation();
|
|
12472
|
-
if (this.viewModel.isPadOpen()) {
|
|
12498
|
+
if (this.isDisabled() || this.viewModel.isPadOpen()) {
|
|
12473
12499
|
return;
|
|
12474
12500
|
}
|
|
12475
12501
|
this.viewModel.completedStrokes.set(cloneStrokes(this.confirmedInk));
|
|
12476
12502
|
this.endStrokeInProgress();
|
|
12477
|
-
this.applyPadPresentation(needsFullscreenPad());
|
|
12503
|
+
this.applyPadPresentation(needsFullscreenPad(this.mobileBreakpoint()));
|
|
12478
12504
|
this.viewModel.isPadOpen.set(true);
|
|
12479
12505
|
}
|
|
12506
|
+
onPreviewClick(event) {
|
|
12507
|
+
if (!this.isMobileViewport() || this.isDisabled()) {
|
|
12508
|
+
return;
|
|
12509
|
+
}
|
|
12510
|
+
this.openPad(event);
|
|
12511
|
+
}
|
|
12480
12512
|
cancelPad() {
|
|
12481
12513
|
this.clearInk();
|
|
12482
12514
|
if (this.canvasContext) {
|
|
@@ -12508,14 +12540,17 @@ class SignatureComponent {
|
|
|
12508
12540
|
this.commitSignature(dataUrl);
|
|
12509
12541
|
}
|
|
12510
12542
|
restoreSavedSignature() {
|
|
12511
|
-
const saved = this.
|
|
12512
|
-
if (!saved) {
|
|
12543
|
+
const saved = this.useSavedSignature();
|
|
12544
|
+
if (!saved || this.isDisabled()) {
|
|
12513
12545
|
return;
|
|
12514
12546
|
}
|
|
12515
12547
|
this.clearInk({ forgetConfirmed: true });
|
|
12516
12548
|
this.commitSignature(toSignatureDataUrl(saved));
|
|
12517
12549
|
}
|
|
12518
12550
|
clearSignature() {
|
|
12551
|
+
if (this.isDisabled()) {
|
|
12552
|
+
return;
|
|
12553
|
+
}
|
|
12519
12554
|
this.clearInk({ forgetConfirmed: true });
|
|
12520
12555
|
this.commitSignature(null);
|
|
12521
12556
|
}
|
|
@@ -12571,7 +12606,7 @@ class SignatureComponent {
|
|
|
12571
12606
|
}
|
|
12572
12607
|
}
|
|
12573
12608
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: SignatureComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12574
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.32", type: SignatureComponent, isStandalone: true, selector: "cai-signature", inputs: { savedSignature: { classPropertyName: "savedSignature", publicName: "savedSignature", isSignal: true, isRequired: false, transformFunction: null }, requiredInvalid: { classPropertyName: "requiredInvalid", publicName: "requiredInvalid", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { signatureChange: "signatureChange" }, host: { listeners: { "document:keydown.escape": "onEscape()" }, properties: { "class.signature--has-current": "viewModel.showsPreview()", "style.--signature-preview-width.px": "previewWidth", "style.--signature-preview-height.px": "previewHeight" }, classAttribute: "signature" }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true, isSignal: true }, { propertyName: "padSizeRef", first: true, predicate: ["padSize"], descendants: true, isSignal: true }], ngImport: i0, template: "@let promptTitle = requiredInvalid() ? 'Signature Required' : 'Click Here';\n@let promptBody = requiredInvalid()\n ? 'Click Here To Sign Using Your Mouse'\n : 'To Sign Using Your Mouse';\n@let isFullscreen = viewModel.isFullscreenOpen();\n@let isInlinePad = viewModel.isPadOpen() && !isFullscreen;\n\n@if (viewModel.showsPreview()) {\n <div class=\"signature__preview\">\n <div class=\"signature__preview-frame\">\n <div class=\"signature__preview-image\">\n <img\n [src]=\"viewModel.previewSrc()\"\n [width]=\"previewWidth\"\n [height]=\"previewHeight\"\n alt=\"\"\n draggable=\"false\"\n />\n </div>\n </div>\n <div class=\"signature__preview-actions\">\n <button\n type=\"button\"\n class=\"signature__icon-button\"\n (click)=\"openPad()\"\n >\n <svg-icon name=\"cai-edit\"></svg-icon>\n </button>\n <button\n type=\"button\"\n class=\"signature__icon-button\"\n (click)=\"clearSignature()\"\n >\n <svg-icon name=\"cai-delete\"></svg-icon>\n </button>\n </div>\n </div>\n} @else {\n <div\n class=\"signature__pad\"\n [class.signature__pad--invalid]=\"\n requiredInvalid() && !viewModel.isPadOpen()\n \"\n >\n <div\n class=\"signature__surface\"\n [class.signature__surface--drawing]=\"isInlinePad\"\n (click)=\"openPad($event)\"\n >\n @if (!isInlinePad) {\n <div\n class=\"signature__prompt\"\n [class.signature__prompt--invalid]=\"requiredInvalid()\"\n >\n <span class=\"signature__prompt-title\">{{ promptTitle }}</span>\n <span class=\"signature__prompt-body\">{{ promptBody }}</span>\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"signaturePad\" />\n }\n </div>\n </div>\n\n @if (isInlinePad) {\n <div class=\"signature__actions\">\n <ng-container *ngTemplateOutlet=\"signatureActions\" />\n </div>\n }\n}\n\n@if (isFullscreen) {\n @let stage = viewModel.fullscreenStage();\n <div class=\"signature__overlay\" (click)=\"onBackdropClick($event)\">\n <div\n class=\"signature__overlay-stage\"\n [class.signature__overlay-stage--rotated]=\"stage?.isRotated\"\n [style.width.px]=\"stage?.width\"\n [style.height.px]=\"stage?.height\"\n (click)=\"$event.stopPropagation()\"\n >\n <div class=\"signature__overlay-panel\">\n <div class=\"signature__overlay-pad\">\n <div class=\"signature__surface signature__surface--drawing\">\n <ng-container *ngTemplateOutlet=\"signaturePad\" />\n </div>\n </div>\n <div class=\"signature__actions signature__actions--overlay\">\n <ng-container *ngTemplateOutlet=\"signatureActions\" />\n </div>\n </div>\n </div>\n </div>\n}\n\n<ng-template #signaturePad>\n <div class=\"signature__surface-measure\" #padSize>\n <canvas\n class=\"signature__canvas\"\n #canvas\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n ></canvas>\n </div>\n</ng-template>\n\n<ng-template #signatureActions>\n <div class=\"signature__actions-start\">\n <button\n type=\"button\"\n class=\"signature__button signature__button--secondary-neutral\"\n (click)=\"cancelPad()\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n class=\"signature__button signature__button--secondary-neutral\"\n (click)=\"undoLastStroke()\"\n >\n Undo\n </button>\n @if (viewModel.hasInk()) {\n <span class=\"signature__actions-label\">Confirmation Required</span>\n }\n </div>\n <div class=\"signature__actions-end\">\n @if (viewModel.hasExistingSignature()) {\n <button\n type=\"button\"\n class=\"signature__button signature__button--secondary-positive\"\n (click)=\"restoreSavedSignature()\"\n >\n Use Saved Signature\n </button>\n }\n <button\n type=\"button\"\n class=\"signature__button signature__button--primary-positive\"\n [disabled]=\"!viewModel.hasInk()\"\n (click)=\"confirmSignature()\"\n >\n Confirm\n </button>\n </div>\n</ng-template>\n", styles: [":host{display:grid;gap:8px;width:100%;max-width:628px;-webkit-user-select:none;user-select:none}:host.signature--has-current{justify-items:center}:host:hover .signature__preview-image{background-color:#eee}:host:hover .signature__preview-actions{opacity:1;pointer-events:auto}.signature__preview{display:flex;align-items:center;gap:4px;margin-left:60px}.signature__preview-frame{box-sizing:border-box;border-bottom:1px solid #dadada;padding:4px}.signature__preview-image{width:var(--signature-preview-width, 302px);height:var(--signature-preview-height, 81px);border-radius:2px;overflow:hidden;transition:background-color .2s ease-in-out}.signature__preview-image img{width:100%;height:100%;object-fit:contain;-webkit-user-drag:none;-webkit-user-select:none;user-select:none;pointer-events:none}.signature__preview-actions{display:flex;gap:4px;opacity:0;pointer-events:none;transition:opacity .2s ease-in-out}.signature__icon-button{width:26px;height:26px;padding:4px;border:0;border-radius:2px;background-color:#eee;transition:background-color .2s ease-in-out}.signature__icon-button:hover{background-color:#424242}.signature__icon-button:hover svg-icon svg path{fill:#fff}.signature__icon-button svg-icon{display:flex}.signature__icon-button svg-icon svg{width:18px;height:18px}.signature__icon-button svg-icon svg path{fill:#919191}.signature__pad{width:100%;height:178px;box-sizing:border-box;padding:4px;background-image:linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%);background-size:16px 4px,16px 4px,4px 17px,4px 17px;background-position:left bottom,left top,left bottom,right bottom;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;border-radius:2px}.signature__pad--invalid{background-image:linear-gradient(to right,#ed9292 50%,#fff 50%),linear-gradient(to right,#ed9292 50%,#fff 50%),linear-gradient(to top,#ed9292 50%,#fff 50%),linear-gradient(to top,#ed9292 50%,#fff 50%);background-size:16px 4px,16px 4px,4px 17px,4px 17px;background-position:left bottom,left top,left bottom,right bottom;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y}.signature__surface{display:flex;justify-content:center;align-items:center;width:100%;height:100%;cursor:pointer;background-color:#fff;transition:background-color .2s ease-in-out}.signature__surface:hover{background-color:#eee}.signature__surface--drawing{display:block;cursor:default;background-color:#fff;min-width:0;min-height:0}.signature__surface--drawing:hover{background-color:#fff}.signature__surface-measure{width:100%;height:100%;min-width:0;min-height:0}.signature__prompt{display:flex;flex-direction:column;align-items:center;gap:4px}.signature__prompt--invalid .signature__prompt-title{color:#df3c3c}.signature__prompt-title{font-weight:700;font-size:14px;line-height:18px;color:#424242;text-align:center;text-transform:uppercase}.signature__prompt-body{font-weight:600;font-size:11px;line-height:14px;color:#424242;text-align:center;text-transform:uppercase}.signature__canvas{display:block;width:100%;height:100%;min-width:0;min-height:0;touch-action:none;cursor:default}.signature__actions{display:flex;gap:12px;width:100%;flex-shrink:0}.signature__actions--overlay .signature__button{padding:11px 8px}.signature__actions-start,.signature__actions-end{display:flex;align-items:center;gap:6px}.signature__actions-start{flex-grow:1}.signature__actions-label{flex-grow:1;font-weight:600;font-size:11px;line-height:15px;color:#df3c3c;text-align:right}.signature__button{padding:4px 8px;border:0;border-radius:2px;min-width:80px;font-weight:700;font-size:11px;line-height:14px;text-transform:uppercase;transition:background-color .2s ease-in-out,color .2s ease-in-out}.signature__button--secondary-neutral{background-color:#eee;color:#6c6c6c}.signature__button--secondary-neutral:hover{background-color:#424242;color:#fff}.signature__button--secondary-positive{background-color:#eee;color:#3b73ed}.signature__button--secondary-positive:hover{background-color:#0b49d1;color:#fff}.signature__button--primary-positive{background-color:#3b73ed;color:#fff}.signature__button--primary-positive:hover{background-color:#0b49d1;color:#fff}.signature__button:disabled,.signature__button[disabled]{background-color:#f7f7f7;color:#ccc;pointer-events:none}.signature__overlay{position:fixed;inset:0;z-index:1000;background-color:#00000073}.signature__overlay-stage{position:absolute;top:50%;left:50%;box-sizing:border-box;transform:translate(-50%,-50%)}.signature__overlay-stage--rotated{transform:translate(-50%,-50%) rotate(90deg)}.signature__overlay-panel{box-sizing:border-box;display:flex;flex-direction:column;gap:12px;width:100%;height:100%;padding:12px;background-color:#fff;border-radius:2px}.signature__overlay-pad{box-sizing:border-box;padding:4px;background-image:linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%);background-size:16px 4px,16px 4px,4px 17px,4px 17px;background-position:left bottom,left top,left bottom,right bottom;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;border-radius:2px;min-width:0;min-height:0;flex:1 1 auto;width:100%}.signature__overlay-pad .signature__surface{width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type:
|
|
12609
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.32", type: SignatureComponent, isStandalone: true, selector: "cai-signature", inputs: { savedSignature: { classPropertyName: "savedSignature", publicName: "savedSignature", isSignal: true, isRequired: false, transformFunction: null }, useSavedSignature: { classPropertyName: "useSavedSignature", publicName: "useSavedSignature", isSignal: true, isRequired: false, transformFunction: null }, requiredInvalid: { classPropertyName: "requiredInvalid", publicName: "requiredInvalid", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, mobileBreakpoint: { classPropertyName: "mobileBreakpoint", publicName: "mobileBreakpoint", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { signatureChange: "signatureChange" }, host: { listeners: { "document:keydown.escape": "onEscape()" }, properties: { "class.signature--has-current": "viewModel.showsPreview()", "class.signature--disabled": "isDisabled()", "class.signature--mobile": "isMobileViewport()", "style.--signature-preview-width.px": "previewWidth", "style.--signature-preview-height.px": "previewHeight" }, classAttribute: "signature" }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true, isSignal: true }, { propertyName: "padSizeRef", first: true, predicate: ["padSize"], descendants: true, isSignal: true }], ngImport: i0, template: "@let promptTitle = requiredInvalid() ? 'Signature Required' : 'Click Here';\n@let promptBody = requiredInvalid()\n ? 'Click Here To Sign Using Your Mouse'\n : 'To Sign Using Your Mouse';\n@let isFullscreen = viewModel.isFullscreenOpen();\n@let isInlinePad = viewModel.isPadOpen() && !isFullscreen;\n@let showPreviewActions = !isDisabled() && !isMobileViewport();\n\n@if (viewModel.showsPreview()) {\n <div class=\"signature__preview\" (click)=\"onPreviewClick($event)\">\n <div class=\"signature__preview-frame\">\n <div class=\"signature__preview-image\">\n <img\n [src]=\"viewModel.previewSrc()\"\n [width]=\"previewWidth\"\n [height]=\"previewHeight\"\n alt=\"\"\n draggable=\"false\"\n />\n </div>\n </div>\n @if (showPreviewActions) {\n <div class=\"signature__preview-actions\">\n <button\n type=\"button\"\n class=\"signature__icon-button\"\n (click)=\"openPad($event)\"\n >\n <svg-icon name=\"cai-edit\"></svg-icon>\n </button>\n <button\n type=\"button\"\n class=\"signature__icon-button\"\n (click)=\"clearSignature()\"\n >\n <svg-icon name=\"cai-delete\"></svg-icon>\n </button>\n </div>\n }\n </div>\n} @else {\n <div\n class=\"signature__pad\"\n [class.signature__pad--invalid]=\"\n requiredInvalid() && !viewModel.isPadOpen()\n \"\n >\n <div\n class=\"signature__surface\"\n [class.signature__surface--drawing]=\"isInlinePad\"\n (click)=\"openPad($event)\"\n >\n @if (!isInlinePad) {\n <div\n class=\"signature__prompt\"\n [class.signature__prompt--invalid]=\"requiredInvalid()\"\n >\n <span class=\"signature__prompt-title\">{{ promptTitle }}</span>\n <span class=\"signature__prompt-body\">{{ promptBody }}</span>\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"signaturePad\" />\n }\n </div>\n </div>\n\n @if (isInlinePad) {\n <div class=\"signature__actions\">\n <ng-container *ngTemplateOutlet=\"signatureActions\" />\n </div>\n }\n}\n\n@if (isFullscreen) {\n @let stage = viewModel.fullscreenStage();\n <div class=\"signature__overlay\" (click)=\"onBackdropClick($event)\">\n <div\n class=\"signature__overlay-stage\"\n [class.signature__overlay-stage--rotated]=\"stage?.isRotated\"\n [style.width.px]=\"stage?.width\"\n [style.height.px]=\"stage?.height\"\n (click)=\"$event.stopPropagation()\"\n >\n <div class=\"signature__overlay-panel\">\n <div class=\"signature__overlay-pad\">\n <div class=\"signature__surface signature__surface--drawing\">\n <ng-container *ngTemplateOutlet=\"signaturePad\" />\n </div>\n </div>\n <div class=\"signature__actions signature__actions--overlay\">\n <ng-container *ngTemplateOutlet=\"signatureActions\" />\n </div>\n </div>\n </div>\n </div>\n}\n\n<ng-template #signaturePad>\n <div class=\"signature__surface-measure\" #padSize>\n <canvas\n class=\"signature__canvas\"\n #canvas\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n ></canvas>\n </div>\n</ng-template>\n\n<ng-template #signatureActions>\n <div class=\"signature__actions-start\">\n <button\n type=\"button\"\n class=\"signature__button signature__button--secondary-neutral\"\n (click)=\"cancelPad()\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n class=\"signature__button signature__button--secondary-neutral\"\n (click)=\"undoLastStroke()\"\n >\n Undo\n </button>\n @if (viewModel.hasInk()) {\n <span class=\"signature__actions-label\">Confirmation Required</span>\n }\n </div>\n <div class=\"signature__actions-end\">\n @if (viewModel.hasExistingSignature()) {\n <button\n type=\"button\"\n class=\"signature__button signature__button--secondary-positive\"\n (click)=\"restoreSavedSignature()\"\n >\n Use Saved Signature\n </button>\n }\n <button\n type=\"button\"\n class=\"signature__button signature__button--primary-positive\"\n [disabled]=\"!viewModel.hasInk()\"\n (click)=\"confirmSignature()\"\n >\n Confirm\n </button>\n </div>\n</ng-template>\n", styles: [":host{display:grid;gap:8px;width:100%;max-width:628px;-webkit-user-select:none;user-select:none}:host.signature--has-current{justify-items:center}:host.signature--disabled{opacity:.6;pointer-events:none;cursor:default}:host.signature--mobile .signature__preview{cursor:pointer;margin-left:0}:host.signature--mobile .signature__preview-actions{display:none}:host.signature--mobile .signature__preview-image{transition:background-color .2s ease-in-out}@media(hover:hover){:host:hover:not(.signature--disabled):not(.signature--mobile) .signature__preview-image{background-color:#eee}:host:hover:not(.signature--disabled):not(.signature--mobile) .signature__preview-actions{opacity:1;pointer-events:auto}:host.signature--mobile:not(.signature--disabled):hover .signature__preview-image{background-color:#eee}}.signature__preview{display:flex;align-items:center;gap:4px;margin-left:60px}.signature__preview-frame{box-sizing:border-box;border-bottom:1px solid #dadada;padding:4px}.signature__preview-image{width:var(--signature-preview-width, 302px);height:var(--signature-preview-height, 81px);border-radius:2px;overflow:hidden;transition:background-color .2s ease-in-out}.signature__preview-image img{width:100%;height:100%;object-fit:contain;-webkit-user-drag:none;-webkit-user-select:none;user-select:none;pointer-events:none}.signature__preview-actions{display:flex;gap:4px;opacity:0;pointer-events:none;transition:opacity .2s ease-in-out}.signature__icon-button{width:26px;height:26px;padding:4px;border:0;border-radius:2px;background-color:#eee;transition:background-color .2s ease-in-out}.signature__icon-button:hover{background-color:#424242}.signature__icon-button:hover svg-icon svg path{fill:#fff}.signature__icon-button svg-icon{display:flex}.signature__icon-button svg-icon svg{width:18px;height:18px}.signature__icon-button svg-icon svg path{fill:#919191;transition:fill .2s ease-in-out}.signature__pad{width:100%;height:178px;box-sizing:border-box;padding:4px;background-image:linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%);background-size:16px 4px,16px 4px,4px 17px,4px 17px;background-position:left bottom,left top,left bottom,right bottom;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;border-radius:2px}.signature__pad--invalid{background-image:linear-gradient(to right,#ed9292 50%,#fff 50%),linear-gradient(to right,#ed9292 50%,#fff 50%),linear-gradient(to top,#ed9292 50%,#fff 50%),linear-gradient(to top,#ed9292 50%,#fff 50%);background-size:16px 4px,16px 4px,4px 17px,4px 17px;background-position:left bottom,left top,left bottom,right bottom;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y}.signature__surface{display:flex;justify-content:center;align-items:center;width:100%;height:100%;cursor:pointer;background-color:#fff;transition:background-color .2s ease-in-out}.signature__surface:hover{background-color:#eee}.signature__surface--drawing{display:block;cursor:default;background-color:#fff;min-width:0;min-height:0}.signature__surface--drawing:hover{background-color:#fff}.signature__surface-measure{width:100%;height:100%;min-width:0;min-height:0}.signature__prompt{display:flex;flex-direction:column;align-items:center;gap:4px}.signature__prompt--invalid .signature__prompt-title{color:#df3c3c}.signature__prompt-title{font-weight:700;font-size:14px;line-height:18px;color:#424242;text-align:center;text-transform:uppercase}.signature__prompt-body{font-weight:600;font-size:11px;line-height:14px;color:#424242;text-align:center;text-transform:uppercase}.signature__canvas{display:block;width:100%;height:100%;min-width:0;min-height:0;touch-action:none;cursor:default}.signature__actions{display:flex;gap:12px;width:100%;flex-shrink:0}.signature__actions--overlay .signature__button{padding:11px 8px}.signature__actions-start,.signature__actions-end{display:flex;align-items:center;gap:6px}.signature__actions-start{flex-grow:1}.signature__actions-label{flex-grow:1;font-weight:600;font-size:11px;line-height:15px;color:#df3c3c;text-align:right}.signature__button{padding:4px 8px;border:0;border-radius:2px;min-width:80px;font-weight:700;font-size:11px;line-height:14px;text-transform:uppercase;transition:background-color .2s ease-in-out,color .2s ease-in-out}.signature__button--secondary-neutral{background-color:#eee;color:#6c6c6c}.signature__button--secondary-neutral:hover{background-color:#424242;color:#fff}.signature__button--secondary-positive{background-color:#eee;color:#3b73ed}.signature__button--secondary-positive:hover{background-color:#0b49d1;color:#fff}.signature__button--primary-positive{background-color:#3b73ed;color:#fff}.signature__button--primary-positive:hover{background-color:#0b49d1;color:#fff}.signature__button:disabled,.signature__button[disabled]{background-color:#f7f7f7;color:#ccc;pointer-events:none}.signature__overlay{position:fixed;inset:0;z-index:1000;background-color:#00000073}.signature__overlay-stage{position:absolute;top:50%;left:50%;box-sizing:border-box;transform:translate(-50%,-50%)}.signature__overlay-stage--rotated{transform:translate(-50%,-50%) rotate(90deg)}.signature__overlay-panel{box-sizing:border-box;display:flex;flex-direction:column;gap:12px;width:100%;height:100%;padding:12px;background-color:#fff;border-radius:2px}.signature__overlay-pad{box-sizing:border-box;padding:4px;background-image:linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%);background-size:16px 4px,16px 4px,4px 17px,4px 17px;background-position:left bottom,left top,left bottom,right bottom;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;border-radius:2px;min-width:0;min-height:0;flex:1 1 auto;width:100%}.signature__overlay-pad .signature__surface{width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type:
|
|
12575
12610
|
// components
|
|
12576
12611
|
SvgIconComponent, selector: "svg-icon", inputs: ["src", "name", "stretch", "applyClass", "svgClass", "class", "viewBox", "svgAriaLabel", "onSVGLoaded", "svgStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12577
12612
|
}
|
|
@@ -12580,6 +12615,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImpo
|
|
|
12580
12615
|
args: [{ selector: 'cai-signature', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
12581
12616
|
class: 'signature',
|
|
12582
12617
|
'[class.signature--has-current]': 'viewModel.showsPreview()',
|
|
12618
|
+
'[class.signature--disabled]': 'isDisabled()',
|
|
12619
|
+
'[class.signature--mobile]': 'isMobileViewport()',
|
|
12583
12620
|
'[style.--signature-preview-width.px]': 'previewWidth',
|
|
12584
12621
|
'[style.--signature-preview-height.px]': 'previewHeight',
|
|
12585
12622
|
'(document:keydown.escape)': 'onEscape()',
|
|
@@ -12587,8 +12624,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImpo
|
|
|
12587
12624
|
NgTemplateOutlet,
|
|
12588
12625
|
// components
|
|
12589
12626
|
SvgIconComponent,
|
|
12590
|
-
], template: "@let promptTitle = requiredInvalid() ? 'Signature Required' : 'Click Here';\n@let promptBody = requiredInvalid()\n ? 'Click Here To Sign Using Your Mouse'\n : 'To Sign Using Your Mouse';\n@let isFullscreen = viewModel.isFullscreenOpen();\n@let isInlinePad = viewModel.isPadOpen() && !isFullscreen;\n\n@if (viewModel.showsPreview()) {\n <div class=\"signature__preview\">\n <div class=\"signature__preview-frame\">\n <div class=\"signature__preview-image\">\n <img\n [src]=\"viewModel.previewSrc()\"\n [width]=\"previewWidth\"\n [height]=\"previewHeight\"\n alt=\"\"\n draggable=\"false\"\n />\n </div>\n </div>\n <div class=\"signature__preview-actions\">\n <button\n type=\"button\"\n class=\"signature__icon-button\"\n (click)=\"openPad()\"\n >\n <svg-icon name=\"cai-edit\"></svg-icon>\n </button>\n <button\n type=\"button\"\n class=\"signature__icon-button\"\n (click)=\"clearSignature()\"\n >\n <svg-icon name=\"cai-delete\"></svg-icon>\n </button>\n </div>\n </div>\n} @else {\n <div\n class=\"signature__pad\"\n [class.signature__pad--invalid]=\"\n requiredInvalid() && !viewModel.isPadOpen()\n \"\n >\n <div\n class=\"signature__surface\"\n [class.signature__surface--drawing]=\"isInlinePad\"\n (click)=\"openPad($event)\"\n >\n @if (!isInlinePad) {\n <div\n class=\"signature__prompt\"\n [class.signature__prompt--invalid]=\"requiredInvalid()\"\n >\n <span class=\"signature__prompt-title\">{{ promptTitle }}</span>\n <span class=\"signature__prompt-body\">{{ promptBody }}</span>\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"signaturePad\" />\n }\n </div>\n </div>\n\n @if (isInlinePad) {\n <div class=\"signature__actions\">\n <ng-container *ngTemplateOutlet=\"signatureActions\" />\n </div>\n }\n}\n\n@if (isFullscreen) {\n @let stage = viewModel.fullscreenStage();\n <div class=\"signature__overlay\" (click)=\"onBackdropClick($event)\">\n <div\n class=\"signature__overlay-stage\"\n [class.signature__overlay-stage--rotated]=\"stage?.isRotated\"\n [style.width.px]=\"stage?.width\"\n [style.height.px]=\"stage?.height\"\n (click)=\"$event.stopPropagation()\"\n >\n <div class=\"signature__overlay-panel\">\n <div class=\"signature__overlay-pad\">\n <div class=\"signature__surface signature__surface--drawing\">\n <ng-container *ngTemplateOutlet=\"signaturePad\" />\n </div>\n </div>\n <div class=\"signature__actions signature__actions--overlay\">\n <ng-container *ngTemplateOutlet=\"signatureActions\" />\n </div>\n </div>\n </div>\n </div>\n}\n\n<ng-template #signaturePad>\n <div class=\"signature__surface-measure\" #padSize>\n <canvas\n class=\"signature__canvas\"\n #canvas\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n ></canvas>\n </div>\n</ng-template>\n\n<ng-template #signatureActions>\n <div class=\"signature__actions-start\">\n <button\n type=\"button\"\n class=\"signature__button signature__button--secondary-neutral\"\n (click)=\"cancelPad()\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n class=\"signature__button signature__button--secondary-neutral\"\n (click)=\"undoLastStroke()\"\n >\n Undo\n </button>\n @if (viewModel.hasInk()) {\n <span class=\"signature__actions-label\">Confirmation Required</span>\n }\n </div>\n <div class=\"signature__actions-end\">\n @if (viewModel.hasExistingSignature()) {\n <button\n type=\"button\"\n class=\"signature__button signature__button--secondary-positive\"\n (click)=\"restoreSavedSignature()\"\n >\n Use Saved Signature\n </button>\n }\n <button\n type=\"button\"\n class=\"signature__button signature__button--primary-positive\"\n [disabled]=\"!viewModel.hasInk()\"\n (click)=\"confirmSignature()\"\n >\n Confirm\n </button>\n </div>\n</ng-template>\n", styles: [":host{display:grid;gap:8px;width:100%;max-width:628px;-webkit-user-select:none;user-select:none}:host.signature--has-current{justify-items:center}:host:hover .signature__preview-image{background-color:#eee}:host:hover .signature__preview-actions{opacity:1;pointer-events:auto}.signature__preview{display:flex;align-items:center;gap:4px;margin-left:60px}.signature__preview-frame{box-sizing:border-box;border-bottom:1px solid #dadada;padding:4px}.signature__preview-image{width:var(--signature-preview-width, 302px);height:var(--signature-preview-height, 81px);border-radius:2px;overflow:hidden;transition:background-color .2s ease-in-out}.signature__preview-image img{width:100%;height:100%;object-fit:contain;-webkit-user-drag:none;-webkit-user-select:none;user-select:none;pointer-events:none}.signature__preview-actions{display:flex;gap:4px;opacity:0;pointer-events:none;transition:opacity .2s ease-in-out}.signature__icon-button{width:26px;height:26px;padding:4px;border:0;border-radius:2px;background-color:#eee;transition:background-color .2s ease-in-out}.signature__icon-button:hover{background-color:#424242}.signature__icon-button:hover svg-icon svg path{fill:#fff}.signature__icon-button svg-icon{display:flex}.signature__icon-button svg-icon svg{width:18px;height:18px}.signature__icon-button svg-icon svg path{fill:#919191}.signature__pad{width:100%;height:178px;box-sizing:border-box;padding:4px;background-image:linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%);background-size:16px 4px,16px 4px,4px 17px,4px 17px;background-position:left bottom,left top,left bottom,right bottom;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;border-radius:2px}.signature__pad--invalid{background-image:linear-gradient(to right,#ed9292 50%,#fff 50%),linear-gradient(to right,#ed9292 50%,#fff 50%),linear-gradient(to top,#ed9292 50%,#fff 50%),linear-gradient(to top,#ed9292 50%,#fff 50%);background-size:16px 4px,16px 4px,4px 17px,4px 17px;background-position:left bottom,left top,left bottom,right bottom;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y}.signature__surface{display:flex;justify-content:center;align-items:center;width:100%;height:100%;cursor:pointer;background-color:#fff;transition:background-color .2s ease-in-out}.signature__surface:hover{background-color:#eee}.signature__surface--drawing{display:block;cursor:default;background-color:#fff;min-width:0;min-height:0}.signature__surface--drawing:hover{background-color:#fff}.signature__surface-measure{width:100%;height:100%;min-width:0;min-height:0}.signature__prompt{display:flex;flex-direction:column;align-items:center;gap:4px}.signature__prompt--invalid .signature__prompt-title{color:#df3c3c}.signature__prompt-title{font-weight:700;font-size:14px;line-height:18px;color:#424242;text-align:center;text-transform:uppercase}.signature__prompt-body{font-weight:600;font-size:11px;line-height:14px;color:#424242;text-align:center;text-transform:uppercase}.signature__canvas{display:block;width:100%;height:100%;min-width:0;min-height:0;touch-action:none;cursor:default}.signature__actions{display:flex;gap:12px;width:100%;flex-shrink:0}.signature__actions--overlay .signature__button{padding:11px 8px}.signature__actions-start,.signature__actions-end{display:flex;align-items:center;gap:6px}.signature__actions-start{flex-grow:1}.signature__actions-label{flex-grow:1;font-weight:600;font-size:11px;line-height:15px;color:#df3c3c;text-align:right}.signature__button{padding:4px 8px;border:0;border-radius:2px;min-width:80px;font-weight:700;font-size:11px;line-height:14px;text-transform:uppercase;transition:background-color .2s ease-in-out,color .2s ease-in-out}.signature__button--secondary-neutral{background-color:#eee;color:#6c6c6c}.signature__button--secondary-neutral:hover{background-color:#424242;color:#fff}.signature__button--secondary-positive{background-color:#eee;color:#3b73ed}.signature__button--secondary-positive:hover{background-color:#0b49d1;color:#fff}.signature__button--primary-positive{background-color:#3b73ed;color:#fff}.signature__button--primary-positive:hover{background-color:#0b49d1;color:#fff}.signature__button:disabled,.signature__button[disabled]{background-color:#f7f7f7;color:#ccc;pointer-events:none}.signature__overlay{position:fixed;inset:0;z-index:1000;background-color:#00000073}.signature__overlay-stage{position:absolute;top:50%;left:50%;box-sizing:border-box;transform:translate(-50%,-50%)}.signature__overlay-stage--rotated{transform:translate(-50%,-50%) rotate(90deg)}.signature__overlay-panel{box-sizing:border-box;display:flex;flex-direction:column;gap:12px;width:100%;height:100%;padding:12px;background-color:#fff;border-radius:2px}.signature__overlay-pad{box-sizing:border-box;padding:4px;background-image:linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%);background-size:16px 4px,16px 4px,4px 17px,4px 17px;background-position:left bottom,left top,left bottom,right bottom;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;border-radius:2px;min-width:0;min-height:0;flex:1 1 auto;width:100%}.signature__overlay-pad .signature__surface{width:100%;height:100%}\n"] }]
|
|
12591
|
-
}], ctorParameters: () => [], propDecorators: { canvasRef: [{ type: i0.ViewChild, args: ['canvas', { isSignal: true }] }], padSizeRef: [{ type: i0.ViewChild, args: ['padSize', { isSignal: true }] }], savedSignature: [{ type: i0.Input, args: [{ isSignal: true, alias: "savedSignature", required: false }] }], requiredInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredInvalid", required: false }] }], signatureChange: [{ type: i0.Output, args: ["signatureChange"] }] } });
|
|
12627
|
+
], template: "@let promptTitle = requiredInvalid() ? 'Signature Required' : 'Click Here';\n@let promptBody = requiredInvalid()\n ? 'Click Here To Sign Using Your Mouse'\n : 'To Sign Using Your Mouse';\n@let isFullscreen = viewModel.isFullscreenOpen();\n@let isInlinePad = viewModel.isPadOpen() && !isFullscreen;\n@let showPreviewActions = !isDisabled() && !isMobileViewport();\n\n@if (viewModel.showsPreview()) {\n <div class=\"signature__preview\" (click)=\"onPreviewClick($event)\">\n <div class=\"signature__preview-frame\">\n <div class=\"signature__preview-image\">\n <img\n [src]=\"viewModel.previewSrc()\"\n [width]=\"previewWidth\"\n [height]=\"previewHeight\"\n alt=\"\"\n draggable=\"false\"\n />\n </div>\n </div>\n @if (showPreviewActions) {\n <div class=\"signature__preview-actions\">\n <button\n type=\"button\"\n class=\"signature__icon-button\"\n (click)=\"openPad($event)\"\n >\n <svg-icon name=\"cai-edit\"></svg-icon>\n </button>\n <button\n type=\"button\"\n class=\"signature__icon-button\"\n (click)=\"clearSignature()\"\n >\n <svg-icon name=\"cai-delete\"></svg-icon>\n </button>\n </div>\n }\n </div>\n} @else {\n <div\n class=\"signature__pad\"\n [class.signature__pad--invalid]=\"\n requiredInvalid() && !viewModel.isPadOpen()\n \"\n >\n <div\n class=\"signature__surface\"\n [class.signature__surface--drawing]=\"isInlinePad\"\n (click)=\"openPad($event)\"\n >\n @if (!isInlinePad) {\n <div\n class=\"signature__prompt\"\n [class.signature__prompt--invalid]=\"requiredInvalid()\"\n >\n <span class=\"signature__prompt-title\">{{ promptTitle }}</span>\n <span class=\"signature__prompt-body\">{{ promptBody }}</span>\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"signaturePad\" />\n }\n </div>\n </div>\n\n @if (isInlinePad) {\n <div class=\"signature__actions\">\n <ng-container *ngTemplateOutlet=\"signatureActions\" />\n </div>\n }\n}\n\n@if (isFullscreen) {\n @let stage = viewModel.fullscreenStage();\n <div class=\"signature__overlay\" (click)=\"onBackdropClick($event)\">\n <div\n class=\"signature__overlay-stage\"\n [class.signature__overlay-stage--rotated]=\"stage?.isRotated\"\n [style.width.px]=\"stage?.width\"\n [style.height.px]=\"stage?.height\"\n (click)=\"$event.stopPropagation()\"\n >\n <div class=\"signature__overlay-panel\">\n <div class=\"signature__overlay-pad\">\n <div class=\"signature__surface signature__surface--drawing\">\n <ng-container *ngTemplateOutlet=\"signaturePad\" />\n </div>\n </div>\n <div class=\"signature__actions signature__actions--overlay\">\n <ng-container *ngTemplateOutlet=\"signatureActions\" />\n </div>\n </div>\n </div>\n </div>\n}\n\n<ng-template #signaturePad>\n <div class=\"signature__surface-measure\" #padSize>\n <canvas\n class=\"signature__canvas\"\n #canvas\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n ></canvas>\n </div>\n</ng-template>\n\n<ng-template #signatureActions>\n <div class=\"signature__actions-start\">\n <button\n type=\"button\"\n class=\"signature__button signature__button--secondary-neutral\"\n (click)=\"cancelPad()\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n class=\"signature__button signature__button--secondary-neutral\"\n (click)=\"undoLastStroke()\"\n >\n Undo\n </button>\n @if (viewModel.hasInk()) {\n <span class=\"signature__actions-label\">Confirmation Required</span>\n }\n </div>\n <div class=\"signature__actions-end\">\n @if (viewModel.hasExistingSignature()) {\n <button\n type=\"button\"\n class=\"signature__button signature__button--secondary-positive\"\n (click)=\"restoreSavedSignature()\"\n >\n Use Saved Signature\n </button>\n }\n <button\n type=\"button\"\n class=\"signature__button signature__button--primary-positive\"\n [disabled]=\"!viewModel.hasInk()\"\n (click)=\"confirmSignature()\"\n >\n Confirm\n </button>\n </div>\n</ng-template>\n", styles: [":host{display:grid;gap:8px;width:100%;max-width:628px;-webkit-user-select:none;user-select:none}:host.signature--has-current{justify-items:center}:host.signature--disabled{opacity:.6;pointer-events:none;cursor:default}:host.signature--mobile .signature__preview{cursor:pointer;margin-left:0}:host.signature--mobile .signature__preview-actions{display:none}:host.signature--mobile .signature__preview-image{transition:background-color .2s ease-in-out}@media(hover:hover){:host:hover:not(.signature--disabled):not(.signature--mobile) .signature__preview-image{background-color:#eee}:host:hover:not(.signature--disabled):not(.signature--mobile) .signature__preview-actions{opacity:1;pointer-events:auto}:host.signature--mobile:not(.signature--disabled):hover .signature__preview-image{background-color:#eee}}.signature__preview{display:flex;align-items:center;gap:4px;margin-left:60px}.signature__preview-frame{box-sizing:border-box;border-bottom:1px solid #dadada;padding:4px}.signature__preview-image{width:var(--signature-preview-width, 302px);height:var(--signature-preview-height, 81px);border-radius:2px;overflow:hidden;transition:background-color .2s ease-in-out}.signature__preview-image img{width:100%;height:100%;object-fit:contain;-webkit-user-drag:none;-webkit-user-select:none;user-select:none;pointer-events:none}.signature__preview-actions{display:flex;gap:4px;opacity:0;pointer-events:none;transition:opacity .2s ease-in-out}.signature__icon-button{width:26px;height:26px;padding:4px;border:0;border-radius:2px;background-color:#eee;transition:background-color .2s ease-in-out}.signature__icon-button:hover{background-color:#424242}.signature__icon-button:hover svg-icon svg path{fill:#fff}.signature__icon-button svg-icon{display:flex}.signature__icon-button svg-icon svg{width:18px;height:18px}.signature__icon-button svg-icon svg path{fill:#919191;transition:fill .2s ease-in-out}.signature__pad{width:100%;height:178px;box-sizing:border-box;padding:4px;background-image:linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%);background-size:16px 4px,16px 4px,4px 17px,4px 17px;background-position:left bottom,left top,left bottom,right bottom;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;border-radius:2px}.signature__pad--invalid{background-image:linear-gradient(to right,#ed9292 50%,#fff 50%),linear-gradient(to right,#ed9292 50%,#fff 50%),linear-gradient(to top,#ed9292 50%,#fff 50%),linear-gradient(to top,#ed9292 50%,#fff 50%);background-size:16px 4px,16px 4px,4px 17px,4px 17px;background-position:left bottom,left top,left bottom,right bottom;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y}.signature__surface{display:flex;justify-content:center;align-items:center;width:100%;height:100%;cursor:pointer;background-color:#fff;transition:background-color .2s ease-in-out}.signature__surface:hover{background-color:#eee}.signature__surface--drawing{display:block;cursor:default;background-color:#fff;min-width:0;min-height:0}.signature__surface--drawing:hover{background-color:#fff}.signature__surface-measure{width:100%;height:100%;min-width:0;min-height:0}.signature__prompt{display:flex;flex-direction:column;align-items:center;gap:4px}.signature__prompt--invalid .signature__prompt-title{color:#df3c3c}.signature__prompt-title{font-weight:700;font-size:14px;line-height:18px;color:#424242;text-align:center;text-transform:uppercase}.signature__prompt-body{font-weight:600;font-size:11px;line-height:14px;color:#424242;text-align:center;text-transform:uppercase}.signature__canvas{display:block;width:100%;height:100%;min-width:0;min-height:0;touch-action:none;cursor:default}.signature__actions{display:flex;gap:12px;width:100%;flex-shrink:0}.signature__actions--overlay .signature__button{padding:11px 8px}.signature__actions-start,.signature__actions-end{display:flex;align-items:center;gap:6px}.signature__actions-start{flex-grow:1}.signature__actions-label{flex-grow:1;font-weight:600;font-size:11px;line-height:15px;color:#df3c3c;text-align:right}.signature__button{padding:4px 8px;border:0;border-radius:2px;min-width:80px;font-weight:700;font-size:11px;line-height:14px;text-transform:uppercase;transition:background-color .2s ease-in-out,color .2s ease-in-out}.signature__button--secondary-neutral{background-color:#eee;color:#6c6c6c}.signature__button--secondary-neutral:hover{background-color:#424242;color:#fff}.signature__button--secondary-positive{background-color:#eee;color:#3b73ed}.signature__button--secondary-positive:hover{background-color:#0b49d1;color:#fff}.signature__button--primary-positive{background-color:#3b73ed;color:#fff}.signature__button--primary-positive:hover{background-color:#0b49d1;color:#fff}.signature__button:disabled,.signature__button[disabled]{background-color:#f7f7f7;color:#ccc;pointer-events:none}.signature__overlay{position:fixed;inset:0;z-index:1000;background-color:#00000073}.signature__overlay-stage{position:absolute;top:50%;left:50%;box-sizing:border-box;transform:translate(-50%,-50%)}.signature__overlay-stage--rotated{transform:translate(-50%,-50%) rotate(90deg)}.signature__overlay-panel{box-sizing:border-box;display:flex;flex-direction:column;gap:12px;width:100%;height:100%;padding:12px;background-color:#fff;border-radius:2px}.signature__overlay-pad{box-sizing:border-box;padding:4px;background-image:linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to right,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%),linear-gradient(to top,#eee 50%,#fff 50%);background-size:16px 4px,16px 4px,4px 17px,4px 17px;background-position:left bottom,left top,left bottom,right bottom;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;border-radius:2px;min-width:0;min-height:0;flex:1 1 auto;width:100%}.signature__overlay-pad .signature__surface{width:100%;height:100%}\n"] }]
|
|
12628
|
+
}], ctorParameters: () => [], propDecorators: { canvasRef: [{ type: i0.ViewChild, args: ['canvas', { isSignal: true }] }], padSizeRef: [{ type: i0.ViewChild, args: ['padSize', { isSignal: true }] }], savedSignature: [{ type: i0.Input, args: [{ isSignal: true, alias: "savedSignature", required: false }] }], useSavedSignature: [{ type: i0.Input, args: [{ isSignal: true, alias: "useSavedSignature", required: false }] }], requiredInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredInvalid", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], mobileBreakpoint: [{ type: i0.Input, args: [{ isSignal: true, alias: "mobileBreakpoint", required: false }] }], signatureChange: [{ type: i0.Output, args: ["signatureChange"] }] } });
|
|
12592
12629
|
|
|
12593
12630
|
/*
|
|
12594
12631
|
* Public API Surface of carriera-intern
|