@breadstone/mosaik-elements-angular 0.0.52 → 0.0.53

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.
@@ -55594,7 +55594,6 @@ function provideAnimate(config) {
55594
55594
  }
55595
55595
 
55596
55596
  // #region Imports
55597
- // #endregion
55598
55597
  /**
55599
55598
  * @public
55600
55599
  */
@@ -55605,8 +55604,7 @@ class AnimateDirective {
55605
55604
  _animationPlayer;
55606
55605
  _renderer;
55607
55606
  _wasTriggered;
55608
- _animationOptions;
55609
- _animation;
55607
+ _options;
55610
55608
  // #endregion
55611
55609
  // #region Ctor
55612
55610
  constructor() {
@@ -55615,32 +55613,20 @@ class AnimateDirective {
55615
55613
  this._animationPlayer = inject(AnimationPlayer2);
55616
55614
  this._renderer = inject(Renderer2);
55617
55615
  this._wasTriggered = false;
55618
- this._animationOptions = undefined;
55619
- this._animation = undefined;
55616
+ this._options = undefined;
55620
55617
  }
55621
55618
  // #endregion
55622
55619
  // #region Properties
55623
- /**
55624
- * Gets or sets the `animation` property.
55625
- *
55626
- * @public
55627
- */
55628
- get animation() {
55629
- return this._animation;
55630
- }
55631
- set animation(value) {
55632
- this._animation = value;
55633
- }
55634
55620
  /**
55635
55621
  * Gets or sets the `options` property.
55636
55622
  *
55637
55623
  * @public
55638
55624
  */
55639
55625
  get options() {
55640
- return this._animationOptions;
55626
+ return this._options;
55641
55627
  }
55642
55628
  set options(value) {
55643
- this._animationOptions = value;
55629
+ this._options = value;
55644
55630
  }
55645
55631
  // #endregion
55646
55632
  // #region Methods
@@ -55650,47 +55636,40 @@ class AnimateDirective {
55650
55636
  ngOnInit() {
55651
55637
  this.tryTrigger();
55652
55638
  }
55653
- /**
55654
- * @public
55655
- */
55656
- ngOnChanges(changes) {
55657
- if ('optionsOrRef' in changes) {
55658
- this.tryTrigger();
55659
- }
55660
- }
55661
- /**
55662
- * @public
55663
- */
55664
- ngOnDestroy() {
55665
- // optionally cancel animation if needed
55666
- }
55667
55639
  /**
55668
55640
  * @private
55669
55641
  */
55670
55642
  tryTrigger() {
55671
- if (this._wasTriggered || !this.options) {
55643
+ if (typeof this._options === 'string') {
55644
+ this._options = this._registry[this._options];
55645
+ if (this._options) {
55646
+ console.warn(`[AnimateDirective]: The animation with "${this._options}" was not found.`);
55647
+ return;
55648
+ }
55649
+ }
55650
+ if (this._wasTriggered) {
55672
55651
  return;
55673
55652
  }
55674
55653
  this._wasTriggered = true;
55675
- const options = this.options;
55676
- const el = this._element.nativeElement;
55677
- // apply `from` and `initial` styles
55678
55654
  const from = {
55679
- ...options.from,
55680
- ...options.initial
55655
+ ...this._options?.from,
55656
+ ...this._options?.initial
55681
55657
  };
55682
55658
  for (const [k, v] of Object.entries(from)) {
55683
- if (k in el.style) {
55684
- this._renderer.setStyle(el, k, v);
55659
+ if (k in this._element.nativeElement.style) {
55660
+ this._renderer.setStyle(this._element.nativeElement, k, v);
55685
55661
  }
55686
55662
  }
55687
- if (options.trigger) {
55688
- options.trigger(() => this.play(options));
55663
+ if (this._options?.trigger) {
55664
+ this._options.trigger(() => this.play(this._options));
55689
55665
  }
55690
55666
  else {
55691
- this.play(options);
55667
+ this.play(this._options);
55692
55668
  }
55693
55669
  }
55670
+ /**
55671
+ * @private
55672
+ */
55694
55673
  play(options) {
55695
55674
  void this._animationPlayer.play(this._element.nativeElement, options.to, {
55696
55675
  duration: 333,
@@ -55701,7 +55680,7 @@ class AnimateDirective {
55701
55680
  });
55702
55681
  }
55703
55682
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: AnimateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
55704
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.4", type: AnimateDirective, isStandalone: true, selector: "[mosaikAnimate]", inputs: { animation: ["mosaikAnimate", "animation"], options: ["mosaikAnimateOptions", "options"] }, usesOnChanges: true, ngImport: i0 });
55683
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.4", type: AnimateDirective, isStandalone: true, selector: "[mosaikAnimate]", inputs: { options: ["mosaikAnimate", "options"] }, ngImport: i0 });
55705
55684
  }
55706
55685
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: AnimateDirective, decorators: [{
55707
55686
  type: Directive,
@@ -55709,16 +55688,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
55709
55688
  selector: '[mosaikAnimate]',
55710
55689
  standalone: true
55711
55690
  }]
55712
- }], ctorParameters: () => [], propDecorators: { animation: [{
55691
+ }], ctorParameters: () => [], propDecorators: { options: [{
55713
55692
  type: Input,
55714
55693
  args: [{
55715
55694
  alias: 'mosaikAnimate',
55716
- required: true
55717
- }]
55718
- }], options: [{
55719
- type: Input,
55720
- args: [{
55721
- alias: 'mosaikAnimateOptions'
55695
+ required: true,
55722
55696
  }]
55723
55697
  }] } });
55724
55698