chore: moving reusable components from src/components to packages/superset-ui-core/src/components (#33593)

This commit is contained in:
Maxime Beauchemin
2025-05-31 15:40:05 -07:00
committed by GitHub
parent 58435e3e28
commit 28db9ad7fc
928 changed files with 3421 additions and 3013 deletions

View File

@@ -37,7 +37,6 @@
},
"peerDependencies": {
"@ant-design/icons": "^5.2.6",
"antd": "^5.24.6",
"@superset-ui/chart-controls": "*",
"@superset-ui/core": "*",
"@testing-library/dom": "^8.20.1",

View File

@@ -42,7 +42,7 @@ import {
} from 'react-table';
import { matchSorter, rankings } from 'match-sorter';
import { isEqual } from 'lodash';
import { Space } from 'antd';
import { Space } from '@superset-ui/core/components';
import GlobalFilter, { GlobalFilterProps } from './components/GlobalFilter';
import SelectPageSize, {
SelectPageSizeProps,

View File

@@ -25,7 +25,7 @@ import {
Ref,
} from 'react';
import { Row, FilterValue } from 'react-table';
import { Input, type InputRef, Space } from 'antd';
import { Input, type InputRef, Space } from '@superset-ui/core/components';
import useAsyncState from '../utils/useAsyncState';
export interface SearchInputProps {

View File

@@ -18,10 +18,10 @@
*/
/* eslint-disable import/no-extraneous-dependencies */
import { styled } from '@superset-ui/core';
import { Select } from 'antd';
import { RawAntdSelect } from '@superset-ui/core/components';
import { SearchOption } from '../../types';
const StyledSelect = styled(Select)`
const StyledSelect = styled(RawAntdSelect)`
width: 120px;
margin-right: 8px;
`;

View File

@@ -19,7 +19,7 @@
import { memo } from 'react';
import { css, t } from '@superset-ui/core';
import { formatSelectOptions } from '@superset-ui/chart-controls';
import { Select } from 'antd';
import { RawAntdSelect } from '@superset-ui/core/components';
export type SizeOption = [number, string];
@@ -34,12 +34,12 @@ function DefaultSelectRenderer({
options,
onChange,
}: SelectPageSizeRendererProps) {
const { Option } = Select;
const { Option } = RawAntdSelect;
return (
<span className="dt-select-page-size form-inline">
{t('Show')}{' '}
<Select<number>
<RawAntdSelect<number>
value={current}
onChange={value => onChange(value)}
size="small"
@@ -62,7 +62,7 @@ function DefaultSelectRenderer({
</Option>
);
})}
</Select>{' '}
</RawAntdSelect>{' '}
{t('entries')}
</span>
);

View File

@@ -54,7 +54,14 @@ import {
useTheme,
SupersetTheme,
} from '@superset-ui/core';
import { Dropdown, Menu, Tooltip } from '@superset-ui/chart-controls';
import {
Input,
Space,
RawAntdSelect as Select,
Dropdown,
Menu,
Tooltip,
} from '@superset-ui/core/components';
import {
CheckOutlined,
InfoCircleOutlined,
@@ -64,7 +71,6 @@ import {
TableOutlined,
} from '@ant-design/icons';
import { isEmpty, debounce, isEqual } from 'lodash';
import { Input, Space, Select } from 'antd';
import {
ColorSchemeEnum,
DataColumnMeta,

View File

@@ -18,17 +18,18 @@
*/
import {
AdhocColumn,
BuildQuery,
PostProcessingRule,
QueryFormOrderBy,
QueryMode,
QueryObject,
buildQueryContext,
ensureIsArray,
getMetricLabel,
isPhysicalColumn,
QueryFormOrderBy,
QueryMode,
QueryObject,
removeDuplicates,
} from '@superset-ui/core';
import { PostProcessingRule } from '@superset-ui/core/src/query/types/PostProcessing';
import { BuildQuery } from '@superset-ui/core/src/chart/registries/ChartBuildQueryRegistrySingleton';
import {
isTimeComparison,
timeCompareOperator,

View File

@@ -17,7 +17,7 @@
* under the License.
*/
import '@testing-library/jest-dom';
import { render, screen } from '@testing-library/react';
import { render, screen } from '@superset-ui/core/spec';
import { ThemeProvider, supersetTheme } from '@superset-ui/core';
import TableChart from '../src/TableChart';
import transformProps from '../src/transformProps';

View File

@@ -1,18 +1,18 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declarationDir": "lib",
"composite": true,
"rootDir": "src",
"outDir": "lib",
"rootDir": "src"
},
"exclude": ["lib", "test"],
"extends": "../../tsconfig.json",
"include": ["src/**/*", "types/**/*", "../../types/**/*"],
"references": [
{
"path": "../../packages/superset-ui-chart-controls"
},
{
"path": "../../packages/superset-ui-core"
"baseUrl": ".",
"paths": {
"@superset-ui/core/components": ["../../packages/superset-ui-core/src/components"]
}
},
"include": ["src/**/*", "types/**/*"],
"exclude": ["lib", "test"],
"references": [
{ "path": "../../packages/superset-ui-core" },
{ "path": "../../packages/superset-ui-chart-controls" }
]
}