Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid Validation Implementation #11923

Merged
merged 172 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
74b3d1b
feat(igxGrid): Grid with reactive forms validation POC - initial commit.
Jul 5, 2022
707f6b7
chore(*): Extend base validator for columns and pass down to cells fo…
Jul 6, 2022
c190a8d
chore(*): Move FormGroup creating to crud service edit row init. Emit…
Jul 6, 2022
af61805
chore(*): Beautify errors a little.
Jul 7, 2022
20712d4
chore(*): re-use grid outlet.
Jul 7, 2022
85330c8
chore(*): Example with adding custom validator.
Jul 7, 2022
3c50667
chore(*): Refactor a bit. Add invalid cell class.
Jul 7, 2022
8f0f481
chore(*): Minor refactor.
Jul 7, 2022
588e591
Add custom validation error template.
Jul 7, 2022
4ea86ad
Add isValid argument to edit events.
Jul 7, 2022
86c2730
chore(*): POC with cell --invalid class with transaction.
Jul 8, 2022
578ff71
chore(*): Add a validition sample with one grid with transactions and…
Jul 11, 2022
a9b58ec
chore(*): Update styles.
Jul 11, 2022
2d53a08
chore(*): Show confirmation in case invalid transactions are about to…
Jul 11, 2022
bd0dc1b
chore(*): Add a validationStatusChange event on the grid.
Jul 11, 2022
7368f73
chore(*): Update poc with new design with icon and tooltip.
Aug 1, 2022
0a7e8ff
chore(*): Smaller icon: 18x18.
Aug 2, 2022
4ed7843
chor(*): Minor style changes.
Aug 2, 2022
22767fa
chore(*): Hide title while error tooltip is showing.
Aug 2, 2022
95a176e
chore(*): Add aria attributes for invalid cell.
Aug 3, 2022
ff2d571
chore(*): Hide tooltip on active node change.
Aug 3, 2022
032c553
chore(*): Move some of the logic in the base transaction service so t…
Aug 3, 2022
389d1af
chore(*): Add grid validation trigger.
Aug 3, 2022
4312eaa
chore(*): Minor refactor.
Aug 9, 2022
50f81d3
chore(*): fix minor issue with error message showing after cell enter…
Aug 9, 2022
50395d7
chore(*): Scrap submit trigger.
Aug 10, 2022
debc88d
chore(*): Add the remaining column validators extending the default a…
Aug 11, 2022
4a393c1
chore(*): Move default error messages as locale resources for localiz…
Aug 11, 2022
4d174aa
chore(*): merge from master.
Aug 11, 2022
dcb02e5
chore(*): fix merge conflicts.
Aug 11, 2022
a131a1b
chore(*): fix lint.
Aug 11, 2022
9fbbd64
chore(*): Add --valid style on cell when it changes state on edit. Fi…
Aug 11, 2022
638bb0f
chore(*): Fix build.
Aug 11, 2022
804ec33
chore(*): Fix tests.
Aug 11, 2022
0a6c46a
chore(*): Add check in case there's no form control for column.
Aug 11, 2022
d8bb991
chore(*): Add check in the other event for formControl.
Aug 11, 2022
3d09098
theme(grid): update validation styles
didimmova Aug 12, 2022
a0ccaf1
theme(grid): hide asterisk
didimmova Aug 15, 2022
36d1683
chore(*): Fix check in case another row is in edit mode and a previou…
Aug 15, 2022
9f40006
Merge branch 'mkirova/grid-reactive-forms' of https://github.com/Igni…
Aug 15, 2022
4297a87
chore():Add a property in base service that determines whether to app…
Aug 15, 2022
b7aaf8d
chore(*): Fix html doc and fix issues when getting id when edit mode …
Aug 15, 2022
cfbef3d
chore(*): Update validitu per field since it gets wrong validity when…
Aug 15, 2022
4664d22
chore(*): Expose default error template.
Aug 15, 2022
aabd7cc
chore(*): Re-use formgroup from row if there's no info in the transac…
Aug 15, 2022
6049273
chore(*): Fix issue when transaction.validity is undefined.
Aug 15, 2022
255a827
chore(*): Clear last pending transaction once Done/Cancel button is c…
Aug 16, 2022
de52513
chore(*): Do not store add and delete transactions in case we want to…
Aug 16, 2022
95d2e88
chore(*): Move validation states in a separate transaction collection…
Aug 16, 2022
b5a1e31
chore(*): Add logic for undo, redo, clear, commit for validation stat…
Aug 16, 2022
0568e65
chore(*): Add some null checks.
Aug 16, 2022
69e5653
chore(*): Update tests with edit event arg isValid.
Aug 16, 2022
48996f6
chore(*): Remove fit.
Aug 16, 2022
c9aa52a
chore(*): Add check in case transaction has no matching validation.
Aug 16, 2022
0ec6494
Merge branch 'master' into mkirova/grid-reactive-forms
dkamburov Aug 16, 2022
d95e83e
chore(*): update more tests.
Aug 16, 2022
1e189d9
Merge branch 'mkirova/grid-reactive-forms' of https://github.com/Igni…
Aug 16, 2022
91f6380
chore(*): Blur only if needed.
Aug 16, 2022
f8db035
chore(*): Fix check.
Aug 16, 2022
3d1a092
chore(*): Use the row's inEditMode.
Aug 16, 2022
73ce2e5
Merge branch 'master' into mkirova/grid-reactive-forms
dkamburov Aug 16, 2022
eb574d6
chore(*): Update more tests.
Aug 16, 2022
213f8db
Merge branch 'mkirova/grid-reactive-forms' of https://github.com/Igni…
Aug 16, 2022
5f5ebb6
chore(*): Update test and also update another flickering test.
Aug 16, 2022
f0a1586
chore(*): Add api docs for new methods in the base transaction service.
Aug 17, 2022
dd7f817
chore(*): add missed inheritdoc tag.
Aug 17, 2022
b9e5eb8
chore(*): Fix warning for ngModel and formConrol's integration. Use t…
Aug 17, 2022
3446070
chore(*): Fix types.
Aug 17, 2022
ce2ad87
chore(*): Return default form control in case formGroup is not popula…
Aug 17, 2022
5a20ace
chore(*): Add note in changelog for grid validation.
Aug 17, 2022
c5fae4f
chore(*): Expose formControl in the public cell api since otherwise t…
Aug 17, 2022
9fe3eab
chore(*): Merge from master.
Aug 17, 2022
cc9b03e
chore(*): Add aria-errormessage to cell and to accessible inputs.
Aug 18, 2022
4c8b7d7
chore(*): Change default messages to match the ones from the igGrid.
Aug 18, 2022
20c5135
chore(*): Fix getter.
Aug 18, 2022
fea270f
Merge branch 'master' into mkirova/grid-reactive-forms
ChronosSF Aug 19, 2022
0b256a7
Merge branch 'master' into mkirova/grid-reactive-forms
didimmova Aug 19, 2022
846e231
Merge branch 'mkirova/grid-reactive-forms' of https://github.com/Igni…
didimmova Aug 19, 2022
f6b6d88
theme(grid): update grid theme
didimmova Aug 19, 2022
341659a
chore(*): Resize and reposition error tooltip overlay when form contr…
Aug 19, 2022
5ee3d2a
chore(*): Apply review comments to changelog section.
Aug 19, 2022
365e9d9
chore(*): Start moving validation related apis in separate service.
Aug 19, 2022
0d0cac3
chore(*): Update apis and sample.
Aug 22, 2022
411011f
chore(*): Update api docs.
Aug 22, 2022
0c36b93
chore(*): Small renames suggested from review.
Aug 22, 2022
3f6c112
chore(*): Update tests.
Aug 22, 2022
60e3680
chore(*): Remove igxColumnValidator. Use DI on column constructor ins…
Aug 22, 2022
656a7dd
chore(*): Fix test error.
Aug 22, 2022
4ea770f
chore(*): Recreate form groups when entering edit mode for cell/row. …
Aug 23, 2022
e53e080
chore(*): Apply some of the review comments.
Aug 23, 2022
0610bef
test(validator): Add all tests from the validator spec
mddragnev Aug 23, 2022
106451a
chore(*): Apply discussion comments.
Aug 23, 2022
dd4a5d0
chore(*): Changing event arg to be 'valid' instead of 'invalid'.
Aug 23, 2022
85b5843
chore(*): fix lint
mddragnev Aug 23, 2022
fcc1ecb
chore(*): Update tests and sample.
Aug 23, 2022
a461aa1
chore(*): Update more tests. Add check.
Aug 23, 2022
6fa3d47
chore(*): Don't emit events when externally updating the control.
Aug 23, 2022
a1d9e1c
chore(*): Add check in case something forces edit mode without going …
Aug 23, 2022
8db50af
chore(*): Fix tests, update crudservice cell editValue when using pub…
mddragnev Aug 24, 2022
73a2c09
chore(*): Add more complex logic for undo/redo for scenarios like und…
Aug 24, 2022
5b4fd65
chore(*): Refactor public row/cell classes. Hide getValidity. Add for…
Aug 24, 2022
b3de041
Merge branch 'master' into mkirova/grid-reactive-forms
dkamburov Aug 25, 2022
a0559dd
chore(*): Do not update validation states while doing pending transac…
Aug 25, 2022
3568703
chore(*): Fix getters.
Aug 25, 2022
befb3e9
chore(*): Expose default error template in context.
Aug 25, 2022
4a6a2af
chore(*): Move update on cancel after transaction is no longer pending.
Aug 25, 2022
c2dc7d1
chore(*): Update on cell edit with commit:false as well.
Aug 25, 2022
250fa85
chore(*): Show error state only if form is touched. For adding mark a…
Aug 25, 2022
6d95843
chore(*): Fix tests.
Aug 25, 2022
5987423
chore(*): Add check.
Aug 25, 2022
164ff24
chore(*): Update sample.
Aug 25, 2022
ee79c04
chore(*): Mark as touched on value changes. Minor sample update.
Aug 26, 2022
ba17349
chore(*): Apply review comments.
Aug 26, 2022
e1b65c3
chore(*): Hide validationService from other grids.
Aug 26, 2022
aa156be
Merge pull request #12001 from IgniteUI/mkirova/grid-reactive-forms-v…
dkamburov Aug 26, 2022
9f65b32
Merge mkirova/grid-reactive-forms into mdragnev/validators-tests
Aug 26, 2022
3ab2ac1
test(validator): Some fixes to the validator tests and add a few more.
Aug 26, 2022
c2e288b
chore(*): Move validation updates on update_cell/update_row if the ed…
Aug 29, 2022
5cbeec6
chore(*): Merge from master.
Aug 29, 2022
4a78450
chore(*): Add sample with all grids.
Aug 29, 2022
8cfce6a
chore(*): Update the other cell types templates.
Aug 29, 2022
2d2a1f2
chore(*): Fix imports for grid module.
Aug 29, 2022
3042d38
chore(*): Pass validator array from row island to child grid instances.
Aug 29, 2022
edd47f4
Merge pull request #12022 from IgniteUI/skrastev/additional-validator…
dkamburov Aug 29, 2022
e32ec5f
chore(*): Mark updated cells/row as touched.
Aug 29, 2022
cd160e8
chore(*): Simplify check.
Aug 29, 2022
e52bd30
chore(*): Fix tests.
Aug 29, 2022
4b427f8
chore(*): Add few more integration tests.
skrustev Aug 29, 2022
87d86b8
chore(*): Add tree grid integration tests.
skrustev Aug 30, 2022
1fae6a1
Merge branch 'mkirova/grid-reactive-forms' into mdragnev/validators-t…
skrustev Aug 30, 2022
4ddae7a
chore(*): Fix error on rapid pointerdown on icon.
Aug 30, 2022
ae7e40f
chore(*): Fix check.
Aug 30, 2022
db112c4
chore(*): Apply review comment.
Aug 30, 2022
8371787
chore(*): Do not call markAsTouched on API calls. Expose it as public…
Aug 30, 2022
0201ebb
chore(*): Ensure error template is passed in all row templates. Add i…
Aug 30, 2022
96a9069
Merge pull request #12023 from IgniteUI/mkirova/grid-reactive-forms-r…
dkamburov Aug 30, 2022
f5f7441
Merge branch 'mkirova/grid-reactive-forms' into mdragnev/validators-t…
skrustev Aug 31, 2022
3db594e
chore(*): Update xit-ed validation test and fix failing one.
skrustev Aug 31, 2022
9f22cdf
chore(*): Fix issue with undo of deleted row that has error.
Aug 31, 2022
cc85bd6
Merge branch 'mkirova/grid-reactive-forms' into mdragnev/validators-t…
Aug 31, 2022
cf20689
chore(*): Fix issue with treegrid delete row not clearing validation …
Aug 31, 2022
c788de0
Merge branch 'mkirova/grid-reactive-forms' into mdragnev/validators-t…
Aug 31, 2022
7e76d70
Merge pull request #12010 from IgniteUI/mdragnev/validators-tests
dkamburov Aug 31, 2022
8ccbec8
Merge branch 'master' into mkirova/grid-reactive-forms
mddragnev Sep 1, 2022
df6e4b5
chore(*): Add missed get.
Sep 1, 2022
9816aba
Merge branch 'mkirova/grid-reactive-forms' of https://github.com/Igni…
Sep 1, 2022
8e9ec2a
chore(*): Copy resource strings for languages from JQuery. Note that …
Sep 1, 2022
2613981
chore(*): Apply review comments.
Sep 1, 2022
4da4fd1
chore(*): More review comments.
Sep 1, 2022
2ddb7c6
chore(*): Fix test to not access formControl. Update due to more comm…
Sep 1, 2022
5511c62
chore(*): Make valid optional since args type is reused for adding/de…
Sep 1, 2022
92e7d74
chore(*): Remove optional for delete.
Sep 1, 2022
666e39a
chore(*): Add handling for nested properties where the column key is …
Sep 1, 2022
ee7c4e3
chore(*): Update some tests.
Sep 1, 2022
2119407
chore(*): Remove focusout.
Sep 2, 2022
d70d50f
chore(*): Update test.
Sep 2, 2022
9ac3265
chore(*): Make Grid status event arg more similar to FormControlStatus.
Sep 2, 2022
a6cf8dd
chore(*): Restore format for inputs.
Sep 2, 2022
97196a6
chore(*): Fix tabs. Remove leftover change event.
Sep 2, 2022
3293bc1
chore(*): Fix few more tabs.
Sep 2, 2022
a119a2c
chore(*): Update formatting in other cell templates also.
Sep 2, 2022
ae2ff02
chore(*): Update html docs.
Sep 2, 2022
79c46ce
chore(*): Update event arg test.
Sep 2, 2022
dc01bc4
chore(*): Update events API docs.
Sep 2, 2022
831402f
chore(*): Fix test.
Sep 2, 2022
9d29a72
Revert "chore(*): Remove focusout."
Sep 2, 2022
9e42a0e
chore(*): Update the IRecordValidationState to be more similar to Row…
Sep 2, 2022
24dec19
chore(*): Fix test.
Sep 2, 2022
03375f1
chore(*): Fix issue with discarded added row.
Sep 2, 2022
e7a7976
Merge branch 'master' into mkirova/grid-reactive-forms
ChronosSF Sep 2, 2022
ec833ec
chore(grid,validation): type export and minor formatting
damyanpetev Sep 2, 2022
aa93478
Update CHANGELOG.md
dkamburov Sep 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ All notable changes for each version of this project will be documented in this

