next-recomponents 1.7.21 → 1.7.22
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/index.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +6 -4
- package/dist/index.mjs +6 -4
- package/package.json +1 -1
- package/src/select/index.tsx +5 -6
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -44320,6 +44320,7 @@ function Select(_a) {
|
|
|
44320
44320
|
].join(" "),
|
|
44321
44321
|
value: inputValue,
|
|
44322
44322
|
onBlur: (e) => {
|
|
44323
|
+
var _a2;
|
|
44323
44324
|
const item = validOption(e.target.value);
|
|
44324
44325
|
if (!item) {
|
|
44325
44326
|
if (strictMode) {
|
|
@@ -44334,12 +44335,12 @@ function Select(_a) {
|
|
|
44334
44335
|
e.currentTarget.classList.add("bg-green-200");
|
|
44335
44336
|
e.currentTarget.classList.remove("bg-red-200");
|
|
44336
44337
|
}
|
|
44337
|
-
props.onChange(e);
|
|
44338
|
+
(_a2 = props == null ? void 0 : props.onChange) == null ? void 0 : _a2.call(props, e);
|
|
44338
44339
|
},
|
|
44339
44340
|
onChange: (e) => {
|
|
44340
44341
|
var _a2;
|
|
44341
44342
|
setInputValue(e.target.value);
|
|
44342
|
-
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, e);
|
|
44343
|
+
(_a2 = props == null ? void 0 : props.onChange) == null ? void 0 : _a2.call(props, e);
|
|
44343
44344
|
},
|
|
44344
44345
|
placeholder,
|
|
44345
44346
|
onFocus: () => setIsOpen(true),
|
|
@@ -44371,8 +44372,9 @@ function Select(_a) {
|
|
|
44371
44372
|
"div",
|
|
44372
44373
|
{
|
|
44373
44374
|
className: `p-2 cursor-pointer ${index === highlightedIndex ? "bg-blue-100" : "hover:bg-gray-100"}`,
|
|
44374
|
-
|
|
44375
|
-
|
|
44375
|
+
onClick: () => {
|
|
44376
|
+
var _a2;
|
|
44377
|
+
(_a2 = props == null ? void 0 : props.onChange) == null ? void 0 : _a2.call(props, {
|
|
44376
44378
|
target: { value: (opt == null ? void 0 : opt.value) || opt.label }
|
|
44377
44379
|
});
|
|
44378
44380
|
const item = validOption(opt.label);
|
package/dist/index.mjs
CHANGED
|
@@ -44308,6 +44308,7 @@ function Select(_a) {
|
|
|
44308
44308
|
].join(" "),
|
|
44309
44309
|
value: inputValue,
|
|
44310
44310
|
onBlur: (e) => {
|
|
44311
|
+
var _a2;
|
|
44311
44312
|
const item = validOption(e.target.value);
|
|
44312
44313
|
if (!item) {
|
|
44313
44314
|
if (strictMode) {
|
|
@@ -44322,12 +44323,12 @@ function Select(_a) {
|
|
|
44322
44323
|
e.currentTarget.classList.add("bg-green-200");
|
|
44323
44324
|
e.currentTarget.classList.remove("bg-red-200");
|
|
44324
44325
|
}
|
|
44325
|
-
props.onChange(e);
|
|
44326
|
+
(_a2 = props == null ? void 0 : props.onChange) == null ? void 0 : _a2.call(props, e);
|
|
44326
44327
|
},
|
|
44327
44328
|
onChange: (e) => {
|
|
44328
44329
|
var _a2;
|
|
44329
44330
|
setInputValue(e.target.value);
|
|
44330
|
-
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, e);
|
|
44331
|
+
(_a2 = props == null ? void 0 : props.onChange) == null ? void 0 : _a2.call(props, e);
|
|
44331
44332
|
},
|
|
44332
44333
|
placeholder,
|
|
44333
44334
|
onFocus: () => setIsOpen(true),
|
|
@@ -44359,8 +44360,9 @@ function Select(_a) {
|
|
|
44359
44360
|
"div",
|
|
44360
44361
|
{
|
|
44361
44362
|
className: `p-2 cursor-pointer ${index === highlightedIndex ? "bg-blue-100" : "hover:bg-gray-100"}`,
|
|
44362
|
-
|
|
44363
|
-
|
|
44363
|
+
onClick: () => {
|
|
44364
|
+
var _a2;
|
|
44365
|
+
(_a2 = props == null ? void 0 : props.onChange) == null ? void 0 : _a2.call(props, {
|
|
44364
44366
|
target: { value: (opt == null ? void 0 : opt.value) || opt.label }
|
|
44365
44367
|
});
|
|
44366
44368
|
const item = validOption(opt.label);
|
package/package.json
CHANGED
package/src/select/index.tsx
CHANGED
|
@@ -18,7 +18,6 @@ interface CustomSelectProps
|
|
|
18
18
|
children: ReactNode;
|
|
19
19
|
name: string;
|
|
20
20
|
value?: string;
|
|
21
|
-
onChange?: any;
|
|
22
21
|
className?: string;
|
|
23
22
|
strictMode?: boolean;
|
|
24
23
|
}
|
|
@@ -133,11 +132,11 @@ export default function Select({
|
|
|
133
132
|
e.currentTarget.classList.remove("bg-red-200");
|
|
134
133
|
}
|
|
135
134
|
|
|
136
|
-
props
|
|
135
|
+
props?.onChange?.(e);
|
|
137
136
|
}}
|
|
138
137
|
onChange={(e) => {
|
|
139
138
|
setInputValue(e.target.value);
|
|
140
|
-
props
|
|
139
|
+
props?.onChange?.(e);
|
|
141
140
|
}}
|
|
142
141
|
placeholder={placeholder}
|
|
143
142
|
onFocus={() => setIsOpen(true)}
|
|
@@ -178,10 +177,10 @@ export default function Select({
|
|
|
178
177
|
? "bg-blue-100"
|
|
179
178
|
: "hover:bg-gray-100"
|
|
180
179
|
}`}
|
|
181
|
-
|
|
182
|
-
props
|
|
180
|
+
onClick={() => {
|
|
181
|
+
props?.onChange?.({
|
|
183
182
|
target: { value: opt?.value || opt.label },
|
|
184
|
-
});
|
|
183
|
+
} as React.ChangeEvent<HTMLInputElement>);
|
|
185
184
|
|
|
186
185
|
const item = validOption(opt.label);
|
|
187
186
|
if (inputRef?.current) {
|