@solidev/data 0.5.0 → 0.5.1
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.
|
@@ -2515,13 +2515,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
2515
2515
|
class ModelListDatetimeRangeFilterComponent {
|
|
2516
2516
|
constructor() {
|
|
2517
2517
|
this.classes = '';
|
|
2518
|
+
this.fc1 = new FormControl();
|
|
2519
|
+
this.fc2 = new FormControl();
|
|
2520
|
+
}
|
|
2521
|
+
ngOnInit() {
|
|
2522
|
+
this.filter.valueChanges.subscribe((val) => {
|
|
2523
|
+
// If value is not an array, return
|
|
2524
|
+
if (val && !Array.isArray(val)) {
|
|
2525
|
+
const [v1, v2] = val.value.split('--');
|
|
2526
|
+
this.fc1.setValue(v1, { emitEvent: false });
|
|
2527
|
+
this.fc2.setValue(v2, { emitEvent: false });
|
|
2528
|
+
}
|
|
2529
|
+
});
|
|
2530
|
+
combineLatest([this.fc1.valueChanges, this.fc2.valueChanges]).subscribe(([val1, val2]) => {
|
|
2531
|
+
if (val1 && val2) {
|
|
2532
|
+
if (this.filter.set(`${val1}--${val2}`, `${val1}--${val2}`)) {
|
|
2533
|
+
this.list.filters.update();
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
});
|
|
2537
|
+
}
|
|
2538
|
+
disable() {
|
|
2539
|
+
this.filter.enabled = false;
|
|
2540
|
+
this.list.filters.update();
|
|
2518
2541
|
}
|
|
2519
2542
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ModelListDatetimeRangeFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2520
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: ModelListDatetimeRangeFilterComponent, isStandalone: true, selector: "data-model-list-datetime-range-filter", inputs: { list: "list", filter: "filter", classes: "classes" }, ngImport: i0, template: "<
|
|
2543
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: ModelListDatetimeRangeFilterComponent, isStandalone: true, selector: "data-model-list-datetime-range-filter", inputs: { list: "list", filter: "filter", classes: "classes" }, ngImport: i0, template: "\n<div class=\"filteritem\" [ngClass]=\"filter.displayClasses || classes\">\n <div class=\"trash float-end\" (click)=\"disable()\"><i class=\"bi bi-trash\"></i></div>\n <label>{{filter.label}}</label>\n <input class=\"form-control form-control-sm mb-1\" type=\"datetime-local\" [formControl]=\"fc1\" [placeholder]=\"filter.help\">\n <input class=\"form-control form-control-sm\" type=\"datetime-local\" [formControl]=\"fc2\" [placeholder]=\"filter.help\">\n</div>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
|
|
2521
2544
|
}
|
|
2522
2545
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ModelListDatetimeRangeFilterComponent, decorators: [{
|
|
2523
2546
|
type: Component,
|
|
2524
|
-
args: [{ selector: 'data-model-list-datetime-range-filter', imports: [CommonModule], template: "<
|
|
2547
|
+
args: [{ selector: 'data-model-list-datetime-range-filter', imports: [CommonModule, ReactiveFormsModule], template: "\n<div class=\"filteritem\" [ngClass]=\"filter.displayClasses || classes\">\n <div class=\"trash float-end\" (click)=\"disable()\"><i class=\"bi bi-trash\"></i></div>\n <label>{{filter.label}}</label>\n <input class=\"form-control form-control-sm mb-1\" type=\"datetime-local\" [formControl]=\"fc1\" [placeholder]=\"filter.help\">\n <input class=\"form-control form-control-sm\" type=\"datetime-local\" [formControl]=\"fc2\" [placeholder]=\"filter.help\">\n</div>" }]
|
|
2525
2548
|
}], ctorParameters: () => [], propDecorators: { list: [{
|
|
2526
2549
|
type: Input
|
|
2527
2550
|
}], filter: [{
|