@page-speed/forms 0.5.7 → 0.5.8
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/FormContext-089h0j0Q.d.ts +153 -0
- package/dist/FormContext-iHzBALZa.d.cts +153 -0
- package/dist/{chunk-A7R6GEMA.js → chunk-455PI4LV.js} +84 -3
- package/dist/chunk-455PI4LV.js.map +1 -0
- package/dist/{chunk-5WWMVS2I.js → chunk-4ROWNTY6.js} +334 -415
- package/dist/chunk-4ROWNTY6.js.map +1 -0
- package/dist/{chunk-FIDKDYT7.cjs → chunk-ED4UK63G.cjs} +439 -521
- package/dist/chunk-ED4UK63G.cjs.map +1 -0
- package/dist/chunk-IXHDJ7E5.js +263 -0
- package/dist/chunk-IXHDJ7E5.js.map +1 -0
- package/dist/{chunk-Q7VR374Y.js → chunk-MJYEXJ3U.js} +3 -3
- package/dist/{chunk-Q7VR374Y.js.map → chunk-MJYEXJ3U.js.map} +1 -1
- package/dist/{chunk-KPHMVGTU.cjs → chunk-MUBEMXI7.cjs} +6 -6
- package/dist/{chunk-KPHMVGTU.cjs.map → chunk-MUBEMXI7.cjs.map} +1 -1
- package/dist/chunk-Q7WXLZN5.cjs +287 -0
- package/dist/chunk-Q7WXLZN5.cjs.map +1 -0
- package/dist/{chunk-QQSBW6N3.cjs → chunk-QRI5TMES.cjs} +85 -2
- package/dist/chunk-QRI5TMES.cjs.map +1 -0
- package/dist/core.cjs +13 -9
- package/dist/core.d.cts +66 -141
- package/dist/core.d.ts +66 -141
- package/dist/core.js +3 -3
- package/dist/index.cjs +14 -14
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/inputs.cjs +16 -16
- package/dist/inputs.d.cts +1 -1
- package/dist/inputs.d.ts +1 -1
- package/dist/inputs.js +2 -2
- package/dist/integration.cjs +17 -17
- package/dist/integration.d.cts +1 -1
- package/dist/integration.d.ts +1 -1
- package/dist/integration.js +3 -3
- package/dist/{types-CnOCn7b3.d.ts → types-BemGfSPA.d.cts} +27 -1
- package/dist/{types-CnOCn7b3.d.cts → types-BemGfSPA.d.ts} +27 -1
- package/dist/validation-rules.d.cts +1 -1
- package/dist/validation-rules.d.ts +1 -1
- package/dist/validation-utils.d.cts +1 -1
- package/dist/validation-utils.d.ts +1 -1
- package/dist/validation-valibot.d.cts +1 -1
- package/dist/validation-valibot.d.ts +1 -1
- package/dist/validation.d.cts +1 -1
- package/dist/validation.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-5WWMVS2I.js.map +0 -1
- package/dist/chunk-A7R6GEMA.js.map +0 -1
- package/dist/chunk-FIDKDYT7.cjs.map +0 -1
- package/dist/chunk-N2HOVRRN.js +0 -150
- package/dist/chunk-N2HOVRRN.js.map +0 -1
- package/dist/chunk-O4ZLR7AN.cjs +0 -173
- package/dist/chunk-O4ZLR7AN.cjs.map +0 -1
- package/dist/chunk-QQSBW6N3.cjs.map +0 -1
package/dist/inputs.cjs
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkED4UK63G_cjs = require('./chunk-ED4UK63G.cjs');
|
|
4
|
+
var chunkQRI5TMES_cjs = require('./chunk-QRI5TMES.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 chunkED4UK63G_cjs.Checkbox; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "CheckboxGroup", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkED4UK63G_cjs.CheckboxGroup; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "DatePicker", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkED4UK63G_cjs.DatePicker; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "DateRangePicker", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkED4UK63G_cjs.DateRangePicker; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "FileInput", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkED4UK63G_cjs.FileInput; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "MultiSelect", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkED4UK63G_cjs.MultiSelect; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "Radio", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkED4UK63G_cjs.Radio; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "Select", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkED4UK63G_cjs.Select; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "Switch", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkED4UK63G_cjs.Switch; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "TextArea", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkED4UK63G_cjs.TextArea; }
|
|
47
47
|
});
|
|
48
|
-
Object.defineProperty(exports, "
|
|
48
|
+
Object.defineProperty(exports, "TimePicker", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkED4UK63G_cjs.TimePicker; }
|
|
51
51
|
});
|
|
52
|
-
Object.defineProperty(exports, "
|
|
52
|
+
Object.defineProperty(exports, "TextInput", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkQRI5TMES_cjs.TextInput; }
|
|
55
55
|
});
|
|
56
56
|
//# sourceMappingURL=inputs.cjs.map
|
|
57
57
|
//# sourceMappingURL=inputs.cjs.map
|
package/dist/inputs.d.cts
CHANGED
package/dist/inputs.d.ts
CHANGED
package/dist/inputs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Checkbox, CheckboxGroup, DatePicker, DateRangePicker, FileInput, MultiSelect, Radio, Select, Switch, TextArea,
|
|
2
|
-
|
|
1
|
+
export { Checkbox, CheckboxGroup, DatePicker, DateRangePicker, FileInput, MultiSelect, Radio, Select, Switch, TextArea, TimePicker } from './chunk-4ROWNTY6.js';
|
|
2
|
+
export { TextInput } from './chunk-455PI4LV.js';
|
|
3
3
|
//# sourceMappingURL=inputs.js.map
|
|
4
4
|
//# sourceMappingURL=inputs.js.map
|
package/dist/integration.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var chunkMUBEMXI7_cjs = require('./chunk-MUBEMXI7.cjs');
|
|
4
|
+
var chunkED4UK63G_cjs = require('./chunk-ED4UK63G.cjs');
|
|
5
|
+
var chunkQRI5TMES_cjs = require('./chunk-QRI5TMES.cjs');
|
|
6
6
|
var React2 = require('react');
|
|
7
7
|
|
|
8
8
|
function _interopNamespace(e) {
|
|
@@ -565,7 +565,7 @@ function useContactForm(options) {
|
|
|
565
565
|
window.location.assign(destination);
|
|
566
566
|
}, 150);
|
|
567
567
|
}, [navigate, redirectUrl]);
|
|
568
|
-
const form =
|
|
568
|
+
const form = chunkMUBEMXI7_cjs.useForm({
|
|
569
569
|
initialValues: React2.useMemo(
|
|
570
570
|
() => generateInitialValues(formFields),
|
|
571
571
|
[formFields]
|
|
@@ -643,7 +643,7 @@ function DynamicFormField({
|
|
|
643
643
|
const usesInlineCheckboxLabel = field.type === "checkbox";
|
|
644
644
|
const shouldRenderFieldLabel = renderLabel && !usesGroupLegend && !usesInlineCheckboxLabel;
|
|
645
645
|
return /* @__PURE__ */ React2__namespace.createElement(
|
|
646
|
-
|
|
646
|
+
chunkMUBEMXI7_cjs.Field,
|
|
647
647
|
{
|
|
648
648
|
name: field.name,
|
|
649
649
|
label: shouldRenderFieldLabel ? field.label : void 0,
|
|
@@ -652,7 +652,7 @@ function DynamicFormField({
|
|
|
652
652
|
className
|
|
653
653
|
},
|
|
654
654
|
({ 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(
|
|
655
|
-
|
|
655
|
+
chunkQRI5TMES_cjs.TextInput,
|
|
656
656
|
{
|
|
657
657
|
...formField,
|
|
658
658
|
id: fieldId,
|
|
@@ -663,7 +663,7 @@ function DynamicFormField({
|
|
|
663
663
|
"aria-label": field.label
|
|
664
664
|
}
|
|
665
665
|
), field.type === "number" && /* @__PURE__ */ React2__namespace.createElement(
|
|
666
|
-
|
|
666
|
+
chunkQRI5TMES_cjs.TextInput,
|
|
667
667
|
{
|
|
668
668
|
...formField,
|
|
669
669
|
id: fieldId,
|
|
@@ -674,7 +674,7 @@ function DynamicFormField({
|
|
|
674
674
|
"aria-label": field.label
|
|
675
675
|
}
|
|
676
676
|
), field.type === "textarea" && /* @__PURE__ */ React2__namespace.createElement(
|
|
677
|
-
|
|
677
|
+
chunkED4UK63G_cjs.TextArea,
|
|
678
678
|
{
|
|
679
679
|
...formField,
|
|
680
680
|
id: fieldId,
|
|
@@ -685,7 +685,7 @@ function DynamicFormField({
|
|
|
685
685
|
"aria-label": field.label
|
|
686
686
|
}
|
|
687
687
|
), field.type === "select" && field.options && /* @__PURE__ */ React2__namespace.createElement(
|
|
688
|
-
|
|
688
|
+
chunkED4UK63G_cjs.Select,
|
|
689
689
|
{
|
|
690
690
|
...formField,
|
|
691
691
|
id: fieldId,
|
|
@@ -696,7 +696,7 @@ function DynamicFormField({
|
|
|
696
696
|
"aria-label": field.label
|
|
697
697
|
}
|
|
698
698
|
), field.type === "multi-select" && field.options && /* @__PURE__ */ React2__namespace.createElement(
|
|
699
|
-
|
|
699
|
+
chunkED4UK63G_cjs.MultiSelect,
|
|
700
700
|
{
|
|
701
701
|
...formField,
|
|
702
702
|
id: fieldId,
|
|
@@ -707,7 +707,7 @@ function DynamicFormField({
|
|
|
707
707
|
"aria-label": field.label
|
|
708
708
|
}
|
|
709
709
|
), field.type === "radio" && field.options && /* @__PURE__ */ React2__namespace.createElement(
|
|
710
|
-
|
|
710
|
+
chunkED4UK63G_cjs.Radio,
|
|
711
711
|
{
|
|
712
712
|
...formField,
|
|
713
713
|
id: fieldId,
|
|
@@ -721,7 +721,7 @@ function DynamicFormField({
|
|
|
721
721
|
"aria-label": field.label
|
|
722
722
|
}
|
|
723
723
|
), field.type === "checkbox" && /* @__PURE__ */ React2__namespace.createElement(
|
|
724
|
-
|
|
724
|
+
chunkED4UK63G_cjs.Checkbox,
|
|
725
725
|
{
|
|
726
726
|
...formField,
|
|
727
727
|
id: fieldId,
|
|
@@ -735,7 +735,7 @@ function DynamicFormField({
|
|
|
735
735
|
"aria-label": field.label
|
|
736
736
|
}
|
|
737
737
|
), field.type === "checkbox-group" && field.options && /* @__PURE__ */ React2__namespace.createElement(
|
|
738
|
-
|
|
738
|
+
chunkED4UK63G_cjs.CheckboxGroup,
|
|
739
739
|
{
|
|
740
740
|
...formField,
|
|
741
741
|
id: fieldId,
|
|
@@ -749,7 +749,7 @@ function DynamicFormField({
|
|
|
749
749
|
"aria-label": field.label
|
|
750
750
|
}
|
|
751
751
|
), (field.type === "date-picker" || field.type === "date") && /* @__PURE__ */ React2__namespace.createElement(
|
|
752
|
-
|
|
752
|
+
chunkED4UK63G_cjs.DatePicker,
|
|
753
753
|
{
|
|
754
754
|
...formField,
|
|
755
755
|
id: fieldId,
|
|
@@ -759,7 +759,7 @@ function DynamicFormField({
|
|
|
759
759
|
"aria-label": field.label
|
|
760
760
|
}
|
|
761
761
|
), field.type === "date-range" && /* @__PURE__ */ React2__namespace.createElement(
|
|
762
|
-
|
|
762
|
+
chunkED4UK63G_cjs.DateRangePicker,
|
|
763
763
|
{
|
|
764
764
|
...formField,
|
|
765
765
|
id: fieldId,
|
|
@@ -769,7 +769,7 @@ function DynamicFormField({
|
|
|
769
769
|
"aria-label": field.label
|
|
770
770
|
}
|
|
771
771
|
), field.type === "time" && /* @__PURE__ */ React2__namespace.createElement(
|
|
772
|
-
|
|
772
|
+
chunkED4UK63G_cjs.TimePicker,
|
|
773
773
|
{
|
|
774
774
|
...formField,
|
|
775
775
|
id: fieldId,
|
|
@@ -779,7 +779,7 @@ function DynamicFormField({
|
|
|
779
779
|
"aria-label": field.label
|
|
780
780
|
}
|
|
781
781
|
), field.type === "file" && /* @__PURE__ */ React2__namespace.createElement(
|
|
782
|
-
|
|
782
|
+
chunkED4UK63G_cjs.FileInput,
|
|
783
783
|
{
|
|
784
784
|
...formField,
|
|
785
785
|
id: fieldId,
|
package/dist/integration.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { d as FormSubmissionBehavior, N as NewFormSubmissionActionConfig, m as UseFormReturn } from './types-
|
|
3
|
+
import { d as FormSubmissionBehavior, N as NewFormSubmissionActionConfig, m as UseFormReturn } from './types-BemGfSPA.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @page-speed/forms - Rails API Serializer
|
package/dist/integration.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { d as FormSubmissionBehavior, N as NewFormSubmissionActionConfig, m as UseFormReturn } from './types-
|
|
3
|
+
import { d as FormSubmissionBehavior, N as NewFormSubmissionActionConfig, m as UseFormReturn } from './types-BemGfSPA.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @page-speed/forms - Rails API Serializer
|
package/dist/integration.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useForm, Field } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import './chunk-
|
|
1
|
+
import { useForm, Field } from './chunk-MJYEXJ3U.js';
|
|
2
|
+
import { TextArea, Select, MultiSelect, Radio, Checkbox, CheckboxGroup, DatePicker, DateRangePicker, TimePicker, FileInput } from './chunk-4ROWNTY6.js';
|
|
3
|
+
import { TextInput } from './chunk-455PI4LV.js';
|
|
4
4
|
import * as React2 from 'react';
|
|
5
5
|
import { useState, useCallback, useMemo } from 'react';
|
|
6
6
|
|
|
@@ -340,6 +340,27 @@ interface FormRenderConfig {
|
|
|
340
340
|
* Optional submission behavior configuration.
|
|
341
341
|
*/
|
|
342
342
|
submissionConfig?: FormSubmissionConfig;
|
|
343
|
+
/**
|
|
344
|
+
* Optional layout configuration. If button-group, the form will be rendered with an input field and submit button.
|
|
345
|
+
* "button-group" is most commonly used for newsletter type forms.
|
|
346
|
+
* @default "standard"
|
|
347
|
+
*/
|
|
348
|
+
formLayout?: "standard" | "button-group";
|
|
349
|
+
/**
|
|
350
|
+
* Size for button-group layout (only applies when formLayout is "button-group")
|
|
351
|
+
* @default "default"
|
|
352
|
+
*/
|
|
353
|
+
buttonGroupSize?: "xs" | "sm" | "default" | "lg";
|
|
354
|
+
/**
|
|
355
|
+
* Submit button label for button-group layout
|
|
356
|
+
* @default "Submit"
|
|
357
|
+
*/
|
|
358
|
+
submitLabel?: React.ReactNode;
|
|
359
|
+
/**
|
|
360
|
+
* Submit button variant for button-group layout
|
|
361
|
+
* @default "default"
|
|
362
|
+
*/
|
|
363
|
+
submitVariant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost";
|
|
343
364
|
}
|
|
344
365
|
/**
|
|
345
366
|
* Form component props
|
|
@@ -352,7 +373,12 @@ interface FormProps<T extends FormValues = FormValues> {
|
|
|
352
373
|
/**
|
|
353
374
|
* Form children
|
|
354
375
|
*/
|
|
355
|
-
children
|
|
376
|
+
children?: ReactNode;
|
|
377
|
+
/**
|
|
378
|
+
* Optional form fields for button-group layout rendering
|
|
379
|
+
* Required when using formLayout="button-group"
|
|
380
|
+
*/
|
|
381
|
+
fields?: any[];
|
|
356
382
|
/**
|
|
357
383
|
* Additional className
|
|
358
384
|
*/
|
|
@@ -340,6 +340,27 @@ interface FormRenderConfig {
|
|
|
340
340
|
* Optional submission behavior configuration.
|
|
341
341
|
*/
|
|
342
342
|
submissionConfig?: FormSubmissionConfig;
|
|
343
|
+
/**
|
|
344
|
+
* Optional layout configuration. If button-group, the form will be rendered with an input field and submit button.
|
|
345
|
+
* "button-group" is most commonly used for newsletter type forms.
|
|
346
|
+
* @default "standard"
|
|
347
|
+
*/
|
|
348
|
+
formLayout?: "standard" | "button-group";
|
|
349
|
+
/**
|
|
350
|
+
* Size for button-group layout (only applies when formLayout is "button-group")
|
|
351
|
+
* @default "default"
|
|
352
|
+
*/
|
|
353
|
+
buttonGroupSize?: "xs" | "sm" | "default" | "lg";
|
|
354
|
+
/**
|
|
355
|
+
* Submit button label for button-group layout
|
|
356
|
+
* @default "Submit"
|
|
357
|
+
*/
|
|
358
|
+
submitLabel?: React.ReactNode;
|
|
359
|
+
/**
|
|
360
|
+
* Submit button variant for button-group layout
|
|
361
|
+
* @default "default"
|
|
362
|
+
*/
|
|
363
|
+
submitVariant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost";
|
|
343
364
|
}
|
|
344
365
|
/**
|
|
345
366
|
* Form component props
|
|
@@ -352,7 +373,12 @@ interface FormProps<T extends FormValues = FormValues> {
|
|
|
352
373
|
/**
|
|
353
374
|
* Form children
|
|
354
375
|
*/
|
|
355
|
-
children
|
|
376
|
+
children?: ReactNode;
|
|
377
|
+
/**
|
|
378
|
+
* Optional form fields for button-group layout rendering
|
|
379
|
+
* Required when using formLayout="button-group"
|
|
380
|
+
*/
|
|
381
|
+
fields?: any[];
|
|
356
382
|
/**
|
|
357
383
|
* Additional className
|
|
358
384
|
*/
|
package/dist/validation.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as FieldValidator, a as ValidationMode, V as ValidationSchema } from './types-
|
|
1
|
+
export { F as FieldValidator, a as ValidationMode, V as ValidationSchema } from './types-BemGfSPA.cjs';
|
|
2
2
|
export { ErrorMessageFn, ValidationRuleOptions, alpha, alphanumeric, compose, creditCard, email, integer, matches, max, maxLength, min, minLength, numeric, oneOf, pattern, phone, postalCode, required, url } from './validation-rules.cjs';
|
|
3
3
|
export { DebounceOptions, ErrorMessages, MessageTemplate, asyncValidator, crossFieldValidator, debounce, defaultMessages, getErrorMessage, messageRegistry, resetErrorMessages, setErrorMessages, when, withRaceConditionPrevention } from './validation-utils.cjs';
|
|
4
4
|
import 'react';
|
package/dist/validation.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as FieldValidator, a as ValidationMode, V as ValidationSchema } from './types-
|
|
1
|
+
export { F as FieldValidator, a as ValidationMode, V as ValidationSchema } from './types-BemGfSPA.js';
|
|
2
2
|
export { ErrorMessageFn, ValidationRuleOptions, alpha, alphanumeric, compose, creditCard, email, integer, matches, max, maxLength, min, minLength, numeric, oneOf, pattern, phone, postalCode, required, url } from './validation-rules.js';
|
|
3
3
|
export { DebounceOptions, ErrorMessages, MessageTemplate, asyncValidator, crossFieldValidator, debounce, defaultMessages, getErrorMessage, messageRegistry, resetErrorMessages, setErrorMessages, when, withRaceConditionPrevention } from './validation-utils.js';
|
|
4
4
|
import 'react';
|