From 11f81f3032a5b7e59a5fe7167317c16d34174c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Tue, 22 Jun 2021 15:52:11 +0800 Subject: [PATCH] feat: Add getRawInputElement (#639) * feat: Add raw customize * feat: Support dropdown * test: Add test case --- examples/custom-selector.tsx | 17 +++++ src/SelectTrigger.tsx | 7 +- src/generate.tsx | 124 ++++++++++++++++++++++------------- tests/Select.test.tsx | 18 +++++ typings/index.d.ts | 2 - 5 files changed, 118 insertions(+), 50 deletions(-) create mode 100644 examples/custom-selector.tsx diff --git a/examples/custom-selector.tsx b/examples/custom-selector.tsx new file mode 100644 index 000000000..381cc2e22 --- /dev/null +++ b/examples/custom-selector.tsx @@ -0,0 +1,17 @@ +/* eslint-disable no-console */ +import React from 'react'; +import Select from '../src'; +import '../assets/index.less'; + +export default () => { + return ( + } + options={[ + { + label: , + value: 'little', + }, + ]} + open + />, + ); + + expect(wrapper.exists('.bamboo')).toBeTruthy(); + expect(wrapper.exists('.little')).toBeTruthy(); + }); + describe('propTypes', () => { let errorSpy; diff --git a/typings/index.d.ts b/typings/index.d.ts index f58471bdb..8c47d3f76 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -7,5 +7,3 @@ declare module 'rc-menu'; declare module 'rc-util/lib/Children/toArray'; declare module 'dom-scroll-into-view'; - -declare module 'rc-trigger';