@tachybase/components 0.23.18 → 0.23.22
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/lib/__builtins__/portal.js +12 -18
- package/lib/__builtins__/sort.js +6 -15
- package/lib/array-base/index.js +31 -26
- package/lib/array-cards/index.js +48 -38
- package/lib/array-collapse/index.js +69 -60
- package/lib/array-items/index.js +29 -26
- package/lib/array-table/index.js +74 -65
- package/lib/array-tabs/index.js +7 -16
- package/lib/cascader/index.js +2 -12
- package/lib/code-mirror/index.js +4 -3
- package/lib/editable/index.js +20 -8
- package/lib/form/index.js +4 -3
- package/lib/form-button-group/index.d.ts +2 -2
- package/lib/form-button-group/index.js +24 -23
- package/lib/form-collapse/index.js +8 -7
- package/lib/form-dialog/index.js +8 -7
- package/lib/form-drawer/index.js +5 -4
- package/lib/form-grid/index.js +8 -7
- package/lib/form-item/hooks/useFormItemLayout.d.ts +1 -1
- package/lib/form-item/hooks/useFormItemLayout.js +2 -12
- package/lib/form-item/index.js +82 -61
- package/lib/form-layout/index.d.ts +1 -1
- package/lib/form-layout/index.js +4 -3
- package/lib/form-step/index.js +12 -8
- package/lib/form-tab/index.js +10 -9
- package/lib/input/index.js +2 -12
- package/lib/lightbox/react-image-lightbox.d.ts +2 -2
- package/lib/lightbox/react-image-lightbox.js +135 -125
- package/lib/password/PasswordStrength.js +3 -12
- package/lib/password/index.js +32 -37
- package/lib/preview-text/index.js +32 -19
- package/lib/reset/index.js +5 -15
- package/lib/select/index.js +2 -12
- package/lib/select-table/hooks/useTitleAddon.d.ts +1 -2
- package/lib/select-table/hooks/useTitleAddon.js +4 -14
- package/lib/select-table/index.js +71 -66
- package/lib/submit/index.js +5 -15
- package/lib/tree-select/index.js +2 -12
- package/lib/upload/index.js +10 -3
- package/package.json +2 -2
|
@@ -32,7 +32,8 @@ __export(form_button_group_exports, {
|
|
|
32
32
|
default: () => form_button_group_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(form_button_group_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = require("react");
|
|
36
37
|
var import_antd = require("antd");
|
|
37
38
|
var import_classnames = __toESM(require("classnames"));
|
|
38
39
|
var import_react_sticky_box = __toESM(require("react-sticky-box"));
|
|
@@ -61,7 +62,7 @@ const FormButtonGroup = /* @__PURE__ */ __name(({
|
|
|
61
62
|
...props
|
|
62
63
|
}) => {
|
|
63
64
|
const prefixCls = (0, import_builtins.usePrefixCls)("formily-button-group");
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
65
66
|
import_antd.Space,
|
|
66
67
|
{
|
|
67
68
|
...props,
|
|
@@ -71,9 +72,9 @@ const FormButtonGroup = /* @__PURE__ */ __name(({
|
|
|
71
72
|
...props.style,
|
|
72
73
|
justifyContent: align === "left" ? "flex-start" : align === "right" ? "flex-end" : "center",
|
|
73
74
|
display: "flex"
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
},
|
|
76
|
+
children: props.children
|
|
77
|
+
}
|
|
77
78
|
);
|
|
78
79
|
}, "FormButtonGroup");
|
|
79
80
|
FormButtonGroup.defaultProps = {
|
|
@@ -81,7 +82,7 @@ FormButtonGroup.defaultProps = {
|
|
|
81
82
|
};
|
|
82
83
|
FormButtonGroup.FormItem = ({ gutter, ...props }) => {
|
|
83
84
|
var _a;
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
86
|
import_form_item.BaseItem,
|
|
86
87
|
{
|
|
87
88
|
...props,
|
|
@@ -92,9 +93,9 @@ FormButtonGroup.FormItem = ({ gutter, ...props }) => {
|
|
|
92
93
|
...props.style,
|
|
93
94
|
width: "100%"
|
|
94
95
|
},
|
|
95
|
-
colon: false
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
colon: false,
|
|
97
|
+
children: ((_a = props.children) == null ? void 0 : _a["length"]) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Space, { size: gutter, children: props.children }) : props.children
|
|
98
|
+
}
|
|
98
99
|
);
|
|
99
100
|
};
|
|
100
101
|
const _Sticky = /* @__PURE__ */ __name(({
|
|
@@ -114,7 +115,7 @@ const _Sticky = /* @__PURE__ */ __name(({
|
|
|
114
115
|
}
|
|
115
116
|
});
|
|
116
117
|
return wrapSSR(
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
118
119
|
import_react_sticky_box.default,
|
|
119
120
|
{
|
|
120
121
|
...props,
|
|
@@ -123,20 +124,20 @@ const _Sticky = /* @__PURE__ */ __name(({
|
|
|
123
124
|
backgroundColor: color,
|
|
124
125
|
...props.style
|
|
125
126
|
},
|
|
126
|
-
bottom: true
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
bottom: true,
|
|
128
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
ref,
|
|
132
|
+
className: `${prefixCls}-sticky-inner`,
|
|
133
|
+
style: {
|
|
134
|
+
...props.style,
|
|
135
|
+
justifyContent: align === "left" ? "flex-start" : align === "right" ? "flex-end" : "center"
|
|
136
|
+
},
|
|
137
|
+
children: props.children
|
|
136
138
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
)
|
|
139
|
+
)
|
|
140
|
+
}
|
|
140
141
|
)
|
|
141
142
|
);
|
|
142
143
|
}, "_Sticky");
|
|
@@ -32,7 +32,8 @@ __export(form_collapse_exports, {
|
|
|
32
32
|
default: () => form_collapse_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(form_collapse_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = require("react");
|
|
36
37
|
var import_schema = require("@tachybase/schema");
|
|
37
38
|
var import_antd = require("antd");
|
|
38
39
|
var import_classnames = __toESM(require("classnames"));
|
|
@@ -117,11 +118,11 @@ const InternalFormCollapse = (0, import_schema.observer)(({ formCollapse, ...pro
|
|
|
117
118
|
address: `${field.address.concat(key)}.*`
|
|
118
119
|
});
|
|
119
120
|
if (errors.length) {
|
|
120
|
-
return /* @__PURE__ */
|
|
121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Badge, { size: "small", className: "errors-badge", count: errors.length, children: props2.header });
|
|
121
122
|
}
|
|
122
123
|
return props2.header;
|
|
123
124
|
}, "badgedHeader");
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
126
|
import_antd.Collapse,
|
|
126
127
|
{
|
|
127
128
|
...props,
|
|
@@ -131,13 +132,13 @@ const InternalFormCollapse = (0, import_schema.observer)(({ formCollapse, ...pro
|
|
|
131
132
|
var _a, _b;
|
|
132
133
|
(_a = props == null ? void 0 : props.onChange) == null ? void 0 : _a.call(props, key);
|
|
133
134
|
(_b = _formCollapse == null ? void 0 : _formCollapse.setActiveKeys) == null ? void 0 : _b.call(_formCollapse, key);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
},
|
|
136
|
+
children: panels.map(({ props: props2, schema, name }, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Collapse.Panel, { ...props2, header: badgedHeader(name, props2), forceRender: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_schema.RecursionField, { schema, name }) }, index))
|
|
137
|
+
}
|
|
137
138
|
);
|
|
138
139
|
});
|
|
139
140
|
const CollapsePanel = /* @__PURE__ */ __name(({ children }) => {
|
|
140
|
-
return /* @__PURE__ */
|
|
141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children });
|
|
141
142
|
}, "CollapsePanel");
|
|
142
143
|
const FormCollapse = Object.assign(InternalFormCollapse, {
|
|
143
144
|
CollapsePanel,
|
package/lib/form-dialog/index.js
CHANGED
|
@@ -32,6 +32,7 @@ __export(form_dialog_exports, {
|
|
|
32
32
|
default: () => form_dialog_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(form_dialog_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_react = __toESM(require("react"));
|
|
36
37
|
var import_schema = require("@tachybase/schema");
|
|
37
38
|
var import_antd = require("antd");
|
|
@@ -73,12 +74,12 @@ function FormDialog(title, id, renderer) {
|
|
|
73
74
|
}, "afterClose")
|
|
74
75
|
};
|
|
75
76
|
const DialogContent = (0, import_schema.observer)(() => {
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: (0, import_schema.isFn)(renderer) ? renderer(env.form) : renderer });
|
|
77
78
|
});
|
|
78
79
|
const renderDialog = /* @__PURE__ */ __name((open = true, resolve, reject) => {
|
|
79
80
|
const { form } = env;
|
|
80
81
|
if (!form) return null;
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_schema.Observer, { children: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
82
83
|
import_antd.Modal,
|
|
83
84
|
{
|
|
84
85
|
...modal,
|
|
@@ -95,10 +96,10 @@ function FormDialog(title, id, renderer) {
|
|
|
95
96
|
if (((_a = modal == null ? void 0 : modal.onOk) == null ? void 0 : _a.call(modal, e)) !== false) {
|
|
96
97
|
resolve == null ? void 0 : resolve();
|
|
97
98
|
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
));
|
|
99
|
+
},
|
|
100
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_schema.FormProvider, { form, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContent, {}) })
|
|
101
|
+
}
|
|
102
|
+
) });
|
|
102
103
|
}, "renderDialog");
|
|
103
104
|
document.body.appendChild(env.host);
|
|
104
105
|
const formDialog = {
|
|
@@ -183,7 +184,7 @@ const DialogFooter = /* @__PURE__ */ __name((props) => {
|
|
|
183
184
|
}
|
|
184
185
|
});
|
|
185
186
|
footerRef.current = footer;
|
|
186
|
-
return /* @__PURE__ */
|
|
187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, style: { display: "none" }, children: footer && (0, import_react_dom.createPortal)(props.children, footer) });
|
|
187
188
|
}, "DialogFooter");
|
|
188
189
|
FormDialog.Footer = DialogFooter;
|
|
189
190
|
FormDialog.Portal = (0, import_builtins.createPortalProvider)("form-dialog");
|
package/lib/form-drawer/index.js
CHANGED
|
@@ -32,6 +32,7 @@ __export(form_drawer_exports, {
|
|
|
32
32
|
default: () => form_drawer_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(form_drawer_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_react = __toESM(require("react"));
|
|
36
37
|
var import_schema = require("@tachybase/schema");
|
|
37
38
|
var import_antd = require("antd");
|
|
@@ -79,12 +80,12 @@ function FormDrawer(title, id, renderer) {
|
|
|
79
80
|
}, "afterOpenChange")
|
|
80
81
|
};
|
|
81
82
|
const DrawerContent = (0, import_schema.observer)(() => {
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: (0, import_schema.isFn)(renderer) ? renderer(env.form) : renderer });
|
|
83
84
|
});
|
|
84
85
|
const renderDrawer = /* @__PURE__ */ __name((open = true) => {
|
|
85
86
|
const { form } = env;
|
|
86
87
|
if (!form) return null;
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Drawer, { ...drawer, open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_schema.FormProvider, { form, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerContent, {}) }) });
|
|
88
89
|
}, "renderDrawer");
|
|
89
90
|
document.body.appendChild(env.host);
|
|
90
91
|
const formDrawer = {
|
|
@@ -152,7 +153,7 @@ const DrawerExtra = /* @__PURE__ */ __name((props) => {
|
|
|
152
153
|
}
|
|
153
154
|
});
|
|
154
155
|
extraRef.current = extra;
|
|
155
|
-
return /* @__PURE__ */
|
|
156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, style: { display: "none" }, children: extra && (0, import_react_dom.createPortal)(props.children, extra) });
|
|
156
157
|
}, "DrawerExtra");
|
|
157
158
|
const DrawerFooter = /* @__PURE__ */ __name((props) => {
|
|
158
159
|
const ref = (0, import_react.useRef)(null);
|
|
@@ -175,7 +176,7 @@ const DrawerFooter = /* @__PURE__ */ __name((props) => {
|
|
|
175
176
|
}
|
|
176
177
|
});
|
|
177
178
|
footerRef.current = footer;
|
|
178
|
-
return /* @__PURE__ */
|
|
179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, style: { display: "none" }, children: footer && (0, import_react_dom.createPortal)(props.children, footer) });
|
|
179
180
|
}, "DrawerFooter");
|
|
180
181
|
FormDrawer.Extra = DrawerExtra;
|
|
181
182
|
FormDrawer.Footer = DrawerFooter;
|
package/lib/form-grid/index.js
CHANGED
|
@@ -35,6 +35,7 @@ __export(form_grid_exports, {
|
|
|
35
35
|
useFormGrid: () => useFormGrid
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(form_grid_exports);
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
39
|
var import_react = __toESM(require("react"));
|
|
39
40
|
var import_schema = require("@tachybase/schema");
|
|
40
41
|
var import_classnames = __toESM(require("classnames"));
|
|
@@ -64,8 +65,8 @@ const InternalFormGrid = (0, import_schema.observer)(
|
|
|
64
65
|
return grid.connect(ref.current);
|
|
65
66
|
}
|
|
66
67
|
}, [grid]);
|
|
67
|
-
return /* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormGridContext.Provider, { value: grid, children: wrapSSR(
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
70
|
"div",
|
|
70
71
|
{
|
|
71
72
|
...dataProps,
|
|
@@ -75,11 +76,11 @@ const InternalFormGrid = (0, import_schema.observer)(
|
|
|
75
76
|
gridTemplateColumns: grid.templateColumns,
|
|
76
77
|
gap: grid.gap
|
|
77
78
|
},
|
|
78
|
-
ref
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
ref,
|
|
80
|
+
children
|
|
81
|
+
}
|
|
81
82
|
)
|
|
82
|
-
));
|
|
83
|
+
) });
|
|
83
84
|
},
|
|
84
85
|
{
|
|
85
86
|
forwardRef: true
|
|
@@ -87,7 +88,7 @@ const InternalFormGrid = (0, import_schema.observer)(
|
|
|
87
88
|
);
|
|
88
89
|
const GridColumn = (0, import_schema.observer)(
|
|
89
90
|
({ gridSpan, children, ...props }) => {
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...props, style: props.style, "data-grid-span": gridSpan, children });
|
|
91
92
|
}
|
|
92
93
|
);
|
|
93
94
|
GridColumn.defaultProps = {
|
|
@@ -19,7 +19,7 @@ export declare const useFormItemLayout: (props: IFormItemProps) => {
|
|
|
19
19
|
feedbackIcon: React.ReactNode;
|
|
20
20
|
feedbackLayout: (string & {}) | "none" | "loose" | "terse" | "popover";
|
|
21
21
|
tooltipLayout: "text" | "icon";
|
|
22
|
-
tooltipIcon: string | number | boolean | Iterable<React.ReactNode> |
|
|
22
|
+
tooltipIcon: string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
className?: string;
|
|
24
24
|
style?: React.CSSProperties;
|
|
25
25
|
prefixCls?: string;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
6
|
var __export = (target, all) => {
|
|
@@ -17,21 +15,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var useFormItemLayout_exports = {};
|
|
30
20
|
__export(useFormItemLayout_exports, {
|
|
31
21
|
useFormItemLayout: () => useFormItemLayout
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(useFormItemLayout_exports);
|
|
34
|
-
var
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
25
|
var import_icons = require("@ant-design/icons");
|
|
36
26
|
var import_form_layout = require("../../form-layout");
|
|
37
27
|
const useFormItemLayout = /* @__PURE__ */ __name((props) => {
|
|
@@ -57,7 +47,7 @@ const useFormItemLayout = /* @__PURE__ */ __name((props) => {
|
|
|
57
47
|
feedbackIcon: props.feedbackIcon,
|
|
58
48
|
feedbackLayout: props.feedbackLayout ?? layout.feedbackLayout ?? "loose",
|
|
59
49
|
tooltipLayout: props.tooltipLayout ?? layout.tooltipLayout ?? "icon",
|
|
60
|
-
tooltipIcon: props.tooltipIcon ?? layout.tooltipIcon ?? /* @__PURE__ */
|
|
50
|
+
tooltipIcon: props.tooltipIcon ?? layout.tooltipIcon ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.QuestionCircleOutlined, {})
|
|
61
51
|
};
|
|
62
52
|
}, "useFormItemLayout");
|
|
63
53
|
// Annotate the CommonJS export names for ESM import in node:
|
package/lib/form-item/index.js
CHANGED
|
@@ -34,7 +34,8 @@ __export(form_item_exports, {
|
|
|
34
34
|
default: () => form_item_default
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(form_item_exports);
|
|
37
|
-
var
|
|
37
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
|
+
var import_react = require("react");
|
|
38
39
|
var import_schema = require("@tachybase/schema");
|
|
39
40
|
var import_icons = require("@ant-design/icons");
|
|
40
41
|
var import_antd = require("antd");
|
|
@@ -46,9 +47,9 @@ var import_style = __toESM(require("./style"));
|
|
|
46
47
|
__reExport(form_item_exports, require("./hooks"), module.exports);
|
|
47
48
|
__reExport(form_item_exports, require("./types"), module.exports);
|
|
48
49
|
const ICON_MAP = {
|
|
49
|
-
error: /* @__PURE__ */
|
|
50
|
-
success: /* @__PURE__ */
|
|
51
|
-
warning: /* @__PURE__ */
|
|
50
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseCircleOutlined, {}),
|
|
51
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckCircleOutlined, {}),
|
|
52
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ExclamationCircleOutlined, {})
|
|
52
53
|
};
|
|
53
54
|
const BaseItem = /* @__PURE__ */ __name(({ children, ...props }) => {
|
|
54
55
|
const [active, setActive] = (0, import_react.useState)(false);
|
|
@@ -104,51 +105,59 @@ const BaseItem = /* @__PURE__ */ __name(({ children, ...props }) => {
|
|
|
104
105
|
enableCol = true;
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
|
-
const formatChildren = feedbackLayout === "popover" ? /* @__PURE__ */
|
|
108
|
+
const formatChildren = feedbackLayout === "popover" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
108
109
|
import_antd.Popover,
|
|
109
110
|
{
|
|
110
111
|
autoAdjustOverflow: true,
|
|
111
112
|
overlayClassName: `${prefixCls}-popover`,
|
|
112
113
|
placement: "top",
|
|
113
|
-
content: /* @__PURE__ */
|
|
114
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
114
115
|
"div",
|
|
115
116
|
{
|
|
116
117
|
className: (0, import_classnames.default)({
|
|
117
118
|
[`${prefixCls}-${feedbackStatus}-help`]: !!feedbackStatus,
|
|
118
119
|
[`${prefixCls}-help`]: true
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
}),
|
|
121
|
+
children: [
|
|
122
|
+
feedbackStatus ? ICON_MAP[feedbackStatus] : null,
|
|
123
|
+
" ",
|
|
124
|
+
feedbackText
|
|
125
|
+
]
|
|
126
|
+
}
|
|
124
127
|
),
|
|
125
128
|
open: !!feedbackText,
|
|
126
|
-
getPopupContainer
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
getPopupContainer,
|
|
130
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children })
|
|
131
|
+
}
|
|
129
132
|
) : children;
|
|
130
133
|
const gridStyles = {};
|
|
131
134
|
const getOverflowTooltip = /* @__PURE__ */ __name(() => {
|
|
132
135
|
if (overflow) {
|
|
133
|
-
return /* @__PURE__ */
|
|
136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: label }),
|
|
138
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: tooltip })
|
|
139
|
+
] });
|
|
134
140
|
}
|
|
135
141
|
return tooltip;
|
|
136
142
|
}, "getOverflowTooltip");
|
|
137
143
|
const renderLabelText = /* @__PURE__ */ __name(() => {
|
|
138
|
-
const labelChildren = /* @__PURE__ */
|
|
144
|
+
const labelChildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-label-content`, ref: containerRef, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { ref: contentRef, children: [
|
|
145
|
+
asterisk && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-asterisk`, children: "*" }),
|
|
146
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { children: label })
|
|
147
|
+
] }) });
|
|
139
148
|
if (tooltipLayout === "text" && tooltip || overflow) {
|
|
140
|
-
return /* @__PURE__ */
|
|
149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tooltip, { placement: "top", title: getOverflowTooltip(), children: labelChildren });
|
|
141
150
|
}
|
|
142
151
|
return labelChildren;
|
|
143
152
|
}, "renderLabelText");
|
|
144
153
|
const renderTooltipIcon = /* @__PURE__ */ __name(() => {
|
|
145
154
|
if (tooltip && tooltipLayout === "icon" && !overflow) {
|
|
146
|
-
return /* @__PURE__ */
|
|
155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-label-tooltip-icon`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tooltip, { placement: "top", title: tooltip, children: tooltipIcon }) });
|
|
147
156
|
}
|
|
148
157
|
}, "renderTooltipIcon");
|
|
149
158
|
const renderLabel = /* @__PURE__ */ __name(() => {
|
|
150
159
|
if (!label) return null;
|
|
151
|
-
return /* @__PURE__ */
|
|
160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
152
161
|
"div",
|
|
153
162
|
{
|
|
154
163
|
className: (0, import_classnames.default)({
|
|
@@ -156,15 +165,17 @@ const BaseItem = /* @__PURE__ */ __name(({ children, ...props }) => {
|
|
|
156
165
|
[`${prefixCls}-label-tooltip`]: tooltip && tooltipLayout === "text" || overflow,
|
|
157
166
|
[`${prefixCls}-item-col-${labelCol}`]: enableCol && !!labelCol
|
|
158
167
|
}),
|
|
159
|
-
style: labelStyle
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
168
|
+
style: labelStyle,
|
|
169
|
+
children: [
|
|
170
|
+
renderLabelText(),
|
|
171
|
+
renderTooltipIcon(),
|
|
172
|
+
label !== " " && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-colon`, children: colon ? ":" : "" })
|
|
173
|
+
]
|
|
174
|
+
}
|
|
164
175
|
);
|
|
165
176
|
}, "renderLabel");
|
|
166
177
|
return wrapSSR(
|
|
167
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
168
179
|
"div",
|
|
169
180
|
{
|
|
170
181
|
...(0, import_builtins.pickDataProps)(props),
|
|
@@ -203,43 +214,53 @@ const BaseItem = /* @__PURE__ */ __name(({ children, ...props }) => {
|
|
|
203
214
|
if (feedbackIcon || inset) {
|
|
204
215
|
setActive(false);
|
|
205
216
|
}
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
renderLabel(),
|
|
209
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
210
|
-
"div",
|
|
211
|
-
{
|
|
212
|
-
className: (0, import_classnames.default)({
|
|
213
|
-
[`${prefixCls}-control`]: true,
|
|
214
|
-
[`${prefixCls}-item-col-${wrapperCol}`]: enableCol && !!wrapperCol && label
|
|
215
|
-
})
|
|
216
217
|
},
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
218
|
+
children: [
|
|
219
|
+
renderLabel(),
|
|
220
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
221
|
+
"div",
|
|
222
|
+
{
|
|
223
|
+
className: (0, import_classnames.default)({
|
|
224
|
+
[`${prefixCls}-control`]: true,
|
|
225
|
+
[`${prefixCls}-item-col-${wrapperCol}`]: enableCol && !!wrapperCol && label
|
|
226
|
+
}),
|
|
227
|
+
children: [
|
|
228
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_classnames.default)(`${prefixCls}-control-content`), children: [
|
|
229
|
+
addonBefore && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(`${prefixCls}-addon-before`), children: addonBefore }),
|
|
230
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
231
|
+
"div",
|
|
232
|
+
{
|
|
233
|
+
style: wrapperStyle,
|
|
234
|
+
className: (0, import_classnames.default)({
|
|
235
|
+
[`${prefixCls}-control-content-component`]: true,
|
|
236
|
+
[`${prefixCls}-control-content-component-has-feedback-icon`]: !!feedbackIcon
|
|
237
|
+
}),
|
|
238
|
+
children: [
|
|
239
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form_layout.FormLayoutShallowContext.Provider, { value: {}, children: formatChildren }),
|
|
240
|
+
feedbackIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(`${prefixCls}-feedback-icon`), children: feedbackIcon })
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
addonAfter && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(`${prefixCls}-addon-after`), children: addonAfter })
|
|
245
|
+
] }),
|
|
246
|
+
!!feedbackText && feedbackLayout !== "popover" && feedbackLayout !== "none" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
247
|
+
"div",
|
|
248
|
+
{
|
|
249
|
+
className: (0, import_classnames.default)({
|
|
250
|
+
[`${prefixCls}-${feedbackStatus}-help`]: !!feedbackStatus,
|
|
251
|
+
[`${prefixCls}-help`]: true,
|
|
252
|
+
[`${prefixCls}-help-enter`]: true,
|
|
253
|
+
[`${prefixCls}-help-enter-active`]: true
|
|
254
|
+
}),
|
|
255
|
+
children: feedbackText
|
|
256
|
+
}
|
|
257
|
+
),
|
|
258
|
+
extra && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(`${prefixCls}-extra`), children: extra })
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
]
|
|
263
|
+
}
|
|
243
264
|
)
|
|
244
265
|
);
|
|
245
266
|
}, "BaseItem");
|
|
@@ -44,8 +44,8 @@ export declare const useFormLayout: () => {
|
|
|
44
44
|
layout?: "vertical" | "horizontal" | "inline";
|
|
45
45
|
labelCol?: number;
|
|
46
46
|
wrapperCol?: number;
|
|
47
|
-
style?: React.CSSProperties;
|
|
48
47
|
className?: string;
|
|
48
|
+
style?: React.CSSProperties;
|
|
49
49
|
inset?: boolean;
|
|
50
50
|
size?: "small" | "default" | "large";
|
|
51
51
|
direction?: "rtl" | "ltr";
|
package/lib/form-layout/index.js
CHANGED
|
@@ -37,7 +37,8 @@ __export(form_layout_exports, {
|
|
|
37
37
|
useFormShallowLayout: () => useFormShallowLayout
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(form_layout_exports);
|
|
40
|
-
var
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
var import_react = require("react");
|
|
41
42
|
var import_classnames = __toESM(require("classnames"));
|
|
42
43
|
var import_builtins = require("../__builtins__");
|
|
43
44
|
var import_useResponsiveFormLayout = require("./useResponsiveFormLayout");
|
|
@@ -77,9 +78,9 @@ const FormLayout = /* @__PURE__ */ __name(({ shallow = true, children, prefixCls
|
|
|
77
78
|
newDeepLayout.colon = props.colon;
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormLayoutDeepContext.Provider, { value: newDeepLayout, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormLayoutShallowContext.Provider, { value: shallow ? props : void 0, children }) });
|
|
81
82
|
}, "renderChildren");
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, className: layoutClassName, style, children: renderChildren() });
|
|
83
84
|
}, "FormLayout");
|
|
84
85
|
FormLayout.useFormDeepLayout = useFormDeepLayout;
|
|
85
86
|
FormLayout.useFormShallowLayout = useFormShallowLayout;
|
package/lib/form-step/index.js
CHANGED
|
@@ -32,7 +32,8 @@ __export(form_step_exports, {
|
|
|
32
32
|
default: () => form_step_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(form_step_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = require("react");
|
|
36
37
|
var import_schema = require("@tachybase/schema");
|
|
37
38
|
var import_antd = require("antd");
|
|
38
39
|
var import_classnames = __toESM(require("classnames"));
|
|
@@ -134,16 +135,19 @@ const FormStep = (0, import_schema.connect)(
|
|
|
134
135
|
const steps = parseSteps(schema);
|
|
135
136
|
const current = props.current || (formStep == null ? void 0 : formStep.current) || 0;
|
|
136
137
|
(_a = formStep == null ? void 0 : formStep.connect) == null ? void 0 : _a.call(formStep, steps, field);
|
|
137
|
-
return /* @__PURE__ */
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_classnames.default)(prefixCls, className), children: [
|
|
139
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Steps, { ...props, style: { marginBottom: 10, ...props.style }, current, children: steps.map(({ props: props2 }, key) => {
|
|
140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Steps.Step, { ...props2 }, key);
|
|
141
|
+
}) }),
|
|
142
|
+
steps.map(({ name, schema: schema2 }, key) => {
|
|
143
|
+
if (key !== current) return;
|
|
144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_schema.RecursionField, { name, schema: schema2 }, key);
|
|
145
|
+
})
|
|
146
|
+
] });
|
|
143
147
|
})
|
|
144
148
|
);
|
|
145
149
|
const StepPane = /* @__PURE__ */ __name(({ children }) => {
|
|
146
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children });
|
|
147
151
|
}, "StepPane");
|
|
148
152
|
FormStep.StepPane = StepPane;
|
|
149
153
|
FormStep.createFormStep = createFormStep;
|