From bc4bd55efcdd5e1f4e0e793e6f47abf5babe325e Mon Sep 17 00:00:00 2001 From: Yubing325 <35515298+Yubing325@users.noreply.github.com> Date: Tue, 7 Jul 2020 16:36:18 -0500 Subject: [PATCH] demo commit --- package.json | 2 +- .../ng-select/ng-select.component.html | 9 +++ .../ng-select/ng-select.component.ts | 13 ++++ .../not-found-template.directive.ts | 11 ++++ .../ps-ng-selectors/ps-ng-selectors.module.ts | 8 ++- .../poweredsoft/ng-select/src/public-api.ts | 3 +- .../datetime-filter.component.html | 0 .../datetime-filter.component.scss | 0 .../datetime-filter.component.ts | 0 .../grid-filter.module.ts | 2 +- .../number-filter.component.html | 64 +++++++++++++++++++ .../number-filter.component.scss | 0 .../number-filter/number-filter.component.ts | 3 +- .../text-filter/text-filter.component.html} | 34 +++++----- .../text-filter/text-filter.component.scss | 0 .../text-filter/text-filter.component.ts | 7 +- .../ds-sorting.module.ts} | 6 +- .../ds-sorting/ds-sorting.component.html} | 0 .../ds-sorting/ds-sorting.component.scss} | 0 .../ds-sorting/ds-sorting.component.ts} | 10 +-- .../text-filter/text-filter.component.html | 62 ------------------ .../ngx-bootstrap/src/public-api.ts | 12 ++-- .../data-grid/data-grid.component.html | 4 +- .../command-modal-demo.component.html | 8 ++- .../data-grid-demo-home.component.html | 12 +--- .../grid-filter-demo.component.html | 29 +++------ .../ng-select-demo.component.html | 17 ++++- 27 files changed, 181 insertions(+), 135 deletions(-) create mode 100644 projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/not-found-template.directive.ts rename projects/poweredsoft/ngx-bootstrap/src/lib/{grid-filter => dataSource-filter}/datetime-filter/datetime-filter.component.html (100%) rename projects/poweredsoft/ngx-bootstrap/src/lib/{grid-filter => dataSource-filter}/datetime-filter/datetime-filter.component.scss (100%) rename projects/poweredsoft/ngx-bootstrap/src/lib/{grid-filter => dataSource-filter}/datetime-filter/datetime-filter.component.ts (100%) rename projects/poweredsoft/ngx-bootstrap/src/lib/{grid-filter => dataSource-filter}/grid-filter.module.ts (95%) create mode 100644 projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/number-filter/number-filter.component.html rename projects/poweredsoft/ngx-bootstrap/src/lib/{grid-filter => dataSource-filter}/number-filter/number-filter.component.scss (100%) rename projects/poweredsoft/ngx-bootstrap/src/lib/{grid-filter => dataSource-filter}/number-filter/number-filter.component.ts (96%) rename projects/poweredsoft/ngx-bootstrap/src/lib/{grid-filter/number-filter/number-filter.component.html => dataSource-filter/text-filter/text-filter.component.html} (53%) rename projects/poweredsoft/ngx-bootstrap/src/lib/{grid-filter => dataSource-filter}/text-filter/text-filter.component.scss (100%) rename projects/poweredsoft/ngx-bootstrap/src/lib/{grid-filter => dataSource-filter}/text-filter/text-filter.component.ts (91%) rename projects/poweredsoft/ngx-bootstrap/src/lib/{grid-sorting/grid-sorting.module.ts => dataSource-sorting/ds-sorting.module.ts} (51%) rename projects/poweredsoft/ngx-bootstrap/src/lib/{grid-sorting/grid-sorting/grid-sorting.component.html => dataSource-sorting/ds-sorting/ds-sorting.component.html} (100%) rename projects/poweredsoft/ngx-bootstrap/src/lib/{grid-sorting/grid-sorting/grid-sorting.component.scss => dataSource-sorting/ds-sorting/ds-sorting.component.scss} (100%) rename projects/poweredsoft/ngx-bootstrap/src/lib/{grid-sorting/grid-sorting/grid-sorting.component.ts => dataSource-sorting/ds-sorting/ds-sorting.component.ts} (80%) delete mode 100644 projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/text-filter/text-filter.component.html diff --git a/package.json b/package.json index 5ba2c3d..f1107d3 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@angular/platform-browser-dynamic": "~9.1.4", "@angular/router": "~9.1.4", "@ng-select/ng-select": "^4.0.1", - "@poweredsoft/data": "0.0.26", + "@poweredsoft/data": "0.0.27", "@poweredsoft/ngx-data": "0.0.13", "@poweredsoft/ngx-data-apollo": "0.0.8", "apollo-angular": "^1.8.0", diff --git a/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/ng-select/ng-select.component.html b/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/ng-select/ng-select.component.html index c065dd5..f218c4f 100644 --- a/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/ng-select/ng-select.component.html +++ b/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/ng-select/ng-select.component.html @@ -23,5 +23,14 @@ index: index }"> + + + + + + diff --git a/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/ng-select/ng-select.component.ts b/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/ng-select/ng-select.component.ts index f0980bc..ae8ca06 100644 --- a/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/ng-select/ng-select.component.ts +++ b/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/ng-select/ng-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 '../select-option-template.directive'; +import { NotFoundTemplateDirective } from '../not-found-template.directive'; @Component({ @@ -22,6 +23,8 @@ export class NgSelectComponent implements OnInit { @ContentChild(SelectOptionTemplateDirective) optionTemplate: SelectOptionTemplateDirective; @ContentChild(SelectLabelTemplateDirective) labelTemplate: SelectLabelTemplateDirective; + @ContentChild(NotFoundTemplateDirective) notFoundTemplate: NotFoundTemplateDirective; + @ViewChild(SelectComponent, { static: true }) selectComponent: SelectComponent; @@ -154,4 +157,14 @@ export class NgSelectComponent implements OnInit { return this.labelTemplate.template; return null; } + + get hasNotFoundTemplate() { + return this.notFoundTemplate ? true : false; + } + + get selectNotFoundTemplate(){ + if(this.notFoundTemplate) + return this.notFoundTemplate.template; + return null; + } } diff --git a/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/not-found-template.directive.ts b/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/not-found-template.directive.ts new file mode 100644 index 0000000..dce5e7b --- /dev/null +++ b/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/not-found-template.directive.ts @@ -0,0 +1,11 @@ +import { Directive, TemplateRef } from '@angular/core'; + + +@Directive({ + selector: '[psNgNotFoundTemplate]' +}) +export class NotFoundTemplateDirective { + + constructor(public template: TemplateRef) { } + +} diff --git a/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/ps-ng-selectors.module.ts b/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/ps-ng-selectors.module.ts index 57a5fb2..1df2cd8 100644 --- a/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/ps-ng-selectors.module.ts +++ b/projects/poweredsoft/ng-select/src/lib/ps-ng-selectors/ps-ng-selectors.module.ts @@ -6,11 +6,12 @@ import { FormsModule } from '@angular/forms'; import { NgSelectModule } from '@ng-select/ng-select'; import { SelectLabelTemplateDirective } from './select-label-template.directive'; import { SelectOptionTemplateDirective } from './select-option-template.directive'; +import { NotFoundTemplateDirective } from './not-found-template.directive'; @NgModule({ - declarations: [NgSelectComponent, MultiSelectComponent, SelectLabelTemplateDirective, SelectOptionTemplateDirective], + declarations: [NgSelectComponent, MultiSelectComponent, SelectLabelTemplateDirective, SelectOptionTemplateDirective, NotFoundTemplateDirective], imports: [ CommonModule, FormsModule, @@ -20,7 +21,8 @@ import { SelectOptionTemplateDirective } from './select-option-template.directiv NgSelectComponent, MultiSelectComponent, SelectLabelTemplateDirective, - SelectOptionTemplateDirective + SelectOptionTemplateDirective, + NotFoundTemplateDirective ] }) -export class PsNgSelectorsModule { } +export class PsNgSelectorsModule { }//NGSELECT diff --git a/projects/poweredsoft/ng-select/src/public-api.ts b/projects/poweredsoft/ng-select/src/public-api.ts index 08def64..eaa0877 100644 --- a/projects/poweredsoft/ng-select/src/public-api.ts +++ b/projects/poweredsoft/ng-select/src/public-api.ts @@ -6,7 +6,8 @@ export * from './lib/ps-ng-selectors/ps-ng-selectors.module'; export * from './lib/ps-ng-selectors/ng-select/ng-select.component'; export * from './lib/ps-ng-selectors/multi-select/multi-select.component'; export * from './lib/ps-ng-selectors/select-label-template.directive'; -export * from './lib/ps-ng-selectors/select-option-template.directive' +export * from './lib/ps-ng-selectors/select-option-template.directive'; +export * from './lib/ps-ng-selectors/not-found-template.directive'; diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/datetime-filter/datetime-filter.component.html b/projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/datetime-filter/datetime-filter.component.html similarity index 100% rename from projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/datetime-filter/datetime-filter.component.html rename to projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/datetime-filter/datetime-filter.component.html diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/datetime-filter/datetime-filter.component.scss b/projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/datetime-filter/datetime-filter.component.scss similarity index 100% rename from projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/datetime-filter/datetime-filter.component.scss rename to projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/datetime-filter/datetime-filter.component.scss diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/datetime-filter/datetime-filter.component.ts b/projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/datetime-filter/datetime-filter.component.ts similarity index 100% rename from projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/datetime-filter/datetime-filter.component.ts rename to projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/datetime-filter/datetime-filter.component.ts diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/grid-filter.module.ts b/projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/grid-filter.module.ts similarity index 95% rename from projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/grid-filter.module.ts rename to projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/grid-filter.module.ts index 40e1923..a720d04 100644 --- a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/grid-filter.module.ts +++ b/projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/grid-filter.module.ts @@ -24,4 +24,4 @@ import { TooltipModule } from 'ngx-bootstrap/tooltip'; ], exports: [TextFilterComponent, NumberFilterComponent,DatetimeFilterComponent] }) -export class GridFilterModule { } +export class GridFilterModule { } //DS Filter diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/number-filter/number-filter.component.html b/projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/number-filter/number-filter.component.html new file mode 100644 index 0000000..d797b24 --- /dev/null +++ b/projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/number-filter/number-filter.component.html @@ -0,0 +1,64 @@ + +
+
+
+ +
+ +
+ +
+ + + + + +
+
+
+ + \ No newline at end of file diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/number-filter/number-filter.component.scss b/projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/number-filter/number-filter.component.scss similarity index 100% rename from projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/number-filter/number-filter.component.scss rename to projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/number-filter/number-filter.component.scss diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/number-filter/number-filter.component.ts b/projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/number-filter/number-filter.component.ts similarity index 96% rename from projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/number-filter/number-filter.component.ts rename to projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/number-filter/number-filter.component.ts index 048d11b..74048b8 100644 --- a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/number-filter/number-filter.component.ts +++ b/projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/number-filter/number-filter.component.ts @@ -3,7 +3,7 @@ import { IDataSource,IFilter } from '@poweredsoft/data'; import { ISimpleFilter } from '../../models/IFilter'; @Component({ - selector: 'psbx-number-filter', + selector: 'psbx-ds-number-filter', templateUrl: './number-filter.component.html', styleUrls: ['./number-filter.component.scss'] }) @@ -32,6 +32,7 @@ export class NumberFilterComponent implements OnInit { } clearFilter() { + this.filterValue = 0; this.isFiltering = false; const existingFilter = this.dataSource.filters.find(t => (t as ISimpleFilter).path == this.path) as ISimpleFilter; if (existingFilter) { diff --git a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/number-filter/number-filter.component.html b/projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/text-filter/text-filter.component.html similarity index 53% rename from projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/number-filter/number-filter.component.html rename to projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/text-filter/text-filter.component.html index 8e56f6e..28aa89f 100644 --- a/projects/poweredsoft/ngx-bootstrap/src/lib/grid-filter/number-filter/number-filter.component.html +++ b/projects/poweredsoft/ngx-bootstrap/src/lib/dataSource-filter/text-filter/text-filter.component.html @@ -1,21 +1,25 @@ -
-
- -
- -
- -
+ +
- - - +
+
+ +
-
+
+ +
+ + + + + +
+
- - - - - - - \ No newline at end of file diff --git a/projects/poweredsoft/ngx-bootstrap/src/public-api.ts b/projects/poweredsoft/ngx-bootstrap/src/public-api.ts index 3089598..ea42355 100644 --- a/projects/poweredsoft/ngx-bootstrap/src/public-api.ts +++ b/projects/poweredsoft/ngx-bootstrap/src/public-api.ts @@ -13,9 +13,9 @@ export * from './lib/confirm-modal/confirm-modal.service'; export * from './lib/confirm-modal/confirm-modal.directive'; export * from './lib/spinner/spinner.module'; export * from './lib/spinner/spinner/spinner.component'; -export * from './lib/grid-filter/grid-filter.module'; -export * from './lib/grid-filter/text-filter/text-filter.component'; -export * from './lib/grid-filter/number-filter/number-filter.component'; -export * from './lib/grid-filter/datetime-filter/datetime-filter.component'; -export * from './lib/grid-sorting/grid-sorting.module'; -export * from './lib/grid-sorting/grid-sorting/grid-sorting.component'; \ No newline at end of file +export * from './lib/dataSource-filter/grid-filter.module'; +export * from './lib/dataSource-filter/text-filter/text-filter.component'; +export * from './lib/dataSource-filter/number-filter/number-filter.component'; +export * from './lib/dataSource-filter/datetime-filter/datetime-filter.component'; +export * from './lib/dataSource-sorting/ds-sorting.module'; +export * from './lib/dataSource-sorting/ds-sorting/ds-sorting.component'; \ No newline at end of file diff --git a/projects/poweredsoft/ngx-cdk-ui/src/lib/data-grid/data-grid/data-grid.component.html b/projects/poweredsoft/ngx-cdk-ui/src/lib/data-grid/data-grid/data-grid.component.html index 84bf7f8..b50289b 100644 --- a/projects/poweredsoft/ngx-cdk-ui/src/lib/data-grid/data-grid/data-grid.component.html +++ b/projects/poweredsoft/ngx-cdk-ui/src/lib/data-grid/data-grid/data-grid.component.html @@ -2,8 +2,8 @@ - - + diff --git a/src/app/command-modal-demo/command-modal-demo/command-modal-demo.component.html b/src/app/command-modal-demo/command-modal-demo/command-modal-demo.component.html index b7b4d0f..4c62d07 100644 --- a/src/app/command-modal-demo/command-modal-demo/command-modal-demo.component.html +++ b/src/app/command-modal-demo/command-modal-demo/command-modal-demo.component.html @@ -4,8 +4,10 @@ - + @@ -51,6 +53,8 @@ Address + Date + \ No newline at end of file diff --git a/src/app/data-grid-demo/data-grid-demo-home/data-grid-demo-home.component.html b/src/app/data-grid-demo/data-grid-demo-home/data-grid-demo-home.component.html index 469e013..2babb94 100644 --- a/src/app/data-grid-demo/data-grid-demo-home/data-grid-demo-home.component.html +++ b/src/app/data-grid-demo/data-grid-demo-home/data-grid-demo-home.component.html @@ -2,15 +2,9 @@ This is a demo for a grid. - - - + + Some header diff --git a/src/app/grid-filter&sorting-demo/grid-filter-demo/grid-filter-demo.component.html b/src/app/grid-filter&sorting-demo/grid-filter-demo/grid-filter-demo.component.html index 6abfc63..148fe65 100644 --- a/src/app/grid-filter&sorting-demo/grid-filter-demo/grid-filter-demo.component.html +++ b/src/app/grid-filter&sorting-demo/grid-filter-demo/grid-filter-demo.component.html @@ -13,27 +13,14 @@ ID - - {{model.id}} - - - - - + + {{model.id}} Name - + {{model.name}} @@ -42,15 +29,15 @@ {{model.address}} - + Priority {{model.ordering}} - - - + + + @@ -58,7 +45,7 @@ {{model.openDate}} - + diff --git a/src/app/ng-select-demo/ng-select-demo/ng-select-demo.component.html b/src/app/ng-select-demo/ng-select-demo/ng-select-demo.component.html index 3e45f9b..271e430 100644 --- a/src/app/ng-select-demo/ng-select-demo/ng-select-demo.component.html +++ b/src/app/ng-select-demo/ng-select-demo/ng-select-demo.component.html @@ -11,21 +11,34 @@ selected: {{ myValue | json }}
- {{ item.name }} - {{ item.address }} + Merchant: {{ item.name }} - Address: {{ item.address }}
- selected: {{ myForm.value | json }}

Single Select Demo | label Template

+
+ Merchant: {{ item.name }} - Address: {{ item.address }} +
+
Name: {{ item.name }} - Address: {{item.address }}
selected: {{ myValue3 | json }} +

Single Select Demo | notFound Template

+ +
+
+ No data found for "{{searchTerm}}" +
+
+
+selected: {{ myValue2 | json }} +

Multi-Select Demo

+