clean code
This commit is contained in:
+3
-1
@@ -3,7 +3,9 @@ import {EventEmitter, Injectable, TemplateRef} from '@angular/core';
|
||||
import {IDataSource} from '@poweredsoft/data';
|
||||
import {BsModalService} from 'ngx-bootstrap/modal';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CommandModalService {
|
||||
constructor(private modalService: BsModalService) {
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {CommandDirective} from './directives/command.directive';
|
||||
import {ConfirmModalModule} from '../confirm-modal/confirm-modal.module';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [CommandDirective],
|
||||
imports: [
|
||||
CommonModule,
|
||||
ConfirmModalModule
|
||||
],
|
||||
exports:[CommandDirective]
|
||||
})
|
||||
export class CommandModule { }
|
||||
+2
-3
@@ -4,7 +4,8 @@ import {finalize} from 'rxjs/operators';
|
||||
import {ConfirmModalService} from '../../confirm-modal/confirm-modal.service';
|
||||
|
||||
@Directive({
|
||||
selector: '[bsxCommand]'
|
||||
selector: '[bsxCommand]',
|
||||
standalone: true
|
||||
})
|
||||
export class CommandDirective {
|
||||
constructor(private confirmModalService: ConfirmModalService) { }
|
||||
@@ -57,7 +58,6 @@ export class CommandDirective {
|
||||
|
||||
@HostListener('click')
|
||||
wasClicked() {
|
||||
|
||||
if (this.confirm) {
|
||||
this.confirmModalService.confirm({
|
||||
message: this.confirmMessage,
|
||||
@@ -73,5 +73,4 @@ export class CommandDirective {
|
||||
this.doCommand();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+7
-2
@@ -1,12 +1,17 @@
|
||||
import {Component, Inject, OnInit} from '@angular/core';
|
||||
import {Component, Inject} from '@angular/core';
|
||||
import {BsModalRef} from 'ngx-bootstrap/modal';
|
||||
import {Observer} from 'rxjs';
|
||||
import {CommonModule} from "@angular/common";
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'bsx-confirm-modal',
|
||||
templateUrl: './confirm-modal.component.html',
|
||||
styleUrls: ['./confirm-modal.component.scss']
|
||||
styleUrls: ['./confirm-modal.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule
|
||||
]
|
||||
})
|
||||
export class ConfirmModalComponent {
|
||||
@Inject(BsModalRef) modelRef!: BsModalRef;
|
||||
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {ConfirmModalComponent} from './confirm-modal-components/confirm-modal/confirm-modal.component';
|
||||
import {ModalModule} from 'ngx-bootstrap/modal';
|
||||
import {ConfirmModalService} from './confirm-modal.service';
|
||||
|
||||
@NgModule({
|
||||
declarations: [ConfirmModalComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
ModalModule.forRoot(),
|
||||
],
|
||||
exports: [],
|
||||
providers: [ConfirmModalService]
|
||||
})
|
||||
export class ConfirmModalModule { }
|
||||
+3
-1
@@ -12,7 +12,9 @@ export interface IConfirmModalOptions
|
||||
noText?: string;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ConfirmModalService {
|
||||
constructor(private modalService: BsModalService) { }
|
||||
|
||||
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {DataSourceTextFilterComponent} from './text-filter/data-source-text-filter.component';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {DataSourceNumberFilterComponent} from './number-filter/data-source-number-filter.component';
|
||||
import {DataSourceDatetimeFilterComponent} from './datetime-filter/data-source-datetime-filter.component';
|
||||
import {BsDatepickerModule} from 'ngx-bootstrap/datepicker';
|
||||
import {PopoverModule} from 'ngx-bootstrap/popover';
|
||||
import {BsDropdownModule} from 'ngx-bootstrap/dropdown';
|
||||
import {TooltipModule} from 'ngx-bootstrap/tooltip';
|
||||
|
||||
@NgModule({
|
||||
declarations: [DataSourceTextFilterComponent, DataSourceNumberFilterComponent,DataSourceDatetimeFilterComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
BsDatepickerModule.forRoot(),
|
||||
PopoverModule.forRoot(),
|
||||
BsDropdownModule.forRoot(),
|
||||
TooltipModule.forRoot()
|
||||
],
|
||||
exports: [DataSourceTextFilterComponent, DataSourceNumberFilterComponent,DataSourceDatetimeFilterComponent]
|
||||
})
|
||||
export class DataSourceFilterModule { }
|
||||
+2
-2
@@ -75,8 +75,8 @@
|
||||
</svg>
|
||||
</button> -->
|
||||
|
||||
<svg id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 477.875 477.875" style="enable-background:new 0 0 477.875 477.875;" xml:space="preserve" fill-opacity="0.5" [tooltip]="showTooltip()" [tooltipEnable]="!filterPopUpOpened" width="13px" height="13px" [ngStyle]="{'fill': isFiltering ? 'red': 'black', 'fill-opacity': isFiltering ? '1': '0.5'}" [popover]="popTemplate" [(isOpen)]="filterPopUpOpened" [outsideClick]="true" #pop="bs-popover">
|
||||
<svg id="Capa_1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
viewBox="0 0 477.875 477.875" fill-opacity="0.5" [tooltip]="showTooltip()" [isDisabled]="filterPopUpOpened" width="13px" height="13px" [ngStyle]="{'fill': isFiltering ? 'red': 'black', 'fill-opacity': isFiltering ? '1': '0.5'}" [popover]="popTemplate" [isOpen]="filterPopUpOpened" [outsideClick]="true" #pop="bs-popover">
|
||||
<g>
|
||||
<g>
|
||||
<path d="M460.804,0H17.071C7.645,0,0.004,7.641,0.004,17.067V102.4c-0.004,4.842,2.05,9.458,5.649,12.698l165.018,148.514V460.8
|
||||
|
||||
+14
-1
@@ -1,11 +1,24 @@
|
||||
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
||||
import {FilterType, ICompositeFilter, IDataSource, ISimpleFilter} from '@poweredsoft/data';
|
||||
import {FormsModule} from "@angular/forms";
|
||||
import {BsDatepickerModule} from "ngx-bootstrap/datepicker";
|
||||
import {TooltipModule} from "ngx-bootstrap/tooltip";
|
||||
import {PopoverModule} from "ngx-bootstrap/popover";
|
||||
import {CommonModule} from "@angular/common";
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'bsx-ds-datetime-filter',
|
||||
templateUrl: './data-source-datetime-filter.component.html',
|
||||
styleUrls: ['./data-source-datetime-filter.component.scss']
|
||||
styleUrls: ['./data-source-datetime-filter.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
BsDatepickerModule,
|
||||
TooltipModule,
|
||||
PopoverModule
|
||||
]
|
||||
})
|
||||
export class DataSourceDatetimeFilterComponent implements OnInit {
|
||||
@Input() path: string;
|
||||
|
||||
+2
-2
@@ -20,8 +20,8 @@
|
||||
</form>
|
||||
</ng-template>
|
||||
|
||||
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 477.875 477.875" style="enable-background:new 0 0 477.875 477.875;" xml:space="preserve" fill-opacity="0.5" [tooltip]="showTooltip()" [tooltipEnable]="!filterIsOpened" width="13px" height="13px" [ngStyle]="{'fill': isFiltering ? 'red': 'black', 'fill-opacity': isFiltering ? '1': '0.5'}" [popover]="popTemplate" [(isOpen)]="filterIsOpened" [outsideClick]="true" #pop="bs-popover">
|
||||
<svg id="Capa_1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
viewBox="0 0 477.875 477.875" fill-opacity="0.5" [tooltip]="showTooltip()" [isDisabled]="filterIsOpened" width="13px" height="13px" [ngStyle]="{'fill': isFiltering ? 'red': 'black', 'fill-opacity': isFiltering ? '1': '0.5'}" [popover]="popTemplate" [isOpen]="filterIsOpened" [outsideClick]="true" #pop="bs-popover">
|
||||
<g>
|
||||
<g>
|
||||
<path d="M460.804,0H17.071C7.645,0,0.004,7.641,0.004,17.067V102.4c-0.004,4.842,2.05,9.458,5.649,12.698l165.018,148.514V460.8
|
||||
|
||||
+12
-1
@@ -1,11 +1,22 @@
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {IDataSource, ISimpleFilter} from '@poweredsoft/data';
|
||||
import {FormsModule} from "@angular/forms";
|
||||
import {CommonModule} from "@angular/common";
|
||||
import {TooltipModule} from "ngx-bootstrap/tooltip";
|
||||
import {PopoverModule} from "ngx-bootstrap/popover";
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'bsx-ds-number-filter',
|
||||
templateUrl: './data-source-number-filter.component.html',
|
||||
styleUrls: ['./data-source-number-filter.component.scss']
|
||||
styleUrls: ['./data-source-number-filter.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
TooltipModule,
|
||||
PopoverModule
|
||||
]
|
||||
})
|
||||
export class DataSourceNumberFilterComponent {
|
||||
@Input() dataSource : IDataSource<any>;
|
||||
|
||||
+2
-2
@@ -64,8 +64,8 @@
|
||||
</svg>
|
||||
</button> -->
|
||||
|
||||
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 477.875 477.875" style="enable-background:new 0 0 477.875 477.875;" xml:space="preserve" fill-opacity="0.5" [tooltip]="showTooltip()" [tooltipEnable]="!filterIsOpened" width="13px" height="13px" [ngStyle]="{'fill': isFiltering ? 'red': 'black', 'fill-opacity': isFiltering ? '1': '0.5'}" [popover]="popTemplate" [(isOpen)]="filterIsOpened" [outsideClick]="true" #pop="bs-popover">
|
||||
<svg id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 477.875 477.875" fill-opacity="0.5" [tooltip]="showTooltip()" [isDisabled]="filterIsOpened" width="13px" height="13px" [ngStyle]="{'fill': isFiltering ? 'red': 'black', 'fill-opacity': isFiltering ? '1': '0.5'}" [popover]="popTemplate" [isOpen]="filterIsOpened" [outsideClick]="true" #pop="bs-popover">
|
||||
<g>
|
||||
<g>
|
||||
<path d="M460.804,0H17.071C7.645,0,0.004,7.641,0.004,17.067V102.4c-0.004,4.842,2.05,9.458,5.649,12.698l165.018,148.514V460.8
|
||||
|
||||
+12
-2
@@ -1,11 +1,21 @@
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {IDataSource, ISimpleFilter} from '@poweredsoft/data';
|
||||
import {PopoverDirective} from 'ngx-bootstrap/popover';
|
||||
import {PopoverDirective, PopoverModule} from 'ngx-bootstrap/popover';
|
||||
import {FormsModule} from "@angular/forms";
|
||||
import {TooltipModule} from "ngx-bootstrap/tooltip";
|
||||
import {CommonModule} from "@angular/common";
|
||||
|
||||
@Component({
|
||||
selector: 'bsx-ds-text-filter',
|
||||
templateUrl: './data-source-text-filter.component.html',
|
||||
styleUrls: ['./data-source-text-filter.component.scss']
|
||||
styleUrls: ['./data-source-text-filter.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
TooltipModule,
|
||||
PopoverModule,
|
||||
]
|
||||
})
|
||||
export class DataSourceTextFilterComponent {
|
||||
@Input() dataSource : IDataSource<any>;
|
||||
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {DataSourceSortingComponent} from './ds-sorting/data-source-sorting.component';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [DataSourceSortingComponent],
|
||||
imports: [
|
||||
CommonModule
|
||||
],
|
||||
exports:[DataSourceSortingComponent]
|
||||
})
|
||||
export class DataSourceSortingModule { }
|
||||
+4
-1
@@ -1,10 +1,13 @@
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {IDataSource} from '@poweredsoft/data';
|
||||
import {CommonModule} from "@angular/common";
|
||||
|
||||
@Component({
|
||||
selector: 'bsx-ds-sorting',
|
||||
templateUrl: './data-source-sorting.component.html',
|
||||
styleUrls: ['./data-source-sorting.component.scss']
|
||||
styleUrls: ['./data-source-sorting.component.scss'],
|
||||
standalone: true,
|
||||
imports: [CommonModule]
|
||||
})
|
||||
export class DataSourceSortingComponent {
|
||||
@Input() dataSource : IDataSource<any>;
|
||||
|
||||
+2
-1
@@ -14,7 +14,8 @@ export interface IModelFormCreateEvent
|
||||
}
|
||||
|
||||
@Directive({
|
||||
selector: '[bsxFormGroupCommandModal]'
|
||||
selector: '[bsxFormGroupCommandModal]',
|
||||
standalone: true
|
||||
})
|
||||
export class FormGroupCommandModalDirective {
|
||||
@Inject(BsModalService) private modalService!: BsModalService;
|
||||
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {FormGroupCommandModalComponent} from './form-group-command-modal/form-group-command-modal.component';
|
||||
import {FormGroupCommandModalDirective} from './directives/form-group-command-modal.directive';
|
||||
import {ModalModule} from 'ngx-bootstrap/modal';
|
||||
import {ReactiveFormsModule} from '@angular/forms';
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
ModalModule.forRoot(),
|
||||
ReactiveFormsModule
|
||||
],
|
||||
declarations: [FormGroupCommandModalComponent, FormGroupCommandModalDirective],
|
||||
exports: [FormGroupCommandModalDirective]
|
||||
})
|
||||
export class FormGroupCommandModalModule { }
|
||||
+4
-1
@@ -4,11 +4,14 @@ import {IDataSource} from '@poweredsoft/data';
|
||||
import {finalize} from 'rxjs/operators';
|
||||
import {Subscription} from 'rxjs'
|
||||
import {UntypedFormGroup} from '@angular/forms';
|
||||
import {CommonModule} from "@angular/common";
|
||||
|
||||
@Component({
|
||||
selector: 'bsx-form-group-command-modal',
|
||||
templateUrl: './form-group-command-modal.component.html',
|
||||
styleUrls: ['./form-group-command-modal.component.scss']
|
||||
styleUrls: ['./form-group-command-modal.component.scss'],
|
||||
standalone: true,
|
||||
imports: [CommonModule]
|
||||
})
|
||||
export class FormGroupCommandModalComponent implements OnInit, OnDestroy {
|
||||
@Inject(BsModalRef) public modalRef!: BsModalRef;
|
||||
|
||||
+6
-1
@@ -1,11 +1,16 @@
|
||||
import {ChangeDetectorRef, Component, Inject, Input, OnDestroy, OnInit} from '@angular/core';
|
||||
import {IDataSource} from '@poweredsoft/data';
|
||||
import {Subscription} from 'rxjs';
|
||||
import {CommonModule} from "@angular/common";
|
||||
import {PaginationModule} from "ngx-bootstrap/pagination";
|
||||
import {FormsModule} from "@angular/forms";
|
||||
|
||||
@Component({
|
||||
selector: 'bsx-ds-pagination',
|
||||
templateUrl: './data-source-pagination.component.html',
|
||||
styleUrls: ['./data-source-pagination.component.scss']
|
||||
styleUrls: ['./data-source-pagination.component.scss'],
|
||||
standalone: true,
|
||||
imports: [CommonModule, PaginationModule, FormsModule]
|
||||
})
|
||||
export class DataSourcePaginationComponent implements OnInit, OnDestroy {
|
||||
@Inject(ChangeDetectorRef) private cdf!: ChangeDetectorRef;
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {DataSourcePaginationComponent} from './data-source-pagination/data-source-pagination.component';
|
||||
import {PaginationModule as ValorPaginationModule} from 'ngx-bootstrap/pagination';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [DataSourcePaginationComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
ValorPaginationModule.forRoot(),
|
||||
FormsModule
|
||||
],
|
||||
exports: [DataSourcePaginationComponent]
|
||||
})
|
||||
export class PaginationModule { }
|
||||
@@ -1,13 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {SpinnerComponent} from './spinner/spinner.component';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [SpinnerComponent],
|
||||
imports: [
|
||||
CommonModule
|
||||
],
|
||||
exports:[SpinnerComponent]
|
||||
})
|
||||
export class SpinnerModule { }
|
||||
+4
-1
@@ -1,9 +1,12 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {CommonModule} from "@angular/common";
|
||||
|
||||
@Component({
|
||||
selector: 'bsx-spinner',
|
||||
templateUrl: './spinner.component.html',
|
||||
styleUrls: ['./spinner.component.scss']
|
||||
styleUrls: ['./spinner.component.scss'],
|
||||
standalone: true,
|
||||
imports: [CommonModule]
|
||||
})
|
||||
export class SpinnerComponent {
|
||||
|
||||
|
||||
@@ -2,22 +2,14 @@
|
||||
* Public API Surface of ngx-bootstrap
|
||||
*/
|
||||
|
||||
export * from './lib/command-modal/command-modal.module';
|
||||
export * from './lib/command-modal/command-modal.service';
|
||||
export * from './lib/command-modal/directives/command-modal.directive';
|
||||
export * from './lib/form-group-command-modal/form-group-command-modal.module';
|
||||
export * from './lib/form-group-command-modal/directives/form-group-command-modal.directive';
|
||||
export * from './lib/pagination/data-source-pagination/data-source-pagination.component';
|
||||
export * from './lib/confirm-modal/confirm-modal.module';
|
||||
export * from './lib/confirm-modal/confirm-modal.service';
|
||||
export * from './lib/spinner/spinner.module';
|
||||
export * from './lib/spinner/spinner/spinner.component';
|
||||
export * from './lib/data-source-filter/data-source-filter.module';
|
||||
export * from './lib/data-source-filter/text-filter/data-source-text-filter.component';
|
||||
export * from './lib/data-source-filter/number-filter/data-source-number-filter.component';
|
||||
export * from './lib/data-source-filter/datetime-filter/data-source-datetime-filter.component';
|
||||
export * from './lib/data-source-sorting/data-source-sorting.module';
|
||||
export * from './lib/data-source-sorting/ds-sorting/data-source-sorting.component';
|
||||
export * from './lib/command/command.module';
|
||||
export * from './lib/command/directives/command.directive';
|
||||
export * from './lib/pagination/pagination.module';
|
||||
|
||||
-2
@@ -19,7 +19,6 @@
|
||||
</div>
|
||||
|
||||
<div class="flex-item">
|
||||
|
||||
<ng-container *ngIf="hasSortingTemplate(column)">
|
||||
<ng-container [ngTemplateOutlet]="getSortingTemplate(column)"></ng-container>
|
||||
</ng-container>
|
||||
@@ -28,7 +27,6 @@
|
||||
<ng-container [ngTemplateOutlet]="getFilterTemplate(column)"></ng-container>
|
||||
</ng-container>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import {Component, EventEmitter, Input, OnDestroy, OnInit, Output} from '@angular/core';
|
||||
import {IDataSource, IQueryExecutionGroupResult, IQueryExecutionResult} from '@poweredsoft/data';
|
||||
import {Subscription} from 'rxjs';
|
||||
import {CommonModule} from "@angular/common";
|
||||
|
||||
@Component({
|
||||
selector: 'cdk-ds-pager',
|
||||
templateUrl: './ds-pager.component.html',
|
||||
styleUrls: ['./ds-pager.component.scss']
|
||||
styleUrls: ['./ds-pager.component.scss'],
|
||||
standalone: true,
|
||||
imports: [CommonModule]
|
||||
})
|
||||
export class DsPagerComponent implements OnInit, OnDestroy {
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {DsPagerComponent} from './ds-pager.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [DsPagerComponent],
|
||||
imports: [
|
||||
CommonModule
|
||||
],
|
||||
exports: [DsPagerComponent]
|
||||
})
|
||||
export class DsPagerModule { }
|
||||
@@ -1,6 +1,6 @@
|
||||
<form (submit)="applySearch()">
|
||||
<div [ngClass]="classes">
|
||||
<input type="search" (onSearch)="onSearch()" [placeholder]="finalSearchText" [ngClass]="searchClasses"
|
||||
<input type="search" (input)="onSearch()" [placeholder]="finalSearchText" [ngClass]="searchClasses"
|
||||
[(ngModel)]="filterValue" [ngModelOptions]="{standalone: true}">
|
||||
<button type="submit" [ngClass]="submitButtonClasses">{{ finalSearchText }}</button>
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import {Component, Input, OnInit} from '@angular/core';
|
||||
import {FilterType, ICompositeFilter, IDataSource, ISimpleFilter} from '@poweredsoft/data';
|
||||
import {CommonModule} from "@angular/common";
|
||||
import {FormsModule} from "@angular/forms";
|
||||
|
||||
@Component({
|
||||
selector: 'cdk-ds-search',
|
||||
templateUrl: './ds-search.component.html',
|
||||
styleUrls: ['./ds-search.component.scss']
|
||||
styleUrls: ['./ds-search.component.scss'],
|
||||
standalone: true,
|
||||
imports: [CommonModule, FormsModule]
|
||||
})
|
||||
export class DsSearchComponent implements OnInit {
|
||||
export class DsSearchComponent {
|
||||
@Input() dataSource: IDataSource<any>;
|
||||
@Input() filterType: string;
|
||||
@Input() filterPaths: string[];
|
||||
@@ -29,11 +33,10 @@ export class DsSearchComponent implements OnInit {
|
||||
}
|
||||
|
||||
onSearch() {
|
||||
this.applySearch();
|
||||
this.applySearch();
|
||||
}
|
||||
|
||||
applySearch() {
|
||||
|
||||
const existingFilters = this.dataSource.filters;
|
||||
|
||||
|
||||
@@ -68,8 +71,4 @@ export class DsSearchComponent implements OnInit {
|
||||
filters: finalNewFilters
|
||||
})
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { DsSearchComponent } from './ds-search.component';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [DsSearchComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule
|
||||
],
|
||||
exports: [DsSearchComponent]
|
||||
})
|
||||
export class DsSearchModule { }
|
||||
+4
-1
@@ -1,11 +1,14 @@
|
||||
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
|
||||
import {IDataSource} from '@poweredsoft/data';
|
||||
import {Subscription} from 'rxjs';
|
||||
import {CommonModule} from "@angular/common";
|
||||
|
||||
@Component({
|
||||
selector: 'cdk-ds-validation-error',
|
||||
templateUrl: './ds-validation-error.component.html',
|
||||
styleUrls: ['./ds-validation-error.component.scss']
|
||||
styleUrls: ['./ds-validation-error.component.scss'],
|
||||
standalone: true,
|
||||
imports: [CommonModule]
|
||||
})
|
||||
export class DsValidationErrorComponent implements OnInit, OnDestroy {
|
||||
@Input() dataSource: IDataSource<any>;
|
||||
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {DsValidationErrorComponent} from './ds-validation-error.component';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [DsValidationErrorComponent],
|
||||
imports: [
|
||||
CommonModule
|
||||
],
|
||||
exports: [DsValidationErrorComponent]
|
||||
})
|
||||
export class DsValidationErrorModule { }
|
||||
@@ -23,11 +23,9 @@ export * from './lib/list-view/directives/list-view-footer.directive';
|
||||
export * from './lib/list-view/directives/list-view-separator.directive';
|
||||
|
||||
// search
|
||||
export * from './lib/ds-search/ds-search.module';
|
||||
export * from './lib/ds-search/ds-search.component';
|
||||
|
||||
// ds validation
|
||||
export * from './lib/ds-validation-error/ds-validation-error.module';
|
||||
export * from './lib/ds-validation-error/ds-validation-error.component';
|
||||
|
||||
// view
|
||||
@@ -48,5 +46,4 @@ export * from './lib/ds-command/directives/ds-command-no-command.directive';
|
||||
export * from './lib/ds-command/directives/ds-command-error.directive';
|
||||
|
||||
// ds-pager
|
||||
export * from './lib/ds-pager/ds-pager.module';
|
||||
export * from './lib/ds-pager/ds-pager.component';
|
||||
|
||||
Reference in New Issue
Block a user