tw-react-components 0.0.182 → 0.0.183

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.
Files changed (2) hide show
  1. package/index.esm.js +5 -2
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -1478,8 +1478,9 @@ const FormGroup = ({ className, label, children }) => (jsxs(Flex, { className: c
1478
1478
 
1479
1479
  function withForm(Component) {
1480
1480
  return (props) => {
1481
- const _a = props, { name, pattern, validate } = _a, restProps = __rest(_a, ["name", "pattern", "validate"]);
1481
+ const _a = props, { name, pattern, validate } = _a, _restProps = __rest(_a, ["name", "pattern", "validate"]);
1482
1482
  const { control, formState } = useFormContext();
1483
+ const restProps = _restProps;
1483
1484
  return (jsx(Controller, { name: name, control: control, rules: {
1484
1485
  required: restProps.required,
1485
1486
  min: restProps.min,
@@ -1490,7 +1491,9 @@ function withForm(Component) {
1490
1491
  validate,
1491
1492
  }, render: ({ field, fieldState }) => {
1492
1493
  var _a, _b;
1493
- return (jsx(Component, Object.assign({}, restProps, field, { value: (_a = field.value) !== null && _a !== void 0 ? _a : '', disabled: ((_b = field.disabled) !== null && _b !== void 0 ? _b : restProps.disabled) ||
1494
+ return (jsx(Component, Object.assign({}, restProps, field, { onChange: Component === NumberInput
1495
+ ? (value) => field.onChange(value.target.valueAsNumber)
1496
+ : field.onChange, value: (_a = field.value) !== null && _a !== void 0 ? _a : '', disabled: ((_b = field.disabled) !== null && _b !== void 0 ? _b : restProps.disabled) ||
1494
1497
  formState.isSubmitting, hasErrors: fieldState.error })));
1495
1498
  } }));
1496
1499
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tw-react-components",
3
3
  "description": "A set of React components build with TailwindCSS to make a nice dashboard.",
4
- "version": "0.0.182",
4
+ "version": "0.0.183",
5
5
  "license": "MIT",
6
6
  "homepage": "https://bacali95.github.io/tw-react-components",
7
7
  "type": "module",