88try :
99 from pydantic import SerializeAsAny
1010except ImportError :
11- from typing import Optional as SerializeAsAny
11+ from typing import Union as SerializeAsAny
1212from .constants import (
1313 BarcodeEnum ,
1414 DisplayModeEnum ,
@@ -356,8 +356,8 @@ class Toast(Action):
356356 """Toast light"""
357357
358358 class ToastItem (AmisNode ):
359- title : SerializeAsAny [Union [ str , SchemaNode ] ] = None # Toast Item Title
360- body : SerializeAsAny [Union [ str , SchemaNode ] ] = None # Toast Item Content
359+ title : SerializeAsAny [SchemaNode ] = None # Toast Item Title
360+ body : SerializeAsAny [SchemaNode ] = None # Toast Item Content
361361 level : str = None # default 'info', Display icon, optional 'info', 'success', 'error', 'warning'
362362 position : str = None # default 'top-center', display position,
363363 # 'top-right', 'top-center', 'top-left', 'bottom-center', 'bottom-left', 'bottom-right', 'center'
@@ -1184,8 +1184,8 @@ class CollapseItem(AmisNode):
11841184 disabled : bool = None # default False
11851185 collapsed : bool = None # default True
11861186 key : Union [int , str ] = None # default -, logo
1187- header : SerializeAsAny [Union [ str , SchemaNode ] ] = None # default -, title
1188- body : SerializeAsAny [Union [ str , SchemaNode ] ] = None # default -, content
1187+ header : SerializeAsAny [SchemaNode ] = None # default -, title
1188+ body : SerializeAsAny [SchemaNode ] = None # default -, content
11891189
11901190 type : str = "collapse-group"
11911191 activeKey : Union [str , int , List [Union [int , str ]]] = None # Initialize the key to activate the panel
@@ -1371,7 +1371,7 @@ class Limit(BaseAmisModel):
13711371 autoFill : Dict [str , str ] = None # After the upload is successful, the value returned by the upload interface can
13721372 # be filled into a form item by configuring autoFill (not supported under non-form)
13731373 initAutoFill : bool = None # False # 表单反显时是否执行 autoFill
1374- uploadBtnText : SerializeAsAny [Union [ str , SchemaNode ] ] = None # 上传按钮文案。支持tpl、schema形式配置。
1374+ uploadBtnText : SerializeAsAny [SchemaNode ] = None # 上传按钮文案。支持tpl、schema形式配置。
13751375 dropCrop : bool = None # True # 图片上传后是否进入裁剪模式
13761376 initCrop : bool = None # False # 图片选择器初始化后是否立即进入裁剪模式
13771377
@@ -1416,7 +1416,7 @@ class Picker(FormItem):
14161416 extractValue : bool = None # False # extract value
14171417 autoFill : dict = None # autofill
14181418 modalMode : Literal ["dialog" , "drawer" ] = None # "dialog" # Set dialog or drawer to configure the popup mode.
1419- pickerSchema : SerializeAsAny [Union ["CRUD" , SchemaNode ]] = None # "{mode: 'list', listItem: {title: '${label}'}}"
1419+ pickerSchema : SerializeAsAny [Union [SchemaNode , "CRUD" ]] = None # "{mode: 'list', listItem: {title: '${label}'}}"
14201420 # That is to use the rendering of the List type to display the list information. More configuration reference CRUD
14211421 embed : bool = None # False # whether to use embedded mode
14221422
@@ -1543,7 +1543,7 @@ class Timeline(AmisNode):
15431543
15441544 class TimelineItem (AmisNode ):
15451545 time : str # Node Time
1546- title : Union [ str , SchemaNode ] = None # Node Title
1546+ title : SchemaNode = None # Node Title
15471547 detail : str = None # Node detailed description (collapsed)
15481548 detailCollapsedText : str = None # default 'Expand'
15491549 detailExpandedText : str = None # default 'Collapse'
@@ -1563,9 +1563,9 @@ class Steps(AmisNode):
15631563 """Steps Bar"""
15641564
15651565 class StepItem (AmisNode ):
1566- title : SerializeAsAny [Union [ str , SchemaNode ] ] = None # Title
1567- subTitle : SerializeAsAny [Union [ str , SchemaNode ] ] = None # Sub Heading
1568- description : SerializeAsAny [Union [ str , SchemaNode ] ] = None # Detail Description
1566+ title : SerializeAsAny [SchemaNode ] = None # Title
1567+ subTitle : SerializeAsAny [SchemaNode ] = None # Sub Heading
1568+ description : SerializeAsAny [SchemaNode ] = None # Detail Description
15691569 value : str = None # Step Value
15701570 icon : str = None # Icon name, support fontawesome v4 or use url (priority is higher than color)
15711571 className : str = None # Custom CSS class name
@@ -1970,8 +1970,8 @@ class InputKVS(FormItem):
19701970 type : str = "input-kvs"
19711971 addButtonText : str = None # default 'new field', butto text of the add button
19721972 draggable : bool = None # Default True, Whether to drag and drop to sort is allowed
1973- keyItem : SerializeAsAny [Union [ str , SchemaNode ] ] = None # key field
1974- valueItems : SerializeAsAny [List [Union [ str , SchemaNode ] ]] = None # items for the key
1973+ keyItem : SerializeAsAny [SchemaNode ] = None # key field
1974+ valueItems : SerializeAsAny [List [SchemaNode ]] = None # items for the key
19751975
19761976
19771977class InputTimeRange (FormItem ):
0 commit comments