diff --git a/cypress/snapshots/b2c/components/Select/Select.component-test.tsx/plasma-b2c Select -- prop afterList.snap.png b/cypress/snapshots/b2c/components/Select/Select.component-test.tsx/plasma-b2c Select -- prop afterList.snap.png new file mode 100644 index 0000000000..acab30eb58 Binary files /dev/null and b/cypress/snapshots/b2c/components/Select/Select.component-test.tsx/plasma-b2c Select -- prop afterList.snap.png differ diff --git a/cypress/snapshots/b2c/components/Select/Select.component-test.tsx/plasma-b2c Select -- prop beforeList.snap.png b/cypress/snapshots/b2c/components/Select/Select.component-test.tsx/plasma-b2c Select -- prop beforeList.snap.png new file mode 100644 index 0000000000..da416fda58 Binary files /dev/null and b/cypress/snapshots/b2c/components/Select/Select.component-test.tsx/plasma-b2c Select -- prop beforeList.snap.png differ diff --git a/cypress/snapshots/web/components/Select/Select.component-test.tsx/plasma-web Select -- prop afterList.snap.png b/cypress/snapshots/web/components/Select/Select.component-test.tsx/plasma-web Select -- prop afterList.snap.png new file mode 100644 index 0000000000..cc67df3cda Binary files /dev/null and b/cypress/snapshots/web/components/Select/Select.component-test.tsx/plasma-web Select -- prop afterList.snap.png differ diff --git a/cypress/snapshots/web/components/Select/Select.component-test.tsx/plasma-web Select -- prop beforeList.snap.png b/cypress/snapshots/web/components/Select/Select.component-test.tsx/plasma-web Select -- prop beforeList.snap.png new file mode 100644 index 0000000000..a5e2230e08 Binary files /dev/null and b/cypress/snapshots/web/components/Select/Select.component-test.tsx/plasma-web Select -- prop beforeList.snap.png differ diff --git a/packages/plasma-b2c/src/components/Select/Select.component-test.tsx b/packages/plasma-b2c/src/components/Select/Select.component-test.tsx index f97762799f..a710a44815 100644 --- a/packages/plasma-b2c/src/components/Select/Select.component-test.tsx +++ b/packages/plasma-b2c/src/components/Select/Select.component-test.tsx @@ -715,6 +715,54 @@ describe('plasma-b2c: Select', () => { cy.matchImageSnapshot(); }); + it('prop: beforeList', () => { + cy.viewport(400, 400); + + mount( + +
+
+ +
+
+
, + ); + + cy.get('#single').realClick(); + + cy.matchImageSnapshot(); + }); + it('basic logic', () => { cy.viewport(1000, 500); diff --git a/packages/plasma-new-hope/src/components/Select/Select.tsx b/packages/plasma-new-hope/src/components/Select/Select.tsx index f690fb037c..f2e413f95c 100644 --- a/packages/plasma-new-hope/src/components/Select/Select.tsx +++ b/packages/plasma-new-hope/src/components/Select/Select.tsx @@ -57,6 +57,8 @@ export const selectRoot = (Root: RootProps initialItemsTransform(items || []), [items]); @@ -346,6 +348,8 @@ export const selectRoot = (Root: RootProps + {beforeList} + {transformedItems.map((item, index) => ( ))} + + {afterList} diff --git a/packages/plasma-new-hope/src/components/Select/Select.types.ts b/packages/plasma-new-hope/src/components/Select/Select.types.ts index c266677fc0..eecdf96ea8 100644 --- a/packages/plasma-new-hope/src/components/Select/Select.types.ts +++ b/packages/plasma-new-hope/src/components/Select/Select.types.ts @@ -142,6 +142,14 @@ export interface BasicProps { * @default если single, то true; если multiple, то false */ closeAfterSelect?: boolean; + /** + * Ячейка для контента в начале выпадающего списка. + */ + beforeList?: React.ReactNode; + /** + * Ячейка для контента в конце выпадающего списка. + */ + afterList?: React.ReactNode; /** * Размер компонента. @@ -308,6 +316,14 @@ export type MergedSelectProps = * @default если single, то true; если multiple, то false */ closeAfterSelect?: boolean; + /** + * Ячейка для контента в начале выпадающего списка. + */ + beforeList?: React.ReactNode; + /** + * Ячейка для контента в конце выпадающего списка. + */ + afterList?: React.ReactNode; /** * Размер компонента. diff --git a/packages/plasma-web/src/components/Select/Select.component-test.tsx b/packages/plasma-web/src/components/Select/Select.component-test.tsx index d32108b13e..bce2342ff2 100644 --- a/packages/plasma-web/src/components/Select/Select.component-test.tsx +++ b/packages/plasma-web/src/components/Select/Select.component-test.tsx @@ -715,6 +715,54 @@ describe('plasma-web: Select', () => { cy.matchImageSnapshot(); }); + it('prop: beforeList', () => { + cy.viewport(400, 400); + + mount( + +
+
+ +
+
+
, + ); + + cy.get('#single').realClick(); + + cy.matchImageSnapshot(); + }); + it('basic logic', () => { cy.viewport(1000, 500);