diff --git a/.eslintrc.json b/.eslintrc.json index 435ebed3d..d999020ad 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -126,6 +126,6 @@ "@typescript-eslint/semi": ["error", "always"], "@typescript-eslint/type-annotation-spacing": "error", "@typescript-eslint/unified-signatures": "error", - "@typescript-eslint/no-explicit-any": "off" + "@typescript-eslint/no-explicit-any": "warn" } } diff --git a/packages/qgrid-core/public-api.d.ts b/packages/qgrid-core/public-api.d.ts index 748d44c91..657b9db96 100644 --- a/packages/qgrid-core/public-api.d.ts +++ b/packages/qgrid-core/public-api.d.ts @@ -381,7 +381,7 @@ export { Resource } from './src/resource/resource'; // export { EnumerableResource } from './src/resource/resource.enumerable'; // export { factory } from './src/resource/resource.factory'; // rest -export { RestState } from './src/rest/rest.state'; +export { RestState, RestSerialized } from './src/rest/rest.state'; // row-details export { RowDetails } from './src/row-details/row.details'; export { RowDetailsLet } from './src/row-details/row.details.let'; diff --git a/packages/qgrid-core/src/column-type/editor.options.d.ts b/packages/qgrid-core/src/column-type/editor.options.d.ts index 47518901a..8b7b71f81 100644 --- a/packages/qgrid-core/src/column-type/editor.options.d.ts +++ b/packages/qgrid-core/src/column-type/editor.options.d.ts @@ -11,43 +11,44 @@ export declare type EditorOptionsTrigger = 'click' | 'custom' | 'focus'; */ export interface EditorOptions { - /** - * Says when cell should go to the edit mode. - * - * * `click` edit mode activates when user clicks on cell. - * * `custom` if user defines own edit mode trigger, like button for reference column edit, this option should be used. - * * `focus` edit mode activates when cell receives focus. - */ - trigger?: EditorOptionsTrigger; - - /** - * Defines navigation behavior when cell is in edit mode. - * - * * `control` when cell is in edit mode, keyboard navigation events are disabled(in general, `tab` and `shift+tab` still works). - * * `transparent` when cell is in edit mode, keyboard navigation event are still applicable. - */ - cruise?: EditorOptionsCruise; - - /** - * q-grid model factory, can be used by reference column to draw a another q-grid in edit cell mode. - */ - modelFactory?: (context: { - row: any; - column: ColumnModel; - getValue: (row: any) => any; - reference: { commit: Command; cancel: Command; value: any }; - }) => Model; - - /** - * Can be used by e.g. `auto-complete` editor to populate list of items. - */ - fetch?: () => Promise | { subscribe: (x: any) => void } | any; - - /** - * List of actions, can be used by row-options column to draw menu with commands. - */ - actions?: Action[]; - - label?: any; - value?: any; + /** + * Says when cell should go to the edit mode. + * + * * `click` edit mode activates when user clicks on cell. + * * `custom` if user defines own edit mode trigger, like button for reference column edit, this option should be used. + * * `focus` edit mode activates when cell receives focus. + */ + trigger?: EditorOptionsTrigger; + + /** + * Defines navigation behavior when cell is in edit mode. + * + * * `control` when cell is in edit mode, keyboard navigation events are disabled(in general, `tab` and `shift+tab` still works). + * * `transparent` when cell is in edit mode, keyboard navigation event are still applicable. + */ + cruise?: EditorOptionsCruise; + + /** + * q-grid model factory, can be used by reference column to draw a another q-grid in edit cell mode. + */ + modelFactory?: (context: { + row: any; + column: ColumnModel; + getValue: (row: any) => any; + reference: { commit: Command; cancel: Command; value: any }; + createDefaultModel?: () => Model; + }) => Model; + + /** + * Can be used by e.g. `auto-complete` editor to populate list of items. + */ + fetch?: () => Promise | { subscribe: (x: any) => void } | any; + + /** + * List of actions, can be used by row-options column to draw menu with commands. + */ + actions?: Action[]; + + label?: any; + value?: any; } diff --git a/packages/qgrid-core/src/rest/rest.state.d.ts b/packages/qgrid-core/src/rest/rest.state.d.ts index ffd9fa5c4..5d2a52593 100644 --- a/packages/qgrid-core/src/rest/rest.state.d.ts +++ b/packages/qgrid-core/src/rest/rest.state.d.ts @@ -1,12 +1,14 @@ import { Model } from '../model/model'; +export interface RestSerialized { + order: string; + filter: string; + skip: number; + take: number; +} + export declare class RestState { url: string; method: string; - serialize: (model: Model) => { - order: string; - filter: string; - skip: number; - take: number; - }; + serialize: (model: Model) => RestSerialized; } diff --git a/packages/qgrid-core/src/validation/validation.service.d.ts b/packages/qgrid-core/src/validation/validation.service.d.ts index e2ff1e002..cd3160d10 100644 --- a/packages/qgrid-core/src/validation/validation.service.d.ts +++ b/packages/qgrid-core/src/validation/validation.service.d.ts @@ -1,6 +1,6 @@ export declare interface Validator { - validate(value: any): boolean; - getErrors(): Array; + validate(value: any): boolean; + getErrors(): { [key: string]: (Array | string) }; } export declare function hasRules(rules: any, key: string): boolean; diff --git a/packages/qgrid-ngx-examples/src/examples/import-basic/example-import-basic.component.html b/packages/qgrid-ngx-examples/src/examples/import-basic/example-import-basic.component.html index 08c03edb9..30034f773 100644 --- a/packages/qgrid-ngx-examples/src/examples/import-basic/example-import-basic.component.html +++ b/packages/qgrid-ngx-examples/src/examples/import-basic/example-import-basic.component.html @@ -5,7 +5,7 @@ - +