- Added the `IgcFormControl` directive that, when imported with its `IgcFormsModule`, is designed to seamlessly attach to form components from the Ignite UI for WebComponents package and allows using them in Angular templates and reactive forms with support for `ngModel` and `formControlName` directives. Currently the only Web Component with support through the directive is `igc-rating`.

- Added reactive forms style validation for grid editing. This extends the [Angular's reactive forms](https://angular.io/guide/form-validation#validating-input-in-reactive-forms) validation functionality
- Added built-in validation mechanism for Grid Editing. Extends the [Angular Form validation](https://angular.io/guide/form-validation) functionality
You can configure it in 2 ways:
1. Via template-driven configuration on the `igx-column` of the grid:
```html
Expand All @@ -91,7 +91,7 @@ All notable changes for each version of this project will be documented in this
}
```

Edited cells wil enter an invalid state when validation fails and will be show an error icon and message. Cell will remain invalid until the value is edited to a valid value or the related transaction in the transaction service are commited or cleared.
Edited cells wil enter an invalid state when validation fails and will show an error icon and message. Cell will remain invalid until the value is edited to a valid value or the related state in the validation service is cleared.

You can refer to the documentation for more details: https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/validation

Expand Down
22 changes: 11 additions & 11 deletions projects/igniteui-angular/src/lib/grids/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DataUtil, GridColumnDataType } from '../data-operations/data-util';
import { IFilteringExpressionsTree } from '../data-operations/filtering-expressions-tree';
import { Transaction, TransactionType, State } from '../services/transaction/transaction';
import { IgxCell, IgxGridCRUDService, IgxEditRow } from './common/crud.service';
import { CellType, ColumnType, GridServiceType, GridType, IFieldValid, RowType } from './common/grid.interface';
import { CellType, ColumnType, GridServiceType, GridType, RowType } from './common/grid.interface';
import { IGridEditEventArgs, IRowToggleEventArgs } from './common/events';
import { IgxColumnMovingService } from './moving/moving.service';
import { IGroupingExpression } from '../data-operations/grouping-expression.interface';
Expand Down Expand Up @@ -294,19 +294,19 @@ export class GridBaseAPIService<T extends GridType> implements GridServiceType {
return this.grid.filteredData;
}

public addRowToData(rowData: any, _parentID?: any, validity?) {
public addRowToData(rowData: any, _parentID?: any) {
// Add row goes to transactions and if rowEditable is properly implemented, added rows will go to pending transactions
// If there is a row in edit - > commit and close
const grid = this.grid;
const transactionId = grid.primaryKey ? rowData[grid.primaryKey] : rowData;
const rowId = grid.primaryKey ? rowData[grid.primaryKey] : rowData;
if (grid.transactions.enabled) {
const transaction: Transaction = { id: transactionId, type: TransactionType.ADD, newValue: rowData };
const transaction: Transaction = { id: rowId, type: TransactionType.ADD, newValue: rowData };
grid.transactions.add(transaction);
} else {
grid.data.push(rowData);
}
grid.validation.markAsTouched(transactionId);
grid.validation.update(transactionId, rowData);
grid.validation.markAsTouched(rowId);
grid.validation.update(rowId, rowData);
}

public deleteRowFromData(rowID: any, index: number) {
Expand Down Expand Up @@ -553,12 +553,12 @@ export class GridBaseAPIService<T extends GridType> implements GridServiceType {
* @param rowNewValue New value of the row
*/
protected updateData(grid, rowID, rowValueInDataSource: any, rowCurrentValue: any, rowNewValue: { [x: string]: any }) {
const transaction: Transaction = {
id: rowID,
type: TransactionType.UPDATE,
newValue: rowNewValue
};
if (grid.transactions.enabled) {
const transaction: Transaction = {
id: rowID,
type: TransactionType.UPDATE,
newValue: rowNewValue
};
grid.transactions.add(transaction, rowCurrentValue);
} else {
mergeObjects(rowValueInDataSource, rowNewValue);
Expand Down
142 changes: 100 additions & 42 deletions projects/igniteui-angular/src/lib/grids/cell.component.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
<ng-template #defaultPinnedIndicator>
<igx-chip *ngIf="displayPinnedChip" class="igx-grid__td--pinned-chip" [disabled]="true"
[displayDensity]="'compact'">{{ grid.resourceStrings.igx_grid_pinned_row_indicator }}</igx-chip>
<igx-chip
*ngIf="displayPinnedChip"
class="igx-grid__td--pinned-chip"
[disabled]="true"
[displayDensity]="'compact'"
>{{ grid.resourceStrings.igx_grid_pinned_row_indicator }}</igx-chip
>
</ng-template>
<ng-template #defaultCell>
<div *ngIf="column.dataType !== 'boolean' || (column.dataType === 'boolean' && this.formatter)" igxTextHighlight
class="igx-grid__td-text" style="pointer-events: none;" [cssClass]="highlightClass"
[activeCssClass]="activeHighlightClass" [groupName]="gridID" [value]="
<div *ngIf="column.dataType !== 'boolean' || (column.dataType === 'boolean' && this.formatter)"
igxTextHighlight
class="igx-grid__td-text"
style="pointer-events: none;"
[cssClass]="highlightClass"
[activeCssClass]="activeHighlightClass"
[groupName]="gridID"
[value]="
formatter
? (value | columnFormatter:formatter:rowData:columnData)
: column.dataType === 'number'
Expand All @@ -17,34 +27,47 @@
: column.dataType === 'percent'
? (value | percent:column.pipeArgs.digitsInfo:grid.locale)
: value
" [row]="rowData" [column]="this.column.field" [containerClass]="'igx-grid__td-text'"
[metadata]="searchMetadata">{{
formatter
? (value | columnFormatter:formatter:rowData:columnData)
: column.dataType === "number"
? (value | number:column.pipeArgs.digitsInfo:grid.locale)
: (column.dataType === 'date' || column.dataType === 'time' || column.dataType === 'dateTime')
? (value | date:column.pipeArgs.format:column.pipeArgs.timezone:grid.locale)
: column.dataType === 'currency'
? (value | currency:currencyCode:column.pipeArgs.display:column.pipeArgs.digitsInfo:grid.locale)
: column.dataType === 'percent'
? (value | percent:column.pipeArgs.digitsInfo:grid.locale)
: value
"
[row]="rowData"
[column]="this.column.field"
[containerClass]="'igx-grid__td-text'"
[metadata]="searchMetadata"
>{{
formatter
? (value | columnFormatter:formatter:rowData:columnData)
: column.dataType === "number"
? (value | number:column.pipeArgs.digitsInfo:grid.locale)
: (column.dataType === 'date' || column.dataType === 'time' || column.dataType === 'dateTime')
? (value | date:column.pipeArgs.format:column.pipeArgs.timezone:grid.locale)
: column.dataType === 'currency'
? (value | currency:currencyCode:column.pipeArgs.display:column.pipeArgs.digitsInfo:grid.locale)
: column.dataType === 'percent'
? (value | percent:column.pipeArgs.digitsInfo:grid.locale)
: value
}}</div>
<igx-icon *ngIf="column.dataType === 'boolean' && !this.formatter"
[ngClass]="{ 'igx-icon--success': value, 'igx-icon--error': !value }">{{ value ? "check" : "close" }}</igx-icon>
<igx-icon
*ngIf="column.dataType === 'boolean' && !this.formatter"
[ngClass]="{ 'igx-icon--success': value, 'igx-icon--error': !value }"
>{{ value ? "check" : "close" }}</igx-icon
>
</ng-template>
<ng-template #addRowCell let-cell="cell">
<div *ngIf="column.dataType !== 'boolean' || (column.dataType === 'boolean' && this.formatter)" igxTextHighlight
class="igx-grid__td-text" style="pointer-events: none" [cssClass]="highlightClass"
[activeCssClass]="activeHighlightClass" [groupName]="gridID" [value]="formatter ? (value | columnFormatter:formatter:rowData) : column.dataType === 'number' ?
<div *ngIf="column.dataType !== 'boolean' || (column.dataType === 'boolean' && this.formatter)"
igxTextHighlight class="igx-grid__td-text" style="pointer-events: none"
[cssClass]="highlightClass"
[activeCssClass]="activeHighlightClass"
[groupName]="gridID"
[value]="formatter ? (value | columnFormatter:formatter:rowData) : column.dataType === 'number' ?
(value | number:column.pipeArgs.digitsInfo:grid.locale) : (column.dataType === 'date' || column.dataType === 'time' || column.dataType === 'dateTime') ?
(value | date:column.pipeArgs.format:column.pipeArgs.timezone:grid.locale) : column.dataType === 'currency' ?
(value | currency:currencyCode:column.pipeArgs.display:column.pipeArgs.digitsInfo:grid.locale) : column.dataType === 'percent' ?
(value | percent:column.pipeArgs.digitsInfo:grid.locale) : value" [row]="rowData" [column]="this.column.field"
[containerClass]="'igx-grid__td-text'" [metadata]="searchMetadata">{{
(value | percent:column.pipeArgs.digitsInfo:grid.locale) : value"
[row]="rowData"
[column]="this.column.field"
[containerClass]="'igx-grid__td-text'"
[metadata]="searchMetadata">{{
!isEmptyAddRowCell ? value : (column.header || column.field)
}}</div>
}}</div>
</ng-template>
<ng-template #inlineEditor let-cell="cell">
<ng-container *ngIf="column.dataType === 'string'" [formGroup]="formGroup">
Expand All @@ -61,13 +84,23 @@
</ng-container>
<ng-container *ngIf="column.dataType === 'number'">
<igx-input-group displayDensity="compact" [formGroup]="formGroup">
<input igxInput [attr.aria-errormessage]="ariaErrorMessage" [igxFocus]="true" [step]="step" type="number"
[formControl]="formControl" />
<input
igxInput
[attr.aria-errormessage]="ariaErrorMessage"
[igxFocus]="true"
[step]="step"
type="number"
[formControl]="formControl"
/>
</igx-input-group>
</ng-container>
<ng-container *ngIf="column.dataType === 'boolean'" [formGroup]="formGroup">
<igx-checkbox [checked]="editValue" (change)="editValue = $event.checked" [igxFocus]="true"
[disableRipple]="true" [formControl]="formControl"></igx-checkbox>
<igx-checkbox
[checked]="editValue"
[igxFocus]="true"
[disableRipple]="true"
[formControl]="formControl"
></igx-checkbox>
</ng-container>
<ng-container *ngIf="column.dataType === 'date'" [formGroup]="formGroup">
<igx-date-picker
Expand All @@ -83,40 +116,65 @@
</igx-date-picker>
</ng-container>
<ng-container *ngIf="column.dataType === 'time'" [formGroup]="formGroup">
<igx-time-picker [style.width.%]="100" [outlet]="grid.outlet" mode="dropdown" [locale]="grid.locale"
[inputFormat]="column.defaultTimeFormat" [(value)]="editValue" [igxFocus]="true"
[formControl]="formControl">
</igx-time-picker>
<igx-time-picker
[style.width.%]="100"
[outlet]="grid.outlet"
mode="dropdown"
[locale]="grid.locale"
[inputFormat]="column.defaultTimeFormat"
[(value)]="editValue"
[igxFocus]="true"
[formControl]="formControl"
></igx-time-picker>
</ng-container>
<ng-container *ngIf="column.dataType === 'dateTime'">
<igx-input-group [formGroup]="formGroup">
<input type="text" [attr.aria-errormessage]="ariaErrorMessage" [formControl]="formControl" igxInput
[igxDateTimeEditor]="column.defaultDateTimeFormat" [igxFocus]="true" />
<input
type="text"
[attr.aria-errormessage]="ariaErrorMessage"
[formControl]="formControl"
igxInput
[igxDateTimeEditor]="column.defaultDateTimeFormat"
[igxFocus]="true"
/>
</igx-input-group>
</ng-container>
<ng-container *ngIf="column.dataType === 'currency'">
<igx-input-group displayDensity="compact" [formGroup]="formGroup">
<igx-prefix *ngIf="grid.currencyPositionLeft">{{ currencyCodeSymbol }}</igx-prefix>
<input igxInput [attr.aria-errormessage]="ariaErrorMessage" [igxFocus]="true" [step]="step" type="number"
[formControl]="formControl" />
<input
igxInput
[attr.aria-errormessage]="ariaErrorMessage"
[igxFocus]="true"
[step]="step"
type="number"
[formControl]="formControl"
/>
<igx-suffix *ngIf="!grid.currencyPositionLeft">{{ currencyCodeSymbol }}</igx-suffix>
</igx-input-group>
</ng-container>
<ng-container *ngIf="column.dataType === 'percent'">
<igx-input-group displayDensity="compact" [formGroup]="formGroup">
<input igxInput [attr.aria-errormessage]="ariaErrorMessage" [igxFocus]="true" [step]="step" type="number"
[formControl]="formControl" />
<input
igxInput
[attr.aria-errormessage]="ariaErrorMessage"
[igxFocus]="true"
[step]="step"
type="number"
[formControl]="formControl"
/>
<igx-suffix> {{ editValue | percent:column.pipeArgs.digitsInfo:grid.locale }} </igx-suffix>
</igx-input-group>
</ng-container>
</ng-template>
<ng-container *ngTemplateOutlet="pinnedIndicatorTemplate; context: context">
</ng-container>
<ng-container *ngTemplateOutlet="template; context: context"></ng-container>

<ng-container *ngIf="isInvalid">
<igx-icon #errorIcon [igxTooltipTarget]="tooltipRef"
(mouseover)='errorShowing = true' (mouseout)='errorShowing = false'>error</igx-icon>
<div [id]="describeBy"
<div [id]="ariaErrorMessage"
igxTooltip #error #tooltipRef="tooltip">
<div [style.width]="'max-content'">
<ng-container *ngTemplateOutlet="cellValidationErrorTemplate || defaultError; context: context"></ng-container>
Expand Down Expand Up @@ -146,4 +204,4 @@
<div *ngIf="formGroup?.get(column?.field).errors?.['pattern']">
{{grid.resourceStrings.igx_grid_pattern_validation_error}}
</div>
</ng-template>
</ng-template>
Loading