From 895474a85aba3c2dc0c74134065e36818121b560 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Sat, 26 May 2018 15:55:13 -0400 Subject: [PATCH] refactor(code): remove deprecated FormElementType --- .../aurelia-slickgrid/aurelia-slickgrid.ts | 1 - .../filters/filterFactory.ts | 6 +++--- .../models/columnFilter.interface.ts | 3 +-- .../models/formElementType.ts | 19 ------------------- .../src/aurelia-slickgrid/models/index.ts | 1 - .../aurelia-slickgrid/services/utilities.ts | 4 ++-- .../src/examples/slickgrid/example7.ts | 2 +- client-cli/src/examples/slickgrid/example5.js | 4 ++-- client-cli/src/examples/slickgrid/example7.js | 2 +- .../src/examples/slickgrid/example5.ts | 2 +- .../src/examples/slickgrid/example7.ts | 2 +- 11 files changed, 12 insertions(+), 34 deletions(-) delete mode 100644 aurelia-slickgrid/src/aurelia-slickgrid/models/formElementType.ts diff --git a/aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts b/aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts index c6b5f5b4d..3345fee99 100644 --- a/aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts +++ b/aurelia-slickgrid/src/aurelia-slickgrid/aurelia-slickgrid.ts @@ -28,7 +28,6 @@ import { BackendServiceOption, CellArgs, Column, - FormElementType, GraphqlResult, GridOption, GridStateChange, diff --git a/aurelia-slickgrid/src/aurelia-slickgrid/filters/filterFactory.ts b/aurelia-slickgrid/src/aurelia-slickgrid/filters/filterFactory.ts index c4c6ad723..860d84d3a 100644 --- a/aurelia-slickgrid/src/aurelia-slickgrid/filters/filterFactory.ts +++ b/aurelia-slickgrid/src/aurelia-slickgrid/filters/filterFactory.ts @@ -1,5 +1,5 @@ import { inject, Container } from 'aurelia-framework'; -import { Filter, FilterType, FormElementType } from '../models/index'; +import { Filter, FilterType } from '../models/index'; import { SlickgridConfig } from '../slickgrid-config'; /** The name of the plugins the factory will initialize */ @@ -26,11 +26,11 @@ export class FilterFactory { /** * Creates a new Filter from the provided filterType - * @param {FilterType | FormElementType | string} [filterType] the type of filter to create + * @param {FilterType | string} [filterType] the type of filter to create * as an enum or custom string. The default filter type will be used if no value is passed * @return {Filter} the new Filter */ - public createFilter(filterType?: FilterType | FormElementType | string): Filter { + public createFilter(filterType?: FilterType | string): Filter { const filters = this.container.getAll(PLUGIN_NAME); let filter: Filter | undefined = filters.find((f: Filter) => diff --git a/aurelia-slickgrid/src/aurelia-slickgrid/models/columnFilter.interface.ts b/aurelia-slickgrid/src/aurelia-slickgrid/models/columnFilter.interface.ts index eed377303..1a5565651 100644 --- a/aurelia-slickgrid/src/aurelia-slickgrid/models/columnFilter.interface.ts +++ b/aurelia-slickgrid/src/aurelia-slickgrid/models/columnFilter.interface.ts @@ -4,7 +4,6 @@ import { Column, Filter, FilterType, - FormElementType, MultipleSelectOption, OperatorString, OperatorType, @@ -34,7 +33,7 @@ export interface ColumnFilter { operator?: OperatorType | OperatorString; /** Filter Type to use (input, multipleSelect, singleSelect, select, custom) */ - type?: FilterType | FormElementType | string; + type?: FilterType | string; /** A collection of items/options (commonly used with a Select/Multi-Select Filter) */ collection?: any[]; diff --git a/aurelia-slickgrid/src/aurelia-slickgrid/models/formElementType.ts b/aurelia-slickgrid/src/aurelia-slickgrid/models/formElementType.ts deleted file mode 100644 index 0d4ab130b..000000000 --- a/aurelia-slickgrid/src/aurelia-slickgrid/models/formElementType.ts +++ /dev/null @@ -1,19 +0,0 @@ -export enum FormElementType { - /** Input Filter type */ - input, - - /** Select Filter type, just a regular select dropdown. You might want to try "singleSelect" which has a nicer look and feel. */ - select, - - /** Multiple-Select Filter type */ - multipleSelect, - - /** Single Filter type */ - singleSelect, - - /** Custom Filter type */ - custom, - - /** TextArea element type */ - textarea -} diff --git a/aurelia-slickgrid/src/aurelia-slickgrid/models/index.ts b/aurelia-slickgrid/src/aurelia-slickgrid/models/index.ts index 0a514f853..15034881e 100644 --- a/aurelia-slickgrid/src/aurelia-slickgrid/models/index.ts +++ b/aurelia-slickgrid/src/aurelia-slickgrid/models/index.ts @@ -33,7 +33,6 @@ export * from './filterCondition.interface'; export * from './filterConditionOption.interface'; export * from './filterType.enum'; export * from './formatter.interface'; -export * from './formElementType'; export * from './graphqlDatasetFilter.interface'; export * from './graphqlCursorPaginationOption.interface'; export * from './graphqlFilteringOption.interface'; diff --git a/aurelia-slickgrid/src/aurelia-slickgrid/services/utilities.ts b/aurelia-slickgrid/src/aurelia-slickgrid/services/utilities.ts index 4cf81a1f7..7b7dd2135 100644 --- a/aurelia-slickgrid/src/aurelia-slickgrid/services/utilities.ts +++ b/aurelia-slickgrid/src/aurelia-slickgrid/services/utilities.ts @@ -1,4 +1,4 @@ -import { FieldType, OperatorType, FilterType, FormElementType } from '../models/index'; +import { FieldType, OperatorType, FilterType } from '../models/index'; import * as moment from 'moment'; /** @@ -291,7 +291,7 @@ export function mapOperatorByFieldType(fieldType: FieldType | string): OperatorT * @param operator * @returns string map */ -export function mapOperatorByFilterType(filterType: FilterType | FormElementType | string): OperatorType { +export function mapOperatorByFilterType(filterType: FilterType | string): OperatorType { let map = OperatorType.empty; switch (filterType) { diff --git a/aurelia-slickgrid/src/examples/slickgrid/example7.ts b/aurelia-slickgrid/src/examples/slickgrid/example7.ts index f2a7b1f3f..df7ec96c6 100644 --- a/aurelia-slickgrid/src/examples/slickgrid/example7.ts +++ b/aurelia-slickgrid/src/examples/slickgrid/example7.ts @@ -1,5 +1,5 @@ import { autoinject } from 'aurelia-framework'; -import { Column, GridOption, FieldType, Formatters, FormElementType } from '../../aurelia-slickgrid'; +import { Column, GridOption, FieldType, Formatters } from '../../aurelia-slickgrid'; let columnsWithHighlightingById = {}; diff --git a/client-cli/src/examples/slickgrid/example5.js b/client-cli/src/examples/slickgrid/example5.js index 10e7241aa..e739cbc05 100644 --- a/client-cli/src/examples/slickgrid/example5.js +++ b/client-cli/src/examples/slickgrid/example5.js @@ -1,6 +1,6 @@ import { inject } from 'aurelia-framework'; import { HttpClient } from 'aurelia-http-client'; -import { FieldType, FilterType, FormElementType, GridOdataService } from 'aurelia-slickgrid'; +import { FieldType, FilterType, GridOdataService } from 'aurelia-slickgrid'; const defaultPageSize = 20; const sampleDataRoot = 'src/examples/slickgrid/sample-data'; @@ -52,7 +52,7 @@ export class Example5 { id: 'gender', name: 'Gender', field: 'gender', filterable: true, sortable: true, minWidth: 100, filter: { collection: [{ value: '', label: '' }, { value: 'male', label: 'male' }, { value: 'female', label: 'female' }], - type: FormElementType.singleSelect + type: FilterType.singleSelect } }, { id: 'company', name: 'Company', field: 'company', minWidth: 100 } diff --git a/client-cli/src/examples/slickgrid/example7.js b/client-cli/src/examples/slickgrid/example7.js index 57a64617b..05afe7653 100644 --- a/client-cli/src/examples/slickgrid/example7.js +++ b/client-cli/src/examples/slickgrid/example7.js @@ -1,5 +1,5 @@ import { autoinject } from 'aurelia-framework'; -import { Column, GridOption, Formatters, FormElementType } from 'aurelia-slickgrid'; +import { Column, GridOption, Formatters } from 'aurelia-slickgrid'; let columnsWithHighlightingById = {}; diff --git a/doc/github-demo/src/examples/slickgrid/example5.ts b/doc/github-demo/src/examples/slickgrid/example5.ts index 10f3bf009..17520b596 100644 --- a/doc/github-demo/src/examples/slickgrid/example5.ts +++ b/doc/github-demo/src/examples/slickgrid/example5.ts @@ -1,6 +1,6 @@ import { autoinject } from 'aurelia-framework'; import { HttpClient } from 'aurelia-http-client'; -import { CaseType, Column, GridOption, FieldType, FilterType, Formatters, FormElementType, GridOdataService, OperatorType } from 'aurelia-slickgrid'; +import { CaseType, Column, GridOption, FieldType, FilterType, Formatters, GridOdataService, OperatorType } from 'aurelia-slickgrid'; const defaultPageSize = 20; const sampleDataRoot = 'assets/data'; diff --git a/doc/github-demo/src/examples/slickgrid/example7.ts b/doc/github-demo/src/examples/slickgrid/example7.ts index d11244885..593e376ec 100644 --- a/doc/github-demo/src/examples/slickgrid/example7.ts +++ b/doc/github-demo/src/examples/slickgrid/example7.ts @@ -1,5 +1,5 @@ import { autoinject } from 'aurelia-framework'; -import { Column, GridOption, FieldType, Formatters, FormElementType } from 'aurelia-slickgrid'; +import { Column, GridOption, FieldType, Formatters } from 'aurelia-slickgrid'; let columnsWithHighlightingById = {};