-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
776 additions
and
768 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
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
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
5 changes: 3 additions & 2 deletions
5
client/src/app/forms/config/types/submit-button/submit-button.type.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
22 changes: 22 additions & 0 deletions
22
client/src/app/forms/config/types/tag-input/tag-input.module.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,22 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { TagInputType, TagInputTypeOption } from './tag-input.type'; | ||
import { ReactiveFormsModule } from '@angular/forms'; | ||
import { FormlyModule } from '@ngx-formly/core'; | ||
import { ReactiveComponentModule } from '@ngrx/component'; | ||
import { NzTagModule } from 'ng-zorro-antd/tag'; | ||
import { NzInputModule } from 'ng-zorro-antd/input'; | ||
|
||
// MultiFieldTypeOption, | ||
@NgModule({ | ||
declarations: [TagInputType], | ||
imports: [ | ||
CommonModule, | ||
ReactiveFormsModule, | ||
ReactiveComponentModule, | ||
FormlyModule.forChild({ types: [TagInputTypeOption] }), | ||
NzTagModule, | ||
NzInputModule | ||
] | ||
}) | ||
export class CvcTagInputTypeModule { } |
9 changes: 9 additions & 0 deletions
9
client/src/app/forms/config/types/tag-input/tag-input.type.html
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,9 @@ | ||
<ng-container *ngIf="!formControl.value; else tagItem"> | ||
<input nz-input | ||
[formControl]="formControl" | ||
[formlyAttributes]="field" | ||
(keydown.enter)="onEnter($event)"/> | ||
</ng-container> | ||
<ng-template #tagItem> | ||
<nz-tag>{{formControl.value}}</nz-tag> | ||
</ng-template> |
Empty file.
41 changes: 41 additions & 0 deletions
41
client/src/app/forms/config/types/tag-input/tag-input.type.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,41 @@ | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
} from '@angular/core'; | ||
import { FormControl } from '@angular/forms'; | ||
import { FieldType } from '@ngx-formly/core'; | ||
import { TypeOption } from "@ngx-formly/core/lib/services/formly.config"; | ||
|
||
@Component({ | ||
selector: 'cvc-tag-input-type', | ||
templateUrl: './tag-input.type.html', | ||
styleUrls: ['./tag-input.type.less'], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class TagInputType extends FieldType { | ||
formControl!: FormControl; | ||
|
||
constructor() { | ||
super(); | ||
this.defaultOptions = { | ||
templateOptions: { | ||
placeholder: 'Enter value', | ||
}, | ||
modelOptions: { | ||
updateOn: 'blur' | ||
} | ||
}; | ||
} | ||
|
||
onEnter(e: any): void { | ||
const input = e.target as HTMLInputElement; | ||
this.formControl.setValue(input.value); | ||
} | ||
|
||
} | ||
|
||
|
||
export const TagInputTypeOption: TypeOption = { | ||
name: 'tag-input', | ||
component: TagInputType, | ||
}; |
6 changes: 4 additions & 2 deletions
6
client/src/app/forms/config/types/textarea-base/textarea-base.type.html
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,4 +1,6 @@ | ||
<textarea nz-input | ||
[nzAutosize]="to.autosize" | ||
[formControl]="formControl" | ||
[formlyAttributes]="field"></textarea> | ||
[formlyAttributes]="field" | ||
[nzAutosize]="to.autosize" | ||
[placeholder]="to.placeholder"> | ||
</textarea> |
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.