Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@
"dependencies": {
"@rc-component/overflow": "^1.0.0",
"@rc-component/trigger": "^3.0.0",
"@rc-component/util": "^1.3.0",
"@rc-component/virtual-list": "^1.0.1",
"@rc-component/util": "^1.11.1",
"@rc-component/virtual-list": "^1.2.0",
"clsx": "^2.1.1"
},
"devDependencies": {
"@rc-component/father-plugin": "^2.0.2",
"@rc-component/father-plugin": "^2.2.0",
"@rc-component/np": "^1.0.0",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^15.0.6",
Expand Down
7 changes: 3 additions & 4 deletions src/BaseSelect/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { AlignType, BuildInPlacements } from '@rc-component/trigger/lib/interface';
import type { AlignType, BuildInPlacements } from '@rc-component/trigger';
import { clsx } from 'clsx';
import { getDOM } from '@rc-component/util/lib/Dom/findDOMNode';
import type { ScrollConfig, ScrollTo } from '@rc-component/virtual-list/lib/List';
import { getDOM, useEvent } from '@rc-component/util';
import type { ScrollConfig, ScrollTo } from '@rc-component/virtual-list';
import * as React from 'react';
import { useAllowClear } from '../hooks/useAllowClear';
import { BaseSelectContext } from '../hooks/useBaseProps';
Expand All @@ -22,7 +22,6 @@ import SelectTrigger from '../SelectTrigger';
import { getSeparatedContent, isValidCount } from '../utils/valueUtil';
import Polite from './Polite';
import useOpen, { macroTask } from '../hooks/useOpen';
import { useEvent } from '@rc-component/util';
import type { SelectInputRef } from '../SelectInput';
import SelectInput from '../SelectInput';
import type { ComponentsConfig } from '../hooks/useComponents';
Expand Down
9 changes: 2 additions & 7 deletions src/OptionList.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { clsx } from 'clsx';
import KeyCode from '@rc-component/util/lib/KeyCode';
import useMemo from '@rc-component/util/lib/hooks/useMemo';
import omit from '@rc-component/util/lib/omit';
import pickAttrs from '@rc-component/util/lib/pickAttrs';
import type { ListRef } from '@rc-component/virtual-list';
import List from '@rc-component/virtual-list';
import type { ScrollConfig } from '@rc-component/virtual-list/lib/List';
import { KeyCode, omit, pickAttrs, useMemo } from '@rc-component/util';
import List, { type ListRef, type ScrollConfig } from '@rc-component/virtual-list';
import * as React from 'react';
import { useEffect } from 'react';
import type { BaseOptionType, RawValueType } from './Select';
Expand Down
4 changes: 1 addition & 3 deletions src/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
* - `combobox` mode not support `optionLabelProp`
*/

import useControlledState from '@rc-component/util/lib/hooks/useControlledState';
import warning from '@rc-component/util/lib/warning';
import { useControlledState, useId, warning } from '@rc-component/util';
import * as React from 'react';
import type {
BaseSelectProps,
Expand All @@ -49,7 +48,6 @@ import SelectContext from './SelectContext';
import type { SelectContextProps } from './SelectContext';
import useCache from './hooks/useCache';
import useFilterOptions from './hooks/useFilterOptions';
import useId from '@rc-component/util/lib/hooks/useId';
import useOptions from './hooks/useOptions';
import useRefFunc from './hooks/useRefFunc';
import type { FlattenOptionData } from './interface';
Expand Down
2 changes: 1 addition & 1 deletion src/SelectInput/Content/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import pickAttrs from '@rc-component/util/lib/pickAttrs';
import { pickAttrs } from '@rc-component/util';
import SingleContent from './SingleContent';
import MultipleContent from './MultipleContent';
import { useSelectInputContext } from '../context';
Expand Down
3 changes: 1 addition & 2 deletions src/SelectInput/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import * as React from 'react';
import { clsx } from 'clsx';
import { useSelectInputContext } from './context';
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
import { composeRef, useLayoutEffect } from '@rc-component/util';
import useBaseProps from '../hooks/useBaseProps';
import { composeRef } from '@rc-component/util/lib/ref';

export interface InputProps {
id?: string;
Expand Down
6 changes: 1 addition & 5 deletions src/SelectInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ import SelectContent from './Content';
import SelectInputContext from './context';
import type { DisplayValueType, Mode, RenderNode } from '../interface';
import useBaseProps from '../hooks/useBaseProps';
import { omit, useEvent } from '@rc-component/util';
import KeyCode from '@rc-component/util/lib/KeyCode';
import { composeRef, getDOM, KeyCode, omit, pickAttrs, useEvent } from '@rc-component/util';
import { isValidateOpenKey } from '../utils/keyUtil';
import { clsx } from 'clsx';
import type { ComponentsConfig } from '../hooks/useComponents';
import { getDOM } from '@rc-component/util/lib/Dom/findDOMNode';
import { composeRef } from '@rc-component/util/lib/ref';
import pickAttrs from '@rc-component/util/lib/pickAttrs';

export interface SelectInputRef {
focus: (options?: FocusOptions) => void;
Expand Down
7 changes: 5 additions & 2 deletions src/SelectTrigger.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Trigger, { type TriggerRef } from '@rc-component/trigger';
import type { AlignType, BuildInPlacements } from '@rc-component/trigger/lib/interface';
import Trigger, {
type AlignType,
type BuildInPlacements,
type TriggerRef,
} from '@rc-component/trigger';
import { clsx } from 'clsx';
import * as React from 'react';
import type { Placement, RenderDOMFunc } from './BaseSelect';
Expand Down
29 changes: 26 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
import Select from './Select';
import Option from './Option';
import OptGroup from './OptGroup';
import type { SelectProps } from './Select';
import type { BaseOptionType, DefaultOptionType, SearchConfig, SelectProps } from './Select';
import BaseSelect from './BaseSelect';
import type { BaseSelectProps, BaseSelectRef, BaseSelectPropsWithoutPrivate } from './BaseSelect';
import type {
BaseSelectProps,
BaseSelectPropsWithoutPrivate,
BaseSelectRef,
BaseSelectSemanticName,
DisplayValueType,
RefOptionListProps,
} from './BaseSelect';
import useBaseProps from './hooks/useBaseProps';
import type { OptionFC, OptionProps } from './Option';
import type { Placement } from './interface';

export { Option, OptGroup, BaseSelect, useBaseProps };
export type { SelectProps, BaseSelectProps, BaseSelectRef, BaseSelectPropsWithoutPrivate };
export type {
BaseOptionType,
BaseSelectProps,
BaseSelectPropsWithoutPrivate,
BaseSelectRef,
Comment thread
QDyanbing marked this conversation as resolved.
Outdated
BaseSelectSemanticName,
DefaultOptionType,
DisplayValueType,
OptionFC,
OptionProps,
Placement,
RefOptionListProps,
SearchConfig,
SelectProps,
};
Comment thread
QDyanbing marked this conversation as resolved.
Outdated

export default Select;
2 changes: 1 addition & 1 deletion src/utils/keyUtil.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import KeyCode from '@rc-component/util/lib/KeyCode';
import { KeyCode } from '@rc-component/util';

/** keyCode Judgment function */
export function isValidateOpenKey(currentKeyCode: number): boolean {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/legacyUtil.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import toArray from '@rc-component/util/lib/Children/toArray';
import { toArray } from '@rc-component/util';
import type { BaseOptionType, DefaultOptionType } from '../Select';

function convertNodeToOption<OptionType extends BaseOptionType = DefaultOptionType>(
Expand Down
2 changes: 1 addition & 1 deletion src/utils/valueUtil.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { BaseOptionType, DefaultOptionType } from '../Select';
import warning from '@rc-component/util/lib/warning';
import { warning } from '@rc-component/util';
import type { RawValueType, FieldNames } from '../Select';
import type { FlattenOptionData } from '../interface';

Expand Down
3 changes: 1 addition & 2 deletions src/utils/warningPropsUtil.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import toNodeArray from '@rc-component/util/lib/Children/toArray';
import warning, { noteOnce } from '@rc-component/util/lib/warning';
import { noteOnce, toArray as toNodeArray, warning as warning } from '@rc-component/util';
import * as React from 'react';
import { isMultiple } from '../BaseSelect';
import type {
Expand Down
2 changes: 1 addition & 1 deletion tests/Accessibility.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import KeyCode from '@rc-component/util/lib/KeyCode';
import { KeyCode } from '@rc-component/util';
import Select from '../src';
import { injectRunAllTimers, expectOpen, keyDown } from './utils/common';
import { act, fireEvent, render } from '@testing-library/react';
Expand Down
3 changes: 1 addition & 2 deletions tests/Combobox.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import '@testing-library/jest-dom';
import { createEvent, fireEvent, render } from '@testing-library/react';
import KeyCode from '@rc-component/util/lib/KeyCode';
import { resetWarned } from '@rc-component/util/lib/warning';
import { KeyCode, resetWarned } from '@rc-component/util';
import React, { act } from 'react';
import type { SelectProps } from '../src';
import Select, { Option } from '../src';
Expand Down
2 changes: 1 addition & 1 deletion tests/Multiple.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import KeyCode from '@rc-component/util/lib/KeyCode';
import { KeyCode } from '@rc-component/util';
import React from 'react';
import Select, { Option, OptGroup } from '../src';
import focusTest from './shared/focusTest';
Expand Down
3 changes: 1 addition & 2 deletions tests/OptionList.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import KeyCode from '@rc-component/util/lib/KeyCode';
import { KeyCode, spyElementPrototypes } from '@rc-component/util';
import React, { act } from 'react';
import { BaseSelectContext } from '../src/hooks/useBaseProps';
import type { RefOptionListProps } from '../src/OptionList';
Expand All @@ -8,7 +8,6 @@ import { fillFieldNames, flattenOptions } from '../src/utils/valueUtil';
import { injectRunAllTimers } from './utils/common';
import { createEvent, fireEvent, render, waitFor } from '@testing-library/react';
import Select from '../src';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';

jest.mock('../src/utils/platformUtil');

Expand Down
6 changes: 2 additions & 4 deletions tests/Select.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import {
render as testingRender,
act,
} from '@testing-library/react';
import KeyCode from '@rc-component/util/lib/KeyCode';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
import { resetWarned } from '@rc-component/util/lib/warning';
import type { ScrollConfig } from '@rc-component/virtual-list/lib/List';
import { KeyCode, resetWarned, spyElementPrototypes } from '@rc-component/util';
import type { ScrollConfig } from '@rc-component/virtual-list';
import React, { StrictMode } from 'react';
import type { SelectProps } from '../src';
import Select, { OptGroup, Option, useBaseProps } from '../src';
Expand Down
2 changes: 1 addition & 1 deletion tests/Tags.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createEvent, fireEvent, render } from '@testing-library/react';
import KeyCode from '@rc-component/util/lib/KeyCode';
import { KeyCode } from '@rc-component/util';
import { clsx } from 'clsx';
import * as React from 'react';
import Select, { BaseSelect, OptGroup, Option } from '../src';
Expand Down
2 changes: 1 addition & 1 deletion tests/shared/focusTest.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { resetWarned } from '@rc-component/util/lib/warning';
import { resetWarned } from '@rc-component/util';
import Option from '../../src/Option';
import Select from '../../src/Select';
import { render } from '@testing-library/react';
Expand Down
2 changes: 1 addition & 1 deletion tests/shared/removeSelectedTest.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import KeyCode from '@rc-component/util/lib/KeyCode';
import { KeyCode } from '@rc-component/util';
import React from 'react';
import Select, { Option } from '../../src';
import { removeSelection, toggleOpen, selectItem, keyDown } from '../utils/common';
Expand Down
2 changes: 1 addition & 1 deletion tests/shared/throwOptionValue.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Select, { Option } from '../../src';
import { resetWarned } from '@rc-component/util/lib/warning';
import { resetWarned } from '@rc-component/util';
Comment thread
QDyanbing marked this conversation as resolved.
import { render } from '@testing-library/react';

export default function throwOptionValue(mode: any) {
Expand Down
2 changes: 0 additions & 2 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ declare module 'component-classes';

declare module 'rc-menu';

declare module '@rc-component/util/lib/Children/toArray';

declare module 'dom-scroll-into-view';
Loading