@page-speed/forms 0.7.2 → 0.7.4
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/{chunk-4K6J2DOK.cjs → chunk-3VSPIJNK.cjs} +189 -156
- package/dist/chunk-3VSPIJNK.cjs.map +1 -0
- package/dist/{chunk-AG67TUZI.js → chunk-HX7733ID.js} +18 -7
- package/dist/chunk-HX7733ID.js.map +1 -0
- package/dist/{chunk-V4HMVPAB.cjs → chunk-MBOEVE6D.cjs} +35 -24
- package/dist/chunk-MBOEVE6D.cjs.map +1 -0
- package/dist/{chunk-WQ4HD5UD.cjs → chunk-PDMFWP5I.cjs} +55 -3
- package/dist/chunk-PDMFWP5I.cjs.map +1 -0
- package/dist/{chunk-SUF7WJS6.js → chunk-QHAQYOBT.js} +55 -4
- package/dist/chunk-QHAQYOBT.js.map +1 -0
- package/dist/{chunk-ZH6XDBWH.js → chunk-SF6NKDID.js} +79 -46
- package/dist/chunk-SF6NKDID.js.map +1 -0
- package/dist/core.cjs +9 -9
- package/dist/core.js +2 -2
- package/dist/index.cjs +13 -13
- package/dist/index.js +2 -2
- package/dist/inputs.cjs +14 -14
- package/dist/inputs.d.cts +12 -1
- package/dist/inputs.d.ts +12 -1
- package/dist/inputs.js +2 -2
- package/dist/integration.cjs +59 -25
- package/dist/integration.cjs.map +1 -1
- package/dist/integration.js +40 -6
- package/dist/integration.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-4K6J2DOK.cjs.map +0 -1
- package/dist/chunk-AG67TUZI.js.map +0 -1
- package/dist/chunk-SUF7WJS6.js.map +0 -1
- package/dist/chunk-V4HMVPAB.cjs.map +0 -1
- package/dist/chunk-WQ4HD5UD.cjs.map +0 -1
- package/dist/chunk-ZH6XDBWH.js.map +0 -1
package/dist/core.cjs
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('./chunk-V7JSGFCI.cjs');
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var chunkMBOEVE6D_cjs = require('./chunk-MBOEVE6D.cjs');
|
|
5
|
+
require('./chunk-PDMFWP5I.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "ButtonGroupForm", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkMBOEVE6D_cjs.ButtonGroupForm; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "Field", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkMBOEVE6D_cjs.Field; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "Form", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkMBOEVE6D_cjs.Form; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "FormContext", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkMBOEVE6D_cjs.FormContext; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "FormFeedback", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkMBOEVE6D_cjs.FormFeedback; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "useField", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkMBOEVE6D_cjs.useField; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "useForm", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkMBOEVE6D_cjs.useForm; }
|
|
36
36
|
});
|
|
37
37
|
//# sourceMappingURL=core.cjs.map
|
|
38
38
|
//# sourceMappingURL=core.cjs.map
|
package/dist/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './chunk-UBDA7CS5.js';
|
|
2
|
-
export { ButtonGroupForm, Field, Form, FormContext, FormFeedback, useField, useForm } from './chunk-
|
|
3
|
-
import './chunk-
|
|
2
|
+
export { ButtonGroupForm, Field, Form, FormContext, FormFeedback, useField, useForm } from './chunk-HX7733ID.js';
|
|
3
|
+
import './chunk-QHAQYOBT.js';
|
|
4
4
|
//# sourceMappingURL=core.js.map
|
|
5
5
|
//# sourceMappingURL=core.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('./chunk-V7JSGFCI.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkMBOEVE6D_cjs = require('./chunk-MBOEVE6D.cjs');
|
|
5
|
+
var chunkPDMFWP5I_cjs = require('./chunk-PDMFWP5I.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "Field", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkMBOEVE6D_cjs.Field; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "Form", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkMBOEVE6D_cjs.Form; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "FormContext", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkMBOEVE6D_cjs.FormContext; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "FormFeedback", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkMBOEVE6D_cjs.FormFeedback; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "useField", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkMBOEVE6D_cjs.useField; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "useForm", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkMBOEVE6D_cjs.useForm; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "FieldDescription", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkPDMFWP5I_cjs.FieldDescription; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "FieldError", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkPDMFWP5I_cjs.FieldError; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "FieldGroup", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkPDMFWP5I_cjs.FieldGroup; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "FieldWrapper", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkPDMFWP5I_cjs.Field; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "FormFieldLabel", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkPDMFWP5I_cjs.FieldLabel; }
|
|
52
52
|
});
|
|
53
53
|
//# sourceMappingURL=index.cjs.map
|
|
54
54
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './chunk-UBDA7CS5.js';
|
|
2
|
-
export { Field, Form, FormContext, FormFeedback, useField, useForm } from './chunk-
|
|
3
|
-
export { FieldDescription, FieldError, FieldGroup, Field as FieldWrapper, FieldLabel as FormFieldLabel } from './chunk-
|
|
2
|
+
export { Field, Form, FormContext, FormFeedback, useField, useForm } from './chunk-HX7733ID.js';
|
|
3
|
+
export { FieldDescription, FieldError, FieldGroup, Field as FieldWrapper, FieldLabel as FormFieldLabel } from './chunk-QHAQYOBT.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/inputs.cjs
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk3VSPIJNK_cjs = require('./chunk-3VSPIJNK.cjs');
|
|
4
|
+
var chunkPDMFWP5I_cjs = require('./chunk-PDMFWP5I.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Checkbox", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunk3VSPIJNK_cjs.Checkbox; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "CheckboxGroup", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunk3VSPIJNK_cjs.CheckboxGroup; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "DatePicker", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunk3VSPIJNK_cjs.DatePicker; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "DateRangePicker", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunk3VSPIJNK_cjs.DateRangePicker; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "FileInput", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunk3VSPIJNK_cjs.FileInput; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "MultiSelect", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunk3VSPIJNK_cjs.MultiSelect; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "Radio", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunk3VSPIJNK_cjs.Radio; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "Select", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunk3VSPIJNK_cjs.Select; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "Switch", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunk3VSPIJNK_cjs.Switch; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "TextArea", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunk3VSPIJNK_cjs.TextArea; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "TimePicker", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunk3VSPIJNK_cjs.TimePicker; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "TextInput", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkPDMFWP5I_cjs.TextInput; }
|
|
55
55
|
});
|
|
56
56
|
//# sourceMappingURL=inputs.cjs.map
|
|
57
57
|
//# sourceMappingURL=inputs.cjs.map
|
package/dist/inputs.d.cts
CHANGED
|
@@ -9,6 +9,7 @@ import { I as InputProps } from './types-BfZYTL89.cjs';
|
|
|
9
9
|
* - Valid value indicator (ring-2)
|
|
10
10
|
* - Form integration (onChange, onBlur)
|
|
11
11
|
* - Full accessibility support
|
|
12
|
+
* - Optional start/end icon support with automatic padding
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```tsx
|
|
@@ -26,7 +27,7 @@ import { I as InputProps } from './types-BfZYTL89.cjs';
|
|
|
26
27
|
*
|
|
27
28
|
* @see https://opensite.ai/developers/page-speed/forms/text-input
|
|
28
29
|
*/
|
|
29
|
-
declare function TextInput({ name, value, onChange, onBlur, placeholder, disabled, required, error, className, type, id, suppressValueRing, ...props }: InputProps<string> & {
|
|
30
|
+
declare function TextInput({ name, value, onChange, onBlur, placeholder, disabled, required, error, className, type, id, suppressValueRing, iconStart, iconEnd, ...props }: InputProps<string> & {
|
|
30
31
|
type?: "text" | "email" | "password" | "url" | "tel" | "search";
|
|
31
32
|
/**
|
|
32
33
|
* When true, suppresses the `ring-2 ring-ring` applied when a value is
|
|
@@ -34,6 +35,16 @@ declare function TextInput({ name, value, onChange, onBlur, placeholder, disable
|
|
|
34
35
|
* ButtonGroupForm) that renders its own unified ring.
|
|
35
36
|
*/
|
|
36
37
|
suppressValueRing?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Optional icon rendered at the start (left) of the input.
|
|
40
|
+
* Automatically adjusts input padding when provided.
|
|
41
|
+
*/
|
|
42
|
+
iconStart?: React.ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Optional icon rendered at the end (right) of the input.
|
|
45
|
+
* Automatically adjusts input padding when provided.
|
|
46
|
+
*/
|
|
47
|
+
iconEnd?: React.ReactNode;
|
|
37
48
|
}): React.JSX.Element;
|
|
38
49
|
declare namespace TextInput {
|
|
39
50
|
var displayName: string;
|
package/dist/inputs.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { I as InputProps } from './types-BfZYTL89.js';
|
|
|
9
9
|
* - Valid value indicator (ring-2)
|
|
10
10
|
* - Form integration (onChange, onBlur)
|
|
11
11
|
* - Full accessibility support
|
|
12
|
+
* - Optional start/end icon support with automatic padding
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```tsx
|
|
@@ -26,7 +27,7 @@ import { I as InputProps } from './types-BfZYTL89.js';
|
|
|
26
27
|
*
|
|
27
28
|
* @see https://opensite.ai/developers/page-speed/forms/text-input
|
|
28
29
|
*/
|
|
29
|
-
declare function TextInput({ name, value, onChange, onBlur, placeholder, disabled, required, error, className, type, id, suppressValueRing, ...props }: InputProps<string> & {
|
|
30
|
+
declare function TextInput({ name, value, onChange, onBlur, placeholder, disabled, required, error, className, type, id, suppressValueRing, iconStart, iconEnd, ...props }: InputProps<string> & {
|
|
30
31
|
type?: "text" | "email" | "password" | "url" | "tel" | "search";
|
|
31
32
|
/**
|
|
32
33
|
* When true, suppresses the `ring-2 ring-ring` applied when a value is
|
|
@@ -34,6 +35,16 @@ declare function TextInput({ name, value, onChange, onBlur, placeholder, disable
|
|
|
34
35
|
* ButtonGroupForm) that renders its own unified ring.
|
|
35
36
|
*/
|
|
36
37
|
suppressValueRing?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Optional icon rendered at the start (left) of the input.
|
|
40
|
+
* Automatically adjusts input padding when provided.
|
|
41
|
+
*/
|
|
42
|
+
iconStart?: React.ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Optional icon rendered at the end (right) of the input.
|
|
45
|
+
* Automatically adjusts input padding when provided.
|
|
46
|
+
*/
|
|
47
|
+
iconEnd?: React.ReactNode;
|
|
37
48
|
}): React.JSX.Element;
|
|
38
49
|
declare namespace TextInput {
|
|
39
50
|
var displayName: string;
|
package/dist/inputs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Checkbox, CheckboxGroup, DatePicker, DateRangePicker, FileInput, MultiSelect, Radio, Select, Switch, TextArea, TimePicker } from './chunk-
|
|
2
|
-
export { TextInput } from './chunk-
|
|
1
|
+
export { Checkbox, CheckboxGroup, DatePicker, DateRangePicker, FileInput, MultiSelect, Radio, Select, Switch, TextArea, TimePicker } from './chunk-SF6NKDID.js';
|
|
2
|
+
export { TextInput } from './chunk-QHAQYOBT.js';
|
|
3
3
|
//# sourceMappingURL=inputs.js.map
|
|
4
4
|
//# sourceMappingURL=inputs.js.map
|
package/dist/integration.cjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkMBOEVE6D_cjs = require('./chunk-MBOEVE6D.cjs');
|
|
4
|
+
var chunk3VSPIJNK_cjs = require('./chunk-3VSPIJNK.cjs');
|
|
5
|
+
var chunkPDMFWP5I_cjs = require('./chunk-PDMFWP5I.cjs');
|
|
6
6
|
var React2 = require('react');
|
|
7
|
+
var icon = require('@page-speed/icon');
|
|
7
8
|
|
|
8
9
|
function _interopNamespace(e) {
|
|
9
10
|
if (e && e.__esModule) return e;
|
|
@@ -394,7 +395,7 @@ function generateValidationSchema(fields) {
|
|
|
394
395
|
acc[field.name] = (value, allValues) => {
|
|
395
396
|
if (field.required) {
|
|
396
397
|
if (!value || typeof value === "string" && !value.trim()) {
|
|
397
|
-
const displayName = field.label ||
|
|
398
|
+
const displayName = field.label || chunkPDMFWP5I_cjs.humanizeFieldName(field.name);
|
|
398
399
|
return `${displayName} is required`;
|
|
399
400
|
}
|
|
400
401
|
}
|
|
@@ -566,7 +567,7 @@ function useContactForm(options) {
|
|
|
566
567
|
window.location.assign(destination);
|
|
567
568
|
}, 150);
|
|
568
569
|
}, [navigate, redirectUrl]);
|
|
569
|
-
const form =
|
|
570
|
+
const form = chunkMBOEVE6D_cjs.useForm({
|
|
570
571
|
initialValues: React2.useMemo(
|
|
571
572
|
() => generateInitialValues(formFields),
|
|
572
573
|
[formFields]
|
|
@@ -630,6 +631,28 @@ function useContactForm(options) {
|
|
|
630
631
|
resetSubmissionState
|
|
631
632
|
};
|
|
632
633
|
}
|
|
634
|
+
var FIELD_TYPE_ICON_MAP = {
|
|
635
|
+
email: "material-symbols/mark-email-unread-outline-rounded",
|
|
636
|
+
tel: "material-symbols/phone-iphone-outline",
|
|
637
|
+
url: "flowbite/link-solid"
|
|
638
|
+
};
|
|
639
|
+
function getDefaultIconStart(field) {
|
|
640
|
+
const iconName = FIELD_TYPE_ICON_MAP[field.type];
|
|
641
|
+
if (iconName) {
|
|
642
|
+
return /* @__PURE__ */ React2__namespace.createElement(icon.Icon, { name: iconName, apiKey: icon.DEFAULT_ICON_API_BASE_URL, size: 18 });
|
|
643
|
+
}
|
|
644
|
+
if (field.type === "text" && field.name === "table_server_name") {
|
|
645
|
+
return /* @__PURE__ */ React2__namespace.createElement(
|
|
646
|
+
icon.Icon,
|
|
647
|
+
{
|
|
648
|
+
name: "majesticons/user-box-line",
|
|
649
|
+
apiKey: icon.DEFAULT_ICON_API_BASE_URL,
|
|
650
|
+
size: 18
|
|
651
|
+
}
|
|
652
|
+
);
|
|
653
|
+
}
|
|
654
|
+
return void 0;
|
|
655
|
+
}
|
|
633
656
|
function DynamicFormField({
|
|
634
657
|
field,
|
|
635
658
|
className,
|
|
@@ -640,20 +663,30 @@ function DynamicFormField({
|
|
|
640
663
|
renderLabel = true
|
|
641
664
|
}) {
|
|
642
665
|
const fieldId = field.name;
|
|
666
|
+
const usesChoiceCard = React2__namespace.useMemo(() => {
|
|
667
|
+
return chunkPDMFWP5I_cjs.fieldIsChoiceCard(field);
|
|
668
|
+
}, [field.type, field.options]);
|
|
669
|
+
const fieldClassName = React2__namespace.useMemo(() => {
|
|
670
|
+
if (usesChoiceCard) {
|
|
671
|
+
return "p-4 border rounded rounded-lg bg-muted/20";
|
|
672
|
+
} else {
|
|
673
|
+
return "";
|
|
674
|
+
}
|
|
675
|
+
}, [usesChoiceCard]);
|
|
643
676
|
const usesGroupLegend = field.type === "radio" || field.type === "checkbox-group";
|
|
644
677
|
const usesInlineCheckboxLabel = field.type === "checkbox";
|
|
645
678
|
const shouldRenderFieldLabel = renderLabel && !usesGroupLegend && !usesInlineCheckboxLabel;
|
|
646
679
|
return /* @__PURE__ */ React2__namespace.createElement(
|
|
647
|
-
|
|
680
|
+
chunkMBOEVE6D_cjs.Field,
|
|
648
681
|
{
|
|
649
682
|
name: field.name,
|
|
650
683
|
label: shouldRenderFieldLabel ? field.label : void 0,
|
|
651
684
|
description: shouldRenderFieldLabel ? field.description : void 0,
|
|
652
685
|
required: field.required,
|
|
653
|
-
className
|
|
686
|
+
className: chunkPDMFWP5I_cjs.cn(fieldClassName, className)
|
|
654
687
|
},
|
|
655
688
|
({ field: formField, meta }) => /* @__PURE__ */ React2__namespace.createElement("div", null, (field.type === "text" || field.type === "email" || field.type === "tel" || field.type === "search" || field.type === "password" || field.type === "url") && /* @__PURE__ */ React2__namespace.createElement(
|
|
656
|
-
|
|
689
|
+
chunkPDMFWP5I_cjs.TextInput,
|
|
657
690
|
{
|
|
658
691
|
...formField,
|
|
659
692
|
id: fieldId,
|
|
@@ -661,10 +694,11 @@ function DynamicFormField({
|
|
|
661
694
|
placeholder: field.placeholder,
|
|
662
695
|
error: meta.touched && !!meta.error,
|
|
663
696
|
disabled: field.disabled,
|
|
664
|
-
"aria-label": field.label
|
|
697
|
+
"aria-label": field.label,
|
|
698
|
+
iconStart: getDefaultIconStart(field)
|
|
665
699
|
}
|
|
666
700
|
), field.type === "number" && /* @__PURE__ */ React2__namespace.createElement(
|
|
667
|
-
|
|
701
|
+
chunkPDMFWP5I_cjs.TextInput,
|
|
668
702
|
{
|
|
669
703
|
...formField,
|
|
670
704
|
id: fieldId,
|
|
@@ -675,7 +709,7 @@ function DynamicFormField({
|
|
|
675
709
|
"aria-label": field.label
|
|
676
710
|
}
|
|
677
711
|
), field.type === "textarea" && /* @__PURE__ */ React2__namespace.createElement(
|
|
678
|
-
|
|
712
|
+
chunk3VSPIJNK_cjs.TextArea,
|
|
679
713
|
{
|
|
680
714
|
...formField,
|
|
681
715
|
id: fieldId,
|
|
@@ -686,7 +720,7 @@ function DynamicFormField({
|
|
|
686
720
|
"aria-label": field.label
|
|
687
721
|
}
|
|
688
722
|
), field.type === "select" && field.options && /* @__PURE__ */ React2__namespace.createElement(
|
|
689
|
-
|
|
723
|
+
chunk3VSPIJNK_cjs.Select,
|
|
690
724
|
{
|
|
691
725
|
...formField,
|
|
692
726
|
id: fieldId,
|
|
@@ -697,7 +731,7 @@ function DynamicFormField({
|
|
|
697
731
|
"aria-label": field.label
|
|
698
732
|
}
|
|
699
733
|
), field.type === "multi-select" && field.options && /* @__PURE__ */ React2__namespace.createElement(
|
|
700
|
-
|
|
734
|
+
chunk3VSPIJNK_cjs.MultiSelect,
|
|
701
735
|
{
|
|
702
736
|
...formField,
|
|
703
737
|
id: fieldId,
|
|
@@ -708,7 +742,7 @@ function DynamicFormField({
|
|
|
708
742
|
"aria-label": field.label
|
|
709
743
|
}
|
|
710
744
|
), field.type === "radio" && field.options && /* @__PURE__ */ React2__namespace.createElement(
|
|
711
|
-
|
|
745
|
+
chunk3VSPIJNK_cjs.Radio,
|
|
712
746
|
{
|
|
713
747
|
...formField,
|
|
714
748
|
id: fieldId,
|
|
@@ -722,7 +756,7 @@ function DynamicFormField({
|
|
|
722
756
|
"aria-label": field.label
|
|
723
757
|
}
|
|
724
758
|
), field.type === "checkbox" && /* @__PURE__ */ React2__namespace.createElement(
|
|
725
|
-
|
|
759
|
+
chunk3VSPIJNK_cjs.Checkbox,
|
|
726
760
|
{
|
|
727
761
|
...formField,
|
|
728
762
|
id: fieldId,
|
|
@@ -736,7 +770,7 @@ function DynamicFormField({
|
|
|
736
770
|
"aria-label": field.label
|
|
737
771
|
}
|
|
738
772
|
), field.type === "checkbox-group" && field.options && /* @__PURE__ */ React2__namespace.createElement(
|
|
739
|
-
|
|
773
|
+
chunk3VSPIJNK_cjs.CheckboxGroup,
|
|
740
774
|
{
|
|
741
775
|
...formField,
|
|
742
776
|
id: fieldId,
|
|
@@ -750,7 +784,7 @@ function DynamicFormField({
|
|
|
750
784
|
"aria-label": field.label
|
|
751
785
|
}
|
|
752
786
|
), (field.type === "date-picker" || field.type === "date") && /* @__PURE__ */ React2__namespace.createElement(
|
|
753
|
-
|
|
787
|
+
chunk3VSPIJNK_cjs.DatePicker,
|
|
754
788
|
{
|
|
755
789
|
...formField,
|
|
756
790
|
id: fieldId,
|
|
@@ -760,7 +794,7 @@ function DynamicFormField({
|
|
|
760
794
|
"aria-label": field.label
|
|
761
795
|
}
|
|
762
796
|
), field.type === "date-range" && /* @__PURE__ */ React2__namespace.createElement(
|
|
763
|
-
|
|
797
|
+
chunk3VSPIJNK_cjs.DateRangePicker,
|
|
764
798
|
{
|
|
765
799
|
...formField,
|
|
766
800
|
id: fieldId,
|
|
@@ -770,7 +804,7 @@ function DynamicFormField({
|
|
|
770
804
|
"aria-label": field.label
|
|
771
805
|
}
|
|
772
806
|
), field.type === "time" && /* @__PURE__ */ React2__namespace.createElement(
|
|
773
|
-
|
|
807
|
+
chunk3VSPIJNK_cjs.TimePicker,
|
|
774
808
|
{
|
|
775
809
|
...formField,
|
|
776
810
|
id: fieldId,
|
|
@@ -780,7 +814,7 @@ function DynamicFormField({
|
|
|
780
814
|
"aria-label": field.label
|
|
781
815
|
}
|
|
782
816
|
), field.type === "file" && /* @__PURE__ */ React2__namespace.createElement(
|
|
783
|
-
|
|
817
|
+
chunk3VSPIJNK_cjs.FileInput,
|
|
784
818
|
{
|
|
785
819
|
...formField,
|
|
786
820
|
id: fieldId,
|
|
@@ -920,7 +954,7 @@ function FormEngine(props) {
|
|
|
920
954
|
};
|
|
921
955
|
}, [isButtonGroup, buttonGroupSetup, api]);
|
|
922
956
|
return /* @__PURE__ */ React2__namespace.createElement("div", { className: styleRules?.formContainer }, /* @__PURE__ */ React2__namespace.createElement(
|
|
923
|
-
|
|
957
|
+
chunkMBOEVE6D_cjs.Form,
|
|
924
958
|
{
|
|
925
959
|
form,
|
|
926
960
|
fields: isButtonGroup ? formFields : void 0,
|
|
@@ -940,8 +974,8 @@ function FormEngine(props) {
|
|
|
940
974
|
!isButtonGroup && /* @__PURE__ */ React2__namespace.createElement(React2__namespace.Fragment, null, /* @__PURE__ */ React2__namespace.createElement(
|
|
941
975
|
"div",
|
|
942
976
|
{
|
|
943
|
-
className:
|
|
944
|
-
"grid grid-cols-12 gap-6 md:gap-
|
|
977
|
+
className: chunkPDMFWP5I_cjs.cn(
|
|
978
|
+
"grid grid-cols-12 space-y-8 gap-x-6 md:gap-x-8",
|
|
945
979
|
styleRules?.fieldsContainer
|
|
946
980
|
)
|
|
947
981
|
},
|
|
@@ -949,7 +983,7 @@ function FormEngine(props) {
|
|
|
949
983
|
"div",
|
|
950
984
|
{
|
|
951
985
|
key: field.name,
|
|
952
|
-
className:
|
|
986
|
+
className: chunkPDMFWP5I_cjs.cn(
|
|
953
987
|
getColumnSpanClass(field.columnSpan ?? 12),
|
|
954
988
|
"min-w-0"
|
|
955
989
|
)
|
|
@@ -967,7 +1001,7 @@ function FormEngine(props) {
|
|
|
967
1001
|
)
|
|
968
1002
|
))
|
|
969
1003
|
), /* @__PURE__ */ React2__namespace.createElement(
|
|
970
|
-
|
|
1004
|
+
chunkPDMFWP5I_cjs.Button,
|
|
971
1005
|
{
|
|
972
1006
|
type: "submit",
|
|
973
1007
|
variant: submitButtonSetup?.submitVariant ?? DEFAULT_BUTTON_VARIANT,
|