@tetacom/ng-components 1.6.26 → 1.6.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.
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { ChangeDetectorRef,
|
|
1
|
+
import { ChangeDetectorRef, Signal } from '@angular/core';
|
|
2
2
|
import { TableService } from '../service/table.service';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class SelectionCellComponent<T>
|
|
4
|
+
export declare class SelectionCellComponent<T> {
|
|
5
5
|
private _svc;
|
|
6
6
|
private _cdr;
|
|
7
|
-
row: T
|
|
7
|
+
row: import("@angular/core").InputSignal<T>;
|
|
8
8
|
private readonly tableCellClass;
|
|
9
|
-
selectedRows: T[]
|
|
10
|
-
|
|
9
|
+
selectedRows: Signal<T[]>;
|
|
10
|
+
isSelected: Signal<boolean>;
|
|
11
11
|
constructor(_svc: TableService<T>, _cdr: ChangeDetectorRef);
|
|
12
12
|
selectRow(value: boolean): void;
|
|
13
|
-
ngOnInit(): void;
|
|
14
|
-
ngOnDestroy(): void;
|
|
15
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectionCellComponent<any>, never>;
|
|
16
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SelectionCellComponent<any>, "teta-selection-cell", never, { "row": { "alias": "row"; "required":
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectionCellComponent<any>, "teta-selection-cell", never, { "row": { "alias": "row"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
17
15
|
}
|
|
@@ -4088,14 +4088,22 @@ class OnlyNumberDirective {
|
|
|
4088
4088
|
}
|
|
4089
4089
|
e.preventDefault();
|
|
4090
4090
|
e.stopPropagation();
|
|
4091
|
-
// this.validateValue(this._elementRef.nativeElement.value);
|
|
4092
4091
|
}
|
|
4093
4092
|
onBlur(e) {
|
|
4094
4093
|
e.preventDefault();
|
|
4095
4094
|
e.stopPropagation();
|
|
4096
|
-
|
|
4097
|
-
if (value
|
|
4098
|
-
|
|
4095
|
+
let value = this._elementRef.nativeElement.value;
|
|
4096
|
+
if (value === '') {
|
|
4097
|
+
value = null;
|
|
4098
|
+
this._elementRef.nativeElement.value = value;
|
|
4099
|
+
this._elementRef.nativeElement.dispatchEvent(new Event('input'));
|
|
4100
|
+
}
|
|
4101
|
+
else if (value.endsWith('.')) {
|
|
4102
|
+
value = value.replace('.', '');
|
|
4103
|
+
if (value === '') {
|
|
4104
|
+
value = null;
|
|
4105
|
+
}
|
|
4106
|
+
this._elementRef.nativeElement.value = value;
|
|
4099
4107
|
this._elementRef.nativeElement.dispatchEvent(new Event('input'));
|
|
4100
4108
|
}
|
|
4101
4109
|
}
|
|
@@ -8199,36 +8207,35 @@ class SelectionCellComponent {
|
|
|
8199
8207
|
constructor(_svc, _cdr) {
|
|
8200
8208
|
this._svc = _svc;
|
|
8201
8209
|
this._cdr = _cdr;
|
|
8210
|
+
this.row = input.required();
|
|
8202
8211
|
this.tableCellClass = true;
|
|
8203
|
-
this.selectedRows =
|
|
8204
|
-
|
|
8212
|
+
this.selectedRows = toSignal(this._svc.selectedRows, {
|
|
8213
|
+
initialValue: [],
|
|
8214
|
+
});
|
|
8215
|
+
this.isSelected = computed(() => {
|
|
8216
|
+
const selectedRows = this.selectedRows();
|
|
8217
|
+
const row = this.row();
|
|
8218
|
+
if (row && selectedRows) {
|
|
8219
|
+
return selectedRows.indexOf(row) >= 0;
|
|
8220
|
+
}
|
|
8221
|
+
return false;
|
|
8222
|
+
});
|
|
8205
8223
|
}
|
|
8206
8224
|
selectRow(value) {
|
|
8207
8225
|
if (value) {
|
|
8208
|
-
this._svc.selectRow(this.row);
|
|
8226
|
+
this._svc.selectRow(this.row());
|
|
8209
8227
|
}
|
|
8210
8228
|
else {
|
|
8211
|
-
this._svc.deselectRow(this.row);
|
|
8229
|
+
this._svc.deselectRow(this.row());
|
|
8212
8230
|
}
|
|
8213
8231
|
}
|
|
8214
|
-
ngOnInit() {
|
|
8215
|
-
this._svc.selectedRows.pipe(takeWhile((_) => this._alive)).subscribe((_) => {
|
|
8216
|
-
this.selectedRows = _;
|
|
8217
|
-
this._cdr.markForCheck();
|
|
8218
|
-
});
|
|
8219
|
-
}
|
|
8220
|
-
ngOnDestroy() {
|
|
8221
|
-
this._alive = false;
|
|
8222
|
-
}
|
|
8223
8232
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SelectionCellComponent, deps: [{ token: TableService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8224
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
8233
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: SelectionCellComponent, isStandalone: true, selector: "teta-selection-cell", inputs: { row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.cell": "this.tableCellClass" } }, ngImport: i0, template: "<teta-checkbox\n [binary]=\"true\"\n [noLabel]=\"true\"\n [ngModel]=\"isSelected()\"\n (ngModelChange)=\"selectRow($event)\"\n (click)=\"$event.stopPropagation()\"\n></teta-checkbox>\n", styles: [":host{display:flex;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "component", type: CheckboxComponent, selector: "teta-checkbox", inputs: ["class", "palette", "noLabel", "disabled", "value", "binary", "labelPosition", "allowNull"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8225
8234
|
}
|
|
8226
8235
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SelectionCellComponent, decorators: [{
|
|
8227
8236
|
type: Component,
|
|
8228
|
-
args: [{ selector: 'teta-selection-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CheckboxComponent, FormsModule], template: "<teta-checkbox\n [binary]=\"true\"\n [noLabel]=\"true\"\n [ngModel]=\"
|
|
8229
|
-
}], ctorParameters: () => [{ type: TableService }, { type: i0.ChangeDetectorRef }], propDecorators: {
|
|
8230
|
-
type: Input
|
|
8231
|
-
}], tableCellClass: [{
|
|
8237
|
+
args: [{ selector: 'teta-selection-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CheckboxComponent, FormsModule], template: "<teta-checkbox\n [binary]=\"true\"\n [noLabel]=\"true\"\n [ngModel]=\"isSelected()\"\n (ngModelChange)=\"selectRow($event)\"\n (click)=\"$event.stopPropagation()\"\n></teta-checkbox>\n", styles: [":host{display:flex;align-items:center;justify-content:center}\n"] }]
|
|
8238
|
+
}], ctorParameters: () => [{ type: TableService }, { type: i0.ChangeDetectorRef }], propDecorators: { tableCellClass: [{
|
|
8232
8239
|
type: HostBinding,
|
|
8233
8240
|
args: ['class.cell']
|
|
8234
8241
|
}] } });
|