-
Notifications
You must be signed in to change notification settings - Fork 1
feat(ngx-layout): Add image-marker component #378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "cSpell.words": [ | ||
| "WCAG" | ||
| ] | ||
| } |
This file contains hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions
13
apps/layout-test/src/pages/image-marker/image-marker.component.html
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <ngx-image-marker | ||
| image="assets/klimmuur.webp" | ||
| imageDescription="Floor-plan of a climbing place" | ||
| [canEdit]="allowEdit" | ||
| [startState]="currentState" | ||
| (stateUpdated)="updateState($event)" | ||
| (markerClicked)="markerClicked()" | ||
| > | ||
| </ngx-image-marker> | ||
|
|
||
| <button [disabled]="!allowEdit" (click)="save()">Save</button> | ||
| <br /> | ||
| <button [disabled]="allowEdit" (click)="edit()">Edit</button> |
31 changes: 31 additions & 0 deletions
31
apps/layout-test/src/pages/image-marker/image-marker.component.ts
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
| import { NgxImageMarkerComponent, NgxImageMarkerState } from '@ngx/layout'; | ||
|
|
||
| @Component({ | ||
| selector: 'ngx-image-marker-page', | ||
| templateUrl: './image-marker.component.html', | ||
| imports: [NgxImageMarkerComponent], | ||
IbenTesara marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| changeDetection: ChangeDetectionStrategy.OnPush, | ||
| }) | ||
| export class NgxImageMarkerPageComponent { | ||
| public currentState: NgxImageMarkerState; | ||
| public newState: NgxImageMarkerState; | ||
| public allowEdit: boolean = true; | ||
|
|
||
| public save() { | ||
| this.currentState = this.newState; | ||
| this.allowEdit = false; | ||
| } | ||
|
|
||
| public edit() { | ||
| this.allowEdit = true; | ||
| } | ||
|
|
||
| public updateState(event: NgxImageMarkerState) { | ||
| this.newState = event; | ||
| } | ||
|
|
||
| public markerClicked() { | ||
| window.alert('Clicked!'); | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,46 +1,52 @@ | ||
| { | ||
| "name": "@studiohyperdrive/ngx-layout", | ||
| "version": "19.0.0", | ||
| "description": "A lightweight customizable approach for common and complex layouts in Angular.", | ||
| "keywords": [ | ||
| "angular", | ||
| "angular2", | ||
| "layout", | ||
| "loading", | ||
| "error", | ||
| "dynamic dashboard", | ||
| "dynamic layout", | ||
| "visual", | ||
| "accordion", | ||
| "wcag", | ||
| "aria", | ||
| "display-content", | ||
| "loading", | ||
| "error", | ||
| "name": "@studiohyperdrive/ngx-layout", | ||
| "version": "19.0.0", | ||
| "description": "A lightweight customizable approach for common and complex layouts in Angular.", | ||
| "keywords": [ | ||
| "angular", | ||
| "angular2", | ||
| "layout", | ||
| "loading", | ||
| "error", | ||
| "dynamic dashboard", | ||
| "dynamic layout", | ||
| "visual", | ||
| "accordion", | ||
| "wcag", | ||
| "aria", | ||
| "display-content", | ||
| "loading", | ||
| "error", | ||
| "drag and drop", | ||
| "accessible drag and drop", | ||
| "drag-and-drop", | ||
| "accessible drag-and-drop" | ||
| ], | ||
| "homepage": "https://open-source.studiohyperdrive.be/docs/angular/layout/introduction", | ||
| "license": "MIT", | ||
| "author": { | ||
| "name": "Studio Hyperdrive", | ||
| "url": "https://studiohyperdrive.be/" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/studiohyperdrive/hyperdrive-opensource", | ||
| "directory": "libs/angular/layout/src" | ||
| }, | ||
| "peerDependencies": { | ||
| "@angular/common": "^19.0.0", | ||
| "@angular/core": "^19.0.0", | ||
| "@angular/forms": "^19.0.0", | ||
| "@angular/cdk": "^19.0.0" | ||
| }, | ||
| "dependencies": { | ||
| "tslib": "^2.3.0" | ||
| }, | ||
| "sideEffects": false | ||
| } | ||
| "accessible drag-and-drop", | ||
| "markerjs2", | ||
| "markerjs-live" | ||
| ], | ||
| "homepage": "https://open-source.studiohyperdrive.be/docs/angular/layout/introduction", | ||
| "license": "MIT", | ||
| "author": { | ||
| "name": "Studio Hyperdrive", | ||
| "url": "https://studiohyperdrive.be/" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/studiohyperdrive/hyperdrive-opensource", | ||
| "directory": "libs/angular/layout/src" | ||
| }, | ||
| "peerDependencies": { | ||
| "@angular/common": "^19.0.0", | ||
| "@angular/core": "^19.0.0", | ||
| "@angular/forms": "^19.0.0", | ||
| "@angular/cdk": "^19.0.0", | ||
| "@studiohyperdrive/ngx-core": "^19.1.0", | ||
| "markerjs-live": "1.2.1", | ||
| "markerjs2": "2.32.3", | ||
| "angular2-uuid": "^1.1.1" | ||
| }, | ||
| "dependencies": { | ||
| "tslib": "^2.3.0" | ||
| }, | ||
| "sideEffects": false | ||
| } |
26 changes: 26 additions & 0 deletions
26
libs/angular/layout/src/lib/components/image-marker/image-marker.component.scss
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // Iben: Add a margin-bottom of 40px so the toolbar is compensated | ||
| :host { | ||
| display: block; | ||
| position: relative; | ||
| margin-bottom: 40px; | ||
|
|
||
| // Iben: Because of issues with the close and save flow in MarkerJs2 in Angular, we remove the save and close buttons | ||
| // Saving goes through the Angular flow | ||
| ::ng-deep { | ||
|
|
||
| [data-action="render"], | ||
| [data-action="close"] { | ||
| display: none; | ||
| } | ||
|
|
||
| // Iben: Remove the margin top so the entire image is visible and the toolbox is not visible on top of the image | ||
| img { | ||
| margin-top: 0 !important; | ||
| } | ||
|
|
||
| // Iben: Because setting the style classes overwrites the existing style we need to set the color to white | ||
| .ngx-image-marker-toolbox-button { | ||
| fill: white; | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if a small demo could be provided here