From d361675159cc38535bf48f823580ce6a77e947fb Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 1 Aug 2024 17:54:33 +0800 Subject: [PATCH] chore: some select style --- web/app/components/base/select/index.tsx | 4 +-- .../components/filter-condition.tsx | 15 ++++++--- .../components/sub-variable-picker.tsx | 12 +++++-- .../workflow/nodes/list-filter/panel.tsx | 9 ++++-- .../workflow/nodes/list-filter/use-config.ts | 32 ++++++++++++++++++- 5 files changed, 60 insertions(+), 12 deletions(-) diff --git a/web/app/components/base/select/index.tsx b/web/app/components/base/select/index.tsx index fbfe742061..fb5c2a4bcf 100644 --- a/web/app/components/base/select/index.tsx +++ b/web/app/components/base/select/index.tsx @@ -108,7 +108,7 @@ const Select: FC = ({ if (!disabled) setOpen(!open) } - } className={classNames(optionClassName, `flex items-center h-9 w-full rounded-lg border-0 ${bgClassName} 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`)}> + } className={classNames(`flex items-center h-9 w-full rounded-lg border-0 ${bgClassName} 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`, optionClassName)}>
{selectedItem?.name}
} = ({ }} >
- + {selectedItem?.name ?? localPlaceholder} {selectedItem diff --git a/web/app/components/workflow/nodes/list-filter/components/filter-condition.tsx b/web/app/components/workflow/nodes/list-filter/components/filter-condition.tsx index 876a100f9f..3543cef7a1 100644 --- a/web/app/components/workflow/nodes/list-filter/components/filter-condition.tsx +++ b/web/app/components/workflow/nodes/list-filter/components/filter-condition.tsx @@ -5,19 +5,26 @@ import SubVariablePicker from './sub-variable-picker' import { SimpleSelect as Select } from '@/app/components/base/select' import Input from '@/app/components/base/input' -const FilterCondition: FC = () => { +type Props = { + hasSubVariable: boolean +} + +const FilterCondition: FC = ({ + hasSubVariable, +}) => { return (
- -
+ {hasSubVariable && } +
+
) diff --git a/web/app/components/workflow/nodes/list-filter/components/sub-variable-picker.tsx b/web/app/components/workflow/nodes/list-filter/components/sub-variable-picker.tsx index 3ce4bb6996..4714ec73e5 100644 --- a/web/app/components/workflow/nodes/list-filter/components/sub-variable-picker.tsx +++ b/web/app/components/workflow/nodes/list-filter/components/sub-variable-picker.tsx @@ -3,8 +3,15 @@ import type { FC } from 'react' import React from 'react' import { SimpleSelect as Select } from '@/app/components/base/select' import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development' +import cn from '@/utils/classnames' -const SubVariablePicker: FC = () => { +type Props = { + className?: string +} + +const SubVariablePicker: FC = ({ + className, +}) => { const renderOption = ({ item }: { item: Record }) => { return (
@@ -17,7 +24,7 @@ const SubVariablePicker: FC = () => { ) } return ( -
+