@mittwald/flow-react-components 0.1.0-alpha.246 → 0.1.0-alpha.248
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/{Accordion-DlklvizS.js → Accordion-CCq563rl.js} +3 -3
- package/dist/Accordion.js +1 -1
- package/dist/{Action-D-HVrpPi.js → Action-BBdK8ZAq.js} +1 -1
- package/dist/Action.js +1 -1
- package/dist/ActionGroup.js +1 -1
- package/dist/Avatar.js +1 -1
- package/dist/Badge.js +4 -4
- package/dist/Breadcrumb.js +2 -2
- package/dist/{Button-C0bvnsA9.js → Button-BepCRVIi.js} +5 -5
- package/dist/Button.js +1 -1
- package/dist/{CalendarHeader-BDN0x1jA.js → CalendarHeader-BlnCorxV.js} +4 -4
- package/dist/{Checkbox-DuUbMnFd.js → Checkbox-CzqG4l7F.js} +4 -4
- package/dist/Checkbox.js +1 -1
- package/dist/{CheckboxButton-CEdjDRD4.js → CheckboxButton-Cz3gStwy.js} +2 -2
- package/dist/CheckboxButton.js +1 -1
- package/dist/CheckboxGroup.js +6 -6
- package/dist/{Content-D6S4fBtN.js → Content-CAZPjbt5.js} +1 -1
- package/dist/Content.js +1 -1
- package/dist/ContextMenu.js +3 -3
- package/dist/{ContextMenuTrigger-BRhhDtvH.js → ContextMenuTrigger-5-EjHDtY.js} +3 -3
- package/dist/ContextualHelp.js +4 -4
- package/dist/CopyButton.js +5 -5
- package/dist/CounterBadge.js +1 -1
- package/dist/DatePicker.js +16 -16
- package/dist/DateRangePicker.js +12 -12
- package/dist/{FieldDescription-CwLtN_Kg.js → FieldDescription-DSjltG-W.js} +2 -2
- package/dist/FieldDescription.js +1 -1
- package/dist/{FieldError-CMj635wN.js → FieldError-Crorz6g5.js} +3 -3
- package/dist/FieldError.js +1 -1
- package/dist/{FormField.module-DHK6nIcD.js → FormField.module-CqWpTQKP.js} +1 -1
- package/dist/{Header-Dwt-oDpb.js → Header-B9w8yH1e.js} +1 -1
- package/dist/Header.js +1 -1
- package/dist/{Heading-aH2xPQRN.js → Heading-FRIQlW19.js} +1 -1
- package/dist/Heading.js +1 -1
- package/dist/{Icon-CP4LKgOz.js → Icon-cEgH3ZXQ.js} +1 -1
- package/dist/Icon.js +1 -1
- package/dist/{IconCalendar-CtEidldN.js → IconCalendar-DBkKsCNt.js} +1 -1
- package/dist/{IconCheck-CZxTwwF4.js → IconCheck-C7DgNpRc.js} +1 -1
- package/dist/{IconCheckboxEmpty-Cba_avLA.js → IconCheckboxEmpty-Drda5S1f.js} +1 -1
- package/dist/{IconCheckboxIndeterminate-wnHCrMdd.js → IconCheckboxIndeterminate-BSSq4uEi.js} +1 -1
- package/dist/{IconChevronDown-fCXbarF0.js → IconChevronDown-CQUk3agB.js} +1 -1
- package/dist/{IconChevronRight-DmZWj_Oy.js → IconChevronRight-D-GVKXLH.js} +1 -1
- package/dist/{IconChevronUp-Uuq7aO0j.js → IconChevronUp-D3Tg6tuM.js} +1 -1
- package/dist/{IconClose-Bj3RfgFP.js → IconClose-DVYTU3Rp.js} +1 -1
- package/dist/{IconContextMenu-DyViVZnd.js → IconContextMenu-DLHXM1Ph.js} +1 -1
- package/dist/{IconCopy-D4ZoFT5T.js → IconCopy-Ceve0ccv.js} +1 -1
- package/dist/{IconDanger-CTnCYKnq.js → IconDanger-DIQGVmr5.js} +1 -1
- package/dist/{IconInfo-A2503xFY.js → IconInfo-76ibiNDU.js} +1 -1
- package/dist/{IconPending-HmLbafAB.js → IconPending-C1JtBTHt.js} +1 -1
- package/dist/{IconPlus-Cf-TOvTC.js → IconPlus-5rBbsI1A.js} +1 -1
- package/dist/{IconRadioOn-BbmhMvJt.js → IconRadioOn-C_HmW3DQ.js} +1 -1
- package/dist/{IconSearch-VVbB4_R0.js → IconSearch-a4VYepNE.js} +1 -1
- package/dist/{IconSettings-fdS8hm_F.js → IconSettings-De6OINaO.js} +1 -1
- package/dist/{IconSucceeded-DoFKQsvj.js → IconSucceeded-C10oveWn.js} +1 -1
- package/dist/{IconWarning-BrAniX0I.js → IconWarning-CVQw2BUC.js} +1 -1
- package/dist/Icons.js +20 -20
- package/dist/Image.js +1 -1
- package/dist/Initials.js +1 -1
- package/dist/InlineAlert.js +2 -2
- package/dist/{Label-C2mkR1Hd.js → Label-C583m3cx.js} +1 -1
- package/dist/Label.js +1 -1
- package/dist/LayoutCard.js +1 -1
- package/dist/{Link-CpVotbfk.js → Link-DW8KPMYX.js} +1 -1
- package/dist/Link.js +1 -1
- package/dist/List.js +14 -14
- package/dist/{LoadingSpinner-nREuGfrr.js → LoadingSpinner-2FvUo7ie.js} +2 -2
- package/dist/LoadingSpinner.js +1 -1
- package/dist/{MenuItem-DvCIe8Fb.js → MenuItem-CFE7SA5J.js} +5 -5
- package/dist/MenuItem.js +1 -1
- package/dist/Modal.js +6 -6
- package/dist/Navigation.js +2 -2
- package/dist/Notification.js +5 -5
- package/dist/NumberField.js +17 -17
- package/dist/Popover.js +2 -2
- package/dist/{PopoverTrigger-KOlGh-Rr.js → PopoverTrigger-CXPiJcMt.js} +1 -1
- package/dist/RadioGroup.js +16 -16
- package/dist/{SearchField-DgibIkmy.js → SearchField-CMvYWO_P.js} +13 -13
- package/dist/SearchField.js +1 -1
- package/dist/{Section-BjMvgxTY.js → Section-QApyOFfC.js} +1 -1
- package/dist/Section.js +1 -1
- package/dist/Select.js +26 -26
- package/dist/Slider.js +4 -4
- package/dist/StatusBadge.js +3 -3
- package/dist/{StatusIcon-BB7ZuNf_.js → StatusIcon-DEK5-0Aw.js} +4 -4
- package/dist/StatusIcon.js +1 -1
- package/dist/Switch.js +5 -5
- package/dist/Tabs.js +7 -7
- package/dist/{Text-85JoU8Wz.js → Text-T_kNKeFe.js} +1 -1
- package/dist/Text.js +1 -1
- package/dist/TextArea.js +2 -2
- package/dist/TextField.js +2 -2
- package/dist/{TextFieldBase-CK5MpgBw.js → TextFieldBase-w-pGXcOi.js} +10 -10
- package/dist/TimeField.js +34 -0
- package/dist/{flowComponent-Bo38T7gg.js → flowComponent-CY2oW3O9.js} +9 -8
- package/dist/react-hook-form.js +48 -47
- package/dist/styles.css +1 -1
- package/dist/types/components/TimeField/TimeField.d.ts +7 -0
- package/dist/types/components/TimeField/index.d.ts +3 -0
- package/dist/types/components/TimeField/stories/Default.stories.d.ts +13 -0
- package/dist/types/components/propTypes/index.d.ts +2 -0
- package/dist/types/lib/controller/overlay/context.d.ts +1 -0
- package/dist/types/lib/propsContext/propsContext.d.ts +2 -0
- package/dist/types/lib/slotContext/slotContext.d.ts +1 -0
- package/package.json +8 -4
package/dist/react-hook-form.js
CHANGED
|
@@ -1,92 +1,93 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import n, { createContext as
|
|
3
|
+
import n, { createContext as F, useContext as v, useEffect as S, useRef as k } from "react";
|
|
4
4
|
import { Controller as P, useFormState as h } from "react-hook-form";
|
|
5
5
|
import "./propsContext-DzAKlmhS.js";
|
|
6
6
|
import { P as b } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
7
7
|
import "@react-aria/utils";
|
|
8
8
|
import "remeda";
|
|
9
9
|
import { d as E } from "./dynamic-ClpUSmEt.js";
|
|
10
|
-
import { F as A } from "./FieldError-
|
|
11
|
-
import { a as g, A as y } from "./Action-
|
|
12
|
-
const x =
|
|
13
|
-
function D(
|
|
10
|
+
import { F as A } from "./FieldError-Crorz6g5.js";
|
|
11
|
+
import { a as g, A as y } from "./Action-BBdK8ZAq.js";
|
|
12
|
+
const x = F({}), V = x.Provider, f = () => v(x);
|
|
13
|
+
function D(t) {
|
|
14
14
|
var i;
|
|
15
|
-
const { children:
|
|
15
|
+
const { children: r, control: o, ...s } = t, a = (i = f().form) == null ? void 0 : i.control;
|
|
16
16
|
return /* @__PURE__ */ n.createElement(
|
|
17
17
|
P,
|
|
18
18
|
{
|
|
19
19
|
...s,
|
|
20
20
|
control: o ?? a,
|
|
21
|
-
render: (
|
|
21
|
+
render: (u) => {
|
|
22
22
|
var p;
|
|
23
23
|
const {
|
|
24
24
|
field: c,
|
|
25
|
-
fieldState: { error:
|
|
26
|
-
} =
|
|
25
|
+
fieldState: { error: l, invalid: m }
|
|
26
|
+
} = u, e = {
|
|
27
27
|
...c,
|
|
28
28
|
isRequired: !!((p = s.rules) != null && p.required),
|
|
29
29
|
isInvalid: m,
|
|
30
30
|
validationBehavior: "aria",
|
|
31
|
-
children: E((C) => /* @__PURE__ */ n.createElement(n.Fragment, null, C.children, /* @__PURE__ */ n.createElement(A, null,
|
|
31
|
+
children: E((C) => /* @__PURE__ */ n.createElement(n.Fragment, null, C.children, /* @__PURE__ */ n.createElement(A, null, l == null ? void 0 : l.message))),
|
|
32
32
|
ref: void 0,
|
|
33
33
|
refProp: c.ref
|
|
34
34
|
}, d = {
|
|
35
|
-
Checkbox:
|
|
36
|
-
CheckboxGroup:
|
|
37
|
-
CheckboxButton:
|
|
38
|
-
NumberField:
|
|
39
|
-
RadioGroup:
|
|
40
|
-
Switch:
|
|
41
|
-
TextArea:
|
|
42
|
-
TextField:
|
|
35
|
+
Checkbox: e,
|
|
36
|
+
CheckboxGroup: e,
|
|
37
|
+
CheckboxButton: e,
|
|
38
|
+
NumberField: e,
|
|
39
|
+
RadioGroup: e,
|
|
40
|
+
Switch: e,
|
|
41
|
+
TextArea: e,
|
|
42
|
+
TextField: e,
|
|
43
43
|
Select: {
|
|
44
|
-
...
|
|
45
|
-
defaultSelectedKey:
|
|
44
|
+
...e,
|
|
45
|
+
defaultSelectedKey: e.value
|
|
46
46
|
},
|
|
47
|
-
Slider:
|
|
48
|
-
DatePicker:
|
|
49
|
-
DateRangePicker:
|
|
47
|
+
Slider: e,
|
|
48
|
+
DatePicker: e,
|
|
49
|
+
DateRangePicker: e,
|
|
50
|
+
TimeField: e
|
|
50
51
|
};
|
|
51
52
|
return /* @__PURE__ */ n.createElement(
|
|
52
53
|
b,
|
|
53
54
|
{
|
|
54
55
|
props: d,
|
|
55
|
-
dependencies: [
|
|
56
|
+
dependencies: [u]
|
|
56
57
|
},
|
|
57
|
-
|
|
58
|
+
r
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
);
|
|
62
63
|
}
|
|
63
|
-
const _ = (
|
|
64
|
-
const { isStarted:
|
|
64
|
+
const _ = (t) => D, I = (t) => {
|
|
65
|
+
const { isStarted: r, hasFailedWithError: o, hasSucceeded: s, children: a } = t, i = g.useNew({});
|
|
65
66
|
return S(() => {
|
|
66
|
-
s ? i.state.onSucceeded() : o ? i.state.onFailed(o) :
|
|
67
|
-
}, [
|
|
68
|
-
}, R = (
|
|
69
|
-
const { children:
|
|
67
|
+
s ? i.state.onSucceeded() : o ? i.state.onFailed(o) : r && i.state.onAsyncStart();
|
|
68
|
+
}, [r, o, s]), /* @__PURE__ */ n.createElement(y, { actionModel: i }, a);
|
|
69
|
+
}, R = (t) => {
|
|
70
|
+
const { children: r, isAsyncSubmit: o } = t, s = f().form, { isSubmitted: a, isSubmitting: i, isSubmitSuccessful: u, errors: c } = h(s), l = a && c && Object.entries(c).length > 0 ? c : void 0, m = a && u;
|
|
70
71
|
return /* @__PURE__ */ n.createElement(
|
|
71
72
|
I,
|
|
72
73
|
{
|
|
73
74
|
isStarted: i && o.current,
|
|
74
|
-
hasFailedWithError:
|
|
75
|
+
hasFailedWithError: l,
|
|
75
76
|
hasSucceeded: m
|
|
76
77
|
},
|
|
77
|
-
|
|
78
|
+
r
|
|
78
79
|
);
|
|
79
|
-
},
|
|
80
|
-
const { children:
|
|
80
|
+
}, T = (t) => {
|
|
81
|
+
const { children: r, isAsyncSubmit: o } = t, s = {
|
|
81
82
|
ActionGroup: {
|
|
82
83
|
children: E((a) => /* @__PURE__ */ n.createElement(R, { isAsyncSubmit: o }, a.children))
|
|
83
84
|
}
|
|
84
85
|
};
|
|
85
|
-
return /* @__PURE__ */ n.createElement(b, { props: s, mergeInParentContext: !0 },
|
|
86
|
-
},
|
|
87
|
-
const
|
|
86
|
+
return /* @__PURE__ */ n.createElement(b, { props: s, mergeInParentContext: !0 }, r);
|
|
87
|
+
}, B = () => {
|
|
88
|
+
const t = f().form, { isValid: r, isSubmitted: o } = h(t);
|
|
88
89
|
return S(() => {
|
|
89
|
-
o &&
|
|
90
|
+
o && r && t && t.reset(void 0, {
|
|
90
91
|
keepIsSubmitted: !1,
|
|
91
92
|
keepIsSubmitSuccessful: !1,
|
|
92
93
|
keepDefaultValues: !0,
|
|
@@ -99,21 +100,21 @@ const _ = (e) => D, I = (e) => {
|
|
|
99
100
|
keepIsValidating: !0,
|
|
100
101
|
keepSubmitCount: !0
|
|
101
102
|
});
|
|
102
|
-
}, [o,
|
|
103
|
+
}, [o, r, t]), null;
|
|
103
104
|
};
|
|
104
|
-
function z(
|
|
105
|
-
const { form:
|
|
106
|
-
const { isSubmitting:
|
|
107
|
-
if (c.stopPropagation(),
|
|
105
|
+
function z(t) {
|
|
106
|
+
const { form: r, children: o, onSubmit: s, ...a } = t, i = k(!1), u = (c) => {
|
|
107
|
+
const { isSubmitting: l, isValidating: m } = r.control._formState;
|
|
108
|
+
if (c.stopPropagation(), l || m) {
|
|
108
109
|
c.preventDefault();
|
|
109
110
|
return;
|
|
110
111
|
}
|
|
111
|
-
|
|
112
|
-
const d = s(
|
|
112
|
+
r.handleSubmit((e) => {
|
|
113
|
+
const d = s(e, c);
|
|
113
114
|
return i.current = d instanceof Promise, d;
|
|
114
115
|
})(c);
|
|
115
116
|
};
|
|
116
|
-
return /* @__PURE__ */ n.createElement(V, { value: { form:
|
|
117
|
+
return /* @__PURE__ */ n.createElement(V, { value: { form: r } }, /* @__PURE__ */ n.createElement(T, { isAsyncSubmit: i }, /* @__PURE__ */ n.createElement("form", { ...a, onSubmit: u }, o), /* @__PURE__ */ n.createElement(B, null)));
|
|
117
118
|
}
|
|
118
119
|
export {
|
|
119
120
|
D as Field,
|