Commit 8b42a89c authored by StyleZhang's avatar StyleZhang

Merge branch 'fix/application-configuration-preview-style' into deploy/dev

parents 4b45a5f1 88ebbe18
...@@ -122,6 +122,7 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({ ...@@ -122,6 +122,7 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
items={(options || []).map(i => ({ name: i, value: i }))} items={(options || []).map(i => ({ name: i, value: i }))}
allowSearch={false} allowSearch={false}
bgClassName='bg-gray-50' bgClassName='bg-gray-50'
overlayClassName='z-[11]'
/> />
) )
: ( : (
......
...@@ -31,6 +31,7 @@ export type ISelectProps = { ...@@ -31,6 +31,7 @@ export type ISelectProps = {
allowSearch?: boolean allowSearch?: boolean
bgClassName?: string bgClassName?: string
placeholder?: string placeholder?: string
overlayClassName?: string
} }
const Select: FC<ISelectProps> = ({ const Select: FC<ISelectProps> = ({
className, className,
...@@ -40,6 +41,7 @@ const Select: FC<ISelectProps> = ({ ...@@ -40,6 +41,7 @@ const Select: FC<ISelectProps> = ({
onSelect, onSelect,
allowSearch = true, allowSearch = true,
bgClassName = 'bg-gray-100', bgClassName = 'bg-gray-100',
overlayClassName,
}) => { }) => {
const [query, setQuery] = useState('') const [query, setQuery] = useState('')
const [open, setOpen] = useState(false) const [open, setOpen] = useState(false)
...@@ -48,9 +50,9 @@ const Select: FC<ISelectProps> = ({ ...@@ -48,9 +50,9 @@ const Select: FC<ISelectProps> = ({
useEffect(() => { useEffect(() => {
let defaultSelect = null let defaultSelect = null
const existed = items.find((item: Item) => item.value === defaultValue) const existed = items.find((item: Item) => item.value === defaultValue)
if (existed) { if (existed)
defaultSelect = existed defaultSelect = existed
}
setSelectedItem(defaultSelect) setSelectedItem(defaultSelect)
}, [defaultValue]) }, [defaultValue])
...@@ -104,7 +106,7 @@ const Select: FC<ISelectProps> = ({ ...@@ -104,7 +106,7 @@ const Select: FC<ISelectProps> = ({
</div> </div>
{filteredItems.length > 0 && ( {filteredItems.length > 0 && (
<Combobox.Options className="absolute z-10 mt-1 px-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg border-gray-200 border-[0.5px] focus:outline-none sm:text-sm"> <Combobox.Options className={`absolute z-10 mt-1 px-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg border-gray-200 border-[0.5px] focus:outline-none sm:text-sm ${overlayClassName}`}>
{filteredItems.map((item: Item) => ( {filteredItems.map((item: Item) => (
<Combobox.Option <Combobox.Option
key={item.value} key={item.value}
...@@ -155,9 +157,9 @@ const SimpleSelect: FC<ISelectProps> = ({ ...@@ -155,9 +157,9 @@ const SimpleSelect: FC<ISelectProps> = ({
useEffect(() => { useEffect(() => {
let defaultSelect = null let defaultSelect = null
const existed = items.find((item: Item) => item.value === defaultValue) const existed = items.find((item: Item) => item.value === defaultValue)
if (existed) { if (existed)
defaultSelect = existed defaultSelect = existed
}
setSelectedItem(defaultSelect) setSelectedItem(defaultSelect)
}, [defaultValue]) }, [defaultValue])
...@@ -173,7 +175,7 @@ const SimpleSelect: FC<ISelectProps> = ({ ...@@ -173,7 +175,7 @@ const SimpleSelect: FC<ISelectProps> = ({
> >
<div className={`relative h-9 ${wrapperClassName}`}> <div className={`relative h-9 ${wrapperClassName}`}>
<Listbox.Button className={`w-full h-full rounded-lg border-0 bg-gray-100 py-1.5 pl-3 pr-10 shadow-sm sm:text-sm sm:leading-6 focus-visible:outline-none focus-visible:bg-gray-200 group-hover:bg-gray-200 cursor-pointer ${className}`}> <Listbox.Button className={`w-full h-full rounded-lg border-0 bg-gray-100 py-1.5 pl-3 pr-10 shadow-sm sm:text-sm sm:leading-6 focus-visible:outline-none focus-visible:bg-gray-200 group-hover:bg-gray-200 cursor-pointer ${className}`}>
<span className={classNames("block truncate text-left", !selectedItem?.name && 'text-gray-400')}>{selectedItem?.name ?? localPlaceholder}</span> <span className={classNames('block truncate text-left', !selectedItem?.name && 'text-gray-400')}>{selectedItem?.name ?? localPlaceholder}</span>
<span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2"> <span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
<ChevronDownIcon <ChevronDownIcon
className="h-5 w-5 text-gray-400" className="h-5 w-5 text-gray-400"
......
...@@ -86,7 +86,7 @@ const translation = { ...@@ -86,7 +86,7 @@ const translation = {
}, },
errorMessage: { errorMessage: {
nameOfKeyRequired: '变量 {{key}} 对应的名称必填', nameOfKeyRequired: '变量 {{key}} 对应的名称必填',
valueOfVarRequired: '变量值必填', valueOfVarRequired: '真实的变量名必填',
queryRequired: '主要文本必填', queryRequired: '主要文本必填',
waitForResponse: '请等待上条信息响应完成', waitForResponse: '请等待上条信息响应完成',
waitForBatchResponse: '请等待批量任务完成', waitForBatchResponse: '请等待批量任务完成',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment