|
@@ -11,6 +11,7 @@ import type { |
|
@@ -11,6 +11,7 @@ import type { |
11
|
import DropdownContent from './dropdown-content';
|
11
|
import DropdownContent from './dropdown-content';
|
12
|
|
12
|
|
13
|
import './styles.less';
|
13
|
import './styles.less';
|
|
|
14
|
+import {QxBaseIcon} from "@qx/common";
|
14
|
|
15
|
|
15
|
const prefix = 'qx-input-select';
|
16
|
const prefix = 'qx-input-select';
|
16
|
|
17
|
|
|
@@ -25,6 +26,7 @@ export const QxInputSelect = React.forwardRef<any, InputSelectProps>( |
|
@@ -25,6 +26,7 @@ export const QxInputSelect = React.forwardRef<any, InputSelectProps>( |
25
|
dropdownProps,
|
26
|
dropdownProps,
|
26
|
onChange,
|
27
|
onChange,
|
27
|
disabled,
|
28
|
disabled,
|
|
|
29
|
+ from,
|
28
|
...rest
|
30
|
...rest
|
29
|
} = props;
|
31
|
} = props;
|
30
|
|
32
|
|
|
@@ -83,14 +85,38 @@ export const QxInputSelect = React.forwardRef<any, InputSelectProps>( |
|
@@ -83,14 +85,38 @@ export const QxInputSelect = React.forwardRef<any, InputSelectProps>( |
83
|
onOpenChange={onVisibleChange}
|
85
|
onOpenChange={onVisibleChange}
|
84
|
disabled={disabled}
|
86
|
disabled={disabled}
|
85
|
>
|
87
|
>
|
86
|
- <Input
|
|
|
87
|
- placeholder="请选择"
|
|
|
88
|
- readOnly
|
|
|
89
|
- suffix={inputSuffix}
|
|
|
90
|
- onClick={() => setState({ visible: !state.visible })}
|
|
|
91
|
- {...rest}
|
|
|
92
|
- className={`${prefix}__input`}
|
|
|
93
|
- />
|
88
|
+ <>
|
|
|
89
|
+ {
|
|
|
90
|
+ from === 'FORM'?
|
|
|
91
|
+ <div
|
|
|
92
|
+ className={'qx-input-select__div'}
|
|
|
93
|
+ tabIndex={1}
|
|
|
94
|
+ onClick={() => setState({ visible: !state.visible })}
|
|
|
95
|
+ >
|
|
|
96
|
+ {props?.prefix}
|
|
|
97
|
+ { !props?.value ?
|
|
|
98
|
+ <span className={'qx-input-select__div-main qx-input-select__div-placeholder'}>{props?.placeholder}</span>:
|
|
|
99
|
+ <span className={'qx-input-select__div-main'}>
|
|
|
100
|
+ <span>{props?.appName}</span>
|
|
|
101
|
+ <QxBaseIcon
|
|
|
102
|
+ type="qx-icon-left"
|
|
|
103
|
+ className={'qx-input-select__div-svg'}
|
|
|
104
|
+ />
|
|
|
105
|
+ <span>{props?.value}</span>
|
|
|
106
|
+ </span>
|
|
|
107
|
+ }
|
|
|
108
|
+ {inputSuffix}
|
|
|
109
|
+ </div>:
|
|
|
110
|
+ <Input
|
|
|
111
|
+ placeholder="请选择"
|
|
|
112
|
+ readOnly
|
|
|
113
|
+ suffix={inputSuffix}
|
|
|
114
|
+ onClick={() => setState({ visible: !state.visible })}
|
|
|
115
|
+ {...rest}
|
|
|
116
|
+ className={`${prefix}__input`}
|
|
|
117
|
+ />
|
|
|
118
|
+ }
|
|
|
119
|
+ </>
|
94
|
</Dropdown>
|
120
|
</Dropdown>
|
95
|
</div>
|
121
|
</div>
|
96
|
);
|
122
|
);
|
|
@@ -103,6 +129,8 @@ export interface InputSelectProps extends Omit<InputProps, 'onChange'> { |
|
@@ -103,6 +129,8 @@ export interface InputSelectProps extends Omit<InputProps, 'onChange'> { |
103
|
dropdownProps?: DropdownContentProps;
|
129
|
dropdownProps?: DropdownContentProps;
|
104
|
disabled?: boolean;
|
130
|
disabled?: boolean;
|
105
|
popupOnBody?: boolean;
|
131
|
popupOnBody?: boolean;
|
|
|
132
|
+ from?: string;
|
|
|
133
|
+ appName?: string;
|
106
|
}
|
134
|
}
|
107
|
export interface InputSelectState {
|
135
|
export interface InputSelectState {
|
108
|
visible: boolean;
|
136
|
visible: boolean;
|