From f9cceadaa691ebed433dcdf9fc3a0976a49afb22 Mon Sep 17 00:00:00 2001 From: David Lebee Date: Thu, 11 Mar 2021 15:45:28 -0500 Subject: [PATCH] 0.0.3 of ng select supports footer. --- projects/poweredsoft/ng-select/package.json | 2 +- .../directives/select-footer-template.directive.ts | 10 ++++++++++ .../directives/select-label-template.directive.ts | 2 ++ .../multi-select/multi-select.component.html | 4 ++++ .../multi-select/multi-select.component.ts | 2 ++ .../ps-ng-select/ng-select/ng-select.component.html | 4 ++++ .../lib/ps-ng-select/ng-select/ng-select.component.ts | 3 +++ .../src/lib/ps-ng-select/ps-ng-select.module.ts | 4 +++- projects/poweredsoft/ng-select/src/public-api.ts | 1 + 9 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 projects/poweredsoft/ng-select/src/lib/ps-ng-select/directives/select-footer-template.directive.ts diff --git a/projects/poweredsoft/ng-select/package.json b/projects/poweredsoft/ng-select/package.json index c7829ab..67a6dca 100644 --- a/projects/poweredsoft/ng-select/package.json +++ b/projects/poweredsoft/ng-select/package.json @@ -1,6 +1,6 @@ { "name": "@poweredsoft/ng-select", - "version": "0.0.2", + "version": "0.0.3", "peerDependencies": { "@angular/common": "^9.1.9", "@angular/core": "^9.1.9" diff --git a/projects/poweredsoft/ng-select/src/lib/ps-ng-select/directives/select-footer-template.directive.ts b/projects/poweredsoft/ng-select/src/lib/ps-ng-select/directives/select-footer-template.directive.ts new file mode 100644 index 0000000..a695991 --- /dev/null +++ b/projects/poweredsoft/ng-select/src/lib/ps-ng-select/directives/select-footer-template.directive.ts @@ -0,0 +1,10 @@ +import { Directive, TemplateRef } from '@angular/core'; + + +@Directive({ + selector: '[psNgSelectFooter]' +}) +export class SelectFooterTemplateDirective { + constructor(public template: TemplateRef) { } + +} diff --git a/projects/poweredsoft/ng-select/src/lib/ps-ng-select/directives/select-label-template.directive.ts b/projects/poweredsoft/ng-select/src/lib/ps-ng-select/directives/select-label-template.directive.ts index 7c667a0..0279163 100644 --- a/projects/poweredsoft/ng-select/src/lib/ps-ng-select/directives/select-label-template.directive.ts +++ b/projects/poweredsoft/ng-select/src/lib/ps-ng-select/directives/select-label-template.directive.ts @@ -7,3 +7,5 @@ export class SelectLabelTemplateDirective { constructor(public template: TemplateRef) { } } + + diff --git a/projects/poweredsoft/ng-select/src/lib/ps-ng-select/multi-select/multi-select.component.html b/projects/poweredsoft/ng-select/src/lib/ps-ng-select/multi-select/multi-select.component.html index c2f118d..1adcf2f 100644 --- a/projects/poweredsoft/ng-select/src/lib/ps-ng-select/multi-select/multi-select.component.html +++ b/projects/poweredsoft/ng-select/src/lib/ps-ng-select/multi-select/multi-select.component.html @@ -28,3 +28,7 @@ + + + + diff --git a/projects/poweredsoft/ng-select/src/lib/ps-ng-select/multi-select/multi-select.component.ts b/projects/poweredsoft/ng-select/src/lib/ps-ng-select/multi-select/multi-select.component.ts index f266b07..2416360 100644 --- a/projects/poweredsoft/ng-select/src/lib/ps-ng-select/multi-select/multi-select.component.ts +++ b/projects/poweredsoft/ng-select/src/lib/ps-ng-select/multi-select/multi-select.component.ts @@ -6,6 +6,7 @@ import { map, distinctUntilChanged, debounceTime } from 'rxjs/operators'; import { NgSelectComponent as SelectComponent } from '@ng-select/ng-select'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { SelectOptionTemplateDirective } from '../directives/select-option-template.directive'; +import { SelectFooterTemplateDirective } from '../directives/select-footer-template.directive'; @Component({ selector: 'ps-ng-multi-select', @@ -22,6 +23,7 @@ export class MultiSelectComponent implements OnInit,OnDestroy { @ContentChild(SelectOptionTemplateDirective) optionTemplate: SelectOptionTemplateDirective; @ContentChild(SelectLabelTemplateDirective) labelTemplate: SelectLabelTemplateDirective; + @ContentChild(SelectFooterTemplateDirective) footerTemplate: SelectFooterTemplateDirective; @ViewChild(SelectComponent, { static: true }) selectComponent: SelectComponent; @Input() dataSource: IDataSource; diff --git a/projects/poweredsoft/ng-select/src/lib/ps-ng-select/ng-select/ng-select.component.html b/projects/poweredsoft/ng-select/src/lib/ps-ng-select/ng-select/ng-select.component.html index 8930035..93a2dd5 100644 --- a/projects/poweredsoft/ng-select/src/lib/ps-ng-select/ng-select/ng-select.component.html +++ b/projects/poweredsoft/ng-select/src/lib/ps-ng-select/ng-select/ng-select.component.html @@ -35,3 +35,7 @@ + + + + \ No newline at end of file diff --git a/projects/poweredsoft/ng-select/src/lib/ps-ng-select/ng-select/ng-select.component.ts b/projects/poweredsoft/ng-select/src/lib/ps-ng-select/ng-select/ng-select.component.ts index fa396ae..fce79f3 100644 --- a/projects/poweredsoft/ng-select/src/lib/ps-ng-select/ng-select/ng-select.component.ts +++ b/projects/poweredsoft/ng-select/src/lib/ps-ng-select/ng-select/ng-select.component.ts @@ -7,6 +7,8 @@ import { NgSelectComponent as SelectComponent } from '@ng-select/ng-select'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { SelectOptionTemplateDirective } from '../directives/select-option-template.directive'; import { NotFoundTemplateDirective } from '../directives/not-found-template.directive'; +import { NgFooterTemplateDirective } from '@ng-select/ng-select/lib/ng-templates.directive'; +import { SelectFooterTemplateDirective } from '../directives/select-footer-template.directive'; @Component({ @@ -24,6 +26,7 @@ export class NgSelectComponent implements OnInit,OnDestroy { @ContentChild(SelectOptionTemplateDirective) optionTemplate: SelectOptionTemplateDirective; @ContentChild(SelectLabelTemplateDirective) labelTemplate: SelectLabelTemplateDirective; @ContentChild(NotFoundTemplateDirective) notFoundTemplate: NotFoundTemplateDirective; + @ContentChild(SelectFooterTemplateDirective) footerTemplate: SelectFooterTemplateDirective; diff --git a/projects/poweredsoft/ng-select/src/lib/ps-ng-select/ps-ng-select.module.ts b/projects/poweredsoft/ng-select/src/lib/ps-ng-select/ps-ng-select.module.ts index 3b89b59..176a5e8 100644 --- a/projects/poweredsoft/ng-select/src/lib/ps-ng-select/ps-ng-select.module.ts +++ b/projects/poweredsoft/ng-select/src/lib/ps-ng-select/ps-ng-select.module.ts @@ -7,11 +7,12 @@ import { NgSelectModule } from '@ng-select/ng-select'; import { SelectLabelTemplateDirective } from './directives/select-label-template.directive'; import { SelectOptionTemplateDirective } from './directives/select-option-template.directive'; import { NotFoundTemplateDirective } from './directives/not-found-template.directive'; +import { SelectFooterTemplateDirective } from './directives/select-footer-template.directive'; @NgModule({ - declarations: [NgSelectComponent, MultiSelectComponent, SelectLabelTemplateDirective, SelectOptionTemplateDirective, NotFoundTemplateDirective], + declarations: [NgSelectComponent, MultiSelectComponent, SelectLabelTemplateDirective, SelectOptionTemplateDirective, NotFoundTemplateDirective, SelectFooterTemplateDirective], imports: [ CommonModule, FormsModule, @@ -22,6 +23,7 @@ import { NotFoundTemplateDirective } from './directives/not-found-template.direc MultiSelectComponent, SelectLabelTemplateDirective, SelectOptionTemplateDirective, + SelectFooterTemplateDirective, NotFoundTemplateDirective ] }) diff --git a/projects/poweredsoft/ng-select/src/public-api.ts b/projects/poweredsoft/ng-select/src/public-api.ts index 7a883ee..989e4fe 100644 --- a/projects/poweredsoft/ng-select/src/public-api.ts +++ b/projects/poweredsoft/ng-select/src/public-api.ts @@ -7,4 +7,5 @@ export * from './lib/ps-ng-select/ng-select/ng-select.component'; export * from './lib/ps-ng-select/multi-select/multi-select.component'; export * from './lib/ps-ng-select/directives/select-label-template.directive'; export * from './lib/ps-ng-select/directives/select-option-template.directive'; +export * from './lib/ps-ng-select/directives/select-footer-template.directive'; export * from './lib/ps-ng-select/directives/not-found-template.directive';