fix(striker-ui): relocate type SelectItem

main
Tsu-ba-me 2 years ago
parent e56fcfd880
commit 3622f4556f
  1. 5
      striker-ui/components/OutlinedLabeledInputWithSelect.tsx
  2. 2
      striker-ui/components/ProvisionServerDialog.tsx
  3. 12
      striker-ui/components/SelectWithLabel.tsx
  4. 7
      striker-ui/types/SelectWithLabel.d.ts

@ -12,10 +12,7 @@ import { MessageBoxProps } from './MessageBox';
import OutlinedInputWithLabel, { import OutlinedInputWithLabel, {
OutlinedInputWithLabelProps, OutlinedInputWithLabelProps,
} from './OutlinedInputWithLabel'; } from './OutlinedInputWithLabel';
import SelectWithLabel, { import SelectWithLabel, { SelectWithLabelProps } from './SelectWithLabel';
SelectItem,
SelectWithLabelProps,
} from './SelectWithLabel';
type OutlinedLabeledInputWithSelectOptionalProps = { type OutlinedLabeledInputWithSelectOptionalProps = {
inputWithLabelProps?: Partial<OutlinedInputWithLabelProps>; inputWithLabelProps?: Partial<OutlinedInputWithLabelProps>;

@ -23,7 +23,7 @@ import MessageBox, { MessageBoxProps } from './MessageBox';
import OutlinedInputWithLabel from './OutlinedInputWithLabel'; import OutlinedInputWithLabel from './OutlinedInputWithLabel';
import OutlinedLabeledInputWithSelect from './OutlinedLabeledInputWithSelect'; import OutlinedLabeledInputWithSelect from './OutlinedLabeledInputWithSelect';
import { Panel, PanelHeader } from './Panels'; import { Panel, PanelHeader } from './Panels';
import SelectWithLabel, { SelectItem } from './SelectWithLabel'; import SelectWithLabel from './SelectWithLabel';
import Slider, { SliderProps } from './Slider'; import Slider, { SliderProps } from './Slider';
import Spinner from './Spinner'; import Spinner from './Spinner';
import { import {

@ -1,4 +1,4 @@
import { FC, ReactNode } from 'react'; import { FC } from 'react';
import { import {
Checkbox as MUICheckbox, Checkbox as MUICheckbox,
FormControl as MUIFormControl, FormControl as MUIFormControl,
@ -14,14 +14,6 @@ import OutlinedInputLabel, {
} from './OutlinedInputLabel'; } from './OutlinedInputLabel';
import Select, { SelectProps } from './Select'; import Select, { SelectProps } from './Select';
type SelectItem<
ValueType = string,
DisplayValueType = ValueType | ReactNode,
> = {
displayValue?: DisplayValueType;
value: ValueType;
};
type SelectWithLabelOptionalProps = { type SelectWithLabelOptionalProps = {
checkItem?: ((value: string) => boolean) | null; checkItem?: ((value: string) => boolean) | null;
disableItem?: ((value: string) => boolean) | null; disableItem?: ((value: string) => boolean) | null;
@ -110,6 +102,6 @@ const SelectWithLabel: FC<SelectWithLabelProps> = ({
SelectWithLabel.defaultProps = SELECT_WITH_LABEL_DEFAULT_PROPS; SelectWithLabel.defaultProps = SELECT_WITH_LABEL_DEFAULT_PROPS;
export type { SelectItem, SelectWithLabelProps }; export type { SelectWithLabelProps };
export default SelectWithLabel; export default SelectWithLabel;

@ -0,0 +1,7 @@
type SelectItem<
ValueType = string,
DisplayValueType = ValueType | import('react').ReactNode,
> = {
displayValue?: DisplayValueType;
value: ValueType;
};
Loading…
Cancel
Save