-
Notifications
You must be signed in to change notification settings - Fork 1
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 #154 from DDtMM/19.x
Fix bad manualCleanups: false, and improve springSignal
- Loading branch information
Showing
13 changed files
with
134 additions
and
55 deletions.
There are no files selected for viewing
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
16 changes: 16 additions & 0 deletions
16
...os/spring-signal/multiple-spring-numbers-demo/multiple-spring-numbers-demo.component.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!-- eslint-disable @angular-eslint/template/interactive-supports-focus --> | ||
<!-- eslint-disable @angular-eslint/template/click-events-have-key-events --> | ||
<div class="flex flex-row gap-3 items-center pb-3"> | ||
<app-spring-options [(springOptions)]="$springOptions" (springOptionsChange)="$coords.setOptions($springOptions())" /> | ||
</div> | ||
<div #target class="relative cursor-pointer w-36 h-36 bg-green-600 rounded-lg border-slate-900 border-solid border overflow-hidden" | ||
(click)="setCords($event, target)" | ||
(mousemove)="setCords($event, target)" > | ||
<div class="w-4 h-4 bg-slate-900 rounded-full" | ||
[ngStyle]="{ 'translate': $coords()[0] + 'px ' + $coords()[1] + 'px' }"> | ||
</div> | ||
<div class="text-sm absolute bottom-2 right-2 pointer-events-none"> | ||
({{$coords()[0] | number: '1.1-2'}}, {{$coords()[1] | number: '1.1-2'}}) | ||
</div> | ||
</div> | ||
|
21 changes: 21 additions & 0 deletions
21
...emos/spring-signal/multiple-spring-numbers-demo/multiple-spring-numbers-demo.component.ts
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { ChangeDetectionStrategy, Component, signal } from '@angular/core'; | ||
import { SpringOptions, springSignal } from '@ddtmm/angular-signal-generators'; | ||
import { SpringOptionsComponent } from "../shared/spring-options.component"; | ||
|
||
@Component({ | ||
selector: 'app-multiple-spring-numbers-demo', | ||
templateUrl: './multiple-spring-numbers-demo.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
imports: [CommonModule, SpringOptionsComponent] | ||
}) | ||
export class MultipleSpringNumbersDemoComponent { | ||
readonly $springOptions = signal<Partial<SpringOptions>>({ damping: 7, stiffness: 150 }); | ||
readonly $coords = springSignal([0, 0], { ...this.$springOptions() }); | ||
|
||
setCords(event: MouseEvent, desiredTarget: HTMLElement) { | ||
if (event.target === desiredTarget) { | ||
this.$coords.set([event.offsetX - 8, event.offsetY - 8]); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.