next-helios-fe 1.8.105 → 1.8.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/dropdown/index.d.ts +3 -4
- package/dist/components/dropdown/item.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/dropdown/index.tsx +10 -18
- package/src/components/dropdown/item.tsx +5 -6
- package/src/components/form/input/checkbox.tsx +15 -4
- package/src/components/form/input/color.tsx +1 -0
- package/src/components/form/input/radio.tsx +11 -2
- package/src/components/form/input/range.tsx +1 -1
- package/src/components/form/other/multipleSelect.tsx +217 -198
- package/src/components/form/other/rating.tsx +1 -0
- package/src/components/form/other/select.tsx +25 -6
@@ -114,6 +114,7 @@ export const Rating: React.FC<RatingProps> = ({
|
|
114
114
|
<input
|
115
115
|
type="text"
|
116
116
|
className={`absolute top-0 w-full border-0 bg-transparent text-transparent caret-transparent pointer-events-none focus:ring-0 ${height}`}
|
117
|
+
tabIndex={-1}
|
117
118
|
required={rest.required}
|
118
119
|
readOnly
|
119
120
|
value={tempValue}
|
@@ -103,11 +103,7 @@ export const Select: React.FC<SelectProps> = ({
|
|
103
103
|
<input
|
104
104
|
ref={inputRef}
|
105
105
|
type="text"
|
106
|
-
className={`w-full ps-4 pe-14 border rounded-md bg-secondary-bg cursor-pointer caret-transparent placeholder:duration-300 placeholder:text-silent focus:placeholder:translate-x-1 focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark disabled:bg-secondary-light disabled:text-disabled disabled:cursor-default ${height}
|
107
|
-
openDropdown
|
108
|
-
? "placeholder:translate-x-1 outline-none ring-1 ring-primary shadow shadow-primary border-primary-dark"
|
109
|
-
: "border-default placeholder:translate-x-0"
|
110
|
-
}`}
|
106
|
+
className={`w-full ps-4 pe-14 border border-default rounded-md bg-secondary-bg cursor-pointer caret-transparent placeholder:duration-300 placeholder:text-silent focus:placeholder:translate-x-1 focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark disabled:bg-secondary-light disabled:text-disabled disabled:cursor-default ${height}`}
|
111
107
|
placeholder={placeholder}
|
112
108
|
required={rest.required}
|
113
109
|
disabled={rest.disabled}
|
@@ -125,6 +121,12 @@ export const Select: React.FC<SelectProps> = ({
|
|
125
121
|
inputRef?.current?.getBoundingClientRect()?.width || 0
|
126
122
|
);
|
127
123
|
}}
|
124
|
+
onKeyDown={(e) => {
|
125
|
+
if (e.key === "Enter") {
|
126
|
+
e.preventDefault();
|
127
|
+
inputRef.current?.click();
|
128
|
+
}
|
129
|
+
}}
|
128
130
|
/>
|
129
131
|
<div className="absolute right-4 text-xl text-disabled pointer-events-none">
|
130
132
|
<Icon icon={`gravity-ui:chevron-${openDropdown ? "up" : "down"}`} />
|
@@ -154,7 +156,15 @@ export const Select: React.FC<SelectProps> = ({
|
|
154
156
|
}
|
155
157
|
>
|
156
158
|
{menus.length === 0 ? (
|
157
|
-
<Dropdown.Item
|
159
|
+
<Dropdown.Item
|
160
|
+
onKeyDown={(e) => {
|
161
|
+
if (e.key === "Escape") {
|
162
|
+
e.preventDefault();
|
163
|
+
inputRef.current?.focus();
|
164
|
+
setOpenDropdown(false);
|
165
|
+
}
|
166
|
+
}}
|
167
|
+
>
|
158
168
|
<div
|
159
169
|
className="flex justify-center"
|
160
170
|
style={{ width: dropdownWidth - 43 }}
|
@@ -177,6 +187,15 @@ export const Select: React.FC<SelectProps> = ({
|
|
177
187
|
target: { value: item.value } as HTMLSelectElement,
|
178
188
|
} as any);
|
179
189
|
}
|
190
|
+
setOpenDropdown(false);
|
191
|
+
inputRef.current?.focus();
|
192
|
+
}}
|
193
|
+
onKeyDown={(e) => {
|
194
|
+
if (e.key === "Escape") {
|
195
|
+
e.preventDefault();
|
196
|
+
inputRef.current?.focus();
|
197
|
+
setOpenDropdown(false);
|
198
|
+
}
|
180
199
|
}}
|
181
200
|
>
|
182
201
|
<div
|