react-store-input 0.1.5 → 0.1.7

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.
@@ -139,7 +139,7 @@ function useStoreController(store, props) {
139
139
  if (!ref.current) return;
140
140
  props.onSubscribe(state, ref.current);
141
141
  });
142
- const onChange = () => {
142
+ const dispatch = () => {
143
143
  store.dispatch(
144
144
  (state) => {
145
145
  const element = ref.current;
@@ -153,26 +153,24 @@ function useStoreController(store, props) {
153
153
  };
154
154
  return {
155
155
  ref,
156
- onChange
156
+ dispatch
157
157
  };
158
158
  }
159
159
 
160
160
  // src/use_store_input.tsx
161
161
  function useStoreInput(store, props) {
162
- const toInputValue = (value) => {
162
+ const toInputValue = props.toInputValue || ((value) => {
163
163
  if (value === void 0 || value === null) {
164
164
  return "";
165
165
  }
166
166
  if (props.type === "datetime-local") {
167
- if (value instanceof Date) {
168
- return (0, import_date_fns.format)(value, "yyyy-MM-dd'T'HH:mm:ss");
169
- }
170
- if (typeof value === "string") {
171
- return toInputValue(new Date(value));
167
+ const date = new Date(value);
168
+ if (!isNaN(date.getTime())) {
169
+ return (0, import_date_fns.format)(date, "yyyy-MM-dd'T'HH:mm:ss");
172
170
  }
173
171
  }
174
172
  return String(value);
175
- };
173
+ });
176
174
  const getDefaultValue = () => {
177
175
  if (props.defaultValue !== void 0) {
178
176
  return props.defaultValue;
@@ -197,16 +195,15 @@ function useStoreInput(store, props) {
197
195
  }
198
196
  return toInputChecked(props.getter(store.state));
199
197
  };
200
- function toStateValue(value) {
201
- const selected = props.getter(store.state);
202
- if (typeof selected === "number") {
198
+ const toStateValue = props.toStateValue || ((value) => {
199
+ if (props.type === "number" || props.type === "range") {
203
200
  return Number(value);
204
201
  }
205
- if (selected instanceof Date) {
202
+ if (props.type === "datetime-local") {
206
203
  return new Date(value);
207
204
  }
208
205
  return value;
209
- }
206
+ });
210
207
  const inputProps = useStoreController(store, {
211
208
  ref: props.ref,
212
209
  onSubscribe: (state, element) => {
@@ -239,7 +236,7 @@ function useStoreInput(store, props) {
239
236
  defaultValue: getDefaultValue(),
240
237
  defaultChecked: getDefaultChecked(),
241
238
  onChange: (event) => {
242
- inputProps.onChange();
239
+ inputProps.dispatch();
243
240
  props.onChange?.(event);
244
241
  }
245
242
  };
@@ -271,15 +268,24 @@ function useStoreInputWithName(store, props) {
271
268
 
272
269
  // src/use_store_component.tsx
273
270
  function useStoreComponent(store) {
274
- const input = (0, import_react7.useCallback)(function Component(props) {
275
- return /* @__PURE__ */ import_react8.default.createElement(Input, { store, ...props });
276
- }, []);
277
- const select = (0, import_react7.useCallback)(function Component(props) {
278
- return /* @__PURE__ */ import_react8.default.createElement(Select, { store, ...props });
279
- }, []);
280
- const textarea = (0, import_react7.useCallback)(function Component(props) {
281
- return /* @__PURE__ */ import_react8.default.createElement(Textarea, { store, ...props });
282
- }, []);
271
+ const input = (0, import_react7.useCallback)(
272
+ function Component(props) {
273
+ return /* @__PURE__ */ import_react8.default.createElement(Input, { store, ...props });
274
+ },
275
+ []
276
+ );
277
+ const select = (0, import_react7.useCallback)(
278
+ function Component(props) {
279
+ return /* @__PURE__ */ import_react8.default.createElement(Select, { store, ...props });
280
+ },
281
+ []
282
+ );
283
+ const textarea = (0, import_react7.useCallback)(
284
+ function Component(props) {
285
+ return /* @__PURE__ */ import_react8.default.createElement(Textarea, { store, ...props });
286
+ },
287
+ []
288
+ );
283
289
  return {
284
290
  input,
285
291
  select,
@@ -290,27 +296,51 @@ function Input({
290
296
  store,
291
297
  getter,
292
298
  setter,
299
+ toInputValue,
300
+ toStateValue,
293
301
  ...props
294
302
  }) {
295
- const storeProps = useStoreInputWithName(store, { ...props, getter, setter });
303
+ const storeProps = useStoreInputWithName(store, {
304
+ ...props,
305
+ getter,
306
+ setter,
307
+ toInputValue,
308
+ toStateValue
309
+ });
296
310
  return /* @__PURE__ */ import_react8.default.createElement("input", { ...props, ...storeProps });
297
311
  }
298
312
  function Select({
299
313
  store,
300
314
  getter,
301
315
  setter,
316
+ toInputValue,
317
+ toStateValue,
302
318
  ...props
303
319
  }) {
304
- const storeProps = useStoreInputWithName(store, { ...props, getter, setter });
320
+ const storeProps = useStoreInputWithName(store, {
321
+ ...props,
322
+ getter,
323
+ setter,
324
+ toInputValue,
325
+ toStateValue
326
+ });
305
327
  return /* @__PURE__ */ import_react8.default.createElement("select", { ...props, ...storeProps });
306
328
  }
307
329
  function Textarea({
308
330
  store,
309
331
  getter,
310
332
  setter,
333
+ toInputValue,
334
+ toStateValue,
311
335
  ...props
312
336
  }) {
313
- const storeProps = useStoreInputWithName(store, { ...props, getter, setter });
337
+ const storeProps = useStoreInputWithName(store, {
338
+ ...props,
339
+ getter,
340
+ setter,
341
+ toInputValue,
342
+ toStateValue
343
+ });
314
344
  return /* @__PURE__ */ import_react8.default.createElement("textarea", { ...props, ...storeProps });
315
345
  }
316
346
 
@@ -83,9 +83,7 @@ function useStore(initialState) {
83
83
  }
84
84
 
85
85
  // src/use_store_component.tsx
86
- import {
87
- useCallback
88
- } from "react";
86
+ import { useCallback } from "react";
89
87
  import React2 from "react";
90
88
 
91
89
  // src/use_store_input.tsx
@@ -105,7 +103,7 @@ function useStoreController(store, props) {
105
103
  if (!ref.current) return;
106
104
  props.onSubscribe(state, ref.current);
107
105
  });
108
- const onChange = () => {
106
+ const dispatch = () => {
109
107
  store.dispatch(
110
108
  (state) => {
111
109
  const element = ref.current;
@@ -119,26 +117,24 @@ function useStoreController(store, props) {
119
117
  };
120
118
  return {
121
119
  ref,
122
- onChange
120
+ dispatch
123
121
  };
124
122
  }
125
123
 
126
124
  // src/use_store_input.tsx
127
125
  function useStoreInput(store, props) {
128
- const toInputValue = (value) => {
126
+ const toInputValue = props.toInputValue || ((value) => {
129
127
  if (value === void 0 || value === null) {
130
128
  return "";
131
129
  }
132
130
  if (props.type === "datetime-local") {
133
- if (value instanceof Date) {
134
- return format(value, "yyyy-MM-dd'T'HH:mm:ss");
135
- }
136
- if (typeof value === "string") {
137
- return toInputValue(new Date(value));
131
+ const date = new Date(value);
132
+ if (!isNaN(date.getTime())) {
133
+ return format(date, "yyyy-MM-dd'T'HH:mm:ss");
138
134
  }
139
135
  }
140
136
  return String(value);
141
- };
137
+ });
142
138
  const getDefaultValue = () => {
143
139
  if (props.defaultValue !== void 0) {
144
140
  return props.defaultValue;
@@ -163,16 +159,15 @@ function useStoreInput(store, props) {
163
159
  }
164
160
  return toInputChecked(props.getter(store.state));
165
161
  };
166
- function toStateValue(value) {
167
- const selected = props.getter(store.state);
168
- if (typeof selected === "number") {
162
+ const toStateValue = props.toStateValue || ((value) => {
163
+ if (props.type === "number" || props.type === "range") {
169
164
  return Number(value);
170
165
  }
171
- if (selected instanceof Date) {
166
+ if (props.type === "datetime-local") {
172
167
  return new Date(value);
173
168
  }
174
169
  return value;
175
- }
170
+ });
176
171
  const inputProps = useStoreController(store, {
177
172
  ref: props.ref,
178
173
  onSubscribe: (state, element) => {
@@ -205,7 +200,7 @@ function useStoreInput(store, props) {
205
200
  defaultValue: getDefaultValue(),
206
201
  defaultChecked: getDefaultChecked(),
207
202
  onChange: (event) => {
208
- inputProps.onChange();
203
+ inputProps.dispatch();
209
204
  props.onChange?.(event);
210
205
  }
211
206
  };
@@ -237,15 +232,24 @@ function useStoreInputWithName(store, props) {
237
232
 
238
233
  // src/use_store_component.tsx
239
234
  function useStoreComponent(store) {
240
- const input = useCallback(function Component(props) {
241
- return /* @__PURE__ */ React2.createElement(Input, { store, ...props });
242
- }, []);
243
- const select = useCallback(function Component(props) {
244
- return /* @__PURE__ */ React2.createElement(Select, { store, ...props });
245
- }, []);
246
- const textarea = useCallback(function Component(props) {
247
- return /* @__PURE__ */ React2.createElement(Textarea, { store, ...props });
248
- }, []);
235
+ const input = useCallback(
236
+ function Component(props) {
237
+ return /* @__PURE__ */ React2.createElement(Input, { store, ...props });
238
+ },
239
+ []
240
+ );
241
+ const select = useCallback(
242
+ function Component(props) {
243
+ return /* @__PURE__ */ React2.createElement(Select, { store, ...props });
244
+ },
245
+ []
246
+ );
247
+ const textarea = useCallback(
248
+ function Component(props) {
249
+ return /* @__PURE__ */ React2.createElement(Textarea, { store, ...props });
250
+ },
251
+ []
252
+ );
249
253
  return {
250
254
  input,
251
255
  select,
@@ -256,27 +260,51 @@ function Input({
256
260
  store,
257
261
  getter,
258
262
  setter,
263
+ toInputValue,
264
+ toStateValue,
259
265
  ...props
260
266
  }) {
261
- const storeProps = useStoreInputWithName(store, { ...props, getter, setter });
267
+ const storeProps = useStoreInputWithName(store, {
268
+ ...props,
269
+ getter,
270
+ setter,
271
+ toInputValue,
272
+ toStateValue
273
+ });
262
274
  return /* @__PURE__ */ React2.createElement("input", { ...props, ...storeProps });
263
275
  }
264
276
  function Select({
265
277
  store,
266
278
  getter,
267
279
  setter,
280
+ toInputValue,
281
+ toStateValue,
268
282
  ...props
269
283
  }) {
270
- const storeProps = useStoreInputWithName(store, { ...props, getter, setter });
284
+ const storeProps = useStoreInputWithName(store, {
285
+ ...props,
286
+ getter,
287
+ setter,
288
+ toInputValue,
289
+ toStateValue
290
+ });
271
291
  return /* @__PURE__ */ React2.createElement("select", { ...props, ...storeProps });
272
292
  }
273
293
  function Textarea({
274
294
  store,
275
295
  getter,
276
296
  setter,
297
+ toInputValue,
298
+ toStateValue,
277
299
  ...props
278
300
  }) {
279
- const storeProps = useStoreInputWithName(store, { ...props, getter, setter });
301
+ const storeProps = useStoreInputWithName(store, {
302
+ ...props,
303
+ getter,
304
+ setter,
305
+ toInputValue,
306
+ toStateValue
307
+ });
280
308
  return /* @__PURE__ */ React2.createElement("textarea", { ...props, ...storeProps });
281
309
  }
282
310
 
@@ -1,21 +1,19 @@
1
- import React__default, { DetailedHTMLProps, InputHTMLAttributes } from 'react';
1
+ import React__default, { DetailedHTMLProps } from 'react';
2
2
  import { Store } from './use_store.mjs';
3
+ import { StoreInputWithNameProps } from './use_store_input_with_name.mjs';
4
+ import './use_store_input.mjs';
3
5
 
4
- type StoreComponentProps<TInputElement, TState> = Omit<DetailedHTMLProps<InputHTMLAttributes<TInputElement>, TInputElement>, "name"> & {
5
- name?: keyof TState;
6
- getter?: (state: TState) => unknown;
7
- setter?: (state: TState, value: unknown) => void;
8
- };
6
+ type StoreInputWithNameComponentProps<TElement, TState, TName extends keyof TState | undefined, TValue> = StoreInputWithNameProps<TElement, TState, TName, TValue> & Omit<DetailedHTMLProps<React__default.InputHTMLAttributes<TElement>, TElement>, keyof StoreInputWithNameProps<TElement, TState, TName, TValue>>;
9
7
  declare function useStoreComponent<TState>(store: Store<TState>): {
10
- input: React__default.FC<StoreComponentProps<HTMLInputElement, TState>>;
11
- select: React__default.FC<StoreComponentProps<HTMLSelectElement, TState>>;
12
- textarea: React__default.FC<StoreComponentProps<HTMLTextAreaElement, TState>>;
8
+ input: <TName extends keyof TState | undefined, TValue>(props: StoreInputWithNameComponentProps<HTMLInputElement, TState, TName, TValue>) => React__default.JSX.Element;
9
+ select: <TName extends keyof TState | undefined, TValue>(props: StoreInputWithNameComponentProps<HTMLSelectElement, TState, TName, TValue>) => React__default.JSX.Element;
10
+ textarea: <TName extends keyof TState | undefined, TValue>(props: StoreInputWithNameComponentProps<HTMLTextAreaElement, TState, TName, TValue>) => React__default.JSX.Element;
13
11
  };
14
- type StoreComponentPropsWithStore<TElement extends HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement, TState> = StoreComponentProps<TElement, TState> & {
12
+ type StoreComponentPropsWithStore<TElement extends HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement, TState, TName extends keyof TState | undefined, TValue> = StoreInputWithNameComponentProps<TElement, TState, TName, TValue> & {
15
13
  store: Store<TState>;
16
14
  };
17
- declare function Input<TState>({ store, getter, setter, ...props }: StoreComponentPropsWithStore<HTMLInputElement, TState>): React__default.JSX.Element;
18
- declare function Select<TState>({ store, getter, setter, ...props }: StoreComponentPropsWithStore<HTMLSelectElement, TState>): React__default.JSX.Element;
19
- declare function Textarea<TState>({ store, getter, setter, ...props }: StoreComponentPropsWithStore<HTMLTextAreaElement, TState>): React__default.JSX.Element;
15
+ declare function Input<TState, TName extends keyof TState | undefined, TValue>({ store, getter, setter, toInputValue, toStateValue, ...props }: StoreComponentPropsWithStore<HTMLInputElement, TState, TName, TValue>): React__default.JSX.Element;
16
+ declare function Select<TState, TName extends keyof TState | undefined, TValue>({ store, getter, setter, toInputValue, toStateValue, ...props }: StoreComponentPropsWithStore<HTMLSelectElement, TState, TName, TValue>): React__default.JSX.Element;
17
+ declare function Textarea<TState, TName extends keyof TState | undefined, TValue>({ store, getter, setter, toInputValue, toStateValue, ...props }: StoreComponentPropsWithStore<HTMLTextAreaElement, TState, TName, TValue>): React__default.JSX.Element;
20
18
 
21
- export { Input, Select, type StoreComponentProps, type StoreComponentPropsWithStore, Textarea, useStoreComponent };
19
+ export { Input, Select, type StoreComponentPropsWithStore, type StoreInputWithNameComponentProps, Textarea, useStoreComponent };
@@ -1,21 +1,19 @@
1
- import React__default, { DetailedHTMLProps, InputHTMLAttributes } from 'react';
1
+ import React__default, { DetailedHTMLProps } from 'react';
2
2
  import { Store } from './use_store.js';
3
+ import { StoreInputWithNameProps } from './use_store_input_with_name.js';
4
+ import './use_store_input.js';
3
5
 
4
- type StoreComponentProps<TInputElement, TState> = Omit<DetailedHTMLProps<InputHTMLAttributes<TInputElement>, TInputElement>, "name"> & {
5
- name?: keyof TState;
6
- getter?: (state: TState) => unknown;
7
- setter?: (state: TState, value: unknown) => void;
8
- };
6
+ type StoreInputWithNameComponentProps<TElement, TState, TName extends keyof TState | undefined, TValue> = StoreInputWithNameProps<TElement, TState, TName, TValue> & Omit<DetailedHTMLProps<React__default.InputHTMLAttributes<TElement>, TElement>, keyof StoreInputWithNameProps<TElement, TState, TName, TValue>>;
9
7
  declare function useStoreComponent<TState>(store: Store<TState>): {
10
- input: React__default.FC<StoreComponentProps<HTMLInputElement, TState>>;
11
- select: React__default.FC<StoreComponentProps<HTMLSelectElement, TState>>;
12
- textarea: React__default.FC<StoreComponentProps<HTMLTextAreaElement, TState>>;
8
+ input: <TName extends keyof TState | undefined, TValue>(props: StoreInputWithNameComponentProps<HTMLInputElement, TState, TName, TValue>) => React__default.JSX.Element;
9
+ select: <TName extends keyof TState | undefined, TValue>(props: StoreInputWithNameComponentProps<HTMLSelectElement, TState, TName, TValue>) => React__default.JSX.Element;
10
+ textarea: <TName extends keyof TState | undefined, TValue>(props: StoreInputWithNameComponentProps<HTMLTextAreaElement, TState, TName, TValue>) => React__default.JSX.Element;
13
11
  };
14
- type StoreComponentPropsWithStore<TElement extends HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement, TState> = StoreComponentProps<TElement, TState> & {
12
+ type StoreComponentPropsWithStore<TElement extends HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement, TState, TName extends keyof TState | undefined, TValue> = StoreInputWithNameComponentProps<TElement, TState, TName, TValue> & {
15
13
  store: Store<TState>;
16
14
  };
17
- declare function Input<TState>({ store, getter, setter, ...props }: StoreComponentPropsWithStore<HTMLInputElement, TState>): React__default.JSX.Element;
18
- declare function Select<TState>({ store, getter, setter, ...props }: StoreComponentPropsWithStore<HTMLSelectElement, TState>): React__default.JSX.Element;
19
- declare function Textarea<TState>({ store, getter, setter, ...props }: StoreComponentPropsWithStore<HTMLTextAreaElement, TState>): React__default.JSX.Element;
15
+ declare function Input<TState, TName extends keyof TState | undefined, TValue>({ store, getter, setter, toInputValue, toStateValue, ...props }: StoreComponentPropsWithStore<HTMLInputElement, TState, TName, TValue>): React__default.JSX.Element;
16
+ declare function Select<TState, TName extends keyof TState | undefined, TValue>({ store, getter, setter, toInputValue, toStateValue, ...props }: StoreComponentPropsWithStore<HTMLSelectElement, TState, TName, TValue>): React__default.JSX.Element;
17
+ declare function Textarea<TState, TName extends keyof TState | undefined, TValue>({ store, getter, setter, toInputValue, toStateValue, ...props }: StoreComponentPropsWithStore<HTMLTextAreaElement, TState, TName, TValue>): React__default.JSX.Element;
20
18
 
21
- export { Input, Select, type StoreComponentProps, type StoreComponentPropsWithStore, Textarea, useStoreComponent };
19
+ export { Input, Select, type StoreComponentPropsWithStore, type StoreInputWithNameComponentProps, Textarea, useStoreComponent };
@@ -69,7 +69,7 @@ function useStoreController(store, props) {
69
69
  if (!ref.current) return;
70
70
  props.onSubscribe(state, ref.current);
71
71
  });
72
- const onChange = () => {
72
+ const dispatch = () => {
73
73
  store.dispatch(
74
74
  (state) => {
75
75
  const element = ref.current;
@@ -83,26 +83,24 @@ function useStoreController(store, props) {
83
83
  };
84
84
  return {
85
85
  ref,
86
- onChange
86
+ dispatch
87
87
  };
88
88
  }
89
89
 
90
90
  // src/use_store_input.tsx
91
91
  function useStoreInput(store, props) {
92
- const toInputValue = (value) => {
92
+ const toInputValue = props.toInputValue || ((value) => {
93
93
  if (value === void 0 || value === null) {
94
94
  return "";
95
95
  }
96
96
  if (props.type === "datetime-local") {
97
- if (value instanceof Date) {
98
- return (0, import_date_fns.format)(value, "yyyy-MM-dd'T'HH:mm:ss");
99
- }
100
- if (typeof value === "string") {
101
- return toInputValue(new Date(value));
97
+ const date = new Date(value);
98
+ if (!isNaN(date.getTime())) {
99
+ return (0, import_date_fns.format)(date, "yyyy-MM-dd'T'HH:mm:ss");
102
100
  }
103
101
  }
104
102
  return String(value);
105
- };
103
+ });
106
104
  const getDefaultValue = () => {
107
105
  if (props.defaultValue !== void 0) {
108
106
  return props.defaultValue;
@@ -127,16 +125,15 @@ function useStoreInput(store, props) {
127
125
  }
128
126
  return toInputChecked(props.getter(store.state));
129
127
  };
130
- function toStateValue(value) {
131
- const selected = props.getter(store.state);
132
- if (typeof selected === "number") {
128
+ const toStateValue = props.toStateValue || ((value) => {
129
+ if (props.type === "number" || props.type === "range") {
133
130
  return Number(value);
134
131
  }
135
- if (selected instanceof Date) {
132
+ if (props.type === "datetime-local") {
136
133
  return new Date(value);
137
134
  }
138
135
  return value;
139
- }
136
+ });
140
137
  const inputProps = useStoreController(store, {
141
138
  ref: props.ref,
142
139
  onSubscribe: (state, element) => {
@@ -169,7 +166,7 @@ function useStoreInput(store, props) {
169
166
  defaultValue: getDefaultValue(),
170
167
  defaultChecked: getDefaultChecked(),
171
168
  onChange: (event) => {
172
- inputProps.onChange();
169
+ inputProps.dispatch();
173
170
  props.onChange?.(event);
174
171
  }
175
172
  };
@@ -201,15 +198,24 @@ function useStoreInputWithName(store, props) {
201
198
 
202
199
  // src/use_store_component.tsx
203
200
  function useStoreComponent(store) {
204
- const input = (0, import_react4.useCallback)(function Component(props) {
205
- return /* @__PURE__ */ import_react5.default.createElement(Input, { store, ...props });
206
- }, []);
207
- const select = (0, import_react4.useCallback)(function Component(props) {
208
- return /* @__PURE__ */ import_react5.default.createElement(Select, { store, ...props });
209
- }, []);
210
- const textarea = (0, import_react4.useCallback)(function Component(props) {
211
- return /* @__PURE__ */ import_react5.default.createElement(Textarea, { store, ...props });
212
- }, []);
201
+ const input = (0, import_react4.useCallback)(
202
+ function Component(props) {
203
+ return /* @__PURE__ */ import_react5.default.createElement(Input, { store, ...props });
204
+ },
205
+ []
206
+ );
207
+ const select = (0, import_react4.useCallback)(
208
+ function Component(props) {
209
+ return /* @__PURE__ */ import_react5.default.createElement(Select, { store, ...props });
210
+ },
211
+ []
212
+ );
213
+ const textarea = (0, import_react4.useCallback)(
214
+ function Component(props) {
215
+ return /* @__PURE__ */ import_react5.default.createElement(Textarea, { store, ...props });
216
+ },
217
+ []
218
+ );
213
219
  return {
214
220
  input,
215
221
  select,
@@ -220,27 +226,51 @@ function Input({
220
226
  store,
221
227
  getter,
222
228
  setter,
229
+ toInputValue,
230
+ toStateValue,
223
231
  ...props
224
232
  }) {
225
- const storeProps = useStoreInputWithName(store, { ...props, getter, setter });
233
+ const storeProps = useStoreInputWithName(store, {
234
+ ...props,
235
+ getter,
236
+ setter,
237
+ toInputValue,
238
+ toStateValue
239
+ });
226
240
  return /* @__PURE__ */ import_react5.default.createElement("input", { ...props, ...storeProps });
227
241
  }
228
242
  function Select({
229
243
  store,
230
244
  getter,
231
245
  setter,
246
+ toInputValue,
247
+ toStateValue,
232
248
  ...props
233
249
  }) {
234
- const storeProps = useStoreInputWithName(store, { ...props, getter, setter });
250
+ const storeProps = useStoreInputWithName(store, {
251
+ ...props,
252
+ getter,
253
+ setter,
254
+ toInputValue,
255
+ toStateValue
256
+ });
235
257
  return /* @__PURE__ */ import_react5.default.createElement("select", { ...props, ...storeProps });
236
258
  }
237
259
  function Textarea({
238
260
  store,
239
261
  getter,
240
262
  setter,
263
+ toInputValue,
264
+ toStateValue,
241
265
  ...props
242
266
  }) {
243
- const storeProps = useStoreInputWithName(store, { ...props, getter, setter });
267
+ const storeProps = useStoreInputWithName(store, {
268
+ ...props,
269
+ getter,
270
+ setter,
271
+ toInputValue,
272
+ toStateValue
273
+ });
244
274
  return /* @__PURE__ */ import_react5.default.createElement("textarea", { ...props, ...storeProps });
245
275
  }
246
276
  // Annotate the CommonJS export names for ESM import in node: