@lobehub/ui 5.19.2 → 5.20.0
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/es/base-ui/AutoComplete/AutoComplete.d.mts +8 -0
- package/es/base-ui/AutoComplete/AutoComplete.mjs +91 -0
- package/es/base-ui/AutoComplete/AutoComplete.mjs.map +1 -0
- package/es/base-ui/AutoComplete/index.d.mts +3 -0
- package/es/base-ui/AutoComplete/style.d.mts +12 -0
- package/es/base-ui/AutoComplete/style.mjs +76 -0
- package/es/base-ui/AutoComplete/style.mjs.map +1 -0
- package/es/base-ui/AutoComplete/type.d.mts +40 -0
- package/es/base-ui/Button/style.mjs +4 -3
- package/es/base-ui/Button/style.mjs.map +1 -1
- package/es/base-ui/Checkbox/Checkbox.d.mts +8 -0
- package/es/base-ui/Checkbox/Checkbox.mjs +61 -0
- package/es/base-ui/Checkbox/Checkbox.mjs.map +1 -0
- package/es/base-ui/Checkbox/CheckboxGroup.d.mts +8 -0
- package/es/base-ui/Checkbox/CheckboxGroup.mjs +37 -0
- package/es/base-ui/Checkbox/CheckboxGroup.mjs.map +1 -0
- package/es/base-ui/Checkbox/index.d.mts +4 -0
- package/es/base-ui/Checkbox/style.d.mts +9 -0
- package/es/base-ui/Checkbox/style.mjs +70 -0
- package/es/base-ui/Checkbox/style.mjs.map +1 -0
- package/es/base-ui/Checkbox/type.d.mts +51 -0
- package/es/base-ui/Form/Form.mjs +155 -0
- package/es/base-ui/Form/Form.mjs.map +1 -0
- package/es/base-ui/Form/components/FormDivider.d.mts +8 -0
- package/es/base-ui/Form/components/FormDivider.mjs +19 -0
- package/es/base-ui/Form/components/FormDivider.mjs.map +1 -0
- package/es/base-ui/Form/components/FormField.d.mts +8 -0
- package/es/base-ui/Form/components/FormField.mjs +59 -0
- package/es/base-ui/Form/components/FormField.mjs.map +1 -0
- package/es/base-ui/Form/components/FormFlatGroup.d.mts +8 -0
- package/es/base-ui/Form/components/FormFlatGroup.mjs +20 -0
- package/es/base-ui/Form/components/FormFlatGroup.mjs.map +1 -0
- package/es/base-ui/Form/components/FormFooter.d.mts +8 -0
- package/es/base-ui/Form/components/FormFooter.mjs +20 -0
- package/es/base-ui/Form/components/FormFooter.mjs.map +1 -0
- package/es/base-ui/Form/components/FormGroup.d.mts +8 -0
- package/es/base-ui/Form/components/FormGroup.mjs +87 -0
- package/es/base-ui/Form/components/FormGroup.mjs.map +1 -0
- package/es/base-ui/Form/components/FormSubmitFooter.d.mts +8 -0
- package/es/base-ui/Form/components/FormSubmitFooter.mjs +118 -0
- package/es/base-ui/Form/components/FormSubmitFooter.mjs.map +1 -0
- package/es/base-ui/Form/components/FormTitle.d.mts +8 -0
- package/es/base-ui/Form/components/FormTitle.mjs +42 -0
- package/es/base-ui/Form/components/FormTitle.mjs.map +1 -0
- package/es/base-ui/Form/context.d.mts +6 -0
- package/es/base-ui/Form/context.mjs +15 -0
- package/es/base-ui/Form/context.mjs.map +1 -0
- package/es/base-ui/Form/index.d.mts +25 -0
- package/es/base-ui/Form/index.mjs +24 -0
- package/es/base-ui/Form/index.mjs.map +1 -0
- package/es/base-ui/Form/style.mjs +288 -0
- package/es/base-ui/Form/style.mjs.map +1 -0
- package/es/base-ui/Form/type.d.mts +139 -0
- package/es/base-ui/Input/Input.d.mts +8 -0
- package/es/base-ui/Input/Input.mjs +43 -0
- package/es/base-ui/Input/Input.mjs.map +1 -0
- package/es/base-ui/Input/InputNumber.d.mts +8 -0
- package/es/base-ui/Input/InputNumber.mjs +50 -0
- package/es/base-ui/Input/InputNumber.mjs.map +1 -0
- package/es/base-ui/Input/InputOTP.d.mts +8 -0
- package/es/base-ui/Input/InputOTP.mjs +31 -0
- package/es/base-ui/Input/InputOTP.mjs.map +1 -0
- package/es/base-ui/Input/InputPassword.d.mts +8 -0
- package/es/base-ui/Input/InputPassword.mjs +31 -0
- package/es/base-ui/Input/InputPassword.mjs.map +1 -0
- package/es/base-ui/Input/TextArea.d.mts +8 -0
- package/es/base-ui/Input/TextArea.mjs +43 -0
- package/es/base-ui/Input/TextArea.mjs.map +1 -0
- package/es/base-ui/Input/index.d.mts +7 -0
- package/es/base-ui/Input/style.d.mts +33 -0
- package/es/base-ui/Input/style.mjs +230 -0
- package/es/base-ui/Input/style.mjs.map +1 -0
- package/es/base-ui/Input/type.d.mts +122 -0
- package/es/base-ui/Popover/PopoverGroup.mjs +9 -2
- package/es/base-ui/Popover/PopoverGroup.mjs.map +1 -1
- package/es/base-ui/Popover/PopoverStandalone.mjs +9 -3
- package/es/base-ui/Popover/PopoverStandalone.mjs.map +1 -1
- package/es/base-ui/Popover/hoverOnlyPress.mjs +14 -0
- package/es/base-ui/Popover/hoverOnlyPress.mjs.map +1 -0
- package/es/base-ui/Select/style.mjs +4 -3
- package/es/base-ui/Select/style.mjs.map +1 -1
- package/es/base-ui/Slider/Slider.d.mts +8 -0
- package/es/base-ui/Slider/Slider.mjs +34 -0
- package/es/base-ui/Slider/Slider.mjs.map +1 -0
- package/es/base-ui/Slider/SliderWithInput.d.mts +8 -0
- package/es/base-ui/Slider/SliderWithInput.mjs +64 -0
- package/es/base-ui/Slider/SliderWithInput.mjs.map +1 -0
- package/es/base-ui/Slider/index.d.mts +4 -0
- package/es/base-ui/Slider/style.d.mts +11 -0
- package/es/base-ui/Slider/style.mjs +69 -0
- package/es/base-ui/Slider/style.mjs.map +1 -0
- package/es/base-ui/Slider/type.d.mts +47 -0
- package/es/base-ui/controlSize.d.mts +10 -0
- package/es/base-ui/controlSize.mjs +10 -0
- package/es/base-ui/controlSize.mjs.map +1 -0
- package/es/base-ui/index.d.mts +33 -4
- package/es/base-ui/index.mjs +28 -4
- package/es/eslint/index.mjs +25 -15
- package/es/eslint/index.mjs.map +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { rootVariants } from "./style.mjs";
|
|
3
|
+
import { FormContext } from "./context.mjs";
|
|
4
|
+
import FormField from "./components/FormField.mjs";
|
|
5
|
+
import FormFlatGroup from "./components/FormFlatGroup.mjs";
|
|
6
|
+
import FormGroup from "./components/FormGroup.mjs";
|
|
7
|
+
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { cx, useResponsive } from "antd-style";
|
|
10
|
+
import { isUndefined } from "es-toolkit/compat";
|
|
11
|
+
import { Form } from "@base-ui/react/form";
|
|
12
|
+
//#region src/base-ui/Form/Form.tsx
|
|
13
|
+
const serializeForm = (form) => {
|
|
14
|
+
if (!form) return "";
|
|
15
|
+
const entries = [...new FormData(form).entries()].filter(([, value]) => typeof value === "string");
|
|
16
|
+
return JSON.stringify(entries.sort((a, b) => a[0].localeCompare(b[0])));
|
|
17
|
+
};
|
|
18
|
+
const Form$1 = memo(({ className, itemMinWidth, footer, items = [], children, itemsType = "group", variant = "borderless", classNames, styles: customStyles, gap, style, collapsible, defaultActiveKey, initialValues, activeKey, onCollapse, onFinish, onFormSubmit, layout, ref, ...rest }) => {
|
|
19
|
+
const { mobile } = useResponsive();
|
|
20
|
+
const formRef = useRef(null);
|
|
21
|
+
const [submitLoading, setSubmitLoading] = useState(false);
|
|
22
|
+
const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);
|
|
23
|
+
const snapshotRef = useRef("");
|
|
24
|
+
const syncUnsaved = useCallback(() => {
|
|
25
|
+
setHasUnsavedChanges(serializeForm(formRef.current) !== snapshotRef.current);
|
|
26
|
+
}, []);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const form = formRef.current;
|
|
29
|
+
if (!form) return;
|
|
30
|
+
snapshotRef.current = serializeForm(form);
|
|
31
|
+
let resetTimer;
|
|
32
|
+
const handleMutation = () => syncUnsaved();
|
|
33
|
+
const handleReset = () => {
|
|
34
|
+
resetTimer = setTimeout(() => {
|
|
35
|
+
snapshotRef.current = serializeForm(formRef.current);
|
|
36
|
+
syncUnsaved();
|
|
37
|
+
}, 0);
|
|
38
|
+
};
|
|
39
|
+
form.addEventListener("input", handleMutation);
|
|
40
|
+
form.addEventListener("change", handleMutation);
|
|
41
|
+
form.addEventListener("reset", handleReset);
|
|
42
|
+
return () => {
|
|
43
|
+
clearTimeout(resetTimer);
|
|
44
|
+
form.removeEventListener("input", handleMutation);
|
|
45
|
+
form.removeEventListener("change", handleMutation);
|
|
46
|
+
form.removeEventListener("reset", handleReset);
|
|
47
|
+
};
|
|
48
|
+
}, [syncUnsaved]);
|
|
49
|
+
const requestReset = useCallback(() => {
|
|
50
|
+
formRef.current?.reset();
|
|
51
|
+
}, []);
|
|
52
|
+
const mergedRef = useCallback((node) => {
|
|
53
|
+
formRef.current = node;
|
|
54
|
+
if (typeof ref === "function") ref(node);
|
|
55
|
+
else if (ref) ref.current = node;
|
|
56
|
+
}, [ref]);
|
|
57
|
+
const context = useMemo(() => ({
|
|
58
|
+
hasUnsavedChanges,
|
|
59
|
+
initialValues,
|
|
60
|
+
itemMinWidth,
|
|
61
|
+
layout: layout || (mobile ? "vertical" : "horizontal"),
|
|
62
|
+
requestReset,
|
|
63
|
+
submitLoading,
|
|
64
|
+
variant
|
|
65
|
+
}), [
|
|
66
|
+
hasUnsavedChanges,
|
|
67
|
+
initialValues,
|
|
68
|
+
itemMinWidth,
|
|
69
|
+
layout,
|
|
70
|
+
mobile,
|
|
71
|
+
requestReset,
|
|
72
|
+
submitLoading,
|
|
73
|
+
variant
|
|
74
|
+
]);
|
|
75
|
+
const mapFlat = useCallback((item, itemIndex) => /* @__PURE__ */ jsx(FormField, {
|
|
76
|
+
className: classNames?.item,
|
|
77
|
+
divider: itemIndex !== 0,
|
|
78
|
+
style: customStyles?.item,
|
|
79
|
+
variant,
|
|
80
|
+
...item
|
|
81
|
+
}, itemIndex), [
|
|
82
|
+
variant,
|
|
83
|
+
classNames,
|
|
84
|
+
customStyles
|
|
85
|
+
]);
|
|
86
|
+
const mapTree = useCallback((group, groupIndex) => {
|
|
87
|
+
const key = group?.key || groupIndex;
|
|
88
|
+
return /* @__PURE__ */ jsx(FormGroup, {
|
|
89
|
+
active: activeKey && group?.key ? activeKey.includes(key) : void 0,
|
|
90
|
+
className: classNames?.group,
|
|
91
|
+
collapsible: isUndefined(group.collapsible) ? collapsible : group.collapsible,
|
|
92
|
+
desc: group?.desc,
|
|
93
|
+
extra: group?.extra,
|
|
94
|
+
icon: group?.icon,
|
|
95
|
+
style: customStyles?.group,
|
|
96
|
+
title: group.title,
|
|
97
|
+
variant: group?.variant || variant,
|
|
98
|
+
defaultActive: defaultActiveKey && group?.key ? defaultActiveKey.includes(key) : group?.defaultActive,
|
|
99
|
+
onCollapse: (active) => {
|
|
100
|
+
let keys = activeKey || defaultActiveKey || [];
|
|
101
|
+
keys = keys.filter((k) => k !== key);
|
|
102
|
+
onCollapse?.(active ? [...keys, key] : keys);
|
|
103
|
+
},
|
|
104
|
+
children: Array.isArray(group.children) ? group.children.filter((item) => !item.hidden).map((item, i) => mapFlat(item, i)) : group.children
|
|
105
|
+
}, key);
|
|
106
|
+
}, [
|
|
107
|
+
activeKey,
|
|
108
|
+
collapsible,
|
|
109
|
+
defaultActiveKey,
|
|
110
|
+
onCollapse,
|
|
111
|
+
variant,
|
|
112
|
+
classNames,
|
|
113
|
+
customStyles,
|
|
114
|
+
mapFlat
|
|
115
|
+
]);
|
|
116
|
+
return /* @__PURE__ */ jsx(FormContext, {
|
|
117
|
+
value: context,
|
|
118
|
+
children: /* @__PURE__ */ jsxs(Form, {
|
|
119
|
+
className: cx(rootVariants({ variant }), className),
|
|
120
|
+
ref: mergedRef,
|
|
121
|
+
style: {
|
|
122
|
+
gap,
|
|
123
|
+
...style
|
|
124
|
+
},
|
|
125
|
+
onFormSubmit: async (values, eventDetails) => {
|
|
126
|
+
onFormSubmit?.(values, eventDetails);
|
|
127
|
+
if (!onFinish) return;
|
|
128
|
+
setSubmitLoading(true);
|
|
129
|
+
try {
|
|
130
|
+
await onFinish(values, eventDetails);
|
|
131
|
+
snapshotRef.current = serializeForm(formRef.current);
|
|
132
|
+
syncUnsaved();
|
|
133
|
+
} finally {
|
|
134
|
+
setSubmitLoading(false);
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
...rest,
|
|
138
|
+
children: [
|
|
139
|
+
items && items.length > 0 ? itemsType === "group" ? items.map((item, i) => mapTree(item, i)) : /* @__PURE__ */ jsx(FormFlatGroup, {
|
|
140
|
+
className: classNames?.group,
|
|
141
|
+
style: customStyles?.group,
|
|
142
|
+
variant,
|
|
143
|
+
children: items.filter((item) => !item.hidden).map((item, i) => mapFlat(item, i))
|
|
144
|
+
}) : void 0,
|
|
145
|
+
children,
|
|
146
|
+
footer
|
|
147
|
+
]
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
Form$1.displayName = "Form";
|
|
152
|
+
//#endregion
|
|
153
|
+
export { Form$1 as default };
|
|
154
|
+
|
|
155
|
+
//# sourceMappingURL=Form.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form.mjs","names":["Form","BaseForm"],"sources":["../../../src/base-ui/Form/Form.tsx"],"sourcesContent":["'use client';\n\nimport { Form as BaseForm } from '@base-ui/react/form';\nimport { cx, useResponsive } from 'antd-style';\nimport { isUndefined } from 'es-toolkit/compat';\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport FormField from './components/FormField';\nimport FormFlatGroup from './components/FormFlatGroup';\nimport FormGroup from './components/FormGroup';\nimport { FormContext } from './context';\nimport { rootVariants } from './style';\nimport type { FormFieldProps, FormGroupItemType, FormProps } from './type';\n\nconst serializeForm = (form: HTMLFormElement | null) => {\n if (!form) return '';\n const entries = [...new FormData(form).entries()].filter(\n ([, value]) => typeof value === 'string',\n ) as [string, string][];\n return JSON.stringify(entries.sort((a, b) => a[0].localeCompare(b[0])));\n};\n\nconst Form = memo<FormProps>(\n ({\n className,\n itemMinWidth,\n footer,\n items = [],\n children,\n itemsType = 'group',\n variant = 'borderless',\n classNames,\n styles: customStyles,\n gap,\n style,\n collapsible,\n defaultActiveKey,\n initialValues,\n activeKey,\n onCollapse,\n onFinish,\n onFormSubmit,\n layout,\n ref,\n ...rest\n }) => {\n const { mobile } = useResponsive();\n const formRef = useRef<HTMLFormElement>(null);\n const [submitLoading, setSubmitLoading] = useState(false);\n const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);\n const snapshotRef = useRef('');\n\n const syncUnsaved = useCallback(() => {\n setHasUnsavedChanges(serializeForm(formRef.current) !== snapshotRef.current);\n }, []);\n\n useEffect(() => {\n const form = formRef.current;\n if (!form) return;\n snapshotRef.current = serializeForm(form);\n let resetTimer: ReturnType<typeof setTimeout>;\n const handleMutation = () => syncUnsaved();\n const handleReset = () => {\n resetTimer = setTimeout(() => {\n snapshotRef.current = serializeForm(formRef.current);\n syncUnsaved();\n }, 0);\n };\n form.addEventListener('input', handleMutation);\n form.addEventListener('change', handleMutation);\n form.addEventListener('reset', handleReset);\n return () => {\n clearTimeout(resetTimer);\n form.removeEventListener('input', handleMutation);\n form.removeEventListener('change', handleMutation);\n form.removeEventListener('reset', handleReset);\n };\n }, [syncUnsaved]);\n\n const requestReset = useCallback(() => {\n formRef.current?.reset();\n }, []);\n\n const mergedRef = useCallback(\n (node: HTMLFormElement | null) => {\n formRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref],\n );\n\n const context = useMemo(\n () => ({\n hasUnsavedChanges,\n initialValues,\n itemMinWidth,\n layout: layout || (mobile ? ('vertical' as const) : ('horizontal' as const)),\n requestReset,\n submitLoading,\n variant,\n }),\n [\n hasUnsavedChanges,\n initialValues,\n itemMinWidth,\n layout,\n mobile,\n requestReset,\n submitLoading,\n variant,\n ],\n );\n\n const mapFlat = useCallback(\n (item: FormFieldProps, itemIndex: number) => (\n <FormField\n className={classNames?.item}\n divider={itemIndex !== 0}\n key={itemIndex}\n style={customStyles?.item}\n variant={variant}\n {...item}\n />\n ),\n [variant, classNames, customStyles],\n );\n\n const mapTree = useCallback(\n (group: FormGroupItemType, groupIndex: number) => {\n const key = group?.key || groupIndex;\n return (\n <FormGroup\n active={activeKey && group?.key ? activeKey.includes(key) : undefined}\n className={classNames?.group}\n collapsible={isUndefined(group.collapsible) ? collapsible : group.collapsible}\n desc={group?.desc}\n extra={group?.extra}\n icon={group?.icon}\n key={key}\n style={customStyles?.group}\n title={group.title}\n variant={group?.variant || variant}\n defaultActive={\n defaultActiveKey && group?.key ? defaultActiveKey.includes(key) : group?.defaultActive\n }\n onCollapse={(active) => {\n let keys: (string | number)[] = activeKey || defaultActiveKey || [];\n keys = keys.filter((k) => k !== key);\n onCollapse?.(active ? [...keys, key] : keys);\n }}\n >\n {Array.isArray(group.children)\n ? group.children.filter((item) => !item.hidden).map((item, i) => mapFlat(item, i))\n : group.children}\n </FormGroup>\n );\n },\n [\n activeKey,\n collapsible,\n defaultActiveKey,\n onCollapse,\n variant,\n classNames,\n customStyles,\n mapFlat,\n ],\n );\n\n return (\n <FormContext value={context}>\n <BaseForm\n className={cx(rootVariants({ variant }), className)}\n ref={mergedRef}\n style={{ gap, ...style }}\n onFormSubmit={async (values, eventDetails) => {\n onFormSubmit?.(values, eventDetails);\n if (!onFinish) return;\n setSubmitLoading(true);\n try {\n await onFinish(values, eventDetails);\n snapshotRef.current = serializeForm(formRef.current);\n syncUnsaved();\n } finally {\n setSubmitLoading(false);\n }\n }}\n {...rest}\n >\n {items && items.length > 0 ? (\n itemsType === 'group' ? (\n (items as FormGroupItemType[]).map((item, i) => mapTree(item, i))\n ) : (\n <FormFlatGroup\n className={classNames?.group}\n style={customStyles?.group}\n variant={variant}\n >\n {(items as FormFieldProps[])\n .filter((item) => !item.hidden)\n .map((item, i) => mapFlat(item, i))}\n </FormFlatGroup>\n )\n ) : undefined}\n {children}\n {footer}\n </BaseForm>\n </FormContext>\n );\n },\n);\n\nForm.displayName = 'Form';\n\nexport default Form;\n"],"mappings":";;;;;;;;;;;;AAcA,MAAM,iBAAiB,SAAiC;AACt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A;EACA;EACD,CACF;AAED,QACE,oBAAC,aAAD;EAAa,OAAO;YAClB,qBAACC,MAAD;GACE,WAAW,GAAG,aAAa,EAAE,SAAS,CAAC,EAAE,UAAU;GACnD,KAAK;GACL,OAAO;IAAE;IAAK,GAAG;IAAO;GACxB,cAAc,OAAO,QAAQ,iBAAiB;AAC5C,mBAAe,QAAQ,aAAa;AACpC,QAAI,CAAC,SAAU;AACf,qBAAiB,KAAK;AACtB,QAAI;AACF,WAAM,SAAS,QAAQ,aAAa;AACpC,iBAAY,UAAU,cAAc,QAAQ,QAAQ;AACpD,kBAAa;cACL;AACR,sBAAiB,MAAM;;;GAG3B,GAAI;aAhBN;IAkBG,SAAS,MAAM,SAAS,IACvB,cAAc,UACX,MAA8B,KAAK,MAAM,MAAM,QAAQ,MAAM,EAAE,CAAC,GAEjE,oBAAC,eAAD;KACE,WAAW,YAAY;KACvB,OAAO,cAAc;KACZ;eAEP,MACC,QAAQ,SAAS,CAAC,KAAK,OAAO,CAC9B,KAAK,MAAM,MAAM,QAAQ,MAAM,EAAE,CAAC;KACvB,CAAA,GAEhB,KAAA;IACH;IACA;IACQ;;EACC,CAAA;EAGnB;AAED,OAAK,cAAc"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormDividerProps } from "../type.mjs";
|
|
2
|
+
import { FC } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/base-ui/Form/components/FormDivider.d.ts
|
|
5
|
+
declare const FormDivider: FC<FormDividerProps>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { FormDivider };
|
|
8
|
+
//# sourceMappingURL=FormDivider.d.mts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { dividerStyles } from "../style.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { cx } from "antd-style";
|
|
5
|
+
//#region src/base-ui/Form/components/FormDivider.tsx
|
|
6
|
+
const FormDivider = ({ visible = true, style, className, ...rest }) => /* @__PURE__ */ jsx("div", {
|
|
7
|
+
className: cx(dividerStyles.root, className),
|
|
8
|
+
role: "separator",
|
|
9
|
+
style: {
|
|
10
|
+
opacity: visible ? .66 : 0,
|
|
11
|
+
...style
|
|
12
|
+
},
|
|
13
|
+
...rest
|
|
14
|
+
});
|
|
15
|
+
FormDivider.displayName = "FormDivider";
|
|
16
|
+
//#endregion
|
|
17
|
+
export { FormDivider as default };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=FormDivider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormDivider.mjs","names":[],"sources":["../../../../src/base-ui/Form/components/FormDivider.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { type FC } from 'react';\n\nimport { dividerStyles } from '../style';\nimport type { FormDividerProps } from '../type';\n\nconst FormDivider: FC<FormDividerProps> = ({ visible = true, style, className, ...rest }) => (\n <div\n className={cx(dividerStyles.root, className)}\n role={'separator'}\n style={{ opacity: visible ? 0.66 : 0, ...style }}\n {...rest}\n />\n);\n\nFormDivider.displayName = 'FormDivider';\n\nexport default FormDivider;\n"],"mappings":";;;;;AAQA,MAAM,eAAqC,EAAE,UAAU,MAAM,OAAO,WAAW,GAAG,WAChF,oBAAC,OAAD;CACE,WAAW,GAAG,cAAc,MAAM,UAAU;CAC5C,MAAM;CACN,OAAO;EAAE,SAAS,UAAU,MAAO;EAAG,GAAG;EAAO;CAChD,GAAI;CACJ,CAAA;AAGJ,YAAY,cAAc"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormFieldProps } from "../type.mjs";
|
|
2
|
+
import * as _$react from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/base-ui/Form/components/FormField.d.ts
|
|
5
|
+
declare const FormField: _$react.NamedExoticComponent<FormFieldProps>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { FormField };
|
|
8
|
+
//# sourceMappingURL=FormField.d.mts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { fieldStyles, fieldVariants } from "../style.mjs";
|
|
3
|
+
import FormDivider from "./FormDivider.mjs";
|
|
4
|
+
import { useFormContext } from "../context.mjs";
|
|
5
|
+
import FormTitle from "./FormTitle.mjs";
|
|
6
|
+
import { cloneElement, isValidElement, memo, useMemo } from "react";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { cx, useResponsive } from "antd-style";
|
|
9
|
+
import { Field } from "@base-ui/react/field";
|
|
10
|
+
//#region src/base-ui/Form/components/FormField.tsx
|
|
11
|
+
const FormField = memo(({ avatar, children, className, desc, divider, hidden, label, layout, minWidth, name, required, style, tag, variant, ...rest }) => {
|
|
12
|
+
const { mobile } = useResponsive();
|
|
13
|
+
const config = useFormContext();
|
|
14
|
+
const mergedLayout = layout || (mobile ? "vertical" : config.layout);
|
|
15
|
+
const mergedVariant = variant || config.variant;
|
|
16
|
+
const mergedMinWidth = minWidth ?? config.itemMinWidth;
|
|
17
|
+
const control = useMemo(() => {
|
|
18
|
+
if (!isValidElement(children)) return children;
|
|
19
|
+
const props = children.props;
|
|
20
|
+
const injected = {};
|
|
21
|
+
if (required && props.required === void 0) injected.required = true;
|
|
22
|
+
if (name) {
|
|
23
|
+
const initialValue = config.initialValues?.[name];
|
|
24
|
+
if (initialValue !== void 0 && props.value === void 0 && props.defaultValue === void 0) injected.defaultValue = initialValue;
|
|
25
|
+
}
|
|
26
|
+
if (Object.keys(injected).length === 0) return children;
|
|
27
|
+
return cloneElement(children, injected);
|
|
28
|
+
}, [
|
|
29
|
+
children,
|
|
30
|
+
name,
|
|
31
|
+
required,
|
|
32
|
+
config.initialValues
|
|
33
|
+
]);
|
|
34
|
+
if (hidden) return null;
|
|
35
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [divider && /* @__PURE__ */ jsx(FormDivider, { visible: mergedVariant !== "borderless" }), /* @__PURE__ */ jsxs(Field.Root, {
|
|
36
|
+
className: cx(fieldVariants({ layout: mergedLayout }), className),
|
|
37
|
+
name,
|
|
38
|
+
style,
|
|
39
|
+
...rest,
|
|
40
|
+
children: [/* @__PURE__ */ jsx(Field.Label, {
|
|
41
|
+
className: fieldStyles.label,
|
|
42
|
+
children: /* @__PURE__ */ jsx(FormTitle, {
|
|
43
|
+
avatar,
|
|
44
|
+
desc,
|
|
45
|
+
tag,
|
|
46
|
+
title: label
|
|
47
|
+
})
|
|
48
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
49
|
+
className: cx(fieldStyles.control, mergedLayout === "vertical" && fieldStyles.controlVertical),
|
|
50
|
+
style: mergedMinWidth === void 0 || mergedMinWidth === null || mergedMinWidth === "" ? void 0 : { minWidth: typeof mergedMinWidth === "number" ? `${mergedMinWidth}px` : mergedMinWidth },
|
|
51
|
+
children: [control, /* @__PURE__ */ jsx(Field.Error, { className: fieldStyles.error })]
|
|
52
|
+
})]
|
|
53
|
+
})] });
|
|
54
|
+
});
|
|
55
|
+
FormField.displayName = "FormField";
|
|
56
|
+
//#endregion
|
|
57
|
+
export { FormField as default };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=FormField.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormField.mjs","names":[],"sources":["../../../../src/base-ui/Form/components/FormField.tsx"],"sourcesContent":["'use client';\n\nimport { Field } from '@base-ui/react/field';\nimport { cx, useResponsive } from 'antd-style';\nimport { cloneElement, isValidElement, memo, useMemo } from 'react';\n\nimport { useFormContext } from '../context';\nimport { fieldStyles, fieldVariants } from '../style';\nimport type { FormFieldProps } from '../type';\nimport FormDivider from './FormDivider';\nimport FormTitle from './FormTitle';\n\nconst FormField = memo<FormFieldProps>(\n ({\n avatar,\n children,\n className,\n desc,\n divider,\n hidden,\n label,\n layout,\n minWidth,\n name,\n required,\n style,\n tag,\n variant,\n ...rest\n }) => {\n const { mobile } = useResponsive();\n const config = useFormContext();\n\n const mergedLayout = layout || (mobile ? 'vertical' : config.layout);\n const mergedVariant = variant || config.variant;\n const mergedMinWidth = minWidth ?? config.itemMinWidth;\n\n const control = useMemo(() => {\n if (!isValidElement(children)) return children;\n const props = children.props as Record<string, unknown>;\n const injected: Record<string, unknown> = {};\n if (required && props.required === undefined) injected.required = true;\n if (name) {\n const initialValue = config.initialValues?.[name];\n if (\n initialValue !== undefined &&\n props.value === undefined &&\n props.defaultValue === undefined\n )\n injected.defaultValue = initialValue;\n }\n if (Object.keys(injected).length === 0) return children;\n return cloneElement(children, injected as never);\n }, [children, name, required, config.initialValues]);\n\n if (hidden) return null;\n\n return (\n <>\n {divider && <FormDivider visible={mergedVariant !== 'borderless'} />}\n <Field.Root\n className={cx(fieldVariants({ layout: mergedLayout }), className)}\n name={name}\n style={style}\n {...rest}\n >\n <Field.Label className={fieldStyles.label}>\n <FormTitle avatar={avatar} desc={desc} tag={tag} title={label} />\n </Field.Label>\n <div\n className={cx(\n fieldStyles.control,\n mergedLayout === 'vertical' && fieldStyles.controlVertical,\n )}\n style={\n mergedMinWidth === undefined || mergedMinWidth === null || mergedMinWidth === ''\n ? undefined\n : {\n minWidth:\n typeof mergedMinWidth === 'number' ? `${mergedMinWidth}px` : mergedMinWidth,\n }\n }\n >\n {control}\n <Field.Error className={fieldStyles.error} />\n </div>\n </Field.Root>\n </>\n );\n },\n);\n\nFormField.displayName = 'FormField';\n\nexport default FormField;\n"],"mappings":";;;;;;;;;;AAYA,MAAM,YAAY,MACf,EACC,QACA,UACA,WACA,MACA,SACA,QACA,OACA,QACA,UACA,MACA,UACA,OACA,KACA,SACA,GAAG,WACC;CACJ,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,SAAS,gBAAgB;CAE/B,MAAM,eAAe,WAAW,SAAS,aAAa,OAAO;CAC7D,MAAM,gBAAgB,WAAW,OAAO;CACxC,MAAM,iBAAiB,YAAY,OAAO;CAE1C,MAAM,UAAU,cAAc;AAC5B,MAAI,CAAC,eAAe,SAAS,CAAE,QAAO;EACtC,MAAM,QAAQ,SAAS;EACvB,MAAM,WAAoC,EAAE;AAC5C,MAAI,YAAY,MAAM,aAAa,KAAA,EAAW,UAAS,WAAW;AAClE,MAAI,MAAM;GACR,MAAM,eAAe,OAAO,gBAAgB;AAC5C,OACE,iBAAiB,KAAA,KACjB,MAAM,UAAU,KAAA,KAChB,MAAM,iBAAiB,KAAA,EAEvB,UAAS,eAAe;;AAE5B,MAAI,OAAO,KAAK,SAAS,CAAC,WAAW,EAAG,QAAO;AAC/C,SAAO,aAAa,UAAU,SAAkB;IAC/C;EAAC;EAAU;EAAM;EAAU,OAAO;EAAc,CAAC;AAEpD,KAAI,OAAQ,QAAO;AAEnB,QACE,qBAAA,YAAA,EAAA,UAAA,CACG,WAAW,oBAAC,aAAD,EAAa,SAAS,kBAAkB,cAAgB,CAAA,EACpE,qBAAC,MAAM,MAAP;EACE,WAAW,GAAG,cAAc,EAAE,QAAQ,cAAc,CAAC,EAAE,UAAU;EAC3D;EACC;EACP,GAAI;YAJN,CAME,oBAAC,MAAM,OAAP;GAAa,WAAW,YAAY;aAClC,oBAAC,WAAD;IAAmB;IAAc;IAAW;IAAK,OAAO;IAAS,CAAA;GACrD,CAAA,EACd,qBAAC,OAAD;GACE,WAAW,GACT,YAAY,SACZ,iBAAiB,cAAc,YAAY,gBAC5C;GACD,OACE,mBAAmB,KAAA,KAAa,mBAAmB,QAAQ,mBAAmB,KAC1E,KAAA,IACA,EACE,UACE,OAAO,mBAAmB,WAAW,GAAG,eAAe,MAAM,gBAChE;aAXT,CAcG,SACD,oBAAC,MAAM,OAAP,EAAa,WAAW,YAAY,OAAS,CAAA,CACzC;KACK;IACZ,EAAA,CAAA;EAGR;AAED,UAAU,cAAc"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormFlatGroupProps } from "../type.mjs";
|
|
2
|
+
import * as _$react from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/base-ui/Form/components/FormFlatGroup.d.ts
|
|
5
|
+
declare const FormFlatGroup: _$react.NamedExoticComponent<FormFlatGroupProps>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { FormFlatGroup };
|
|
8
|
+
//# sourceMappingURL=FormFlatGroup.d.mts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import FlexBasic_default from "../../../Flex/FlexBasic.mjs";
|
|
3
|
+
import { flatGroupStyles, flatGroupVariants } from "../style.mjs";
|
|
4
|
+
import { memo } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { cx, useResponsive } from "antd-style";
|
|
7
|
+
//#region src/base-ui/Form/components/FormFlatGroup.tsx
|
|
8
|
+
const FormFlatGroup = memo(({ className, children, variant = "borderless", ...rest }) => {
|
|
9
|
+
const { mobile } = useResponsive();
|
|
10
|
+
return /* @__PURE__ */ jsx(FlexBasic_default, {
|
|
11
|
+
className: cx(mobile ? flatGroupStyles.mobile : flatGroupVariants({ variant }), className),
|
|
12
|
+
...rest,
|
|
13
|
+
children
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
FormFlatGroup.displayName = "FormFlatGroup";
|
|
17
|
+
//#endregion
|
|
18
|
+
export { FormFlatGroup as default };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=FormFlatGroup.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormFlatGroup.mjs","names":["Flexbox"],"sources":["../../../../src/base-ui/Form/components/FormFlatGroup.tsx"],"sourcesContent":["'use client';\n\nimport { cx, useResponsive } from 'antd-style';\nimport { memo } from 'react';\n\nimport { Flexbox } from '@/Flex';\n\nimport { flatGroupStyles, flatGroupVariants } from '../style';\nimport type { FormFlatGroupProps } from '../type';\n\nconst FormFlatGroup = memo<FormFlatGroupProps>(\n ({ className, children, variant = 'borderless', ...rest }) => {\n const { mobile } = useResponsive();\n\n return (\n <Flexbox\n className={cx(mobile ? flatGroupStyles.mobile : flatGroupVariants({ variant }), className)}\n {...rest}\n >\n {children}\n </Flexbox>\n );\n },\n);\n\nFormFlatGroup.displayName = 'FormFlatGroup';\n\nexport default FormFlatGroup;\n"],"mappings":";;;;;;;AAUA,MAAM,gBAAgB,MACnB,EAAE,WAAW,UAAU,UAAU,cAAc,GAAG,WAAW;CAC5D,MAAM,EAAE,WAAW,eAAe;AAElC,QACE,oBAACA,mBAAD;EACE,WAAW,GAAG,SAAS,gBAAgB,SAAS,kBAAkB,EAAE,SAAS,CAAC,EAAE,UAAU;EAC1F,GAAI;EAEH;EACO,CAAA;EAGf;AAED,cAAc,cAAc"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormFooterProps } from "../type.mjs";
|
|
2
|
+
import { FC } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/base-ui/Form/components/FormFooter.d.ts
|
|
5
|
+
declare const FormFooter: FC<FormFooterProps>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { FormFooter };
|
|
8
|
+
//# sourceMappingURL=FormFooter.d.mts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import FlexBasic_default from "../../../Flex/FlexBasic.mjs";
|
|
3
|
+
import { footerStyles } from "../style.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { cx } from "antd-style";
|
|
6
|
+
//#region src/base-ui/Form/components/FormFooter.tsx
|
|
7
|
+
const FormFooter = ({ className, children, ...rest }) => /* @__PURE__ */ jsx(FlexBasic_default, {
|
|
8
|
+
horizontal: true,
|
|
9
|
+
align: "center",
|
|
10
|
+
className: cx(footerStyles.root, className),
|
|
11
|
+
gap: 8,
|
|
12
|
+
justify: "flex-end",
|
|
13
|
+
...rest,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
FormFooter.displayName = "FormFooter";
|
|
17
|
+
//#endregion
|
|
18
|
+
export { FormFooter as default };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=FormFooter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormFooter.mjs","names":["Flexbox"],"sources":["../../../../src/base-ui/Form/components/FormFooter.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { type FC } from 'react';\n\nimport { Flexbox } from '@/Flex';\n\nimport { footerStyles } from '../style';\nimport type { FormFooterProps } from '../type';\n\nconst FormFooter: FC<FormFooterProps> = ({ className, children, ...rest }) => (\n <Flexbox\n horizontal\n align={'center'}\n className={cx(footerStyles.root, className)}\n gap={8}\n justify={'flex-end'}\n {...rest}\n >\n {children}\n </Flexbox>\n);\n\nFormFooter.displayName = 'FormFooter';\n\nexport default FormFooter;\n"],"mappings":";;;;;;AAUA,MAAM,cAAmC,EAAE,WAAW,UAAU,GAAG,WACjE,oBAACA,mBAAD;CACE,YAAA;CACA,OAAO;CACP,WAAW,GAAG,aAAa,MAAM,UAAU;CAC3C,KAAK;CACL,SAAS;CACT,GAAI;CAEH;CACO,CAAA;AAGZ,WAAW,cAAc"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormGroupProps } from "../type.mjs";
|
|
2
|
+
import * as _$react from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/base-ui/Form/components/FormGroup.d.ts
|
|
5
|
+
declare const FormGroup: _$react.NamedExoticComponent<FormGroupProps>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { FormGroup };
|
|
8
|
+
//# sourceMappingURL=FormGroup.d.mts.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import Icon from "../../../Icon/Icon.mjs";
|
|
3
|
+
import { groupStyles, groupVariants } from "../style.mjs";
|
|
4
|
+
import { memo } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { cx, useResponsive } from "antd-style";
|
|
7
|
+
import { ChevronDown } from "lucide-react";
|
|
8
|
+
import { Collapsible } from "@base-ui/react/collapsible";
|
|
9
|
+
//#region src/base-ui/Form/components/FormGroup.tsx
|
|
10
|
+
const GroupTitle = memo(({ icon, title, desc, variant, mobile }) => /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
className: cx(groupStyles.title, variant === "borderless" && !mobile && groupStyles.titleBorderless, mobile && groupStyles.mobileTitle),
|
|
12
|
+
children: [icon && /* @__PURE__ */ jsx(Icon, { icon }), /* @__PURE__ */ jsxs("div", { children: [title, desc && /* @__PURE__ */ jsx("div", {
|
|
13
|
+
className: groupStyles.desc,
|
|
14
|
+
children: desc
|
|
15
|
+
})] })]
|
|
16
|
+
}));
|
|
17
|
+
GroupTitle.displayName = "GroupTitle";
|
|
18
|
+
const FormGroup = memo(({ className, icon, title, children, extra, variant = "borderless", defaultActive = true, collapsible, active, onCollapse, desc, keyValue: _keyValue, ...rest }) => {
|
|
19
|
+
const { mobile } = useResponsive();
|
|
20
|
+
const isBorderless = variant === "borderless";
|
|
21
|
+
const isCollapsible = collapsible === void 0 ? !isBorderless : collapsible;
|
|
22
|
+
if (mobile) return /* @__PURE__ */ jsxs("div", {
|
|
23
|
+
className,
|
|
24
|
+
...rest,
|
|
25
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
26
|
+
className: cx(groupStyles.header, groupStyles.mobileHeader),
|
|
27
|
+
children: [/* @__PURE__ */ jsx(GroupTitle, {
|
|
28
|
+
mobile: true,
|
|
29
|
+
desc,
|
|
30
|
+
icon,
|
|
31
|
+
title
|
|
32
|
+
}), extra]
|
|
33
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
34
|
+
className: groupStyles.mobileBody,
|
|
35
|
+
children
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
38
|
+
if (!isCollapsible) return /* @__PURE__ */ jsxs("div", {
|
|
39
|
+
className: cx(groupVariants({ variant }), className),
|
|
40
|
+
...rest,
|
|
41
|
+
children: [title && /* @__PURE__ */ jsxs("div", {
|
|
42
|
+
className: cx(groupStyles.header, isBorderless ? groupStyles.headerBorderless : groupStyles.headerBoxed),
|
|
43
|
+
children: [/* @__PURE__ */ jsx(GroupTitle, {
|
|
44
|
+
desc,
|
|
45
|
+
icon,
|
|
46
|
+
title,
|
|
47
|
+
variant
|
|
48
|
+
}), extra]
|
|
49
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
50
|
+
className: cx(groupStyles.body, !isBorderless && groupStyles.bodyBoxed),
|
|
51
|
+
children
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
54
|
+
return /* @__PURE__ */ jsxs(Collapsible.Root, {
|
|
55
|
+
className: cx(groupVariants({ variant }), className),
|
|
56
|
+
defaultOpen: defaultActive,
|
|
57
|
+
open: active,
|
|
58
|
+
onOpenChange: onCollapse,
|
|
59
|
+
...rest,
|
|
60
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
61
|
+
className: cx(groupStyles.header, isBorderless ? groupStyles.headerBorderless : groupStyles.headerBoxed),
|
|
62
|
+
children: [/* @__PURE__ */ jsxs(Collapsible.Trigger, {
|
|
63
|
+
className: groupStyles.trigger,
|
|
64
|
+
children: [/* @__PURE__ */ jsx(GroupTitle, {
|
|
65
|
+
desc,
|
|
66
|
+
icon,
|
|
67
|
+
title,
|
|
68
|
+
variant
|
|
69
|
+
}), /* @__PURE__ */ jsx(Icon, {
|
|
70
|
+
className: groupStyles.chevron,
|
|
71
|
+
icon: ChevronDown
|
|
72
|
+
})]
|
|
73
|
+
}), extra]
|
|
74
|
+
}), /* @__PURE__ */ jsx(Collapsible.Panel, {
|
|
75
|
+
className: groupStyles.panel,
|
|
76
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
77
|
+
className: cx(groupStyles.body, !isBorderless && groupStyles.bodyBoxed),
|
|
78
|
+
children
|
|
79
|
+
})
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
FormGroup.displayName = "FormGroup";
|
|
84
|
+
//#endregion
|
|
85
|
+
export { FormGroup as default };
|
|
86
|
+
|
|
87
|
+
//# sourceMappingURL=FormGroup.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormGroup.mjs","names":[],"sources":["../../../../src/base-ui/Form/components/FormGroup.tsx"],"sourcesContent":["'use client';\n\nimport { Collapsible } from '@base-ui/react/collapsible';\nimport { cx, useResponsive } from 'antd-style';\nimport { ChevronDown } from 'lucide-react';\nimport { memo, type ReactNode } from 'react';\n\nimport Icon from '@/Icon';\n\nimport { groupStyles, groupVariants } from '../style';\nimport type { FormGroupProps } from '../type';\n\nconst GroupTitle = memo<{\n desc?: ReactNode;\n icon?: FormGroupProps['icon'];\n mobile?: boolean;\n title?: ReactNode;\n variant?: FormGroupProps['variant'];\n}>(({ icon, title, desc, variant, mobile }) => (\n <div\n className={cx(\n groupStyles.title,\n variant === 'borderless' && !mobile && groupStyles.titleBorderless,\n mobile && groupStyles.mobileTitle,\n )}\n >\n {icon && <Icon icon={icon} />}\n <div>\n {title}\n {desc && <div className={groupStyles.desc}>{desc}</div>}\n </div>\n </div>\n));\n\nGroupTitle.displayName = 'GroupTitle';\n\nconst FormGroup = memo<FormGroupProps>(\n ({\n className,\n icon,\n title,\n children,\n extra,\n variant = 'borderless',\n defaultActive = true,\n collapsible,\n active,\n onCollapse,\n desc,\n keyValue: _keyValue,\n ...rest\n }) => {\n const { mobile } = useResponsive();\n const isBorderless = variant === 'borderless';\n const isCollapsible = collapsible === undefined ? !isBorderless : collapsible;\n\n if (mobile)\n return (\n <div className={className} {...rest}>\n <div className={cx(groupStyles.header, groupStyles.mobileHeader)}>\n <GroupTitle mobile desc={desc} icon={icon} title={title} />\n {extra}\n </div>\n <div className={groupStyles.mobileBody}>{children}</div>\n </div>\n );\n\n if (!isCollapsible)\n return (\n <div className={cx(groupVariants({ variant }), className)} {...rest}>\n {title && (\n <div\n className={cx(\n groupStyles.header,\n isBorderless ? groupStyles.headerBorderless : groupStyles.headerBoxed,\n )}\n >\n <GroupTitle desc={desc} icon={icon} title={title} variant={variant} />\n {extra}\n </div>\n )}\n <div className={cx(groupStyles.body, !isBorderless && groupStyles.bodyBoxed)}>\n {children}\n </div>\n </div>\n );\n\n return (\n <Collapsible.Root\n className={cx(groupVariants({ variant }), className)}\n defaultOpen={defaultActive}\n open={active}\n onOpenChange={onCollapse}\n {...rest}\n >\n <div\n className={cx(\n groupStyles.header,\n isBorderless ? groupStyles.headerBorderless : groupStyles.headerBoxed,\n )}\n >\n <Collapsible.Trigger className={groupStyles.trigger}>\n <GroupTitle desc={desc} icon={icon} title={title} variant={variant} />\n <Icon className={groupStyles.chevron} icon={ChevronDown} />\n </Collapsible.Trigger>\n {extra}\n </div>\n <Collapsible.Panel className={groupStyles.panel}>\n <div className={cx(groupStyles.body, !isBorderless && groupStyles.bodyBoxed)}>\n {children}\n </div>\n </Collapsible.Panel>\n </Collapsible.Root>\n );\n },\n);\n\nFormGroup.displayName = 'FormGroup';\n\nexport default FormGroup;\n"],"mappings":";;;;;;;;;AAYA,MAAM,aAAa,MAMf,EAAE,MAAM,OAAO,MAAM,SAAS,aAChC,qBAAC,OAAD;CACE,WAAW,GACT,YAAY,OACZ,YAAY,gBAAgB,CAAC,UAAU,YAAY,iBACnD,UAAU,YAAY,YACvB;WALH,CAOG,QAAQ,oBAAC,MAAD,EAAY,MAAQ,CAAA,EAC7B,qBAAC,OAAD,EAAA,UAAA,CACG,OACA,QAAQ,oBAAC,OAAD;EAAK,WAAW,YAAY;YAAO;EAAW,CAAA,CACnD,EAAA,CAAA,CACF;GACN;AAEF,WAAW,cAAc;AAEzB,MAAM,YAAY,MACf,EACC,WACA,MACA,OACA,UACA,OACA,UAAU,cACV,gBAAgB,MAChB,aACA,QACA,YACA,MACA,UAAU,WACV,GAAG,WACC;CACJ,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,eAAe,YAAY;CACjC,MAAM,gBAAgB,gBAAgB,KAAA,IAAY,CAAC,eAAe;AAElE,KAAI,OACF,QACE,qBAAC,OAAD;EAAgB;EAAW,GAAI;YAA/B,CACE,qBAAC,OAAD;GAAK,WAAW,GAAG,YAAY,QAA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base-ui/Form/components/FormSubmitFooter.d.ts
|
|
5
|
+
declare const FormSubmitFooter: _$react.NamedExoticComponent<FormSubmitFooterProps>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { FormSubmitFooter };
|
|
8
|
+
//# sourceMappingURL=FormSubmitFooter.d.mts.map
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMotionComponent } from "../../../MotionProvider/index.mjs";
|
|
3
|
+
import FlexBasic_default from "../../../Flex/FlexBasic.mjs";
|
|
4
|
+
import Icon from "../../../Icon/Icon.mjs";
|
|
5
|
+
import { useTranslation } from "../../../i18n/useTranslation.mjs";
|
|
6
|
+
import form_default from "../../../i18n/resources/en/form.mjs";
|
|
7
|
+
import Button from "../../Button/Button.mjs";
|
|
8
|
+
import { submitFooterStyles } from "../style.mjs";
|
|
9
|
+
import { useFormContext } from "../context.mjs";
|
|
10
|
+
import { memo, useEffect } from "react";
|
|
11
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { cssVar, cx } from "antd-style";
|
|
13
|
+
import { InfoIcon } from "lucide-react";
|
|
14
|
+
//#region src/base-ui/Form/components/FormSubmitFooter.tsx
|
|
15
|
+
const FormSubmitFooter = memo(({ enableReset = true, buttonProps, float, onReset, saveButtonProps, resetButtonProps, enableUnsavedWarning, children, texts, className, ...rest }) => {
|
|
16
|
+
const Motion = useMotionComponent();
|
|
17
|
+
const { hasUnsavedChanges, requestReset, submitLoading } = useFormContext();
|
|
18
|
+
const { t } = useTranslation(form_default);
|
|
19
|
+
const unsavedWarningText = texts?.unSavedWarning ?? t("form.unsavedWarning");
|
|
20
|
+
const unsavedText = texts?.unSaved ?? t("form.unsavedChanges");
|
|
21
|
+
const resetText = texts?.reset ?? t("form.reset");
|
|
22
|
+
const submitText = texts?.submit ?? t("form.submit");
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (!enableUnsavedWarning || typeof window === "undefined" || !hasUnsavedChanges) return;
|
|
25
|
+
const fn = (e) => {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
e.returnValue = unsavedWarningText;
|
|
28
|
+
};
|
|
29
|
+
window.addEventListener("beforeunload", fn);
|
|
30
|
+
return () => window.removeEventListener("beforeunload", fn);
|
|
31
|
+
}, [
|
|
32
|
+
enableUnsavedWarning,
|
|
33
|
+
hasUnsavedChanges,
|
|
34
|
+
unsavedWarningText
|
|
35
|
+
]);
|
|
36
|
+
const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
37
|
+
(float || hasUnsavedChanges) && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
38
|
+
color: cssVar.colorTextDescription,
|
|
39
|
+
icon: InfoIcon,
|
|
40
|
+
size: 12,
|
|
41
|
+
style: { marginLeft: 8 }
|
|
42
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
43
|
+
style: {
|
|
44
|
+
color: cssVar.colorTextDescription,
|
|
45
|
+
flex: "none",
|
|
46
|
+
fontSize: 12,
|
|
47
|
+
marginRight: float ? 16 : 4
|
|
48
|
+
},
|
|
49
|
+
children: unsavedText
|
|
50
|
+
})] }),
|
|
51
|
+
children,
|
|
52
|
+
enableReset && (float || hasUnsavedChanges) && /* @__PURE__ */ jsx(Button, {
|
|
53
|
+
htmlType: "button",
|
|
54
|
+
shape: float ? "round" : void 0,
|
|
55
|
+
type: "fill",
|
|
56
|
+
onClick: () => {
|
|
57
|
+
requestReset();
|
|
58
|
+
onReset?.();
|
|
59
|
+
},
|
|
60
|
+
...buttonProps,
|
|
61
|
+
...resetButtonProps,
|
|
62
|
+
children: resetText
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ jsx(Button, {
|
|
65
|
+
htmlType: "submit",
|
|
66
|
+
loading: submitLoading,
|
|
67
|
+
shape: float ? "round" : void 0,
|
|
68
|
+
type: "primary",
|
|
69
|
+
...buttonProps,
|
|
70
|
+
...saveButtonProps,
|
|
71
|
+
children: submitText
|
|
72
|
+
})
|
|
73
|
+
] });
|
|
74
|
+
if (!float) return /* @__PURE__ */ jsx(FlexBasic_default, {
|
|
75
|
+
horizontal: true,
|
|
76
|
+
align: "center",
|
|
77
|
+
className: cx(submitFooterStyles.footer, className),
|
|
78
|
+
gap: 8,
|
|
79
|
+
justify: "flex-end",
|
|
80
|
+
...rest,
|
|
81
|
+
children: content
|
|
82
|
+
});
|
|
83
|
+
return /* @__PURE__ */ jsx(Motion.div, {
|
|
84
|
+
animate: hasUnsavedChanges ? "visible" : "hidden",
|
|
85
|
+
className: submitFooterStyles.floatFooter,
|
|
86
|
+
initial: "hidden",
|
|
87
|
+
transition: {
|
|
88
|
+
duration: .1,
|
|
89
|
+
ease: "easeOut"
|
|
90
|
+
},
|
|
91
|
+
variants: {
|
|
92
|
+
hidden: {
|
|
93
|
+
opacity: 0,
|
|
94
|
+
x: "-50%",
|
|
95
|
+
y: 20
|
|
96
|
+
},
|
|
97
|
+
visible: {
|
|
98
|
+
opacity: 1,
|
|
99
|
+
x: "-50%",
|
|
100
|
+
y: 0
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
children: /* @__PURE__ */ jsx(FlexBasic_default, {
|
|
104
|
+
horizontal: true,
|
|
105
|
+
align: "center",
|
|
106
|
+
className,
|
|
107
|
+
gap: 8,
|
|
108
|
+
justify: "center",
|
|
109
|
+
...rest,
|
|
110
|
+
children: content
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
FormSubmitFooter.displayName = "FormSubmitFooter";
|
|
115
|
+
//#endregion
|
|
116
|
+
export { FormSubmitFooter as default };
|
|
117
|
+
|
|
118
|
+
//# sourceMappingURL=FormSubmitFooter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormSubmitFooter.mjs","names":["formMessages","Flexbox","styles"],"sources":["../../../../src/base-ui/Form/components/FormSubmitFooter.tsx"],"sourcesContent":["'use client';\n\nimport { cssVar, cx } from 'antd-style';\nimport { InfoIcon } from 'lucide-react';\nimport { memo, useEffect } from 'react';\n\nimport Button from '@/base-ui/Button';\nimport { Flexbox } from '@/Flex';\nimport formMessages from '@/i18n/resources/en/form';\nimport { useTranslation } from '@/i18n/useTranslation';\nimport Icon from '@/Icon';\nimport { useMotionComponent } from '@/MotionProvider';\n\nimport { useFormContext } from '../context';\nimport { submitFooterStyles as styles } from '../style';\nimport type { FormSubmitFooterProps } from '../type';\n\nconst FormSubmitFooter = memo<FormSubmitFooterProps>(\n ({\n enableReset = true,\n buttonProps,\n float,\n onReset,\n saveButtonProps,\n resetButtonProps,\n enableUnsavedWarning,\n children,\n texts,\n className,\n ...rest\n }) => {\n const Motion = useMotionComponent();\n const { hasUnsavedChanges, requestReset, submitLoading } = useFormContext();\n const { t } = useTranslation(formMessages);\n\n const unsavedWarningText = texts?.unSavedWarning ?? t('form.unsavedWarning');\n const unsavedText = texts?.unSaved ?? t('form.unsavedChanges');\n const resetText = texts?.reset ?? t('form.reset');\n const submitText = texts?.submit ?? t('form.submit');\n\n useEffect(() => {\n if (!enableUnsavedWarning || typeof window === 'undefined' || !hasUnsavedChanges) return;\n const fn = (e: BeforeUnloadEvent) => {\n e.preventDefault();\n e.returnValue = unsavedWarningText;\n };\n window.addEventListener('beforeunload', fn);\n return () => window.removeEventListener('beforeunload', fn);\n }, [enableUnsavedWarning, hasUnsavedChanges, unsavedWarningText]);\n\n const content = (\n <>\n {(float || hasUnsavedChanges) && (\n <>\n <Icon\n color={cssVar.colorTextDescription}\n icon={InfoIcon}\n size={12}\n style={{ marginLeft: 8 }}\n />\n <span\n style={{\n color: cssVar.colorTextDescription,\n flex: 'none',\n fontSize: 12,\n marginRight: float ? 16 : 4,\n }}\n >\n {unsavedText}\n </span>\n </>\n )}\n {children}\n {enableReset && (float || hasUnsavedChanges) && (\n <Button\n htmlType={'button'}\n shape={float ? 'round' : undefined}\n type={'fill'}\n onClick={() => {\n requestReset();\n onReset?.();\n }}\n {...buttonProps}\n {...resetButtonProps}\n >\n {resetText}\n </Button>\n )}\n <Button\n htmlType={'submit'}\n loading={submitLoading}\n shape={float ? 'round' : undefined}\n type={'primary'}\n {...buttonProps}\n {...saveButtonProps}\n >\n {submitText}\n </Button>\n </>\n );\n\n if (!float)\n return (\n <Flexbox\n horizontal\n align={'center'}\n className={cx(styles.footer, className)}\n gap={8}\n justify={'flex-end'}\n {...rest}\n >\n {content}\n </Flexbox>\n );\n\n return (\n <Motion.div\n animate={hasUnsavedChanges ? 'visible' : 'hidden'}\n className={styles.floatFooter}\n initial={'hidden'}\n transition={{ duration: 0.1, ease: 'easeOut' }}\n variants={{\n hidden: {\n opacity: 0,\n x: '-50%',\n y: 20,\n },\n visible: {\n opacity: 1,\n x: '-50%',\n y: 0,\n },\n }}\n >\n <Flexbox\n horizontal\n align={'center'}\n className={className}\n gap={8}\n justify={'center'}\n {...rest}\n >\n {content}\n </Flexbox>\n </Motion.div>\n );\n },\n);\n\nFormSubmitFooter.displayName = 'FormSubmitFooter';\n\nexport default FormSubmitFooter;\n"],"mappings":";;;;;;;;;;;;;;AAiBA,MAAM,mBAAmB,MACtB,EACC,cAAc,MACd,aACA,OACA,SACA,iBACA,kBACA,sBACA,UACA,OACA,WACA,GAAG,WACC;CACJ,MAAM,SAAS,oBAAoB;CACnC,MAAM,EAAE,mBAAmB,cAAc,kBAAkB,gBAAgB;CAC3E,MAAM,EAAE,MAAM,eAAeA,aAAa;CAE1C,MAAM,qBAAqB,OAAO,kBAAkB,EAAE,sBAAsB;CAC5E,MAAM,cAAc,OAAO,WAAW,EAAE,sBAAsB;CAC9D,MAAM,YAAY,OAAO,SAAS,EAAE,aAAa;CACjD,MAAM,aAAa,OAAO,UAAU,EAAE,cAAc;AAEpD,iBAAgB;AACd,MAAI,CAAC,wBAAwB,OAAO,WAAW,eAAe,CAAC,kBAAmB;EAClF,MAAM,MAAM,MAAyB;AACnC,KAAE,gBAAgB;AAClB,KAAE,cAAc;;AAElB,SAAO,iBAAiB,g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