diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index 836add1bfe2..e55c493c5f6 100755 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -4295,7 +4295,134 @@ export class ReorderableRow implements AfterViewInit { 'class': 'p-element' } }) +export class ColumnFilterFormElement implements OnInit { + + @Input() field: string; + + @Input() type: string; + + @Input() filterConstraint: FilterMetadata; + + @Input() filterTemplate: TemplateRef; + + @Input() placeholder: string; + + @Input() minFractionDigits: number + + @Input() maxFractionDigits: number; + + @Input() prefix: string; + + @Input() suffix: string; + + @Input() locale: string; + + @Input() localeMatcher: string; + + @Input() currency: string; + + @Input() currencyDisplay: string; + + @Input() useGrouping: boolean = true; + + get showButtons(): boolean { + return this.colFilter.showButtons; + } + + filterCallback: Function; + + constructor(public dt: Table, private colFilter: ColumnFilter) {} + + ngOnInit() { + this.filterCallback = value => { + this.filterConstraint.value = value; + this.dt._filter(); + }; + } + + onModelChange(value: any) { + this.filterConstraint.value = value; + + if (this.type === 'boolean' || value === '') { + this.dt._filter(); + } + } + + onTextInputEnterKeyDown(event: KeyboardEvent) { + this.dt._filter(); + event.preventDefault(); + } + + onNumericInputKeyDown(event: KeyboardEvent) { + if (event.key === 'Enter') { + this.dt._filter(); + event.preventDefault(); + } + } +} +@Component({ + selector: 'p-columnFilter', + template: ` +
+ + + +
+ +
    +
  • {{matchMode.label}}
  • +
  • +
  • {{noFilterLabel}}
  • +
+ +
+ +
+
+
+ + +
+ +
+
+
+
+ +
+
+ + +
+
+ +
+
+ `, + animations: [ + trigger('overlayAnimation', [ + transition(':enter', [ + style({opacity: 0, transform: 'scaleY(0.8)'}), + animate('.12s cubic-bezier(0, 0, 0.2, 1)') + ]), + transition(':leave', [ + animate('.1s linear', style({ opacity: 0 })) + ]) + ]) + ], + encapsulation: ViewEncapsulation.None, + host: { + 'class': 'p-element' + } +}) export class ColumnFilter implements AfterContentInit { @Input() field: string; @@ -4789,135 +4916,6 @@ export class ColumnFilter implements AfterContentInit { } } -export class ColumnFilterFormElement implements OnInit { - - @Input() field: string; - - @Input() type: string; - - @Input() filterConstraint: FilterMetadata; - - @Input() filterTemplate: TemplateRef; - - @Input() placeholder: string; - - @Input() minFractionDigits: number - - @Input() maxFractionDigits: number; - - @Input() prefix: string; - - @Input() suffix: string; - - @Input() locale: string; - - @Input() localeMatcher: string; - - @Input() currency: string; - - @Input() currencyDisplay: string; - - @Input() useGrouping: boolean = true; - - get showButtons(): boolean { - return this.colFilter.showButtons; - } - - filterCallback: Function; - - constructor(public dt: Table, private colFilter: ColumnFilter) {} - - ngOnInit() { - this.filterCallback = value => { - this.filterConstraint.value = value; - this.dt._filter(); - }; - } - - onModelChange(value: any) { - this.filterConstraint.value = value; - - if (this.type === 'boolean' || value === '') { - this.dt._filter(); - } - } - - onTextInputEnterKeyDown(event: KeyboardEvent) { - this.dt._filter(); - event.preventDefault(); - } - - onNumericInputKeyDown(event: KeyboardEvent) { - if (event.key === 'Enter') { - this.dt._filter(); - event.preventDefault(); - } - } -} - -@Component({ - selector: 'p-columnFilter', - template: ` -
- - - -
- -
    -
  • {{matchMode.label}}
  • -
  • -
  • {{noFilterLabel}}
  • -
- -
- -
-
-
- - -
- -
-
-
-
- -
-
- - -
-
- -
-
- `, - animations: [ - trigger('overlayAnimation', [ - transition(':enter', [ - style({opacity: 0, transform: 'scaleY(0.8)'}), - animate('.12s cubic-bezier(0, 0, 0.2, 1)') - ]), - transition(':leave', [ - animate('.1s linear', style({ opacity: 0 })) - ]) - ]) - ], - encapsulation: ViewEncapsulation.None, - host: { - 'class': 'p-element' - } -}) - @NgModule({ imports: [CommonModule,PaginatorModule,InputTextModule,DropdownModule,FormsModule,ButtonModule,SelectButtonModule,CalendarModule,InputNumberModule,TriStateCheckboxModule,ScrollerModule], exports: [Table,SharedModule,SortableColumn,FrozenColumn,RowGroupHeader,SelectableRow,RowToggler,ContextMenuRow,ResizableColumn,ReorderableColumn,EditableColumn,CellEditor,SortIcon,