@shival99/z-ui 1.4.24 → 1.4.28
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.
|
@@ -2,7 +2,7 @@ import { moveItemInArray, CdkDropList, CdkDrag } from '@angular/cdk/drag-drop';
|
|
|
2
2
|
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
3
3
|
import { NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { input, output, computed, ChangeDetectionStrategy, Component, inject, DestroyRef, signal, ElementRef, Renderer2, Directive, NgZone, Pipe, TemplateRef, viewChild, viewChildren, untracked, effect, afterNextRender } from '@angular/core';
|
|
5
|
+
import { input, output, computed, ChangeDetectionStrategy, Component, inject, DestroyRef, Injector, signal, ElementRef, Renderer2, Directive, NgZone, Pipe, TemplateRef, viewChild, viewChildren, untracked, effect, afterNextRender } from '@angular/core';
|
|
6
6
|
import { TranslatePipe } from '@ngx-translate/core';
|
|
7
7
|
import { injectVirtualizer } from '@shival99/angular-virtual';
|
|
8
8
|
import { ZButtonComponent } from '@shival99/z-ui/components/z-button';
|
|
@@ -244,6 +244,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
244
244
|
|
|
245
245
|
class ZTableEditCellComponent {
|
|
246
246
|
_destroyRef = inject(DestroyRef);
|
|
247
|
+
_injector = inject(Injector);
|
|
247
248
|
zRow = input.required(...(ngDevMode ? [{ debugName: "zRow" }] : []));
|
|
248
249
|
zRowId = input.required(...(ngDevMode ? [{ debugName: "zRowId" }] : []));
|
|
249
250
|
zRowIndex = input.required(...(ngDevMode ? [{ debugName: "zRowIndex" }] : []));
|
|
@@ -340,8 +341,9 @@ class ZTableEditCellComponent {
|
|
|
340
341
|
this._setupBlurWatcher();
|
|
341
342
|
}
|
|
342
343
|
_handleInputBlur() {
|
|
343
|
-
if (!this._hasPendingBlur)
|
|
344
|
+
if (!this._hasPendingBlur) {
|
|
344
345
|
return;
|
|
346
|
+
}
|
|
345
347
|
const oldValue = this.zValue();
|
|
346
348
|
this._hasPendingBlur = false;
|
|
347
349
|
this._emitChange(oldValue, this._pendingBlurValue);
|
|
@@ -397,9 +399,10 @@ class ZTableEditCellComponent {
|
|
|
397
399
|
});
|
|
398
400
|
}
|
|
399
401
|
_setupBlurWatcher() {
|
|
400
|
-
if (!this._inputControl || !this.editConfig()?.blurEdit)
|
|
402
|
+
if (!this._inputControl || !this.editConfig()?.blurEdit) {
|
|
401
403
|
return;
|
|
402
|
-
|
|
404
|
+
}
|
|
405
|
+
toObservable(this._inputControl.state, { injector: this._injector })
|
|
403
406
|
.pipe(map(state => state.blurred), pairwise(), filter(([prev, curr]) => !prev && curr), takeUntilDestroyed(this._destroyRef))
|
|
404
407
|
.subscribe(() => {
|
|
405
408
|
this._handleInputBlur();
|