@coreui/angular-pro 5.5.1 → 5.5.2

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.
@@ -5623,23 +5623,30 @@ class FormPasswordDirective {
5623
5623
  #wrapper = this.#renderer.createElement('div');
5624
5624
  #actionButtonRef = this.viewContainerRef.createComponent(FormPasswordActionComponent);
5625
5625
  #unListen;
5626
+ #afterNextRender = afterNextRender({
5627
+ write: () => {
5628
+ // this fixes RuntimeError: NG0500: During hydration Angular expected <input> but found <div>.
5629
+ // Find more at https://angular.dev/errors/NG0500
5630
+ const nativeElement = this.#hostElement.nativeElement;
5631
+ const parentNode = this.#renderer.parentNode(nativeElement);
5632
+ const wrapper = this.#wrapper;
5633
+ const actionButton = this.#actionButtonRef.location.nativeElement.querySelector('button');
5634
+ this.#renderer.addClass(wrapper, 'form-password');
5635
+ this.#renderer.appendChild(parentNode, wrapper);
5636
+ this.#renderer.insertBefore(parentNode, wrapper, nativeElement);
5637
+ this.#renderer.appendChild(wrapper, nativeElement);
5638
+ this.#renderer.appendChild(wrapper, actionButton);
5639
+ this.#renderer.removeChild(wrapper, this.#actionButtonRef.location.nativeElement);
5640
+ this.#addFloatingLabel();
5641
+ }
5642
+ });
5626
5643
  ngOnInit() {
5627
- const nativeElement = this.#hostElement.nativeElement;
5628
- const parentNode = this.#renderer.parentNode(nativeElement);
5629
- const wrapper = this.#wrapper;
5630
5644
  const actionButton = this.#actionButtonRef.location.nativeElement.querySelector('button');
5631
- this.#renderer.addClass(wrapper, 'form-password');
5632
- this.#renderer.appendChild(parentNode, wrapper);
5633
- this.#renderer.insertBefore(parentNode, wrapper, nativeElement);
5634
- this.#renderer.appendChild(wrapper, nativeElement);
5635
- this.#renderer.appendChild(wrapper, actionButton);
5636
- this.#renderer.removeChild(wrapper, this.#actionButtonRef.location.nativeElement);
5637
- this.#addFloatingLabel();
5638
5645
  this.#unListen = this.#renderer.listen(actionButton, 'click', () => {
5639
5646
  this.#passwordVisible.update((value) => !value);
5640
5647
  });
5641
5648
  this.#focusMonitor
5642
- .monitor(wrapper, true)
5649
+ .monitor(this.#wrapper, true)
5643
5650
  .pipe(distinctUntilChanged(), takeUntilDestroyed(this.#destroyRef))
5644
5651
  .subscribe((origin) => {
5645
5652
  this.#passwordVisible.update((value) => (origin ? value : false));