fix: add description prop to Field component and pass filter prop in TableUI and TableList components
This commit is contained in:
parent
566ab6c206
commit
8a911a9115
|
|
@ -69,6 +69,7 @@ export interface FieldProps {
|
|||
visibleLabel?: boolean;
|
||||
autoRefresh?: boolean;
|
||||
forceDisabled?: boolean;
|
||||
description?: string;
|
||||
}
|
||||
export const Field: React.FC<FieldProps> = ({
|
||||
fm,
|
||||
|
|
@ -101,6 +102,7 @@ export const Field: React.FC<FieldProps> = ({
|
|||
search = "api",
|
||||
autoRefresh = false,
|
||||
forceDisabled,
|
||||
description,
|
||||
}) => {
|
||||
let result = null;
|
||||
const field = useLocal({
|
||||
|
|
@ -513,7 +515,11 @@ export const Field: React.FC<FieldProps> = ({
|
|||
)}
|
||||
</div>
|
||||
</TooltipBetter>
|
||||
|
||||
{description ? (
|
||||
<div className="text-xs text-gray-500 py-1">{description}</div>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
{error ? (
|
||||
<div className="text-sm text-red-500 py-1">{error}</div>
|
||||
) : (
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ export const TableList = <T extends object>({
|
|||
onChange,
|
||||
filter = true,
|
||||
}: TableListProps<T>) => {
|
||||
console.log({ filter });
|
||||
const [show, setShow] = useState(false as boolean);
|
||||
const [data, setData] = useState<any[]>([]);
|
||||
const sideLeft =
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ export const TableUI = <T extends object>({
|
|||
breadcrumb,
|
||||
title,
|
||||
ready = true,
|
||||
filter = true,
|
||||
}: TableUIProps<T>) => {
|
||||
const local = useLocal({
|
||||
tab: get(tab, "[0].id"),
|
||||
|
|
@ -142,6 +143,7 @@ export const TableUI = <T extends object>({
|
|||
<div className="w-full flex flex-row flex-grow overflow-hidden ">
|
||||
{local.show ? (
|
||||
<TableList
|
||||
filter={filter}
|
||||
name={name}
|
||||
header={header}
|
||||
column={column}
|
||||
|
|
|
|||
Loading…
Reference in New Issue