-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6433 from ever-co/develop
Release
- Loading branch information
Showing
38 changed files
with
1,128 additions
and
571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
apps/gauzy/src/app/@shared/table-components/editors/number-editor.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; | ||
import { Cell, DefaultEditor } from 'ng2-smart-table'; | ||
|
||
@Component({ | ||
template: `<input | ||
class="form-control" | ||
[min]="0" | ||
[type]="'number'" | ||
[(ngModel)]="cell.newValue" | ||
[name]="cell.getId()" | ||
>`, | ||
}) | ||
export class NumberEditorComponent extends DefaultEditor implements OnInit { | ||
|
||
@Input() cell!: Cell; | ||
@Output() onConfirm: EventEmitter<number> = new EventEmitter<number>(); | ||
|
||
constructor() { | ||
super(); | ||
} | ||
|
||
ngOnInit() { | ||
if (this.cell.newValue) { | ||
this.cell.newValue = +this.cell.newValue; // Convert the input to a number | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.