|
|
|
@ -1,4 +1,4 @@
|
|
|
|
import React, { useEffect, useRef } from "react";
|
|
|
|
import React, { useEffect } from "react";
|
|
|
|
import { Collapse, Empty, Table as AntdTable } from "antd";
|
|
|
|
import { Collapse, Empty, Table as AntdTable } from "antd";
|
|
|
|
import "./Table.css";
|
|
|
|
import "./Table.css";
|
|
|
|
import parse from "wellknown";
|
|
|
|
import parse from "wellknown";
|
|
|
|
@ -7,6 +7,7 @@ import { useClickedPointConfig } from "../../stores/useClickedPointConfig";
|
|
|
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
|
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
import { HeaderWrapper } from "./HeaderWrapper";
|
|
|
|
import { HeaderWrapper } from "./HeaderWrapper";
|
|
|
|
|
|
|
|
import { useTable } from "../../stores/useTable";
|
|
|
|
|
|
|
|
|
|
|
|
export const Table = React.memo(
|
|
|
|
export const Table = React.memo(
|
|
|
|
({
|
|
|
|
({
|
|
|
|
@ -20,10 +21,11 @@ export const Table = React.memo(
|
|
|
|
columns,
|
|
|
|
columns,
|
|
|
|
header,
|
|
|
|
header,
|
|
|
|
fullWidth,
|
|
|
|
fullWidth,
|
|
|
|
|
|
|
|
loading,
|
|
|
|
}) => {
|
|
|
|
}) => {
|
|
|
|
const { clickedPointConfig } = useClickedPointConfig();
|
|
|
|
const { clickedPointConfig } = useClickedPointConfig();
|
|
|
|
const { map } = useMap();
|
|
|
|
const { map } = useMap();
|
|
|
|
const tableRef = useRef(null);
|
|
|
|
const { isOpened, setIsOpened } = useTable();
|
|
|
|
|
|
|
|
|
|
|
|
const SCROLL = {
|
|
|
|
const SCROLL = {
|
|
|
|
y: `${height}px`,
|
|
|
|
y: `${height}px`,
|
|
|
|
@ -40,11 +42,16 @@ export const Table = React.memo(
|
|
|
|
}, [clickedPointConfig, data]);
|
|
|
|
}, [clickedPointConfig, data]);
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Collapse>
|
|
|
|
<Collapse
|
|
|
|
<Collapse.Panel key="1" header={header ? header : <HeaderWrapper />}>
|
|
|
|
bordered={false}
|
|
|
|
|
|
|
|
onChange={setIsOpened}
|
|
|
|
|
|
|
|
defaultActiveKey={isOpened ? "opened" : null}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<Collapse.Panel
|
|
|
|
|
|
|
|
key={"opened"}
|
|
|
|
|
|
|
|
header={header ? header : <HeaderWrapper />}
|
|
|
|
|
|
|
|
>
|
|
|
|
<AntdTable
|
|
|
|
<AntdTable
|
|
|
|
ref={tableRef}
|
|
|
|
|
|
|
|
// className="max-w-full"
|
|
|
|
|
|
|
|
size="small"
|
|
|
|
size="small"
|
|
|
|
locale={{ emptyText: <Empty description="Нет данных" /> }}
|
|
|
|
locale={{ emptyText: <Empty description="Нет данных" /> }}
|
|
|
|
pagination={{
|
|
|
|
pagination={{
|
|
|
|
@ -80,6 +87,7 @@ export const Table = React.memo(
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
data-fullwidth={fullWidth}
|
|
|
|
data-fullwidth={fullWidth}
|
|
|
|
|
|
|
|
loading={loading}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</Collapse.Panel>
|
|
|
|
</Collapse.Panel>
|
|
|
|
</Collapse>
|
|
|
|
</Collapse>
|
|
|
|
|