Skip to content

Commit

Permalink
Merge pull request #292 from LifeSG/nested-multi-select-long-lived
Browse files Browse the repository at this point in the history
Nested multi select long lived
  • Loading branch information
qroll authored Aug 24, 2023
2 parents 653e727 + 2936521 commit a025b5d
Show file tree
Hide file tree
Showing 18 changed files with 1,279 additions and 137 deletions.
29 changes: 29 additions & 0 deletions src/form/form-nested-multi-select.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { InputNestedMultiSelect } from "../input-nested-multi-select";
import { FormWrapper } from "./form-wrapper";
import { FormNestedMultiSelectProps } from "./types";

export const FormNestedMultiSelect = <V1, V2, V3>({
label,
errorMessage,
id = "form-nested-multi-select",
"data-error-testid": errorTestId,
"data-testid": testId,
...otherProps
}: FormNestedMultiSelectProps<V1, V2, V3>): JSX.Element => {
return (
<FormWrapper
id={id}
label={label}
errorMessage={errorMessage}
data-error-testid={errorTestId}
disabled={otherProps.disabled}
>
<InputNestedMultiSelect
id={`${id}-base`}
data-testid={testId || id}
error={!!errorMessage}
{...otherProps}
/>
</FormWrapper>
);
};
2 changes: 2 additions & 0 deletions src/form/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { FormInputGroup } from "./form-input-group";
import { FormLabel } from "./form-label";
import { FormMultiSelect } from "./form-multi-select";
import { FormNestedSelect } from "./form-nested-select";
import { FormNestedMultiSelect } from "./form-nested-multi-select";
import { FormPhoneNumberInput } from "./form-phone-number-input";
import { FormPredictiveTextInput } from "./form-predictive-text-input";
import { FormRangeSelect } from "./form-range-select";
Expand All @@ -23,6 +24,7 @@ export const Form = {
Label: FormLabel,
MultiSelect: FormMultiSelect,
NestedSelect: FormNestedSelect,
NestedMultiSelect: FormNestedMultiSelect,
Select: FormSelect,
RangeSelect: FormRangeSelect,
Textarea: FormTextarea,
Expand Down
5 changes: 5 additions & 0 deletions src/form/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { DateRangeInputProps } from "../date-range-input/types";
import { InputGroupPartialProps } from "../input-group/types";
import { InputMultiSelectPartialProps } from "../input-multi-select/types";
import { InputNestedSelectPartialProps } from "../input-nested-select";
import { InputNestedMultiSelectPartialProps } from "../input-nested-multi-select";
import { InputRangeSelectPartialProps } from "../input-range-select/types";
import { InputSelectPartialProps } from "../input-select/types";
import { TextareaPartialProps } from "../input-textarea/types";
Expand Down Expand Up @@ -81,6 +82,10 @@ export interface FormNestedSelectProps<V1, V2, V3>
extends InputNestedSelectPartialProps<V1, V2, V3>,
BaseFormElementProps {}

export interface FormNestedMultiSelectProps<V1, V2, V3>
extends InputNestedMultiSelectPartialProps<V1, V2, V3>,
BaseFormElementProps {}

export interface FormDateInputProps
extends DateInputProps,
BaseFormElementProps {}
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export * from "./input";
export * from "./input-group";
export * from "./input-multi-select";
export * from "./input-nested-select";
export * from "./input-nested-multi-select";
export * from "./input-range-select";
export * from "./input-select";
export * from "./input-textarea";
Expand Down
2 changes: 2 additions & 0 deletions src/input-nested-multi-select/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./input-nested-multi-select";
export * from "./types";
Loading

0 comments on commit a025b5d

Please sign in to comment.