Skip to content

Commit

Permalink
feat: add Textarea field (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
moonRider authored Jul 23, 2024
1 parent 834b468 commit 8e1ec3e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json",
"name": "@byzanteam/taihaku-schemas",
"version": "0.3.2",
"version": "0.3.3",
"exports": "./types/mod.ts",
"compilerOptions": {
"strict": true,
Expand Down
1 change: 1 addition & 0 deletions types/ui_schema/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum FieldType {
RadioButton = 'RadioButton',
Signature = 'Signature',
SingleLine = 'SingleLine',
Textarea = 'Textarea',
}

interface EnumSettings {
Expand Down
5 changes: 5 additions & 0 deletions types/ui_schema/form/example/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const PersonFormUISchema: UISchema<{
tags: Array<{
title: string
}>
maxim: string
}> = {
'ui:rootFieldId': 'PersonForm',
'ui:submitButtonOptions': {
Expand Down Expand Up @@ -64,6 +65,10 @@ const PersonFormUISchema: UISchema<{
},
},
},
maxim: {
'ui:widget': 'TextareaWidget',
'ui:placeholder': '请输入',
},
}

export default PersonFormUISchema
1 change: 1 addition & 0 deletions types/ui_schema/form/ui_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ export type CustomFieldUIOptionsMap = {
[FieldType.RadioButton]: RadioButtonFieldUIOptions
[FieldType.Signature]: SignatureFieldUIOptions
[FieldType.SingleLine]: SingleLineFieldUIOptions
[FieldType.Textarea]: CommonCustomFieldUIOptions
}
6 changes: 6 additions & 0 deletions types/ui_schema/table/example/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const moviesTableSchema: TableSchema<{
duration: string
rating: string
score: number
description: string
}> = {
id: 'movie_list_schema',
columns: {
Expand Down Expand Up @@ -54,6 +55,11 @@ const moviesTableSchema: TableSchema<{
name: 'score',
label: '评分',
},
description: {
name: 'description',
fieldType: 'TextareaField',
label: '介绍',
},
},
uiSchema: {
'ui:column-order': ['title', 'rating', 'score', 'duration', 'releaseYear'],
Expand Down
1 change: 1 addition & 0 deletions types/ui_schema/table/ui_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export type CustomColumnUIOptionsMap = {
[FieldType.RadioButton]: CommonCustomFieldUIOptions
[FieldType.Signature]: CommonCustomFieldUIOptions
[FieldType.SingleLine]: SingleLineFieldUIOptions
[FieldType.Textarea]: CommonCustomFieldUIOptions
}

0 comments on commit 8e1ec3e

Please sign in to comment.