next-recomponents 1.7.11 → 1.7.12
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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -0
- package/dist/index.mjs +12 -0
- package/package.json +1 -1
- package/src/index.tsx +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -40,6 +40,7 @@ interface Props$3 extends React$1.DetailedHTMLProps<React$1.FormHTMLAttributes<H
|
|
|
40
40
|
invalidMessage?: string;
|
|
41
41
|
loader?: React$1.ReactNode;
|
|
42
42
|
}
|
|
43
|
+
declare function useFormValues<T>(initial: Partial<T>): [Partial<T>, React$1.Dispatch<Partial<T>>];
|
|
43
44
|
declare function Form({ onSubmit, state, invalidMessage, children, loader, ...otherProps }: Props$3): react_jsx_runtime.JSX.Element;
|
|
44
45
|
|
|
45
46
|
interface InputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
@@ -188,4 +189,4 @@ interface CalendarProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputE
|
|
|
188
189
|
}
|
|
189
190
|
declare function MyCalendar({ enabledDates, onChange, defaultValue, className, ...otherProps }: CalendarProps): react_jsx_runtime.JSX.Element | null;
|
|
190
191
|
|
|
191
|
-
export { Alert, Button, Container, Form, Input, Modal, MyCalendar, Pre, Select, Table, type TableEventProps, TextArea, regularExpresions, useDates, useExcel, useResources };
|
|
192
|
+
export { Alert, Button, Container, Form, Input, Modal, MyCalendar, Pre, Select, Table, type TableEventProps, TextArea, regularExpresions, useDates, useExcel, useFormValues, useResources };
|
package/dist/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ interface Props$3 extends React$1.DetailedHTMLProps<React$1.FormHTMLAttributes<H
|
|
|
40
40
|
invalidMessage?: string;
|
|
41
41
|
loader?: React$1.ReactNode;
|
|
42
42
|
}
|
|
43
|
+
declare function useFormValues<T>(initial: Partial<T>): [Partial<T>, React$1.Dispatch<Partial<T>>];
|
|
43
44
|
declare function Form({ onSubmit, state, invalidMessage, children, loader, ...otherProps }: Props$3): react_jsx_runtime.JSX.Element;
|
|
44
45
|
|
|
45
46
|
interface InputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
@@ -188,4 +189,4 @@ interface CalendarProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputE
|
|
|
188
189
|
}
|
|
189
190
|
declare function MyCalendar({ enabledDates, onChange, defaultValue, className, ...otherProps }: CalendarProps): react_jsx_runtime.JSX.Element | null;
|
|
190
191
|
|
|
191
|
-
export { Alert, Button, Container, Form, Input, Modal, MyCalendar, Pre, Select, Table, type TableEventProps, TextArea, regularExpresions, useDates, useExcel, useResources };
|
|
192
|
+
export { Alert, Button, Container, Form, Input, Modal, MyCalendar, Pre, Select, Table, type TableEventProps, TextArea, regularExpresions, useDates, useExcel, useFormValues, useResources };
|
package/dist/index.js
CHANGED
|
@@ -2982,6 +2982,7 @@ __export(index_exports, {
|
|
|
2982
2982
|
regularExpresions: () => regular_expresions_default,
|
|
2983
2983
|
useDates: () => useDates,
|
|
2984
2984
|
useExcel: () => useExcel,
|
|
2985
|
+
useFormValues: () => useFormValues,
|
|
2985
2986
|
useResources: () => useResources
|
|
2986
2987
|
});
|
|
2987
2988
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -11017,6 +11018,17 @@ function Container({
|
|
|
11017
11018
|
// src/form/index.tsx
|
|
11018
11019
|
var import_react22 = __toESM(require("react"));
|
|
11019
11020
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
11021
|
+
function useFormValues(initial) {
|
|
11022
|
+
function reducer(st, action) {
|
|
11023
|
+
const newSt = __spreadValues(__spreadValues({}, st), action);
|
|
11024
|
+
return newSt;
|
|
11025
|
+
}
|
|
11026
|
+
const state = (0, import_react22.useReducer)(
|
|
11027
|
+
reducer,
|
|
11028
|
+
initial
|
|
11029
|
+
);
|
|
11030
|
+
return state;
|
|
11031
|
+
}
|
|
11020
11032
|
function Form(_a) {
|
|
11021
11033
|
var _b = _a, {
|
|
11022
11034
|
onSubmit,
|
|
@@ -44570,6 +44582,7 @@ function MyCalendar(_a) {
|
|
|
44570
44582
|
regularExpresions,
|
|
44571
44583
|
useDates,
|
|
44572
44584
|
useExcel,
|
|
44585
|
+
useFormValues,
|
|
44573
44586
|
useResources
|
|
44574
44587
|
});
|
|
44575
44588
|
/*! Bundled license information:
|
package/dist/index.mjs
CHANGED
|
@@ -11001,6 +11001,17 @@ import React2, {
|
|
|
11001
11001
|
useState as useState3
|
|
11002
11002
|
} from "react";
|
|
11003
11003
|
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
11004
|
+
function useFormValues(initial) {
|
|
11005
|
+
function reducer(st, action) {
|
|
11006
|
+
const newSt = __spreadValues(__spreadValues({}, st), action);
|
|
11007
|
+
return newSt;
|
|
11008
|
+
}
|
|
11009
|
+
const state = useReducer(
|
|
11010
|
+
reducer,
|
|
11011
|
+
initial
|
|
11012
|
+
);
|
|
11013
|
+
return state;
|
|
11014
|
+
}
|
|
11004
11015
|
function Form(_a) {
|
|
11005
11016
|
var _b = _a, {
|
|
11006
11017
|
onSubmit,
|
|
@@ -44563,6 +44574,7 @@ export {
|
|
|
44563
44574
|
regular_expresions_default as regularExpresions,
|
|
44564
44575
|
useDates,
|
|
44565
44576
|
useExcel,
|
|
44577
|
+
useFormValues,
|
|
44566
44578
|
useResources
|
|
44567
44579
|
};
|
|
44568
44580
|
/*! Bundled license information:
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED