@shival99/z-ui 1.6.3 → 1.6.6
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, Injector, signal, ElementRef, Renderer2, Directive, NgZone, Pipe, TemplateRef, viewChild, viewChildren, untracked,
|
|
5
|
+
import { input, output, computed, ChangeDetectionStrategy, Component, inject, DestroyRef, Injector, signal, effect, ElementRef, Renderer2, Directive, NgZone, Pipe, TemplateRef, viewChild, viewChildren, untracked, 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';
|
|
@@ -255,10 +255,15 @@ class ZTableEditCellComponent {
|
|
|
255
255
|
zChange = output();
|
|
256
256
|
_currentValue = signal(undefined, ...(ngDevMode ? [{ debugName: "_currentValue" }] : []));
|
|
257
257
|
_valueChange$ = new Subject();
|
|
258
|
-
_lastExternalValue = undefined;
|
|
259
258
|
_pendingBlurValue = undefined;
|
|
260
259
|
_hasPendingBlur = false;
|
|
261
260
|
_inputControl = null;
|
|
261
|
+
constructor() {
|
|
262
|
+
effect(() => {
|
|
263
|
+
const externalValue = this.zValue();
|
|
264
|
+
this._currentValue.set(externalValue);
|
|
265
|
+
});
|
|
266
|
+
}
|
|
262
267
|
editConfig = computed(() => {
|
|
263
268
|
const config = this.zEditConfig();
|
|
264
269
|
if (!config || typeof config === 'boolean') {
|
|
@@ -339,15 +344,7 @@ class ZTableEditCellComponent {
|
|
|
339
344
|
}
|
|
340
345
|
return config.readonly;
|
|
341
346
|
}, ...(ngDevMode ? [{ debugName: "isReadonly" }] : []));
|
|
342
|
-
value = computed(() => {
|
|
343
|
-
const externalValue = this.zValue();
|
|
344
|
-
if (externalValue !== this._lastExternalValue) {
|
|
345
|
-
this._lastExternalValue = externalValue;
|
|
346
|
-
this._currentValue.set(externalValue);
|
|
347
|
-
return externalValue;
|
|
348
|
-
}
|
|
349
|
-
return this._currentValue();
|
|
350
|
-
}, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
347
|
+
value = computed(() => this._currentValue(), ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
351
348
|
stringValue = computed(() => {
|
|
352
349
|
const val = this.value();
|
|
353
350
|
if (val === null || val === undefined) {
|
|
@@ -503,7 +500,8 @@ class ZTableEditCellComponent {
|
|
|
503
500
|
[zScrollClose]="true"
|
|
504
501
|
[zOptions]="selectOptions()"
|
|
505
502
|
[zAllowClear]="allowClear()"
|
|
506
|
-
[zDisabled]="isDisabled()
|
|
503
|
+
[zDisabled]="isDisabled()"
|
|
504
|
+
[zReadonly]="isReadonly()"
|
|
507
505
|
[ngModel]="value()"
|
|
508
506
|
[zPlaceholder]="placeholder()"
|
|
509
507
|
(ngModelChange)="onSelectChange($event)"
|
|
@@ -517,7 +515,8 @@ class ZTableEditCellComponent {
|
|
|
517
515
|
zAllowClear
|
|
518
516
|
zValueType="date"
|
|
519
517
|
[zScrollClose]="true"
|
|
520
|
-
[zDisabled]="isDisabled()
|
|
518
|
+
[zDisabled]="isDisabled()"
|
|
519
|
+
[zReadonly]="isReadonly()"
|
|
521
520
|
[zPlaceholder]="placeholder()"
|
|
522
521
|
[ngModel]="dateValue()"
|
|
523
522
|
(ngModelChange)="onDateChange($event)"
|
|
@@ -602,7 +601,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
602
601
|
[zScrollClose]="true"
|
|
603
602
|
[zOptions]="selectOptions()"
|
|
604
603
|
[zAllowClear]="allowClear()"
|
|
605
|
-
[zDisabled]="isDisabled()
|
|
604
|
+
[zDisabled]="isDisabled()"
|
|
605
|
+
[zReadonly]="isReadonly()"
|
|
606
606
|
[ngModel]="value()"
|
|
607
607
|
[zPlaceholder]="placeholder()"
|
|
608
608
|
(ngModelChange)="onSelectChange($event)"
|
|
@@ -616,7 +616,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
616
616
|
zAllowClear
|
|
617
617
|
zValueType="date"
|
|
618
618
|
[zScrollClose]="true"
|
|
619
|
-
[zDisabled]="isDisabled()
|
|
619
|
+
[zDisabled]="isDisabled()"
|
|
620
|
+
[zReadonly]="isReadonly()"
|
|
620
621
|
[zPlaceholder]="placeholder()"
|
|
621
622
|
[ngModel]="dateValue()"
|
|
622
623
|
(ngModelChange)="onDateChange($event)"
|
|
@@ -654,7 +655,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
654
655
|
`, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
655
656
|
class: 'z-table-edit-cell block',
|
|
656
657
|
}, styles: [":host{display:block;width:100%}\n"] }]
|
|
657
|
-
}], propDecorators: { zRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "zRow", required: true }] }], zRowId: [{ type: i0.Input, args: [{ isSignal: true, alias: "zRowId", required: true }] }], zRowIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "zRowIndex", required: true }] }], zColumnId: [{ type: i0.Input, args: [{ isSignal: true, alias: "zColumnId", required: true }] }], zValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "zValue", required: false }] }], zEditConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "zEditConfig", required: false }] }], zChange: [{ type: i0.Output, args: ["zChange"] }] } });
|
|
658
|
+
}], ctorParameters: () => [], propDecorators: { zRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "zRow", required: true }] }], zRowId: [{ type: i0.Input, args: [{ isSignal: true, alias: "zRowId", required: true }] }], zRowIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "zRowIndex", required: true }] }], zColumnId: [{ type: i0.Input, args: [{ isSignal: true, alias: "zColumnId", required: true }] }], zValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "zValue", required: false }] }], zEditConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "zEditConfig", required: false }] }], zChange: [{ type: i0.Output, args: ["zChange"] }] } });
|
|
658
659
|
|
|
659
660
|
class ZTableFilterComponent {
|
|
660
661
|
zColumn = input.required(...(ngDevMode ? [{ debugName: "zColumn" }] : []));
|