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, {
OutlinedInputWithLabelProps,
} from './OutlinedInputWithLabel';
import SelectWithLabel, {
SelectItem,
SelectWithLabelProps,
} from './SelectWithLabel';
import SelectWithLabel, { SelectWithLabelProps } from './SelectWithLabel';
type OutlinedLabeledInputWithSelectOptionalProps = {
inputWithLabelProps?: Partial<OutlinedInputWithLabelProps>;

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

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

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