next-recomponents 1.7.21 → 1.7.23

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 CHANGED
@@ -146,7 +146,6 @@ interface CustomSelectProps extends React$1.DetailedHTMLProps<React$1.InputHTMLA
146
146
  children: ReactNode;
147
147
  name: string;
148
148
  value?: string;
149
- onChange?: any;
150
149
  className?: string;
151
150
  strictMode?: boolean;
152
151
  }
package/dist/index.d.ts CHANGED
@@ -146,7 +146,6 @@ interface CustomSelectProps extends React$1.DetailedHTMLProps<React$1.InputHTMLA
146
146
  children: ReactNode;
147
147
  name: string;
148
148
  value?: string;
149
- onChange?: any;
150
149
  className?: string;
151
150
  strictMode?: boolean;
152
151
  }
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,10 +44372,7 @@ 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
- onMouseDown: () => {
44375
- props.onChange({
44376
- target: { value: (opt == null ? void 0 : opt.value) || opt.label }
44377
- });
44375
+ onClick: () => {
44378
44376
  const item = validOption(opt.label);
44379
44377
  if (inputRef == null ? void 0 : inputRef.current) {
44380
44378
  if (!item) {
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,10 +44360,7 @@ 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
- onMouseDown: () => {
44363
- props.onChange({
44364
- target: { value: (opt == null ? void 0 : opt.value) || opt.label }
44365
- });
44363
+ onClick: () => {
44366
44364
  const item = validOption(opt.label);
44367
44365
  if (inputRef == null ? void 0 : inputRef.current) {
44368
44366
  if (!item) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-recomponents",
3
- "version": "1.7.21",
3
+ "version": "1.7.23",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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.onChange(e);
135
+ props?.onChange?.(e);
137
136
  }}
138
137
  onChange={(e) => {
139
138
  setInputValue(e.target.value);
140
- props.onChange?.(e);
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
- onMouseDown={() => {
182
- props.onChange({
183
- target: { value: opt?.value || opt.label },
184
- });
180
+ onClick={() => {
181
+ // props?.onChange?.({
182
+ // target: { value: opt?.value || opt.label },
183
+ // } as React.ChangeEvent<HTMLInputElement>);
185
184
 
186
185
  const item = validOption(opt.label);
187
186
  if (inputRef?.current) {