@@ -61,7 +61,7 @@ export class IgxCell {
6161 public rowData : any ,
6262 public grid : IgxGridBaseDirective & GridType ) { }
6363
64- public castToNumber ( value : any ) : any {
64+ public castToNumber ( value : any ) : any {
6565 if ( this . column . dataType === 'number' && ! this . column . inlineEditorTemplate ) {
6666 const v = parseFloat ( value ) ;
6767 return ! isNaN ( v ) && isFinite ( v ) ? v : 0 ;
@@ -185,7 +185,7 @@ export class IgxCellCrudState {
185185 doneArgs = this . exitCellEdit ( event ) ;
186186 }
187187
188- return { ...args , ...doneArgs } ;
188+ return { ...args , ...doneArgs } ;
189189 }
190190
191191 public cellEditDone ( event , addRow : boolean ) : IGridEditDoneEventArgs {
@@ -324,7 +324,7 @@ export class IgxRowCrudState extends IgxCellCrudState {
324324
325325 nonCancelableArgs = this . exitRowEdit ( rowEditArgs . oldValue , event ) ;
326326
327- return { ...nonCancelableArgs , ...rowEditArgs } ;
327+ return { ...nonCancelableArgs , ...rowEditArgs } ;
328328 }
329329
330330 public rowEditDone ( cachedRowData , event : Event ) {
@@ -368,7 +368,7 @@ export class IgxRowCrudState extends IgxCellCrudState {
368368
369369 if ( rowInEditMode && row . id === rowInEditMode . id ) {
370370 row . data = { ...row . data , ...rowInEditMode . transactionState } ;
371- // TODO: Workaround for updating a row in edit mode through the API
371+ // TODO: Workaround for updating a row in edit mode through the API
372372 } else if ( this . grid . transactions . enabled ) {
373373 const state = grid . transactions . getState ( row . id ) ;
374374 row . data = state ? Object . assign ( { } , row . data , state . value ) : row . data ;
@@ -378,19 +378,21 @@ export class IgxRowCrudState extends IgxCellCrudState {
378378}
379379
380380export class IgxRowAddCrudState extends IgxRowCrudState {
381- /**
382- * @hidden @interal
383- */
384- // TODO: Consider changing the modifier to protected or private.
385381 public addRowParent : IgxRowParent = null ;
386382 public addRow : IgxRow | null = null ;
387383
384+ /**
385+ * @hidden @internal
386+ */
388387 public createRow ( cell : IgxCell ) : IgxRow {
389388 this . row = super . createRow ( cell ) ;
390- this . row . isAddRow = this . addRow ? this . addRow . id == this . row . id : false ;
389+ this . row . isAddRow = this . addRow ? this . addRow . id === this . row . id : false ;
391390 return this . row ;
392391 }
393392
393+ /**
394+ * @hidden @internal
395+ */
394396 public createAddRow ( parentRow : IgxRowDirective < IgxGridBaseDirective & GridType > , asChild ?: boolean ) {
395397 this . createAddRowParent ( parentRow , asChild ) ;
396398
@@ -399,11 +401,14 @@ export class IgxRowAddCrudState extends IgxRowCrudState {
399401 return this . addRow = new IgxRow ( newRec [ this . primaryKey ] , addRowIndex , newRec , this . grid ) ;
400402 }
401403
402- protected createAddRowParent ( row : IgxRowDirective < IgxGridBaseDirective & GridType > , newRowAsChild ?: boolean ) {
404+ /**
405+ * @hidden @internal
406+ */
407+ public createAddRowParent ( row : IgxRowDirective < IgxGridBaseDirective & GridType > , newRowAsChild ?: boolean ) {
403408 const rowIndex = row ? row . index : this . grid . rowList . length - 1 ;
404409 const rowId = row ? row . rowID : ( rowIndex >= 0 ? this . grid . rowList . last . rowID : null ) ;
405410
406- const isInPinnedArea = this . grid . isRecordPinnedByViewIndex ( rowIndex ) ;
411+ const isInPinnedArea = this . grid . isRecordPinnedByViewIndex ( rowIndex ) ;
407412 const pinIndex = this . grid . pinnedRecords . findIndex ( x => x [ this . primaryKey ] === rowId ) ;
408413 const unpinIndex = this . grid . unpinnedRecords . findIndex ( x => x [ this . primaryKey ] === rowId ) ;
409414 this . addRowParent = {
@@ -414,10 +419,13 @@ export class IgxRowAddCrudState extends IgxRowCrudState {
414419 } ;
415420 }
416421
422+ /**
423+ * @hidden @internal
424+ */
417425 public endRowTransaction ( commit : boolean , event ?: Event ) : IGridEditEventArgs {
418426 if ( this . addRow ) {
419- this . grid . rowAdded . pipe ( first ( ) ) . subscribe ( ( args : IRowDataEventArgs ) => {
420- const rowData = args . data ;
427+ this . grid . rowAdded . pipe ( first ( ) ) . subscribe ( ( addRowArgs : IRowDataEventArgs ) => {
428+ const rowData = addRowArgs . data ;
421429 const pinnedIndex = this . grid . pinnedRecords . findIndex ( x => x [ this . primaryKey ] === rowData [ this . primaryKey ] ) ;
422430 // A check whether the row is in the current view
423431 const viewIndex = pinnedIndex !== - 1 ? pinnedIndex : this . _findRecordIndexInView ( rowData ) ;
@@ -431,34 +439,33 @@ export class IgxRowAddCrudState extends IgxRowCrudState {
431439 }
432440
433441 const args = super . endRowTransaction ( commit , event ) ;
434-
442+
435443 if ( this . addRow ) {
436444 this . grid . transactions . endPending ( true ) ;
437-
445+
438446 if ( commit ) {
439447 args . isAddRow = true ;
440-
448+
441449 if ( ! this . grid . transactions . enabled ) {
442450 this . grid . gridAPI . addRowToData ( this . addRow . newData || this . addRow . data ) ;
443451 }
444-
445-
452+
446453 this . grid . rowAddedNotifier . next ( this . addRow . newData || this . addRow . data ) ;
447454 this . grid . rowAdded . emit ( { data : this . addRow . newData || this . addRow . data } ) ;
448455 } else if ( this . grid . transactions . enabled ) {
449456 this . grid . transactions . clear ( this . addRow . id ) ;
450457 }
451-
458+
452459 this . endAddRow ( ) ;
453460 }
454-
461+
455462 return args ;
456463 }
457464
458465 /**
459466 * @hidden @internal
460467 */
461- public endAddRow ( ) {
468+ public endAddRow ( ) {
462469 this . addRow = null ;
463470 this . addRowParent = null ;
464471 this . grid . triggerPipes ( ) ;
@@ -469,11 +476,11 @@ export class IgxRowAddCrudState extends IgxRowCrudState {
469476 * @internal
470477 * TODO: consider changing modifier
471478 */
472- public _findRecordIndexInView ( rec ) {
479+ public _findRecordIndexInView ( rec ) {
473480 return this . grid . dataView . findIndex ( data => data [ this . primaryKey ] === rec [ this . primaryKey ] ) ;
474481 }
475482
476- protected _getParentRecordId ( ) {
483+ protected _getParentRecordId ( ) {
477484 if ( this . addRowParent . asChild ) {
478485 return this . addRowParent . asChild ? this . addRowParent . rowID : undefined ; ;
479486 } else if ( this . addRowParent . rowID !== null && this . addRowParent . rowID !== undefined ) {
@@ -527,13 +534,13 @@ export class IgxGridCRUDService extends IgxRowAddCrudState {
527534
528535 /**
529536 * Enters add row mode by creating temporary dummy so the user can fill in new row cells.
530- *
531- * @param parentRow Parent row after which the Add Row UI will be rendered. If `null` will show it at the bottom after all rows (or top if there are not rows).
537+ *
538+ * @param parentRow Parent row after which the Add Row UI will be rendered.
539+ * If `null` will show it at the bottom after all rows (or top if there are not rows).
532540 * @param asChild Specifies if the new row should be added as a child to a tree row.
533541 * @param event Base event that triggered the add row mode.
534542 */
535- public enterAddRowMode ( parentRow : IgxRowDirective < IgxGridBaseDirective & GridType > , asChild ?: boolean , event ?: Event )
536- {
543+ public enterAddRowMode ( parentRow : IgxRowDirective < IgxGridBaseDirective & GridType > , asChild ?: boolean , event ?: Event ) {
537544 if ( ! this . rowEditing && ( this . grid . primaryKey === undefined || this . grid . primaryKey === null ) ) {
538545 console . warn ( 'The grid must use row edit mode to perform row adding! Please set rowEditable to true.' ) ;
539546 return ;
@@ -582,7 +589,7 @@ export class IgxGridCRUDService extends IgxRowAddCrudState {
582589 * @param commit
583590 */
584591 // TODO: Implement the same representation of the method without evt emission.
585- public endEdit ( commit = true , event ?: Event ) {
592+ public endEdit ( commit = true , event ?: Event ) {
586593 if ( ! this . row && ! this . cell ) {
587594 return ;
588595 }
0 commit comments