@iress-oss/ids-components 6.0.0-alpha.4 → 6.0.0-alpha.6
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/{Provider-8wS70V56.js → Provider-BPeo5YfI.js} +1 -1
- package/dist/components/Field/Field.styles.js +5 -1
- package/dist/components/Input/Input.styles.js +4 -3
- package/dist/components/Progress/Progress.js +1 -1
- package/dist/components/Provider/Provider.js +2 -2
- package/dist/components/Provider/index.js +1 -1
- package/dist/components/RichSelect/components/SelectOptions.js +61 -60
- package/dist/components/Slideout/hooks/usePushElement.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/{index-CZ9ot38T.js → index-aTLA1VIV.js} +1 -1
- package/dist/main.js +1 -1
- package/dist/patterns/Form/FormField/FormField.js +30 -24
- package/dist/patterns/Form/FormField/FormFieldset.js +1 -1
- package/dist/patterns/Form/HookForm/HookForm.js +8 -8
- package/dist/patterns/Form/components/LongForm.js +9 -9
- package/dist/patterns/Form/components/ShortForm.js +7 -7
- package/dist/patterns/Shadow/Shadow.js +10 -6
- package/dist/src/components/RichSelect/RichSelect.d.ts +10 -0
- package/dist/src/components/RichSelect/components/SelectOptions.d.ts +1 -1
- package/dist/src/patterns/Form/FormField/FormField.d.ts +15 -2
- package/dist/src/patterns/Form/FormField/hooks/useFieldRenderProps.d.ts +3 -9
- package/dist/style.css +1 -1
- package/package.json +4 -3
- package/dist/index.esm-BiUTGNH8.js +0 -1080
|
@@ -10,7 +10,7 @@ import "./components/Toaster/hooks/useToaster.js";
|
|
|
10
10
|
import "./components/Toaster/Toaster.styles.js";
|
|
11
11
|
import "./components/Toaster/components/Toast/Toast.styles.js";
|
|
12
12
|
import "./components/Slideout/Slideout.styles.js";
|
|
13
|
-
import "./index-
|
|
13
|
+
import "./index-aTLA1VIV.js";
|
|
14
14
|
import "./components/Slideout/hooks/useSlideout.js";
|
|
15
15
|
import { IressSlideoutProvider as d } from "./components/Slideout/SlideoutProvider.js";
|
|
16
16
|
import { createPortal as y } from "react-dom";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as r } from "../../sva-OmxClA9g.js";
|
|
2
|
-
const
|
|
2
|
+
const t = r({
|
|
3
3
|
slots: ["root", "wrapper", "inline", "addon", "internal", "formControl"],
|
|
4
4
|
base: {
|
|
5
5
|
wrapper: {
|
|
@@ -49,7 +49,8 @@ const o = r({
|
|
|
49
49
|
formControl: {
|
|
50
50
|
borderWidth: 0,
|
|
51
51
|
borderRadius: "radius.system.form",
|
|
52
|
-
|
|
52
|
+
paddingInline: "spacing.2",
|
|
53
|
+
paddingBlock: "spacing.1",
|
|
53
54
|
backgroundColor: "colour.neutral.10",
|
|
54
55
|
textStyle: "typography.body.md",
|
|
55
56
|
color: "colour.neutral.80",
|
|
@@ -204,5 +205,5 @@ const o = r({
|
|
|
204
205
|
defaultVariants: {}
|
|
205
206
|
});
|
|
206
207
|
export {
|
|
207
|
-
|
|
208
|
+
t as input
|
|
208
209
|
};
|
|
@@ -6,7 +6,7 @@ import { progress as y } from "./Progress.styles.js";
|
|
|
6
6
|
import { s as n } from "../../factory-oPXoMw9H.js";
|
|
7
7
|
import { s as b } from "../../is-valid-prop-Ce0wiweq.js";
|
|
8
8
|
import { GlobalCSSClass as x } from "../../enums.js";
|
|
9
|
-
import { t as C } from "../../index-
|
|
9
|
+
import { t as C } from "../../index-aTLA1VIV.js";
|
|
10
10
|
const V = ({
|
|
11
11
|
borderRadius: e,
|
|
12
12
|
className: p,
|
|
@@ -10,11 +10,11 @@ import "../Toaster/hooks/useToaster.js";
|
|
|
10
10
|
import "../Toaster/Toaster.styles.js";
|
|
11
11
|
import "../Toaster/components/Toast/Toast.styles.js";
|
|
12
12
|
import "../Slideout/Slideout.styles.js";
|
|
13
|
-
import "../../index-
|
|
13
|
+
import "../../index-aTLA1VIV.js";
|
|
14
14
|
import "../Slideout/hooks/useSlideout.js";
|
|
15
15
|
import "../Slideout/SlideoutProvider.js";
|
|
16
16
|
import "react-dom";
|
|
17
|
-
import { I as h } from "../../Provider-
|
|
17
|
+
import { I as h } from "../../Provider-BPeo5YfI.js";
|
|
18
18
|
export {
|
|
19
19
|
h as IressProvider
|
|
20
20
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { getValueAsEvent as
|
|
1
|
+
import { jsx as s, jsxs as y, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { getValueAsEvent as F } from "../../../helpers/form/getValueAsEvent.js";
|
|
3
3
|
import { useCallback as O, useRef as j, useId as k, useEffect as P } from "react";
|
|
4
4
|
import { IressSelectSearch as $ } from "../SelectSearch/SelectSearch.js";
|
|
5
5
|
import { toArray as D } from "../../../helpers/formatting/toArray.js";
|
|
6
|
-
import { IressSelectMenu as
|
|
6
|
+
import { IressSelectMenu as E } from "../SelectMenu/SelectMenu.js";
|
|
7
7
|
import { IressAlert as T } from "../../Alert/Alert.js";
|
|
8
8
|
import "../../Alert/Alert.styles.js";
|
|
9
9
|
import { IressSelectSearchInput as z } from "../SelectSearchInput/SelectSearchInput.js";
|
|
@@ -15,19 +15,19 @@ import "../../Menu/MenuItem/MenuItem.js";
|
|
|
15
15
|
import "../../Popover/hooks/usePopover.js";
|
|
16
16
|
const H = ({
|
|
17
17
|
minSearchLength: e,
|
|
18
|
-
multiSelect:
|
|
19
|
-
onChange:
|
|
18
|
+
multiSelect: r,
|
|
19
|
+
onChange: i,
|
|
20
20
|
query: I,
|
|
21
21
|
results: o,
|
|
22
22
|
shouldShowInstructions: d,
|
|
23
23
|
shouldShowNoResults: c,
|
|
24
24
|
value: t
|
|
25
25
|
}) => /* @__PURE__ */ s(
|
|
26
|
-
|
|
26
|
+
E,
|
|
27
27
|
{
|
|
28
|
-
heading:
|
|
28
|
+
heading: r ? "Search results" : void 0,
|
|
29
29
|
items: o,
|
|
30
|
-
multiSelect:
|
|
30
|
+
multiSelect: r,
|
|
31
31
|
noResults: (() => {
|
|
32
32
|
if (I) {
|
|
33
33
|
if (d)
|
|
@@ -36,18 +36,18 @@ const H = ({
|
|
|
36
36
|
return "No results found";
|
|
37
37
|
}
|
|
38
38
|
})(),
|
|
39
|
-
onChange:
|
|
39
|
+
onChange: i,
|
|
40
40
|
selected: t,
|
|
41
|
-
hideSelectedItems:
|
|
41
|
+
hideSelectedItems: r
|
|
42
42
|
}
|
|
43
|
-
), J = ({ error: e }) => e ? /* @__PURE__ */ s(T, { className: "iress-m--sm", status: "danger", children: typeof e == "string" ? e : /* @__PURE__ */
|
|
43
|
+
), J = ({ error: e }) => e ? /* @__PURE__ */ s(T, { className: "iress-m--sm", status: "danger", children: typeof e == "string" ? e : /* @__PURE__ */ y(W, { children: [
|
|
44
44
|
"An unknown error occurred.",
|
|
45
45
|
/* @__PURE__ */ s("br", {}),
|
|
46
46
|
" Please contact support if the error persists."
|
|
47
47
|
] }) }) : null, K = ({
|
|
48
48
|
autoHighlight: e,
|
|
49
|
-
error:
|
|
50
|
-
loading:
|
|
49
|
+
error: r,
|
|
50
|
+
loading: i,
|
|
51
51
|
minSearchLength: I,
|
|
52
52
|
multiSelect: o,
|
|
53
53
|
onChange: d,
|
|
@@ -56,62 +56,62 @@ const H = ({
|
|
|
56
56
|
results: f,
|
|
57
57
|
setQuery: p,
|
|
58
58
|
show: A,
|
|
59
|
-
value:
|
|
59
|
+
value: l,
|
|
60
60
|
shouldShowInstructions: R,
|
|
61
61
|
shouldShowNoResults: S
|
|
62
62
|
}) => {
|
|
63
|
-
const
|
|
64
|
-
(
|
|
65
|
-
const { formattedLabel: g, ...
|
|
66
|
-
return
|
|
63
|
+
const n = D(l).map(
|
|
64
|
+
(a) => {
|
|
65
|
+
const { formattedLabel: g, ...N } = a;
|
|
66
|
+
return N;
|
|
67
67
|
}
|
|
68
|
-
), u = !
|
|
68
|
+
), u = !r && (!!f?.length || t && !i), m = !!n.length && o, v = u && m, h = j(null), x = k();
|
|
69
69
|
P(() => {
|
|
70
70
|
A || p?.("");
|
|
71
71
|
}, [A, p]);
|
|
72
|
-
const
|
|
73
|
-
return /* @__PURE__ */
|
|
72
|
+
const M = m ? n.length + 1 : 0;
|
|
73
|
+
return /* @__PURE__ */ y(
|
|
74
74
|
$,
|
|
75
75
|
{
|
|
76
76
|
activator: /* @__PURE__ */ s(
|
|
77
77
|
z,
|
|
78
78
|
{
|
|
79
79
|
"aria-label": "Search",
|
|
80
|
-
loading:
|
|
81
|
-
onChange: (
|
|
80
|
+
loading: i,
|
|
81
|
+
onChange: (a) => p?.(a.target.value),
|
|
82
82
|
ref: h,
|
|
83
83
|
placeholder: "Search and select",
|
|
84
84
|
value: t
|
|
85
85
|
}
|
|
86
86
|
),
|
|
87
87
|
autoHighlight: e,
|
|
88
|
-
focusStartIndex: e ? t && u ?
|
|
88
|
+
focusStartIndex: e ? t && u ? M : m ? 1 : 0 : void 0,
|
|
89
89
|
children: [
|
|
90
90
|
m && /* @__PURE__ */ s(
|
|
91
|
-
|
|
91
|
+
E,
|
|
92
92
|
{
|
|
93
93
|
"aria-labelledby": x,
|
|
94
94
|
heading: /* @__PURE__ */ s(
|
|
95
95
|
B,
|
|
96
96
|
{
|
|
97
97
|
clearAll: !0,
|
|
98
|
-
onClearAll: (
|
|
99
|
-
c?.(
|
|
98
|
+
onClearAll: (a) => {
|
|
99
|
+
c?.(a), h.current?.focus();
|
|
100
100
|
},
|
|
101
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ y("h2", { id: x, children: [
|
|
102
102
|
"Selected (",
|
|
103
|
-
|
|
103
|
+
n.length,
|
|
104
104
|
")"
|
|
105
105
|
] })
|
|
106
106
|
}
|
|
107
107
|
),
|
|
108
|
-
items:
|
|
108
|
+
items: n,
|
|
109
109
|
multiSelect: o,
|
|
110
110
|
onChange: d,
|
|
111
|
-
selected:
|
|
111
|
+
selected: l
|
|
112
112
|
}
|
|
113
113
|
),
|
|
114
|
-
|
|
114
|
+
v && /* @__PURE__ */ s(G, {}),
|
|
115
115
|
u && /* @__PURE__ */ s(
|
|
116
116
|
H,
|
|
117
117
|
{
|
|
@@ -120,19 +120,19 @@ const H = ({
|
|
|
120
120
|
onChange: d,
|
|
121
121
|
query: t,
|
|
122
122
|
results: f,
|
|
123
|
-
value:
|
|
123
|
+
value: l,
|
|
124
124
|
shouldShowInstructions: R,
|
|
125
125
|
shouldShowNoResults: S
|
|
126
126
|
}
|
|
127
127
|
),
|
|
128
|
-
/* @__PURE__ */ s(J, { error:
|
|
128
|
+
/* @__PURE__ */ s(J, { error: r })
|
|
129
129
|
]
|
|
130
130
|
}
|
|
131
131
|
);
|
|
132
132
|
}, oe = ({
|
|
133
133
|
autoHighlight: e,
|
|
134
|
-
debouncedQuery:
|
|
135
|
-
error:
|
|
134
|
+
debouncedQuery: r,
|
|
135
|
+
error: i,
|
|
136
136
|
initialOptions: I,
|
|
137
137
|
loading: o,
|
|
138
138
|
minSearchLength: d,
|
|
@@ -141,36 +141,38 @@ const H = ({
|
|
|
141
141
|
options: f,
|
|
142
142
|
query: p,
|
|
143
143
|
renderOptions: A,
|
|
144
|
-
results:
|
|
144
|
+
results: l,
|
|
145
145
|
setQuery: R,
|
|
146
146
|
setShow: S,
|
|
147
|
-
setValue:
|
|
147
|
+
setValue: n,
|
|
148
148
|
show: u,
|
|
149
149
|
shouldShowInstructions: m,
|
|
150
|
-
shouldShowNoResults:
|
|
150
|
+
shouldShowNoResults: v,
|
|
151
151
|
value: h
|
|
152
152
|
}) => {
|
|
153
|
-
const x = typeof f == "function",
|
|
153
|
+
const x = typeof f == "function", M = I ?? (x ? [] : f), C = l.length ? l : M, b = O(
|
|
154
154
|
(g) => {
|
|
155
|
-
|
|
155
|
+
n(g), t?.(F(g), g), c || S(!1);
|
|
156
156
|
},
|
|
157
|
-
[S,
|
|
158
|
-
),
|
|
157
|
+
[S, n, t, c]
|
|
158
|
+
), a = O(
|
|
159
159
|
(g) => {
|
|
160
160
|
g.stopPropagation();
|
|
161
|
-
const
|
|
162
|
-
|
|
161
|
+
const N = [];
|
|
162
|
+
n(N), t?.(F([]), N);
|
|
163
163
|
},
|
|
164
|
-
[
|
|
164
|
+
[n, t]
|
|
165
165
|
);
|
|
166
166
|
return A ? A({
|
|
167
167
|
close: () => S(!1),
|
|
168
|
-
debouncedQuery:
|
|
169
|
-
error:
|
|
168
|
+
debouncedQuery: r,
|
|
169
|
+
error: i,
|
|
170
|
+
handleClear: a,
|
|
171
|
+
handleMenuChange: b,
|
|
170
172
|
loading: o,
|
|
171
173
|
query: p,
|
|
172
|
-
results:
|
|
173
|
-
setValue:
|
|
174
|
+
results: C,
|
|
175
|
+
setValue: n,
|
|
174
176
|
setQuery: R,
|
|
175
177
|
show: u,
|
|
176
178
|
value: h
|
|
@@ -178,28 +180,27 @@ const H = ({
|
|
|
178
180
|
K,
|
|
179
181
|
{
|
|
180
182
|
autoHighlight: e,
|
|
181
|
-
error:
|
|
183
|
+
error: i,
|
|
182
184
|
loading: o,
|
|
183
185
|
minSearchLength: d,
|
|
184
186
|
multiSelect: c,
|
|
185
|
-
onChange:
|
|
186
|
-
onClear:
|
|
187
|
+
onChange: b,
|
|
188
|
+
onClear: a,
|
|
187
189
|
query: p,
|
|
188
|
-
results:
|
|
190
|
+
results: l,
|
|
189
191
|
setQuery: R,
|
|
190
192
|
show: u,
|
|
191
193
|
value: h,
|
|
192
194
|
shouldShowInstructions: m,
|
|
193
|
-
shouldShowNoResults:
|
|
195
|
+
shouldShowNoResults: v
|
|
194
196
|
}
|
|
195
197
|
) : /* @__PURE__ */ s(
|
|
196
|
-
|
|
198
|
+
E,
|
|
197
199
|
{
|
|
198
|
-
items:
|
|
200
|
+
items: C,
|
|
199
201
|
multiSelect: c,
|
|
200
|
-
onChange:
|
|
201
|
-
selected: h
|
|
202
|
-
selectedFirst: !0
|
|
202
|
+
onChange: b,
|
|
203
|
+
selected: h
|
|
203
204
|
}
|
|
204
205
|
);
|
|
205
206
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef as m, useEffect as y } from "react";
|
|
2
2
|
import { GlobalCSSClass as e } from "../../../enums.js";
|
|
3
|
-
import { t as p } from "../../../index-
|
|
3
|
+
import { t as p } from "../../../index-aTLA1VIV.js";
|
|
4
4
|
import { useBreakpoint as S } from "../../../hooks/useBreakpoint.js";
|
|
5
5
|
function h({
|
|
6
6
|
element: r,
|
package/dist/constants.js
CHANGED
|
@@ -444,7 +444,7 @@ const s = {
|
|
|
444
444
|
variable: "var(--spacing-button\\.block)"
|
|
445
445
|
},
|
|
446
446
|
"spacing.field.footer": {
|
|
447
|
-
value: "calc(var(--iress-typography-base-size, .875rem) * 2
|
|
447
|
+
value: "calc(var(--iress-typography-base-size, .875rem) * 2)",
|
|
448
448
|
variable: "var(--spacing-field\\.footer)"
|
|
449
449
|
},
|
|
450
450
|
"spacing.slider.tick": {
|
package/dist/main.js
CHANGED
|
@@ -62,7 +62,7 @@ import { IressInputPopover as Ce } from "./components/Popover/InputPopover/Input
|
|
|
62
62
|
import { usePopoverItem as Ge } from "./components/Popover/hooks/usePopoverItem.js";
|
|
63
63
|
import { IressProgress as _e } from "./components/Progress/Progress.js";
|
|
64
64
|
import { progress as Re } from "./components/Progress/Progress.styles.js";
|
|
65
|
-
import { I as Fe } from "./Provider-
|
|
65
|
+
import { I as Fe } from "./Provider-BPeo5YfI.js";
|
|
66
66
|
import { IressRadio as Pe } from "./components/Radio/Radio.js";
|
|
67
67
|
import { radio as De } from "./components/Radio/Radio.styles.js";
|
|
68
68
|
import { IressRadioGroup as Oe, RadioGroupContext as Ve, getRadioGroupContext as ye } from "./components/RadioGroup/RadioGroup.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import {
|
|
4
|
-
import { getErrorTypeMessage as
|
|
5
|
-
import { FormContext as
|
|
6
|
-
import { transformCustomRulesToValidateRule as
|
|
7
|
-
import { IressField as
|
|
1
|
+
import { jsx as I } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as M, useRef as E, useMemo as f, useEffect as x } from "react";
|
|
3
|
+
import { useController as _ } from "react-hook-form";
|
|
4
|
+
import { getErrorTypeMessage as $ } from "./helpers/getErrorTypeMessage.js";
|
|
5
|
+
import { FormContext as v } from "../FormContext.js";
|
|
6
|
+
import { transformCustomRulesToValidateRule as q } from "./helpers/transformCustomRulesToValidateRule.js";
|
|
7
|
+
import { IressField as S } from "../../../components/Field/Field.js";
|
|
8
8
|
import "../../../components/Field/Field.styles.js";
|
|
9
9
|
import "../../../components/Icon/Icon.styles.js";
|
|
10
10
|
import "../../../components/Field/FieldGroup/FieldGroup.styles.js";
|
|
11
11
|
import "../../../components/Label/Label.styles.js";
|
|
12
12
|
import { useFieldRenderProps as T } from "./hooks/useFieldRenderProps.js";
|
|
13
|
-
const
|
|
14
|
-
control:
|
|
13
|
+
const H = ({
|
|
14
|
+
control: d,
|
|
15
15
|
defaultValue: p,
|
|
16
16
|
name: r,
|
|
17
17
|
render: n,
|
|
@@ -20,47 +20,53 @@ const G = ({
|
|
|
20
20
|
readOnly: e,
|
|
21
21
|
...u
|
|
22
22
|
}) => {
|
|
23
|
-
const o =
|
|
23
|
+
const o = M(v), F = E(null);
|
|
24
24
|
if (!o)
|
|
25
25
|
throw new Error(
|
|
26
26
|
"IressFormField must be used inside an IressForm. If you need a standalone field, use IressField instead."
|
|
27
27
|
);
|
|
28
|
-
const m =
|
|
28
|
+
const m = f(() => {
|
|
29
29
|
if (!e)
|
|
30
|
-
return s ?
|
|
31
|
-
}, [e, s]), { field: c, fieldState: t } =
|
|
32
|
-
control:
|
|
30
|
+
return s ? q(s) : void 0;
|
|
31
|
+
}, [e, s]), { field: c, formState: g, fieldState: t } = _({
|
|
32
|
+
control: d,
|
|
33
33
|
defaultValue: p,
|
|
34
34
|
name: r,
|
|
35
35
|
rules: m,
|
|
36
36
|
shouldUnregister: l
|
|
37
|
-
}), i =
|
|
38
|
-
() => t.error ?
|
|
37
|
+
}), i = f(
|
|
38
|
+
() => t.error ? $(
|
|
39
39
|
t.error?.message,
|
|
40
40
|
t.error?.type,
|
|
41
41
|
s
|
|
42
42
|
) : "",
|
|
43
43
|
[t.error, s]
|
|
44
44
|
);
|
|
45
|
-
|
|
45
|
+
x(() => {
|
|
46
46
|
e ? o.setErrorMessage(r, "") : o.setErrorMessage(r, i);
|
|
47
47
|
}, [i, o, r, e]);
|
|
48
48
|
const a = T(c, F);
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
|
|
49
|
+
return /* @__PURE__ */ I(
|
|
50
|
+
S,
|
|
51
51
|
{
|
|
52
52
|
errorMessages: i && !e ? [{ message: i }] : void 0,
|
|
53
53
|
readOnly: e,
|
|
54
54
|
required: !!m?.required,
|
|
55
55
|
htmlFor: `${o.id}__${r}`,
|
|
56
56
|
...u,
|
|
57
|
-
children: n(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
children: n(
|
|
58
|
+
{
|
|
59
|
+
...a,
|
|
60
|
+
id: `${o.id}__${r}`
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
formState: g,
|
|
64
|
+
fieldState: t
|
|
65
|
+
}
|
|
66
|
+
)
|
|
61
67
|
}
|
|
62
68
|
);
|
|
63
69
|
};
|
|
64
70
|
export {
|
|
65
|
-
|
|
71
|
+
H as IressFormField
|
|
66
72
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as F } from "react/jsx-runtime";
|
|
2
2
|
import { useContext as c, useRef as g, useMemo as I, useEffect as M } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { useController as x } from "react-hook-form";
|
|
4
4
|
import { getErrorTypeMessage as E } from "./helpers/getErrorTypeMessage.js";
|
|
5
5
|
import "../../../components/Label/Label.styles.js";
|
|
6
6
|
import "../../../components/Field/Field.styles.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as f, jsxs as E } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as J, useState as U, useRef as m, useCallback as n, useImperativeHandle as K, useEffect as V, useMemo as L } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { FormProvider as W } from "react-hook-form";
|
|
4
4
|
import { useIdIfNeeded as X } from "../../../hooks/useIdIfNeeded.js";
|
|
5
5
|
import { IressFormValidationSummary as Y } from "../FormValidationSummary/FormValidationSummary.js";
|
|
6
6
|
import { s as Z } from "../../../factory-oPXoMw9H.js";
|
|
@@ -20,7 +20,7 @@ const _ = ({
|
|
|
20
20
|
updateErrorSummaryOnSubmit: s,
|
|
21
21
|
...g
|
|
22
22
|
}, h) => {
|
|
23
|
-
const
|
|
23
|
+
const i = X({ id: g.id }), [r, a] = U({}), c = m({}), v = m(null), M = m(null), { handleSubmit: x, reset: q, formState: z } = o, { isValid: H, isSubmitted: I } = z, [C, N] = U(!1), R = n(
|
|
24
24
|
(e) => {
|
|
25
25
|
F?.(e), v.current?.focus(), s && N(!0);
|
|
26
26
|
},
|
|
@@ -28,7 +28,7 @@ const _ = ({
|
|
|
28
28
|
), j = n(
|
|
29
29
|
(e) => {
|
|
30
30
|
x((t) => {
|
|
31
|
-
u?.(t),
|
|
31
|
+
u?.(t), a({}), c.current = {};
|
|
32
32
|
}, R)(e);
|
|
33
33
|
},
|
|
34
34
|
[R, x, u]
|
|
@@ -53,7 +53,7 @@ const _ = ({
|
|
|
53
53
|
}),
|
|
54
54
|
{}
|
|
55
55
|
);
|
|
56
|
-
s ? k(() => Q) :
|
|
56
|
+
s ? k(() => Q) : a(() => Q);
|
|
57
57
|
},
|
|
58
58
|
[
|
|
59
59
|
r,
|
|
@@ -70,16 +70,16 @@ const _ = ({
|
|
|
70
70
|
})), V(() => {
|
|
71
71
|
p?.(H);
|
|
72
72
|
}, [H, p]), V(() => {
|
|
73
|
-
s && C && I && (
|
|
73
|
+
s && C && I && (a(() => c.current), N(!1));
|
|
74
74
|
}, [s, C, I]);
|
|
75
75
|
const A = L(
|
|
76
76
|
() => ({
|
|
77
|
-
id:
|
|
77
|
+
id: i,
|
|
78
78
|
errorMessages: r,
|
|
79
79
|
setErrorMessage: P,
|
|
80
80
|
setFocusOnError: w
|
|
81
81
|
}),
|
|
82
|
-
[r,
|
|
82
|
+
[r, i, P, w]
|
|
83
83
|
);
|
|
84
84
|
return /* @__PURE__ */ f($.Provider, { value: A, children: /* @__PURE__ */ f(W, { ...o, children: /* @__PURE__ */ E(
|
|
85
85
|
Z.form,
|
|
@@ -87,7 +87,7 @@ const _ = ({
|
|
|
87
87
|
...g,
|
|
88
88
|
className: y(b, O.Form),
|
|
89
89
|
"data-testid": d,
|
|
90
|
-
id:
|
|
90
|
+
id: i,
|
|
91
91
|
noValidate: !0,
|
|
92
92
|
onSubmit: j,
|
|
93
93
|
ref: M,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useForm as L } from "react-hook-form";
|
|
3
3
|
import { forwardRef as y, useMemo as z } from "react";
|
|
4
4
|
import { IressText as B } from "../../../components/Text/Text.js";
|
|
5
5
|
import { form as C } from "../Form.styles.js";
|
|
@@ -10,9 +10,9 @@ import "../../../components/Panel/Panel.styles.js";
|
|
|
10
10
|
import "../../../components/Inline/Inline.styles.js";
|
|
11
11
|
import { IressInline as R } from "../../../components/Inline/Inline.js";
|
|
12
12
|
const T = ({
|
|
13
|
-
actions:
|
|
13
|
+
actions: c,
|
|
14
14
|
alert: m,
|
|
15
|
-
children:
|
|
15
|
+
children: a,
|
|
16
16
|
className: l,
|
|
17
17
|
criteriaMode: f,
|
|
18
18
|
context: d,
|
|
@@ -20,9 +20,9 @@ const T = ({
|
|
|
20
20
|
delayError: p,
|
|
21
21
|
footer: t,
|
|
22
22
|
heading: o,
|
|
23
|
-
mode:
|
|
23
|
+
mode: g = "onBlur",
|
|
24
24
|
panelStyle: n = { bg: "alt" },
|
|
25
|
-
progressive:
|
|
25
|
+
progressive: u,
|
|
26
26
|
resetOptions: F,
|
|
27
27
|
resolver: N,
|
|
28
28
|
reValidateMode: x = "onChange",
|
|
@@ -37,8 +37,8 @@ const T = ({
|
|
|
37
37
|
context: d,
|
|
38
38
|
defaultValues: h,
|
|
39
39
|
delayError: p,
|
|
40
|
-
mode:
|
|
41
|
-
progressive:
|
|
40
|
+
mode: g,
|
|
41
|
+
progressive: u,
|
|
42
42
|
resetOptions: F,
|
|
43
43
|
resolver: N,
|
|
44
44
|
reValidateMode: x,
|
|
@@ -64,7 +64,7 @@ const T = ({
|
|
|
64
64
|
className: r.header,
|
|
65
65
|
children: [
|
|
66
66
|
H,
|
|
67
|
-
/* @__PURE__ */ e("div", { className: r.actions, children:
|
|
67
|
+
/* @__PURE__ */ e("div", { className: r.actions, children: c })
|
|
68
68
|
]
|
|
69
69
|
}
|
|
70
70
|
),
|
|
@@ -75,7 +75,7 @@ const T = ({
|
|
|
75
75
|
className: i(r.children, n.className),
|
|
76
76
|
children: [
|
|
77
77
|
m,
|
|
78
|
-
|
|
78
|
+
a
|
|
79
79
|
]
|
|
80
80
|
}
|
|
81
81
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as H, jsxs as I } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useForm as b } from "react-hook-form";
|
|
3
3
|
import { forwardRef as g, useMemo as w } from "react";
|
|
4
4
|
import { form as C } from "../Form.styles.js";
|
|
5
5
|
import { IressHookForm as E } from "../HookForm/HookForm.js";
|
|
@@ -17,9 +17,9 @@ const R = ({
|
|
|
17
17
|
heading: o,
|
|
18
18
|
mode: i = "onSubmit",
|
|
19
19
|
progressive: u,
|
|
20
|
-
resetOptions:
|
|
21
|
-
resolver:
|
|
22
|
-
reValidateMode:
|
|
20
|
+
resetOptions: h,
|
|
21
|
+
resolver: p,
|
|
22
|
+
reValidateMode: a = "onChange",
|
|
23
23
|
shouldUseNativeValidation: F,
|
|
24
24
|
shouldUnregister: l,
|
|
25
25
|
values: x,
|
|
@@ -32,9 +32,9 @@ const R = ({
|
|
|
32
32
|
delayError: c,
|
|
33
33
|
mode: i,
|
|
34
34
|
progressive: u,
|
|
35
|
-
resetOptions:
|
|
36
|
-
resolver:
|
|
37
|
-
reValidateMode:
|
|
35
|
+
resetOptions: h,
|
|
36
|
+
resolver: p,
|
|
37
|
+
reValidateMode: a,
|
|
38
38
|
shouldFocusError: !r,
|
|
39
39
|
shouldUseNativeValidation: F,
|
|
40
40
|
shouldUnregister: l,
|