forked from deephaven/web-client-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ComboBoxNormalized component (deephaven#2071)
- Loading branch information
Showing
4 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/components/src/spectrum/comboBox/ComboBoxNormalized.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ComboBox as SpectrumComboBox } from '@adobe/react-spectrum'; | ||
import { FocusableRef } from '@react-types/shared'; | ||
import cl from 'classnames'; | ||
import { PickerNormalizedPropsT, usePickerNormalizedProps } from '../picker'; | ||
import { ComboBoxProps } from './ComboBox'; | ||
|
||
export type ComboBoxNormalizedProps = PickerNormalizedPropsT<ComboBoxProps>; | ||
|
||
export function ComboBoxNormalized({ | ||
UNSAFE_className, | ||
...props | ||
}: ComboBoxNormalizedProps): JSX.Element { | ||
const { forceRerenderKey, ref, ...pickerProps } = | ||
usePickerNormalizedProps<ComboBoxNormalizedProps>(props); | ||
|
||
return ( | ||
<SpectrumComboBox | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...pickerProps} | ||
key={forceRerenderKey} | ||
ref={ref as FocusableRef<HTMLElement>} | ||
UNSAFE_className={cl( | ||
'dh-combobox', | ||
'dh-combobox-normalized', | ||
UNSAFE_className | ||
)} | ||
/> | ||
); | ||
} | ||
|
||
export default ComboBoxNormalized; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './ComboBox'; | ||
export * from './ComboBoxNormalized'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { dh as DhType } from '@deephaven/jsapi-types'; | ||
|
||
export interface ComboBoxProps { | ||
table: DhType.Table; | ||
} | ||
|
||
export function ComboBox({ table }: ComboBoxProps): JSX.Element { | ||
return <>ComboBox</>; | ||
} | ||
|
||
export default ComboBox; |