Skip to content

Commit

Permalink
feat(*): add combobox to libs
Browse files Browse the repository at this point in the history
  • Loading branch information
iljs committed Nov 7, 2024
1 parent 8b18fe4 commit c45c225
Show file tree
Hide file tree
Showing 7 changed files with 469 additions and 34 deletions.
464 changes: 462 additions & 2 deletions packages/plasma-b2c/api/plasma-b2c.api.md

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions packages/plasma-b2c/src/components/Combobox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { forwardRef, ComponentProps } from 'react';
import type { ItemOption, ComboboxProps } from '@salutejs/plasma-new-hope';
import React, { forwardRef, ComponentProps, FC, ForwardedRef, ReactElement } from 'react';
import { ItemOption, ComboboxProps, boundCombobox, getFormComponentGenerator } from '@salutejs/plasma-new-hope';

import { config } from './Combobox.config';
import { Combobox as ComboboxOld } from './Legacy';
Expand Down Expand Up @@ -33,3 +33,8 @@ const ComboboxComponent = <T extends ItemOption>(props: CommonProps<T>, ref: Rea
};

export const Combobox = fixedForwardRef(ComboboxComponent);

export const ComboboxWithForm = boundCombobox({
base: Combobox as FC<ComboboxProps>,
baseForm: getFormComponentGenerator(Combobox as FC<ComboboxProps>),
}) as <T extends ItemOption>(props: PropsNew<T> & { ref?: ForwardedRef<HTMLInputElement> }) => ReactElement | null;
6 changes: 0 additions & 6 deletions packages/sdds-cs/api/sdds-cs.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: boolean | undefined;
disabled?: true | undefined;
Expand Down Expand Up @@ -1060,7 +1059,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: boolean | undefined;
disabled?: true | undefined;
Expand Down Expand Up @@ -1133,7 +1131,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: true | undefined;
disabled?: boolean | undefined;
Expand Down Expand Up @@ -1206,7 +1203,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: true | undefined;
disabled?: boolean | undefined;
Expand Down Expand Up @@ -1279,7 +1275,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: false | undefined;
disabled?: false | undefined;
Expand Down Expand Up @@ -1352,7 +1347,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: false | undefined;
disabled?: false | undefined;
Expand Down
6 changes: 0 additions & 6 deletions packages/sdds-dfa/api/sdds-dfa.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: boolean | undefined;
disabled?: true | undefined;
Expand Down Expand Up @@ -1089,7 +1088,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: boolean | undefined;
disabled?: true | undefined;
Expand Down Expand Up @@ -1162,7 +1160,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: true | undefined;
disabled?: boolean | undefined;
Expand Down Expand Up @@ -1235,7 +1232,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: true | undefined;
disabled?: boolean | undefined;
Expand Down Expand Up @@ -1308,7 +1304,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: false | undefined;
disabled?: false | undefined;
Expand Down Expand Up @@ -1381,7 +1376,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: false | undefined;
disabled?: false | undefined;
Expand Down
6 changes: 0 additions & 6 deletions packages/sdds-finportal/api/sdds-finportal.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: boolean | undefined;
disabled?: true | undefined;
Expand Down Expand Up @@ -1140,7 +1139,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: boolean | undefined;
disabled?: true | undefined;
Expand Down Expand Up @@ -1213,7 +1211,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: true | undefined;
disabled?: boolean | undefined;
Expand Down Expand Up @@ -1286,7 +1283,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: true | undefined;
disabled?: boolean | undefined;
Expand Down Expand Up @@ -1359,7 +1355,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: false | undefined;
disabled?: false | undefined;
Expand Down Expand Up @@ -1432,7 +1427,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: false | undefined;
disabled?: false | undefined;
Expand Down
6 changes: 0 additions & 6 deletions packages/sdds-insol/api/sdds-insol.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: boolean | undefined;
disabled?: true | undefined;
Expand Down Expand Up @@ -1141,7 +1140,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: boolean | undefined;
disabled?: true | undefined;
Expand Down Expand Up @@ -1214,7 +1212,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: true | undefined;
disabled?: boolean | undefined;
Expand Down Expand Up @@ -1287,7 +1284,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: true | undefined;
disabled?: boolean | undefined;
Expand Down Expand Up @@ -1360,7 +1356,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: false | undefined;
disabled?: false | undefined;
Expand Down Expand Up @@ -1433,7 +1428,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: false | undefined;
disabled?: false | undefined;
Expand Down
6 changes: 0 additions & 6 deletions packages/sdds-serv/api/sdds-serv.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: boolean | undefined;
disabled?: true | undefined;
Expand Down Expand Up @@ -1140,7 +1139,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: boolean | undefined;
disabled?: true | undefined;
Expand Down Expand Up @@ -1213,7 +1211,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: true | undefined;
disabled?: boolean | undefined;
Expand Down Expand Up @@ -1286,7 +1283,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: true | undefined;
disabled?: boolean | undefined;
Expand Down Expand Up @@ -1359,7 +1355,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: false | undefined;
disabled?: false | undefined;
Expand Down Expand Up @@ -1432,7 +1427,6 @@ true: PolymorphicClassName;
size?: string | undefined;
view?: string | undefined;
labelPlacement?: "outer" | "inner" | undefined;
formType?: Boolean | undefined;
} & {
readOnly?: false | undefined;
disabled?: false | undefined;
Expand Down

0 comments on commit c45c225

Please sign in to comment.