-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin' into w/#WIK-16218
- Loading branch information
Showing
39 changed files
with
597 additions
and
167 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,12 @@ | |
height: 100%; | ||
} | ||
} | ||
|
||
.text-cell-editor { | ||
display: block; | ||
|
||
textarea { | ||
min-height: 44px; | ||
resize: none; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/grid/src/components/cell-editors/progress/progress-editor.component.scss
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,21 @@ | ||
@use 'ngx-tethys/styles/variables.scss'; | ||
|
||
.progress-editor { | ||
display: flex; | ||
align-items: center; | ||
height: 100%; | ||
padding: 0 12px; | ||
|
||
.thy-slider { | ||
flex: 1; | ||
padding: 2px 0; | ||
} | ||
.progress-text { | ||
display: inline-block; | ||
margin-left: 8px; | ||
width: 40px; | ||
white-space: nowrap; | ||
font-size: 0.875rem; | ||
flex-shrink: 0; | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
packages/grid/src/components/cell-editors/progress/progress-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,58 @@ | ||
import { ChangeDetectionStrategy, Component, HostListener, OnInit } from '@angular/core'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { ThySlider, ThySliderSize, ThySliderType } from 'ngx-tethys/slider'; | ||
import { AbstractEditCellEditor } from '../abstract-cell-editor.component'; | ||
|
||
export interface AITableProgressConfig { | ||
max?: number; | ||
min?: number; | ||
step?: number; | ||
progressType?: ThySliderType; | ||
suffix?: string; | ||
size?: ThySliderSize; | ||
} | ||
|
||
@Component({ | ||
selector: 'progress-editor', | ||
template: ` | ||
<thy-slider | ||
[(ngModel)]="modelValue" | ||
[thyMax]="config?.max || 100" | ||
[thyMin]="config?.min || 0" | ||
[thyStep]="config?.step || 1" | ||
[thyType]="config?.progressType || 'success'" | ||
[thySize]="config?.size || 'md'" | ||
(ngModelChange)="updateValue($event)" | ||
></thy-slider> | ||
<span class="progress-text">{{ modelValue }}{{ config?.suffix || '%' }}</span> | ||
`, | ||
standalone: true, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
imports: [FormsModule, ThySlider], | ||
host: { | ||
class: 'progress-editor' | ||
} | ||
}) | ||
export class ProgressEditorComponent extends AbstractEditCellEditor<number> implements OnInit { | ||
config: Partial<AITableProgressConfig | undefined> = { | ||
max: 100, | ||
min: 0, | ||
step: 1, | ||
progressType: 'success', | ||
suffix: '%', | ||
size: 'md' | ||
}; | ||
|
||
@HostListener('mousedown', ['$event']) | ||
mousedownHandler(event: Event) { | ||
event.preventDefault(); | ||
} | ||
|
||
constructor() { | ||
super(); | ||
} | ||
|
||
updateValue(value: number) { | ||
this.updateFieldValue(); | ||
} | ||
} |
5 changes: 2 additions & 3 deletions
5
packages/grid/src/components/cell-editors/rating/rating-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
58 changes: 47 additions & 11 deletions
58
packages/grid/src/components/cell-editors/text/text-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
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
export * from './field-property-editor/field-property-editor.component' | ||
export * from './cell-editors/date-time/date-time-editor.component'; | ||
export * from './cell-editors/link/number-editor.component'; | ||
export * from './cell-editors/number/number-editor.component'; | ||
export * from './cell-editors/progress/progress-editor.component'; | ||
export * from './cell-editors/rating/rating-editor.component'; | ||
export * from './cell-editors/text/text-editor.component'; | ||
export * from './field-property-editor/field-property-editor.component'; |
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 |
---|---|---|
@@ -1,16 +1,22 @@ | ||
import { AITableFieldType } from '../core'; | ||
import { TextCellEditorComponent } from '../components/cell-editors/text/text-editor.component'; | ||
import { NumberCellEditorComponent } from '../components/cell-editors/number/number-editor.component'; | ||
import { DateTimeCellEditorComponent } from '../components/cell-editors/date-time/date-time-editor.component'; | ||
import { RatingCellEditorComponent } from '../components/cell-editors/rating/rating-editor.component'; | ||
import { LinkCellEditorComponent } from '../components/cell-editors/link/number-editor.component'; | ||
import { | ||
DateTimeCellEditorComponent, | ||
LinkCellEditorComponent, | ||
NumberCellEditorComponent, | ||
ProgressEditorComponent, | ||
RatingCellEditorComponent, | ||
TextCellEditorComponent | ||
} from '../components'; | ||
import { SelectCellEditorComponent } from '../components/cell-editors/select/select-editor.component'; | ||
import { AITableFieldType } from '../core'; | ||
|
||
export const GRID_CELL_EDITOR_MAP: Partial<Record<AITableFieldType, any>> = { | ||
export const GRID_CELL_EDITOR_MAP: Record<AITableFieldType, any> = { | ||
[AITableFieldType.text]: TextCellEditorComponent, | ||
[AITableFieldType.richText]: TextCellEditorComponent, | ||
[AITableFieldType.select]: SelectCellEditorComponent, | ||
[AITableFieldType.number]: NumberCellEditorComponent, | ||
[AITableFieldType.member]: null, | ||
[AITableFieldType.date]: DateTimeCellEditorComponent, | ||
[AITableFieldType.rate]: RatingCellEditorComponent, | ||
[AITableFieldType.link]: LinkCellEditorComponent | ||
[AITableFieldType.link]: LinkCellEditorComponent, | ||
[AITableFieldType.progress]: ProgressEditorComponent | ||
}; |
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
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
Oops, something went wrong.