Skip to content

Commit

Permalink
chore(date-editor): cleanup public api exports and descriptions #6271
Browse files Browse the repository at this point in the history
  • Loading branch information
damyanpetev committed Apr 27, 2020
1 parent b402d4d commit 3952721
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -18,6 +18,7 @@ export enum DatePart {
Literal = 'literal'
}

/** @hidden @internal */
export interface DatePartInfo {
type: DatePart;
start: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
* <input igxDateTimeEditor [locale]="'en'">
Expand All @@ -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
Expand All @@ -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
* <input igxDateTimeEditor [maxValue]="maxDate">
Expand Down Expand Up @@ -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
* <input [igxDateTimeEditor]="'dd/MM/yyyy'">
Expand All @@ -142,7 +147,7 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh
}

/**
* get/set the editor's value.
* Editor value.
* @example
* ```html
* <input igxDateTimeEditor [value]="date">
Expand Down Expand Up @@ -573,7 +578,6 @@ export class IgxDateTimeEditorDirective extends IgxMaskDirective implements OnCh

@NgModule({
declarations: [IgxDateTimeEditorDirective],
exports: [IgxDateTimeEditorDirective],
imports: [CommonModule]
exports: [IgxDateTimeEditorDirective]
})
export class IgxDateTimeEditorModule { }
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './date-time-editor.common';
export { DatePart, IgxDateTimeEditorEventArgs } from './date-time-editor.common';
export * from './date-time-editor.directive';

0 comments on commit 3952721

Please sign in to comment.