@a-type/ui 0.6.11 → 0.6.13
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/cjs/components/forms/Form.d.ts +1 -1
- package/dist/cjs/components/forms/hooks.d.ts +2 -0
- package/dist/cjs/components/forms/hooks.js +7 -1
- package/dist/cjs/components/forms/hooks.js.map +1 -1
- package/dist/esm/components/forms/Form.d.ts +1 -1
- package/dist/esm/components/forms/hooks.d.ts +2 -0
- package/dist/esm/components/forms/hooks.js +5 -1
- package/dist/esm/components/forms/hooks.js.map +1 -1
- package/package.json +2 -2
- package/src/components/forms/hooks.ts +7 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
-
export declare const Form: import("react").FunctionComponent<
|
|
2
|
+
export declare const Form: import("react").FunctionComponent<Omit<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & import("react").RefAttributes<HTMLFormElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @unocss-include
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useField = void 0;
|
|
4
|
+
exports.useValues = exports.useSubmit = exports.useField = void 0;
|
|
5
5
|
const formik_1 = require("formik");
|
|
6
6
|
var formik_2 = require("formik");
|
|
7
7
|
Object.defineProperty(exports, "useField", { enumerable: true, get: function () { return formik_2.useField; } });
|
|
@@ -9,4 +9,10 @@ function useSubmit() {
|
|
|
9
9
|
const { submitForm, isSubmitting } = (0, formik_1.useFormikContext)();
|
|
10
10
|
return [submitForm, isSubmitting];
|
|
11
11
|
}
|
|
12
|
+
exports.useSubmit = useSubmit;
|
|
13
|
+
function useValues() {
|
|
14
|
+
const { values } = (0, formik_1.useFormikContext)();
|
|
15
|
+
return values;
|
|
16
|
+
}
|
|
17
|
+
exports.useValues = useValues;
|
|
12
18
|
//# sourceMappingURL=hooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../src/components/forms/hooks.ts"],"names":[],"mappings":";;;AAAA,mCAA0C;AAE1C,iCAAkC;AAAzB,kGAAA,QAAQ,OAAA;AAEjB,
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../src/components/forms/hooks.ts"],"names":[],"mappings":";;;AAAA,mCAA0C;AAE1C,iCAAkC;AAAzB,kGAAA,QAAQ,OAAA;AAEjB,SAAgB,SAAS;IACxB,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,IAAA,yBAAgB,GAAE,CAAC;IAExD,OAAO,CAAC,UAAU,EAAE,YAAY,CAAU,CAAC;AAC5C,CAAC;AAJD,8BAIC;AAED,SAAgB,SAAS;IACxB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,yBAAgB,GAAE,CAAC;IAEtC,OAAO,MAAM,CAAC;AACf,CAAC;AAJD,8BAIC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
-
export declare const Form: import("react").FunctionComponent<
|
|
2
|
+
export declare const Form: import("react").FunctionComponent<Omit<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & import("react").RefAttributes<HTMLFormElement>>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
// @unocss-include
|
|
2
2
|
import { useFormikContext } from 'formik';
|
|
3
3
|
export { useField } from 'formik';
|
|
4
|
-
function useSubmit() {
|
|
4
|
+
export function useSubmit() {
|
|
5
5
|
const { submitForm, isSubmitting } = useFormikContext();
|
|
6
6
|
return [submitForm, isSubmitting];
|
|
7
7
|
}
|
|
8
|
+
export function useValues() {
|
|
9
|
+
const { values } = useFormikContext();
|
|
10
|
+
return values;
|
|
11
|
+
}
|
|
8
12
|
//# sourceMappingURL=hooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../src/components/forms/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../src/components/forms/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,MAAM,UAAU,SAAS;IACxB,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAExD,OAAO,CAAC,UAAU,EAAE,YAAY,CAAU,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,SAAS;IACxB,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAEtC,OAAO,MAAM,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a-type/ui",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"/dist",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"color-parse": "^2.0.0",
|
|
70
70
|
"color-space": "^2.0.1",
|
|
71
71
|
"date-fns": "^2.29.3",
|
|
72
|
-
"formik": "^2.
|
|
72
|
+
"formik": "^2.4.5",
|
|
73
73
|
"pluralize": "^8.0.0",
|
|
74
74
|
"prosemirror-model": "^1.18.0",
|
|
75
75
|
"react": "18.2.0",
|
|
@@ -2,8 +2,14 @@ import { useFormikContext } from 'formik';
|
|
|
2
2
|
|
|
3
3
|
export { useField } from 'formik';
|
|
4
4
|
|
|
5
|
-
function useSubmit() {
|
|
5
|
+
export function useSubmit() {
|
|
6
6
|
const { submitForm, isSubmitting } = useFormikContext();
|
|
7
7
|
|
|
8
8
|
return [submitForm, isSubmitting] as const;
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
export function useValues() {
|
|
12
|
+
const { values } = useFormikContext();
|
|
13
|
+
|
|
14
|
+
return values;
|
|
15
|
+
}
|