-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #285 from e-picsa/feat/custom-drawing-integration
Feat/custom drawing integration
- Loading branch information
Showing
15 changed files
with
184 additions
and
144 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
apps/picsa-tools/budget-tool/src/app/components/budget-draw/budget-draw.component.html
This file was deleted.
Oops, something went wrong.
Empty file.
21 changes: 0 additions & 21 deletions
21
apps/picsa-tools/budget-tool/src/app/components/budget-draw/budget-draw.component.spec.ts
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
apps/picsa-tools/budget-tool/src/app/components/budget-draw/budget-draw.component.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
apps/picsa-tools/budget-tool/src/app/components/card/card-new/card-new-dialog.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
<mat-card appearance="outlined" mat-elevation-z4 class="budget-card selectable"> | ||
<!-- <mat-card appearance="outlined" mat-elevation-z4 class="budget-card selectable"> | ||
<budget-card-image [card]="card"></budget-card-image> | ||
<div class="card-title">{{ card.label | translate }}</div> | ||
</mat-card> | ||
<mat-form-field> | ||
</mat-card> --> | ||
|
||
<picsa-custom-drawing (onChange)="setBudgetDrawing($event)"></picsa-custom-drawing> | ||
<mat-form-field class="label-input"> | ||
<mat-label>{{'Card Label' | translate}}</mat-label> | ||
<input matInput [(ngModel)]="card.label" /> | ||
</mat-form-field> | ||
<button mat-stroked-button (click)="save()" [disabled]="card.label === ''" style="margin-top: 1em; width: 70%"> | ||
<button mat-stroked-button (click)="save()" [disabled]="!card.label || !imgData" style="margin-top: 1em; width: 70%"> | ||
<mat-icon>check</mat-icon>{{ 'Save' | translate }} | ||
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,7 @@ | |
background: #dcdcdc; | ||
overflow: auto; | ||
} | ||
.label-input { | ||
width: 100%; | ||
margin-top: 1rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,39 @@ | ||
<button mat-raised-button (click)="dialog.open(editorDialog)">Click to Draw</button> | ||
<div class="dialog-container"> | ||
<div class="edit-buttons"> | ||
<button mat-stroked-button (click)="undoSvgStroke()"><mat-icon>undo</mat-icon>{{ 'Undo' | translate }}</button> | ||
<button mat-stroked-button (click)="redoSvgStroke()"><mat-icon>redo</mat-icon>{{ 'Redo' | translate }}</button> | ||
<button mat-stroked-button style="margin-left: auto" (click)="clearDraw()">{{ 'Clear All' | translate }}</button> | ||
</div> | ||
<div class="svg-container" [style.width]="size() + 'px'" [style.height]="size() + 'px'"> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
[attr.viewBox]="viewbox()" | ||
[attr.height]="size()" | ||
[attr.width]="size()" | ||
#svgElement | ||
(pointerdown)="handlePointerDown($event)" | ||
(pointermove)="handlePointerMove($event)" | ||
(mouseup)="handlePointerUp()" | ||
(pointerup)="handlePointerUp()" | ||
style="touch-action: none" | ||
> | ||
<!-- Previously rendered segments --> | ||
@for(segment of segments; track segment.id){ | ||
<path [attr.d]="segment.path()" [id]="segment.id" /> | ||
} | ||
|
||
<ng-template #editorDialog> | ||
<div class="svg-container"> | ||
<div className="flex flex-row"> | ||
<button mat-stroked-button (click)="undoSvgStroke()">Undo</button> | ||
<button mat-stroked-button (click)="redoSvgStroke()">Redo</button> | ||
<!-- Active segment --> | ||
@if(activeSegment.path()){ | ||
<path [attr.d]="activeSegment.path()" [id]="activeSegment.id" /> | ||
} | ||
</svg> | ||
<!-- Draw Prompt Logo --> | ||
@if(segments.length===0 && !activeSegment.path()){ | ||
<div class="draw-logo"> | ||
<mat-icon>draw</mat-icon> | ||
<div>{{ 'Draw Here' | translate }}</div> | ||
</div> | ||
<div class="svg-dialog-container"> | ||
<svg | ||
#svgElement | ||
width="100%" | ||
height="100%" | ||
(pointerdown)="handlePointerDown($event)" | ||
(pointermove)="handlePointerMove($event)" | ||
(mouseup)="handlePointerUp()" | ||
(pointerup)="handlePointerUp()" | ||
style="touch-action: none" | ||
> | ||
<!-- Previously rendered segments --> | ||
@for(segment of segments; track segment.id){ | ||
<path [attr.d]="segment.path()" id="path-1" /> | ||
} | ||
|
||
<!-- Active segment --> | ||
@if(activeSegment){ | ||
<path [attr.d]="activeSegment.path()" id="path-1" /> | ||
} | ||
</svg> | ||
</div> | ||
<button mat-stroked-button (click)="clearDraw()">Clear All</button> | ||
} | ||
</div> | ||
</ng-template> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
.svg-dialog-container { | ||
.dialog-container { | ||
text-align: center; | ||
} | ||
.svg-container { | ||
border: 1px solid #eeeeee; | ||
border-radius: 4px; | ||
box-sizing: border-box; | ||
// mat-dialog has max-width 80vw and includes 24px padding so just fit max | ||
width: calc(80vw - 48px); | ||
height: 70vh; | ||
position: relative; | ||
overflow: hidden; | ||
} | ||
|
||
.flex.flex-row{ | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
.draw-logo { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
color: var(--color-light); | ||
mat-icon { | ||
font-size: 48px; | ||
height: 48px; | ||
width: 48px; | ||
} | ||
} | ||
|
||
.svg-container{ | ||
height: 100%; | ||
.edit-buttons { | ||
display: flex; | ||
gap: 8px; | ||
margin-bottom: 8px; | ||
} |
Oops, something went wrong.