@tidbcloud/uikit 2.0.0-beta.50 → 2.0.0-beta.52
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/CHANGELOG.md +12 -0
- package/dist/biz/Dot/index.cjs +1 -1
- package/dist/biz/Dot/index.js +1 -1
- package/dist/biz/DotBadge/index.cjs +2 -2
- package/dist/biz/DotBadge/index.js +2 -2
- package/dist/biz/Form/Form.cjs +32 -14
- package/dist/biz/Form/Form.d.cts +3 -1
- package/dist/biz/Form/Form.d.ts +3 -1
- package/dist/biz/Form/Form.js +32 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/biz/Dot/index.cjs
CHANGED
|
@@ -9,7 +9,7 @@ const Dot = ({ color, size = 8, ...rest }) => {
|
|
|
9
9
|
sx: (theme) => {
|
|
10
10
|
var _a;
|
|
11
11
|
return {
|
|
12
|
-
backgroundColor: ((_a = theme.colors[color]) == null ? void 0 : _a[
|
|
12
|
+
backgroundColor: ((_a = theme.colors[color]) == null ? void 0 : _a[7]) ?? theme.colors.carbon[6],
|
|
13
13
|
height: size,
|
|
14
14
|
width: size,
|
|
15
15
|
borderRadius: "50%"
|
package/dist/biz/Dot/index.js
CHANGED
|
@@ -7,7 +7,7 @@ const Dot = ({ color, size = 8, ...rest }) => {
|
|
|
7
7
|
sx: (theme) => {
|
|
8
8
|
var _a;
|
|
9
9
|
return {
|
|
10
|
-
backgroundColor: ((_a = theme.colors[color]) == null ? void 0 : _a[
|
|
10
|
+
backgroundColor: ((_a = theme.colors[color]) == null ? void 0 : _a[7]) ?? theme.colors.carbon[6],
|
|
11
11
|
height: size,
|
|
12
12
|
width: size,
|
|
13
13
|
borderRadius: "50%"
|
|
@@ -11,7 +11,7 @@ const DotBadge = ({ color = "green", children, ...rest }) => {
|
|
|
11
11
|
variant: "light",
|
|
12
12
|
styles: (theme) => ({
|
|
13
13
|
root: {
|
|
14
|
-
backgroundColor: theme.colors[color][
|
|
14
|
+
backgroundColor: theme.colors[color][1],
|
|
15
15
|
borderRadius: theme.defaultRadius,
|
|
16
16
|
textTransform: "none",
|
|
17
17
|
height: 28
|
|
@@ -19,7 +19,7 @@ const DotBadge = ({ color = "green", children, ...rest }) => {
|
|
|
19
19
|
}),
|
|
20
20
|
leftSection: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(index.Dot, { color, size: 8 }),
|
|
21
21
|
...rest,
|
|
22
|
-
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(index$1.Typography, {
|
|
22
|
+
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(index$1.Typography, { size: 14, fw: 500, c: `${color}.8`, children })
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
25
|
};
|
|
@@ -9,7 +9,7 @@ const DotBadge = ({ color = "green", children, ...rest }) => {
|
|
|
9
9
|
variant: "light",
|
|
10
10
|
styles: (theme) => ({
|
|
11
11
|
root: {
|
|
12
|
-
backgroundColor: theme.colors[color][
|
|
12
|
+
backgroundColor: theme.colors[color][1],
|
|
13
13
|
borderRadius: theme.defaultRadius,
|
|
14
14
|
textTransform: "none",
|
|
15
15
|
height: 28
|
|
@@ -17,7 +17,7 @@ const DotBadge = ({ color = "green", children, ...rest }) => {
|
|
|
17
17
|
}),
|
|
18
18
|
leftSection: /* @__PURE__ */ jsxRuntimeExports.jsx(Dot, { color, size: 8 }),
|
|
19
19
|
...rest,
|
|
20
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, {
|
|
20
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { size: 14, fw: 500, c: `${color}.8`, children })
|
|
21
21
|
}
|
|
22
22
|
);
|
|
23
23
|
};
|
package/dist/biz/Form/Form.cjs
CHANGED
|
@@ -24,6 +24,8 @@ const _Form = ({
|
|
|
24
24
|
layout = "vertical",
|
|
25
25
|
layoutProps,
|
|
26
26
|
onError,
|
|
27
|
+
stopPropagation,
|
|
28
|
+
preventDefault,
|
|
27
29
|
...rest
|
|
28
30
|
}) => {
|
|
29
31
|
const [submitError, setSubmitError] = ahooks.useSafeState("");
|
|
@@ -51,21 +53,37 @@ const _Form = ({
|
|
|
51
53
|
const handleDismissErrorMessage = () => {
|
|
52
54
|
setSubmitError("");
|
|
53
55
|
};
|
|
54
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(reactHookForm.FormProvider, { ...methods, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
onDismiss: handleDismissErrorMessage,
|
|
63
|
-
...errorMessageProps
|
|
56
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(reactHookForm.FormProvider, { ...methods, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
|
|
57
|
+
Box.Box,
|
|
58
|
+
{
|
|
59
|
+
component: "form",
|
|
60
|
+
...rest,
|
|
61
|
+
onSubmit: (e) => {
|
|
62
|
+
if (stopPropagation) {
|
|
63
|
+
e == null ? void 0 : e.stopPropagation();
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
if (preventDefault) {
|
|
66
|
+
e == null ? void 0 : e.preventDefault();
|
|
67
|
+
}
|
|
68
|
+
return handleSubmit(submit)(e);
|
|
69
|
+
},
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(FormLayout.FormLayout, { layout, ...layoutProps, children }),
|
|
72
|
+
withActions && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [
|
|
73
|
+
submitError && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
74
|
+
FormErrorMessage.FormErrorMessage,
|
|
75
|
+
{
|
|
76
|
+
mt: 24,
|
|
77
|
+
message: submitError,
|
|
78
|
+
onDismiss: handleDismissErrorMessage,
|
|
79
|
+
...errorMessageProps
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(FormActions.FormActions, { onCancel, loading: submitting, ...actionsProps })
|
|
83
|
+
] })
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
) });
|
|
69
87
|
};
|
|
70
88
|
const Form = _Form;
|
|
71
89
|
Form.Actions = FormActions.FormActions;
|
package/dist/biz/Form/Form.d.cts
CHANGED
|
@@ -15,12 +15,14 @@ export interface FormProps<T extends FieldValues = object> extends BoxProps {
|
|
|
15
15
|
errorMessageProps?: Omit<FormErrorMessageProps, 'message'>;
|
|
16
16
|
layout?: FormLayoutType;
|
|
17
17
|
layoutProps?: Omit<FormLayoutProps, 'layout'>;
|
|
18
|
+
stopPropagation?: boolean;
|
|
19
|
+
preventDefault?: boolean;
|
|
18
20
|
onSubmit: SubmitHandler<T>;
|
|
19
21
|
onError?: () => any;
|
|
20
22
|
onCancel?: () => void;
|
|
21
23
|
onFormUnMount?: () => void;
|
|
22
24
|
}
|
|
23
|
-
declare const _Form: <T extends object = {}>({ children, form, formMode, reValidateMode, defaultValues, onSubmit, onFormUnMount, onCancel, withActions, actionsProps, errorMessageProps, layout, layoutProps, onError, ...rest }: FormProps<T>) => import("react/jsx-runtime.js").JSX.Element;
|
|
25
|
+
declare const _Form: <T extends object = {}>({ children, form, formMode, reValidateMode, defaultValues, onSubmit, onFormUnMount, onCancel, withActions, actionsProps, errorMessageProps, layout, layoutProps, onError, stopPropagation, preventDefault, ...rest }: FormProps<T>) => import("react/jsx-runtime.js").JSX.Element;
|
|
24
26
|
type FormType = typeof _Form;
|
|
25
27
|
export declare const Form: FormType & {
|
|
26
28
|
Actions: typeof FormActions;
|
package/dist/biz/Form/Form.d.ts
CHANGED
|
@@ -15,12 +15,14 @@ export interface FormProps<T extends FieldValues = object> extends BoxProps {
|
|
|
15
15
|
errorMessageProps?: Omit<FormErrorMessageProps, 'message'>;
|
|
16
16
|
layout?: FormLayoutType;
|
|
17
17
|
layoutProps?: Omit<FormLayoutProps, 'layout'>;
|
|
18
|
+
stopPropagation?: boolean;
|
|
19
|
+
preventDefault?: boolean;
|
|
18
20
|
onSubmit: SubmitHandler<T>;
|
|
19
21
|
onError?: () => any;
|
|
20
22
|
onCancel?: () => void;
|
|
21
23
|
onFormUnMount?: () => void;
|
|
22
24
|
}
|
|
23
|
-
declare const _Form: <T extends object = {}>({ children, form, formMode, reValidateMode, defaultValues, onSubmit, onFormUnMount, onCancel, withActions, actionsProps, errorMessageProps, layout, layoutProps, onError, ...rest }: FormProps<T>) => import("react/jsx-runtime.js").JSX.Element;
|
|
25
|
+
declare const _Form: <T extends object = {}>({ children, form, formMode, reValidateMode, defaultValues, onSubmit, onFormUnMount, onCancel, withActions, actionsProps, errorMessageProps, layout, layoutProps, onError, stopPropagation, preventDefault, ...rest }: FormProps<T>) => import("react/jsx-runtime.js").JSX.Element;
|
|
24
26
|
type FormType = typeof _Form;
|
|
25
27
|
export declare const Form: FormType & {
|
|
26
28
|
Actions: typeof FormActions;
|
package/dist/biz/Form/Form.js
CHANGED
|
@@ -22,6 +22,8 @@ const _Form = ({
|
|
|
22
22
|
layout = "vertical",
|
|
23
23
|
layoutProps,
|
|
24
24
|
onError,
|
|
25
|
+
stopPropagation,
|
|
26
|
+
preventDefault,
|
|
25
27
|
...rest
|
|
26
28
|
}) => {
|
|
27
29
|
const [submitError, setSubmitError] = useSafeState("");
|
|
@@ -49,21 +51,37 @@ const _Form = ({
|
|
|
49
51
|
const handleDismissErrorMessage = () => {
|
|
50
52
|
setSubmitError("");
|
|
51
53
|
};
|
|
52
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormProvider, { ...methods, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
onDismiss: handleDismissErrorMessage,
|
|
61
|
-
...errorMessageProps
|
|
54
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormProvider, { ...methods, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
55
|
+
Box,
|
|
56
|
+
{
|
|
57
|
+
component: "form",
|
|
58
|
+
...rest,
|
|
59
|
+
onSubmit: (e) => {
|
|
60
|
+
if (stopPropagation) {
|
|
61
|
+
e == null ? void 0 : e.stopPropagation();
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
if (preventDefault) {
|
|
64
|
+
e == null ? void 0 : e.preventDefault();
|
|
65
|
+
}
|
|
66
|
+
return handleSubmit(submit)(e);
|
|
67
|
+
},
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FormLayout, { layout, ...layoutProps, children }),
|
|
70
|
+
withActions && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
71
|
+
submitError && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
72
|
+
FormErrorMessage,
|
|
73
|
+
{
|
|
74
|
+
mt: 24,
|
|
75
|
+
message: submitError,
|
|
76
|
+
onDismiss: handleDismissErrorMessage,
|
|
77
|
+
...errorMessageProps
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FormActions, { onCancel, loading: submitting, ...actionsProps })
|
|
81
|
+
] })
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
) });
|
|
67
85
|
};
|
|
68
86
|
const Form = _Form;
|
|
69
87
|
Form.Actions = FormActions;
|