@fuf-stack/uniform 0.0.3 → 0.0.5
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/Form/index.cjs +5 -143
- package/dist/Form/index.cjs.map +1 -1
- package/dist/Form/index.d.cts +8 -27
- package/dist/Form/index.d.ts +8 -27
- package/dist/Form/index.js +6 -144
- package/dist/Form/index.js.map +1 -1
- package/dist/Form-Bv0R3QNk.d.cts +29 -0
- package/dist/Form-Bv0R3QNk.d.ts +29 -0
- package/dist/Grid/index.cjs +5 -14
- package/dist/Grid/index.cjs.map +1 -1
- package/dist/Grid/index.d.cts +6 -15
- package/dist/Grid/index.d.ts +6 -15
- package/dist/Grid/index.js +5 -14
- package/dist/Grid/index.js.map +1 -1
- package/dist/Grid-DF3L9NF3.d.cts +17 -0
- package/dist/Grid-DF3L9NF3.d.ts +17 -0
- package/dist/SubmitButton/index.cjs +4 -3
- package/dist/SubmitButton/index.cjs.map +1 -1
- package/dist/SubmitButton/index.d.cts +2 -2
- package/dist/SubmitButton/index.d.ts +2 -2
- package/dist/SubmitButton/index.js +2 -1
- package/dist/SubmitButton/index.js.map +1 -1
- package/dist/chunk-4BELEHDQ.cjs +159 -0
- package/dist/chunk-4BELEHDQ.cjs.map +1 -0
- package/dist/chunk-4MEKDDB2.js +20 -0
- package/dist/chunk-4MEKDDB2.js.map +1 -0
- package/dist/chunk-6XKDXQ4A.js +159 -0
- package/dist/chunk-6XKDXQ4A.js.map +1 -0
- package/dist/chunk-ZPFKVKGV.cjs +20 -0
- package/dist/chunk-ZPFKVKGV.cjs.map +1 -0
- package/dist/index.cjs +13 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/partials/FieldCopyTestIdButton/index.cjs +3 -4
- package/dist/partials/FieldCopyTestIdButton/index.cjs.map +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.js +1 -2
- package/dist/partials/FieldCopyTestIdButton/index.js.map +1 -1
- package/package.json +20 -9
package/dist/Form/index.cjs
CHANGED
|
@@ -1,149 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk4BELEHDQcjs = require('../chunk-4BELEHDQ.cjs');
|
|
5
|
+
require('../chunk-WQRM7G4C.cjs');
|
|
6
|
+
require('../chunk-BBB4FEY6.cjs');
|
|
5
7
|
|
|
6
8
|
|
|
7
|
-
var _chunkBBB4FEY6cjs = require('../chunk-BBB4FEY6.cjs');
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
var _react = require('react');
|
|
11
|
-
var _reacthookform = require('react-hook-form');
|
|
12
|
-
var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames);
|
|
13
|
-
|
|
14
|
-
// src/Form/subcomponents/FormDebugViewer.tsx
|
|
15
|
-
|
|
16
|
-
var _fa = require('react-icons/fa');
|
|
17
|
-
var _fa6 = require('react-icons/fa6');
|
|
18
|
-
|
|
19
|
-
var _Button = require('@fuf-stack/pixels/Button'); var _Button2 = _interopRequireDefault(_Button);
|
|
20
|
-
var _Card = require('@fuf-stack/pixels/Card'); var _Card2 = _interopRequireDefault(_Card);
|
|
21
|
-
var _useLocalStorage = require('@fuf-stack/pixels/hooks/useLocalStorage'); var _useLocalStorage2 = _interopRequireDefault(_useLocalStorage);
|
|
22
|
-
var _Json = require('@fuf-stack/pixels/Json'); var _Json2 = _interopRequireDefault(_Json);
|
|
23
|
-
var _jsxruntime = require('react/jsx-runtime');
|
|
24
|
-
var LOCALSTORAGE_DEBUG_KEY = "uniform:form-debug-enabled";
|
|
25
|
-
var FormDebugViewer = ({ className = void 0 }) => {
|
|
26
|
-
const {
|
|
27
|
-
watch,
|
|
28
|
-
formState: { dirtyFields, isValid, isSubmitting },
|
|
29
|
-
validation
|
|
30
|
-
} = _chunkWQRM7G4Ccjs.useFormContext.call(void 0, );
|
|
31
|
-
const [debug, setDebug] = _useLocalStorage2.default.call(void 0, LOCALSTORAGE_DEBUG_KEY, false);
|
|
32
|
-
const [validationErrors, setValidationErrors] = _react.useState.call(void 0, null);
|
|
33
|
-
const formValues = watch();
|
|
34
|
-
_react.useEffect.call(void 0, () => {
|
|
35
|
-
const updateValidationErrors = async () => {
|
|
36
|
-
if (validation) {
|
|
37
|
-
const validateResult = await _optionalChain([validation, 'optionalAccess', _ => _.validateAsync, 'call', _2 => _2(formValues)]);
|
|
38
|
-
setValidationErrors(_optionalChain([validateResult, 'optionalAccess', _3 => _3.errors]));
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
updateValidationErrors();
|
|
42
|
-
}, [JSON.stringify(formValues)]);
|
|
43
|
-
if (!debug) {
|
|
44
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
45
|
-
_Button2.default,
|
|
46
|
-
{
|
|
47
|
-
ariaLabel: "Enable form debug mode",
|
|
48
|
-
onClick: () => setDebug(!debug),
|
|
49
|
-
className: "absolute bottom-2.5 right-2.5 w-5 text-default-400",
|
|
50
|
-
variant: "light",
|
|
51
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _fa6.FaBug, {})
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
56
|
-
_Card2.default,
|
|
57
|
-
{
|
|
58
|
-
className: _classnames2.default.call(void 0, className),
|
|
59
|
-
header: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-row justify-between", children: [
|
|
60
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-lg", children: "Debug Mode" }),
|
|
61
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
62
|
-
_Button2.default,
|
|
63
|
-
{
|
|
64
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _fa.FaTimes, { className: "text-danger" }),
|
|
65
|
-
onClick: () => setDebug(false),
|
|
66
|
-
size: "sm",
|
|
67
|
-
variant: "flat"
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
] }),
|
|
71
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
72
|
-
_Json2.default,
|
|
73
|
-
{
|
|
74
|
-
value: {
|
|
75
|
-
values: formValues,
|
|
76
|
-
errors: validationErrors,
|
|
77
|
-
dirtyFields,
|
|
78
|
-
isValid,
|
|
79
|
-
isSubmitting
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
var FormDebugViewer_default = FormDebugViewer;
|
|
87
|
-
|
|
88
|
-
// src/Form/Form.tsx
|
|
89
|
-
|
|
90
|
-
var removeNullishFields = (obj) => {
|
|
91
|
-
return JSON.parse(
|
|
92
|
-
JSON.stringify(obj, (_key, value) => {
|
|
93
|
-
return value === null ? void 0 : value;
|
|
94
|
-
})
|
|
95
|
-
);
|
|
96
|
-
};
|
|
97
|
-
var Form = ({
|
|
98
|
-
children,
|
|
99
|
-
className = void 0,
|
|
100
|
-
initialValues = void 0,
|
|
101
|
-
name = void 0,
|
|
102
|
-
onSubmit,
|
|
103
|
-
testId = void 0,
|
|
104
|
-
validation = void 0,
|
|
105
|
-
validationTrigger = "all"
|
|
106
|
-
}) => {
|
|
107
|
-
const methods = _reacthookform.useForm.call(void 0,
|
|
108
|
-
validation ? {
|
|
109
|
-
defaultValues: initialValues,
|
|
110
|
-
resolver: async (values) => {
|
|
111
|
-
const { data, errors, ...rest } = await validation.validateAsync(
|
|
112
|
-
removeNullishFields(values)
|
|
113
|
-
);
|
|
114
|
-
return { values: data || {}, errors: errors || {}, ...rest };
|
|
115
|
-
},
|
|
116
|
-
// set rhf mode
|
|
117
|
-
// see: https://react-hook-form.com/docs/useform#mode
|
|
118
|
-
mode: validationTrigger === "all-instant" ? "all" : validationTrigger
|
|
119
|
-
} : {
|
|
120
|
-
defaultValues: initialValues
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
_react.useEffect.call(void 0, () => {
|
|
124
|
-
if (validationTrigger === "all-instant") {
|
|
125
|
-
methods.trigger();
|
|
126
|
-
}
|
|
127
|
-
}, []);
|
|
128
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWQRM7G4Ccjs.FormContext_default, { ...methods, validation, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-row justify-between gap-6", children: [
|
|
129
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
130
|
-
"form",
|
|
131
|
-
{
|
|
132
|
-
className: _classnames2.default.call(void 0, "flex-grow", className),
|
|
133
|
-
"data-testid": _chunkBBB4FEY6cjs.slugify.call(void 0, testId || name || ""),
|
|
134
|
-
name,
|
|
135
|
-
onSubmit: methods.handleSubmit(onSubmit),
|
|
136
|
-
children
|
|
137
|
-
}
|
|
138
|
-
),
|
|
139
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, FormDebugViewer_default, { className: "w-96 flex-shrink" })
|
|
140
|
-
] }) });
|
|
141
|
-
};
|
|
142
|
-
var Form_default = Form;
|
|
143
|
-
|
|
144
|
-
// src/Form/index.ts
|
|
145
|
-
var Form_default2 = Form_default;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
exports.default = Form_default2;
|
|
10
|
+
exports.Form = _chunk4BELEHDQcjs.Form_default; exports.default = _chunk4BELEHDQcjs.Form_default2;
|
|
149
11
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Form/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/Form/index.d.cts
CHANGED
|
@@ -1,29 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { F as Form } from '../Form-Bv0R3QNk.cjs';
|
|
2
|
+
export { a as FormProps } from '../Form-Bv0R3QNk.cjs';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import '@fuf-stack/veto';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'react-hook-form';
|
|
5
7
|
|
|
6
|
-
interface FormProps {
|
|
7
|
-
/** form children */
|
|
8
|
-
children: ReactNode | ReactNode[];
|
|
9
|
-
/** CSS class name */
|
|
10
|
-
className?: string | string[];
|
|
11
|
-
/** initial form values */
|
|
12
|
-
initialValues?: FieldValues;
|
|
13
|
-
/** name of the form */
|
|
14
|
-
name?: string;
|
|
15
|
-
/** form submit handler */
|
|
16
|
-
onSubmit: SubmitHandler<FieldValues>;
|
|
17
|
-
/** HTML data-testid attribute used in e2e tests */
|
|
18
|
-
testId?: string;
|
|
19
|
-
/** veto validation schema */
|
|
20
|
-
validation?: VetoInstance;
|
|
21
|
-
/** when the validation should be triggered */
|
|
22
|
-
validationTrigger?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all' | 'all-instant';
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Form component that has to wrap every uniform
|
|
26
|
-
*/
|
|
27
|
-
declare const Form: ({ children, className, initialValues, name, onSubmit, testId, validation, validationTrigger, }: FormProps) => react_jsx_runtime.JSX.Element;
|
|
28
8
|
|
|
29
|
-
|
|
9
|
+
|
|
10
|
+
export { Form, Form as default };
|
package/dist/Form/index.d.ts
CHANGED
|
@@ -1,29 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { F as Form } from '../Form-Bv0R3QNk.js';
|
|
2
|
+
export { a as FormProps } from '../Form-Bv0R3QNk.js';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import '@fuf-stack/veto';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'react-hook-form';
|
|
5
7
|
|
|
6
|
-
interface FormProps {
|
|
7
|
-
/** form children */
|
|
8
|
-
children: ReactNode | ReactNode[];
|
|
9
|
-
/** CSS class name */
|
|
10
|
-
className?: string | string[];
|
|
11
|
-
/** initial form values */
|
|
12
|
-
initialValues?: FieldValues;
|
|
13
|
-
/** name of the form */
|
|
14
|
-
name?: string;
|
|
15
|
-
/** form submit handler */
|
|
16
|
-
onSubmit: SubmitHandler<FieldValues>;
|
|
17
|
-
/** HTML data-testid attribute used in e2e tests */
|
|
18
|
-
testId?: string;
|
|
19
|
-
/** veto validation schema */
|
|
20
|
-
validation?: VetoInstance;
|
|
21
|
-
/** when the validation should be triggered */
|
|
22
|
-
validationTrigger?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all' | 'all-instant';
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Form component that has to wrap every uniform
|
|
26
|
-
*/
|
|
27
|
-
declare const Form: ({ children, className, initialValues, name, onSubmit, testId, validation, validationTrigger, }: FormProps) => react_jsx_runtime.JSX.Element;
|
|
28
8
|
|
|
29
|
-
|
|
9
|
+
|
|
10
|
+
export { Form, Form as default };
|
package/dist/Form/index.js
CHANGED
|
@@ -1,149 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
} from "../chunk-V46BHM2U.js";
|
|
8
|
-
|
|
9
|
-
// src/Form/Form.tsx
|
|
10
|
-
import { useEffect as useEffect2 } from "react";
|
|
11
|
-
import { useForm } from "react-hook-form";
|
|
12
|
-
import cn2 from "classnames";
|
|
13
|
-
|
|
14
|
-
// src/Form/subcomponents/FormDebugViewer.tsx
|
|
15
|
-
import { useEffect, useState } from "react";
|
|
16
|
-
import { FaTimes } from "react-icons/fa";
|
|
17
|
-
import { FaBug } from "react-icons/fa6";
|
|
18
|
-
import cn from "classnames";
|
|
19
|
-
import Button from "@fuf-stack/pixels/Button";
|
|
20
|
-
import Card from "@fuf-stack/pixels/Card";
|
|
21
|
-
import useLocalStorage from "@fuf-stack/pixels/hooks/useLocalStorage";
|
|
22
|
-
import Json from "@fuf-stack/pixels/Json";
|
|
23
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
-
var LOCALSTORAGE_DEBUG_KEY = "uniform:form-debug-enabled";
|
|
25
|
-
var FormDebugViewer = ({ className = void 0 }) => {
|
|
26
|
-
const {
|
|
27
|
-
watch,
|
|
28
|
-
formState: { dirtyFields, isValid, isSubmitting },
|
|
29
|
-
validation
|
|
30
|
-
} = useFormContext();
|
|
31
|
-
const [debug, setDebug] = useLocalStorage(LOCALSTORAGE_DEBUG_KEY, false);
|
|
32
|
-
const [validationErrors, setValidationErrors] = useState(null);
|
|
33
|
-
const formValues = watch();
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
const updateValidationErrors = async () => {
|
|
36
|
-
if (validation) {
|
|
37
|
-
const validateResult = await validation?.validateAsync(formValues);
|
|
38
|
-
setValidationErrors(validateResult?.errors);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
updateValidationErrors();
|
|
42
|
-
}, [JSON.stringify(formValues)]);
|
|
43
|
-
if (!debug) {
|
|
44
|
-
return /* @__PURE__ */ jsx(
|
|
45
|
-
Button,
|
|
46
|
-
{
|
|
47
|
-
ariaLabel: "Enable form debug mode",
|
|
48
|
-
onClick: () => setDebug(!debug),
|
|
49
|
-
className: "absolute bottom-2.5 right-2.5 w-5 text-default-400",
|
|
50
|
-
variant: "light",
|
|
51
|
-
icon: /* @__PURE__ */ jsx(FaBug, {})
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
return /* @__PURE__ */ jsx(
|
|
56
|
-
Card,
|
|
57
|
-
{
|
|
58
|
-
className: cn(className),
|
|
59
|
-
header: /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-row justify-between", children: [
|
|
60
|
-
/* @__PURE__ */ jsx("span", { className: "text-lg", children: "Debug Mode" }),
|
|
61
|
-
/* @__PURE__ */ jsx(
|
|
62
|
-
Button,
|
|
63
|
-
{
|
|
64
|
-
icon: /* @__PURE__ */ jsx(FaTimes, { className: "text-danger" }),
|
|
65
|
-
onClick: () => setDebug(false),
|
|
66
|
-
size: "sm",
|
|
67
|
-
variant: "flat"
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
] }),
|
|
71
|
-
children: /* @__PURE__ */ jsx(
|
|
72
|
-
Json,
|
|
73
|
-
{
|
|
74
|
-
value: {
|
|
75
|
-
values: formValues,
|
|
76
|
-
errors: validationErrors,
|
|
77
|
-
dirtyFields,
|
|
78
|
-
isValid,
|
|
79
|
-
isSubmitting
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
var FormDebugViewer_default = FormDebugViewer;
|
|
87
|
-
|
|
88
|
-
// src/Form/Form.tsx
|
|
89
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
90
|
-
var removeNullishFields = (obj) => {
|
|
91
|
-
return JSON.parse(
|
|
92
|
-
JSON.stringify(obj, (_key, value) => {
|
|
93
|
-
return value === null ? void 0 : value;
|
|
94
|
-
})
|
|
95
|
-
);
|
|
96
|
-
};
|
|
97
|
-
var Form = ({
|
|
98
|
-
children,
|
|
99
|
-
className = void 0,
|
|
100
|
-
initialValues = void 0,
|
|
101
|
-
name = void 0,
|
|
102
|
-
onSubmit,
|
|
103
|
-
testId = void 0,
|
|
104
|
-
validation = void 0,
|
|
105
|
-
validationTrigger = "all"
|
|
106
|
-
}) => {
|
|
107
|
-
const methods = useForm(
|
|
108
|
-
validation ? {
|
|
109
|
-
defaultValues: initialValues,
|
|
110
|
-
resolver: async (values) => {
|
|
111
|
-
const { data, errors, ...rest } = await validation.validateAsync(
|
|
112
|
-
removeNullishFields(values)
|
|
113
|
-
);
|
|
114
|
-
return { values: data || {}, errors: errors || {}, ...rest };
|
|
115
|
-
},
|
|
116
|
-
// set rhf mode
|
|
117
|
-
// see: https://react-hook-form.com/docs/useform#mode
|
|
118
|
-
mode: validationTrigger === "all-instant" ? "all" : validationTrigger
|
|
119
|
-
} : {
|
|
120
|
-
defaultValues: initialValues
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
useEffect2(() => {
|
|
124
|
-
if (validationTrigger === "all-instant") {
|
|
125
|
-
methods.trigger();
|
|
126
|
-
}
|
|
127
|
-
}, []);
|
|
128
|
-
return /* @__PURE__ */ jsx2(FormContext_default, { ...methods, validation, children: /* @__PURE__ */ jsxs2("div", { className: "flex w-full flex-row justify-between gap-6", children: [
|
|
129
|
-
/* @__PURE__ */ jsx2(
|
|
130
|
-
"form",
|
|
131
|
-
{
|
|
132
|
-
className: cn2("flex-grow", className),
|
|
133
|
-
"data-testid": slugify(testId || name || ""),
|
|
134
|
-
name,
|
|
135
|
-
onSubmit: methods.handleSubmit(onSubmit),
|
|
136
|
-
children
|
|
137
|
-
}
|
|
138
|
-
),
|
|
139
|
-
/* @__PURE__ */ jsx2(FormDebugViewer_default, { className: "w-96 flex-shrink" })
|
|
140
|
-
] }) });
|
|
141
|
-
};
|
|
142
|
-
var Form_default = Form;
|
|
143
|
-
|
|
144
|
-
// src/Form/index.ts
|
|
145
|
-
var Form_default2 = Form_default;
|
|
2
|
+
Form_default,
|
|
3
|
+
Form_default2
|
|
4
|
+
} from "../chunk-6XKDXQ4A.js";
|
|
5
|
+
import "../chunk-BCMPSLSG.js";
|
|
6
|
+
import "../chunk-V46BHM2U.js";
|
|
146
7
|
export {
|
|
8
|
+
Form_default as Form,
|
|
147
9
|
Form_default2 as default
|
|
148
10
|
};
|
|
149
11
|
//# sourceMappingURL=index.js.map
|
package/dist/Form/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { VetoInstance } from '@fuf-stack/veto';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { FieldValues, SubmitHandler } from 'react-hook-form';
|
|
5
|
+
|
|
6
|
+
interface FormProps {
|
|
7
|
+
/** form children */
|
|
8
|
+
children: ReactNode | ReactNode[];
|
|
9
|
+
/** CSS class name */
|
|
10
|
+
className?: string | string[];
|
|
11
|
+
/** initial form values */
|
|
12
|
+
initialValues?: FieldValues;
|
|
13
|
+
/** name of the form */
|
|
14
|
+
name?: string;
|
|
15
|
+
/** form submit handler */
|
|
16
|
+
onSubmit: SubmitHandler<FieldValues>;
|
|
17
|
+
/** HTML data-testid attribute used in e2e tests */
|
|
18
|
+
testId?: string;
|
|
19
|
+
/** veto validation schema */
|
|
20
|
+
validation?: VetoInstance;
|
|
21
|
+
/** when the validation should be triggered */
|
|
22
|
+
validationTrigger?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all' | 'all-instant';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Form component that has to wrap every uniform
|
|
26
|
+
*/
|
|
27
|
+
declare const Form: ({ children, className, initialValues, name, onSubmit, testId, validation, validationTrigger, }: FormProps) => react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
export { Form as F, type FormProps as a };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { VetoInstance } from '@fuf-stack/veto';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { FieldValues, SubmitHandler } from 'react-hook-form';
|
|
5
|
+
|
|
6
|
+
interface FormProps {
|
|
7
|
+
/** form children */
|
|
8
|
+
children: ReactNode | ReactNode[];
|
|
9
|
+
/** CSS class name */
|
|
10
|
+
className?: string | string[];
|
|
11
|
+
/** initial form values */
|
|
12
|
+
initialValues?: FieldValues;
|
|
13
|
+
/** name of the form */
|
|
14
|
+
name?: string;
|
|
15
|
+
/** form submit handler */
|
|
16
|
+
onSubmit: SubmitHandler<FieldValues>;
|
|
17
|
+
/** HTML data-testid attribute used in e2e tests */
|
|
18
|
+
testId?: string;
|
|
19
|
+
/** veto validation schema */
|
|
20
|
+
validation?: VetoInstance;
|
|
21
|
+
/** when the validation should be triggered */
|
|
22
|
+
validationTrigger?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all' | 'all-instant';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Form component that has to wrap every uniform
|
|
26
|
+
*/
|
|
27
|
+
declare const Form: ({ children, className, initialValues, name, onSubmit, testId, validation, validationTrigger, }: FormProps) => react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
export { Form as F, type FormProps as a };
|
package/dist/Grid/index.cjs
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames);
|
|
3
|
-
var _jsxruntime = require('react/jsx-runtime');
|
|
4
|
-
var Grid = ({
|
|
5
|
-
children = null,
|
|
6
|
-
className = void 0,
|
|
7
|
-
testId = void 0
|
|
8
|
-
}) => {
|
|
9
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _classnames2.default.call(void 0, "grid gap-6", className), "data-testid": testId, children });
|
|
10
|
-
};
|
|
11
|
-
var Grid_default = Grid;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
12
2
|
|
|
13
|
-
// src/Grid/index.ts
|
|
14
|
-
var Grid_default2 = Grid_default;
|
|
15
3
|
|
|
4
|
+
var _chunkZPFKVKGVcjs = require('../chunk-ZPFKVKGV.cjs');
|
|
16
5
|
|
|
17
|
-
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.Grid = _chunkZPFKVKGVcjs.Grid_default; exports.default = _chunkZPFKVKGVcjs.Grid_default2;
|
|
18
9
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Grid/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/Grid/index.d.cts
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { G as Grid } from '../Grid-DF3L9NF3.cjs';
|
|
2
|
+
export { a as GridProps } from '../Grid-DF3L9NF3.cjs';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'react';
|
|
3
5
|
|
|
4
|
-
interface GridProps {
|
|
5
|
-
/** child components */
|
|
6
|
-
children?: ReactNode;
|
|
7
|
-
/** CSS class name */
|
|
8
|
-
className?: string;
|
|
9
|
-
/** HTML data-testid attribute used in e2e tests */
|
|
10
|
-
testId?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Defines the default grid for form components
|
|
14
|
-
*/
|
|
15
|
-
declare const Grid: ({ children, className, testId, }: GridProps) => react_jsx_runtime.JSX.Element;
|
|
16
6
|
|
|
17
|
-
|
|
7
|
+
|
|
8
|
+
export { Grid, Grid as default };
|
package/dist/Grid/index.d.ts
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { G as Grid } from '../Grid-DF3L9NF3.js';
|
|
2
|
+
export { a as GridProps } from '../Grid-DF3L9NF3.js';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'react';
|
|
3
5
|
|
|
4
|
-
interface GridProps {
|
|
5
|
-
/** child components */
|
|
6
|
-
children?: ReactNode;
|
|
7
|
-
/** CSS class name */
|
|
8
|
-
className?: string;
|
|
9
|
-
/** HTML data-testid attribute used in e2e tests */
|
|
10
|
-
testId?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Defines the default grid for form components
|
|
14
|
-
*/
|
|
15
|
-
declare const Grid: ({ children, className, testId, }: GridProps) => react_jsx_runtime.JSX.Element;
|
|
16
6
|
|
|
17
|
-
|
|
7
|
+
|
|
8
|
+
export { Grid, Grid as default };
|
package/dist/Grid/index.js
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
children = null,
|
|
6
|
-
className = void 0,
|
|
7
|
-
testId = void 0
|
|
8
|
-
}) => {
|
|
9
|
-
return /* @__PURE__ */ jsx("div", { className: cn("grid gap-6", className), "data-testid": testId, children });
|
|
10
|
-
};
|
|
11
|
-
var Grid_default = Grid;
|
|
12
|
-
|
|
13
|
-
// src/Grid/index.ts
|
|
14
|
-
var Grid_default2 = Grid_default;
|
|
1
|
+
import {
|
|
2
|
+
Grid_default,
|
|
3
|
+
Grid_default2
|
|
4
|
+
} from "../chunk-4MEKDDB2.js";
|
|
15
5
|
export {
|
|
6
|
+
Grid_default as Grid,
|
|
16
7
|
Grid_default2 as default
|
|
17
8
|
};
|
|
18
9
|
//# sourceMappingURL=index.js.map
|
package/dist/Grid/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface GridProps {
|
|
5
|
+
/** child components */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/** CSS class name */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** HTML data-testid attribute used in e2e tests */
|
|
10
|
+
testId?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Defines the default grid for form components
|
|
14
|
+
*/
|
|
15
|
+
declare const Grid: ({ children, className, testId, }: GridProps) => react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { Grid as G, type GridProps as a };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface GridProps {
|
|
5
|
+
/** child components */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/** CSS class name */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** HTML data-testid attribute used in e2e tests */
|
|
10
|
+
testId?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Defines the default grid for form components
|
|
14
|
+
*/
|
|
15
|
+
declare const Grid: ({ children, className, testId, }: GridProps) => react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { Grid as G, type GridProps as a };
|