Skip to content

Commit 0c38fa8

Browse files
committed
chore: adjust
1 parent e4a254d commit 0c38fa8

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/PickerInput/Selector/Input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,14 +385,12 @@ const Input = React.forwardRef<InputRef, InputProps>((props, ref) => {
385385
ref={holderRef}
386386
className={classNames(
387387
inputPrefixCls,
388-
inputClassNames?.input,
389388
{
390389
[`${inputPrefixCls}-active`]: active && showActiveCls,
391390
[`${inputPrefixCls}-placeholder`]: helped,
392391
},
393392
className,
394393
)}
395-
style={styles?.input}
396394
>
397395
<Component
398396
ref={inputRef}
@@ -406,6 +404,8 @@ const Input = React.forwardRef<InputRef, InputProps>((props, ref) => {
406404
// Value
407405
value={inputValue}
408406
onChange={onInternalChange}
407+
className={inputClassNames?.input}
408+
style={styles?.input}
409409
/>
410410
<Icon type="suffix" icon={suffixIcon} />
411411
{clearIcon}

src/interface.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,6 @@ export type Components<DateType extends object = any> = Partial<
281281
>;
282282

283283
// ========================= Picker =========================
284-
export type SemanticStructure = 'popup' | 'popupBody' | 'popupContent' | 'popupItem' | 'suffix' | 'prefix' | 'input';
285-
286284
export type CustomFormat<DateType> = (value: DateType) => string;
287285

288286
export type FormatType<DateType = any> = string | CustomFormat<DateType>;
@@ -313,6 +311,10 @@ export type LegacyOnKeyDown = (
313311
preventDefault: VoidFunction,
314312
) => void;
315313

314+
export type SemanticName = 'root' | 'prefix' | 'input' | 'suffix';
315+
316+
export type PanelSemanticName = 'root' | 'header' | 'body' | 'content' | 'item' | 'footer';
317+
316318
export interface SharedPickerProps<DateType extends object = any>
317319
extends SharedHTMLAttrs,
318320
Pick<
@@ -328,8 +330,12 @@ export interface SharedPickerProps<DateType extends object = any>
328330
className?: string;
329331
style?: React.CSSProperties;
330332

331-
styles?: Partial<Record<SemanticStructure, React.CSSProperties>>;
332-
classNames?: Partial<Record<SemanticStructure, string>>;
333+
styles?: Partial<Record<SemanticName, React.CSSProperties>> & {
334+
popup: Partial<Record<PanelSemanticName, React.CSSProperties>>;
335+
};
336+
classNames?: Partial<Record<SemanticName, string>> & {
337+
popup: Partial<Record<PanelSemanticName, string>>;
338+
};
333339

334340
// Config
335341
locale: Locale;

0 commit comments

Comments
 (0)