From 395272159200c045842b0fe5f00f993300f09fd3 Mon Sep 17 00:00:00 2001 From: Damyan Petev Date: Mon, 27 Apr 2020 08:12:45 +0300 Subject: [PATCH] chore(date-editor): cleanup public api exports and descriptions #6271 --- .../date-time-editor.common.ts | 9 +++---- .../date-time-editor.directive.ts | 24 +++++++++++-------- .../lib/directives/date-time-editor/index.ts | 2 +- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/projects/igniteui-angular/src/lib/directives/date-time-editor/date-time-editor.common.ts b/projects/igniteui-angular/src/lib/directives/date-time-editor/date-time-editor.common.ts index 8b3dade6702..77b0d435775 100644 --- a/projects/igniteui-angular/src/lib/directives/date-time-editor/date-time-editor.common.ts +++ b/projects/igniteui-angular/src/lib/directives/date-time-editor/date-time-editor.common.ts @@ -1,11 +1,11 @@ export interface IgxDateTimeEditorEventArgs { - oldValue: Date; - newValue: Date; - userInput: string; + readonly oldValue?: Date; + newValue?: Date; + readonly userInput: string; } /** - * An @Enum that allows you to specify a particular date, time or AmPm part. + * Specify a particular date, time or AmPm part. */ export enum DatePart { Date = 'date', @@ -18,6 +18,7 @@ export enum DatePart { Literal = 'literal' } +/** @hidden @internal */ export interface DatePartInfo { type: DatePart; start: number; diff --git a/projects/igniteui-angular/src/lib/directives/date-time-editor/date-time-editor.directive.ts b/projects/igniteui-angular/src/lib/directives/date-time-editor/date-time-editor.directive.ts index f0c4504a81f..8b3dca0bd8e 100644 --- a/projects/igniteui-angular/src/lib/directives/date-time-editor/date-time-editor.directive.ts +++ b/projects/igniteui-angular/src/lib/directives/date-time-editor/date-time-editor.directive.ts @@ -3,7 +3,7 @@ import { Renderer2, NgModule, Output, EventEmitter, Inject, LOCALE_ID, OnChanges, SimpleChanges } from '@angular/core'; import { NG_VALUE_ACCESSOR, ControlValueAccessor, Validator, AbstractControl, ValidationErrors, NG_VALIDATORS, } from '@angular/forms'; -import { CommonModule, formatDate, DOCUMENT } from '@angular/common'; +import { formatDate, DOCUMENT } from '@angular/common'; import { IgxMaskDirective } from '../mask/mask.directive'; import { MaskParsingService } from '../mask/mask-parsing.service'; import { KEYS } from '../../core/utils'; @@ -50,9 +50,11 @@ import { IgxDateTimeEditorEventArgs, DatePartInfo, DatePart } from './date-time- }) export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnChanges, Validator, ControlValueAccessor { /** - * Set the locale settings used in `displayFormat`. + * Locale settings used for value formatting. + * + * @remarks + * Uses Angular's `LOCALE_ID` by default. Affects both input mask and display format if those are not set. * - * Uses Angular's `LOCALE_ID` for the default value. * @example * ```html * @@ -62,9 +64,10 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh public locale: string; /** - * Set the minimum possible value the editor will allow. + * Minimum value required for the editor to remain valid. * - * If a `string` value is passed in, it must be in the defined input format. + * @remarks + * If a `string` value is passed, it must be in the defined input format. * * @example * ```html @@ -82,9 +85,11 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh } /** - * Set the maximum possible value the editor will allow. + * Maximum value required for the editor to remain valid. * + * @remarks * If a `string` value is passed in, it must be in the defined input format. + * * @example * ```html * @@ -122,7 +127,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh public displayFormat: string; /** - * get/set the expected user input format (and placeholder). + * Expected user input format (and placeholder). * @example * ```html * @@ -142,7 +147,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh } /** - * get/set the editor's value. + * Editor value. * @example * ```html * @@ -573,7 +578,6 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh @NgModule({ declarations: [IgxDateTimeEditorDirective], - exports: [IgxDateTimeEditorDirective], - imports: [CommonModule] + exports: [IgxDateTimeEditorDirective] }) export class IgxDateTimeEditorModule { } diff --git a/projects/igniteui-angular/src/lib/directives/date-time-editor/index.ts b/projects/igniteui-angular/src/lib/directives/date-time-editor/index.ts index 4a06b380806..2ce5075a89d 100644 --- a/projects/igniteui-angular/src/lib/directives/date-time-editor/index.ts +++ b/projects/igniteui-angular/src/lib/directives/date-time-editor/index.ts @@ -1,2 +1,2 @@ -export * from './date-time-editor.common'; +export { DatePart, IgxDateTimeEditorEventArgs } from './date-time-editor.common'; export * from './date-time-editor.directive';