@spacego/fe-components 0.1.0 → 0.2.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/README.md +37 -37
- package/lib/_virtual/Resizable.js +4 -0
- package/lib/_virtual/ResizableBox.js +4 -0
- package/lib/_virtual/index.js +5 -0
- package/lib/_virtual/index2.js +4 -0
- package/lib/_virtual/index3.js +4 -0
- package/lib/_virtual/index4.js +4 -0
- package/lib/_virtual/propTypes.js +4 -0
- package/lib/_virtual/react-is.development.js +4 -0
- package/lib/_virtual/react-is.production.min.js +4 -0
- package/lib/_virtual/utils.js +4 -0
- package/lib/fe-auto-complete/index.js +6 -0
- package/lib/fe-button/index.js +27 -0
- package/lib/fe-cascader/index.js +19 -0
- package/lib/fe-checkbox/index.js +6 -0
- package/lib/fe-checkbox-group/index.js +6 -0
- package/lib/fe-date-picker/index.js +19 -0
- package/lib/fe-description-render/index.js +43 -0
- package/lib/fe-descriptions/index.js +6 -0
- package/lib/fe-empty/index.js +6 -0
- package/lib/fe-error-block/index.js +6 -0
- package/lib/fe-form/fe-form/index.js +133 -0
- package/lib/fe-form/fe-form-auto-complete/index.js +57 -0
- package/lib/fe-form/fe-form-btn-group/index.js +29 -0
- package/lib/fe-form/fe-form-cascader/index.js +25 -0
- package/lib/fe-form/fe-form-checkbox-group/index.js +21 -0
- package/lib/fe-form/fe-form-date-picker/index.js +75 -0
- package/lib/fe-form/fe-form-date-range-picker/index.js +99 -0
- package/lib/fe-form/fe-form-input/index.js +53 -0
- package/lib/fe-form/fe-form-input-input/index.js +63 -0
- package/lib/fe-form/fe-form-input-number/index.js +43 -0
- package/lib/fe-form/fe-form-item/index.js +46 -0
- package/lib/fe-form/fe-form-label/index.js +20 -0
- package/lib/fe-form/fe-form-radio/index.js +21 -0
- package/lib/fe-form/fe-form-render/index.js +33 -0
- package/lib/fe-form/fe-form-rich-text/index.js +25 -0
- package/lib/fe-form/fe-form-select/index.js +93 -0
- package/lib/fe-form/fe-form-switch/index.js +21 -0
- package/lib/fe-form/fe-form-text/index.js +20 -0
- package/lib/fe-form/fe-form-text-area/index.js +24 -0
- package/lib/fe-form/fe-form-time-picker/index.js +21 -0
- package/lib/fe-form/fe-form-upload/index.js +63 -0
- package/lib/fe-form/utils/index.js +28 -0
- package/lib/fe-input/index.js +32 -0
- package/lib/fe-input-number/index.js +19 -0
- package/lib/fe-layouts/auth-layout/index.js +35 -17
- package/lib/fe-layouts/basics-layout/index.js +2 -2
- package/lib/fe-layouts/layout.js +34 -16
- package/lib/fe-link/index.js +23 -0
- package/lib/fe-map/index.js +263 -0
- package/lib/fe-modal/index.js +85 -0
- package/lib/fe-pagination/index.js +6 -0
- package/lib/fe-panel/fe-panel-toolbar.js +40 -0
- package/lib/fe-panel/index.js +49 -0
- package/lib/fe-panel/use-panel-context.js +9 -0
- package/lib/fe-permission/index.js +12 -0
- package/lib/fe-permission-provider/index.js +29 -0
- package/lib/fe-radio/index.js +11 -0
- package/lib/fe-radio-group/index.js +6 -0
- package/lib/fe-rich-text/index.js +293 -0
- package/lib/fe-select/index.js +24 -0
- package/lib/fe-switch/index.js +6 -0
- package/lib/fe-table/fe-edit-table/index.js +39 -0
- package/lib/fe-table/fe-edit-table-cell/index.js +63 -0
- package/lib/fe-table/fe-head-title/index.js +9 -0
- package/lib/fe-table/fe-normal-table/index.js +192 -0
- package/lib/fe-table/fe-sub-table/index.js +74 -0
- package/lib/fe-table/fe-table/index.js +7 -0
- package/lib/fe-table/fe-table-alert/index.js +42 -0
- package/lib/fe-table/fe-table-link/index.js +87 -0
- package/lib/fe-table/fe-table-render/index.js +56 -0
- package/lib/fe-table/fe-table-setting/index.js +165 -0
- package/lib/fe-table/fe-table-toolbar/index.js +63 -0
- package/lib/fe-table/fe-table-utils/index.js +157 -0
- package/lib/fe-table/type/table.d.js +4 -0
- package/lib/fe-table/use-edit-table/index.js +151 -0
- package/lib/fe-table/use-pagination/index.js +59 -0
- package/lib/fe-table/use-sub-table/index.js +23 -0
- package/lib/fe-table/use-table/index.js +177 -0
- package/lib/fe-table/use-table-columns/index.js +53 -0
- package/lib/fe-table/use-table-form-context/index.js +14 -0
- package/lib/fe-table/use-table-selection/index.js +53 -0
- package/lib/fe-text-area/index.js +21 -0
- package/lib/fe-time-picker/index.js +19 -0
- package/lib/fe-upload/index.js +182 -0
- package/lib/fe-upload/upload.constant.js +91 -0
- package/lib/fe-upload-atomic/index.js +6 -0
- package/lib/fe-upload-crop/index.js +207 -0
- package/lib/hooks/{use-auth.hook.js → use-auth.hook/index.js} +3 -3
- package/lib/hooks/use-form/index.js +38 -0
- package/lib/hooks/use-permission.hook/index.js +9 -0
- package/lib/index.css +7 -1
- package/lib/index.js +161 -42
- package/lib/node_modules/.pnpm/@dnd-kit_accessibility@3.1.1_react@18.3.1/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +56 -0
- package/lib/node_modules/.pnpm/@dnd-kit_core@6.3.1_nnrd3gsncyragczmpvfhocinkq/node_modules/@dnd-kit/core/dist/core.esm.js +2344 -0
- package/lib/node_modules/.pnpm/@dnd-kit_modifiers@9.0.0_55ztycxty3xzw7t4rzpvix55vq/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +13 -0
- package/lib/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_55ztycxty3xzw7t4rzpvix55vq/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +439 -0
- package/lib/node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@18.3.1/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +235 -0
- package/lib/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js +54 -0
- package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.js +54 -0
- package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.js +52 -0
- package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.js +329 -0
- package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +17 -0
- package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js +10 -0
- package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.js +7 -0
- package/lib/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js +95 -0
- package/lib/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js +78 -0
- package/lib/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +10 -0
- package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/Resizable.js +233 -0
- package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/ResizableBox.js +164 -0
- package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/propTypes.js +113 -0
- package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/utils.js +56 -0
- package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/index.js +12 -0
- package/lib/store/modules/layout-config.store.js +83 -65
- package/lib/store/modules/theme.store.js +36 -18
- package/lib/types/fe-auto-complete/index.d.ts +2 -0
- package/lib/types/fe-button/index.d.ts +16 -0
- package/lib/types/fe-cascader/index.d.ts +7 -0
- package/lib/types/fe-checkbox/index.d.ts +6 -0
- package/lib/types/fe-checkbox-group/index.d.ts +7 -0
- package/lib/types/fe-date-picker/index.d.ts +3 -0
- package/lib/types/fe-description-render/index.d.ts +31 -0
- package/lib/types/fe-descriptions/index.d.ts +2 -0
- package/lib/types/fe-empty/index.d.ts +2 -0
- package/lib/types/fe-error-block/index.d.ts +6 -0
- package/lib/types/fe-form/fe-form/index.d.ts +356 -0
- package/lib/types/fe-form/fe-form-auto-complete/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-btn-group/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-cascader/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-checkbox-group/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-date-picker/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-date-range-picker/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-input/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-input-input/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-input-number/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-item/index.d.ts +70 -0
- package/lib/types/fe-form/fe-form-label/index.d.ts +45 -0
- package/lib/types/fe-form/fe-form-radio/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-render/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-rich-text/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-select/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-switch/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-text/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-text-area/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-time-picker/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-upload/index.d.ts +3 -0
- package/lib/types/fe-form/index.d.ts +26 -0
- package/lib/types/fe-form/utils/index.d.ts +24 -0
- package/lib/types/fe-input/index.d.ts +12 -0
- package/lib/types/fe-input-number/index.d.ts +2 -0
- package/lib/types/fe-layouts/context/global-context.d.ts +240 -238
- package/lib/types/fe-link/index.d.ts +6 -0
- package/lib/types/fe-map/index.d.ts +73 -0
- package/lib/types/fe-modal/index.d.ts +20 -0
- package/lib/types/fe-pagination/index.d.ts +2 -0
- package/lib/types/fe-panel/fe-panel-toolbar.d.ts +3 -0
- package/lib/types/fe-panel/index.d.ts +61 -0
- package/lib/types/fe-panel/panel-toolbar.d.ts +4 -0
- package/lib/types/fe-panel/use-panel-context.d.ts +6 -0
- package/lib/types/fe-permission/index.d.ts +10 -0
- package/lib/types/fe-permission-provider/index.d.ts +8 -0
- package/lib/types/fe-radio/index.d.ts +2 -0
- package/lib/types/fe-radio-group/index.d.ts +2 -0
- package/lib/types/fe-rich-text/index.d.ts +167 -0
- package/lib/types/fe-select/index.d.ts +8 -0
- package/lib/types/fe-switch/index.d.ts +2 -0
- package/lib/types/fe-table/fe-edit-table/index.d.ts +3 -0
- package/lib/types/fe-table/fe-edit-table-cell/index.d.ts +16 -0
- package/lib/types/fe-table/fe-head-title/index.d.ts +6 -0
- package/lib/types/fe-table/fe-normal-table/index.d.ts +3 -0
- package/lib/types/fe-table/fe-sub-table/index.d.ts +3 -0
- package/lib/types/fe-table/fe-table/index.d.ts +3 -0
- package/lib/types/fe-table/fe-table-alert/index.d.ts +13 -0
- package/lib/types/fe-table/fe-table-link/index.d.ts +12 -0
- package/lib/types/fe-table/fe-table-render/index.d.ts +13 -0
- package/lib/types/fe-table/fe-table-setting/index.d.ts +22 -0
- package/lib/types/fe-table/fe-table-toolbar/index.d.ts +18 -0
- package/lib/types/fe-table/fe-table-utils/index.d.ts +193 -0
- package/lib/types/fe-table/index.d.ts +6 -0
- package/lib/types/fe-table/type/table-context.d.ts +60 -0
- package/lib/types/fe-table/type/table.d.ts +797 -0
- package/lib/types/fe-table/use-edit-table/index.d.ts +6 -0
- package/lib/types/fe-table/use-pagination/index.d.ts +3 -0
- package/lib/types/fe-table/use-sub-table/index.d.ts +8 -0
- package/lib/types/fe-table/use-table/index.d.ts +3 -0
- package/lib/types/fe-table/use-table-columns/index.d.ts +47 -0
- package/lib/types/fe-table/use-table-form-context/index.d.ts +10 -0
- package/lib/types/fe-table/use-table-selection/index.d.ts +46 -0
- package/lib/types/fe-text-area/index.d.ts +4 -0
- package/lib/types/fe-time-picker/index.d.ts +3 -0
- package/lib/types/fe-upload/index.d.ts +85 -0
- package/lib/types/fe-upload/upload.constant.d.ts +39 -0
- package/lib/types/fe-upload-atomic/index.d.ts +2 -0
- package/lib/types/fe-upload-crop/index.d.ts +10 -0
- package/lib/types/hooks/index.d.ts +1 -0
- package/lib/types/hooks/use-descriptions/index.d.ts +3 -0
- package/lib/types/hooks/use-form/index.d.ts +16 -0
- package/lib/types/hooks/use-permission.hook/index.d.ts +10 -0
- package/lib/types/index.d.ts +32 -0
- package/lib/types/typings/index.d.ts +98 -59
- package/lib/types/typings/shims-axios.d.ts +38 -38
- package/package.json +79 -68
- /package/lib/hooks/{use-nprogress.hook.js → use-nprogress.hook/index.js} +0 -0
- /package/lib/types/hooks/{use-auth.hook.d.ts → use-auth.hook/index.d.ts} +0 -0
- /package/lib/types/hooks/{use-nprogress.hook.d.ts → use-nprogress.hook/index.d.ts} +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { dayjs as Y, classnames as A } from "@spacego/turbo-utils";
|
|
3
|
+
import { DatePicker as q } from "antd";
|
|
4
|
+
import { useState as D, useRef as h, useEffect as M } from "react";
|
|
5
|
+
import R from "../fe-form-item/index.js";
|
|
6
|
+
import { getFormItemProps as S, getLabelProps as E } from "../utils/index.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
const { RangePicker: C } = q, _ = ({
|
|
9
|
+
pickerId: t,
|
|
10
|
+
activePanel: o,
|
|
11
|
+
onPanelChange: a,
|
|
12
|
+
value: u,
|
|
13
|
+
onChange: d,
|
|
14
|
+
dateRangePickerProps: l,
|
|
15
|
+
pickerRef: s
|
|
16
|
+
}) => (M(() => {
|
|
17
|
+
(() => {
|
|
18
|
+
const n = document.querySelector(`[data-picker-id="${t}"]`);
|
|
19
|
+
if (n) {
|
|
20
|
+
const r = n.querySelector(".ant-picker") || n;
|
|
21
|
+
r && r.setAttribute && r.setAttribute("data-panel-active", String(o));
|
|
22
|
+
}
|
|
23
|
+
const i = document.querySelector(".date-range-picker__popup");
|
|
24
|
+
i && i.setAttribute("data-panel-active", String(o));
|
|
25
|
+
})();
|
|
26
|
+
const c = new MutationObserver((n) => {
|
|
27
|
+
for (const i of n)
|
|
28
|
+
if (i.type === "childList") {
|
|
29
|
+
const r = document.querySelector(".date-range-picker__popup");
|
|
30
|
+
r && r.setAttribute("data-panel-active", String(o));
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return c.observe(document.body, { childList: !0, subtree: !0 }), () => {
|
|
34
|
+
c.disconnect();
|
|
35
|
+
};
|
|
36
|
+
}, [o, t]), M(() => {
|
|
37
|
+
const f = (c) => {
|
|
38
|
+
const n = c.target, i = n.closest(`[data-picker-id="${t}"]`);
|
|
39
|
+
if (!i) return;
|
|
40
|
+
const r = i.querySelectorAll(".ant-picker-input");
|
|
41
|
+
if (r.length >= 2) {
|
|
42
|
+
const p = r[0], k = r[1], e = n.closest(".ant-picker-input");
|
|
43
|
+
e === p ? a(0) : e === k && a(1);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return document.addEventListener("click", f, !0), () => {
|
|
47
|
+
document.removeEventListener("click", f, !0);
|
|
48
|
+
};
|
|
49
|
+
}, [t, a]), /* @__PURE__ */ m("div", { "data-picker-id": t, style: { display: "contents" }, children: /* @__PURE__ */ m(
|
|
50
|
+
C,
|
|
51
|
+
{
|
|
52
|
+
ref: s,
|
|
53
|
+
className: "date-range-picker",
|
|
54
|
+
value: u,
|
|
55
|
+
onChange: d,
|
|
56
|
+
style: { width: "100%" },
|
|
57
|
+
...l,
|
|
58
|
+
popupClassName: A("date-range-picker__popup", l.popupClassName)
|
|
59
|
+
}
|
|
60
|
+
) })), N = (t) => {
|
|
61
|
+
const o = Y.default, { dateRangePickerAttributes: a, onChange: u, value: d } = t, { hasTime: l = !0, ...s } = a || {}, [f, c] = D(0), n = h(`date-range-picker-${Date.now()}-${Math.random()}`), i = h(null), { valueType: r, ...p } = S(t), k = (e) => {
|
|
62
|
+
u == null || u(e);
|
|
63
|
+
};
|
|
64
|
+
return /* @__PURE__ */ m(
|
|
65
|
+
R,
|
|
66
|
+
{
|
|
67
|
+
name: t.dataIndex,
|
|
68
|
+
required: t.required ?? !1,
|
|
69
|
+
rules: t.rules,
|
|
70
|
+
type: t.type,
|
|
71
|
+
requiredMessage: t.requiredMessage,
|
|
72
|
+
valueType: r ?? "array",
|
|
73
|
+
getValueProps: (e) => e ? Array.isArray(d) && d.length >= 2 ? { value: [e[0] ? o(e[0]) : null, e[1] ? o(e[1]) : null] } : { value: void 0 } : { value: void 0 },
|
|
74
|
+
normalize: (e) => {
|
|
75
|
+
if (!(e != null && e[0]) || !(e != null && e[1])) return;
|
|
76
|
+
const y = (g, P) => l && !s.showTime ? P ? g.startOf("day") : g.endOf("day") : g, b = s.picker === "month" ? "YYYY-MM" : l || s.showTime ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
77
|
+
return [y(e[0], !0).format(b), y(e[1], !1).format(b)];
|
|
78
|
+
},
|
|
79
|
+
...E(t),
|
|
80
|
+
...p,
|
|
81
|
+
attributes: { ...t.attributes || {} },
|
|
82
|
+
children: /* @__PURE__ */ m(
|
|
83
|
+
_,
|
|
84
|
+
{
|
|
85
|
+
pickerId: n.current,
|
|
86
|
+
activePanel: f,
|
|
87
|
+
onPanelChange: c,
|
|
88
|
+
value: d,
|
|
89
|
+
onChange: k,
|
|
90
|
+
dateRangePickerProps: s,
|
|
91
|
+
pickerRef: i
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
export {
|
|
98
|
+
N as default
|
|
99
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { Space as c } from "antd";
|
|
3
|
+
import { useMemo as o } from "react";
|
|
4
|
+
import d from "../../fe-button/index.js";
|
|
5
|
+
import p from "../../fe-input/index.js";
|
|
6
|
+
import h from "../fe-form-item/index.js";
|
|
7
|
+
import { getFormItemProps as b, getLabelProps as f } from "../utils/index.js";
|
|
8
|
+
const i = (t) => {
|
|
9
|
+
const { value: n, onChange: r, attr: u, ...m } = t, l = o(() => {
|
|
10
|
+
if (!u.inputAttributes) return {};
|
|
11
|
+
const a = { ...u.inputAttributes };
|
|
12
|
+
return delete a.inputType, a;
|
|
13
|
+
}, [t.attr]);
|
|
14
|
+
return /* @__PURE__ */ e(
|
|
15
|
+
p,
|
|
16
|
+
{
|
|
17
|
+
allowClear: !0,
|
|
18
|
+
placeholder: t.attr.placeholder ?? `请输入${t.attr.label}`,
|
|
19
|
+
value: n,
|
|
20
|
+
onChange: r,
|
|
21
|
+
...l,
|
|
22
|
+
...m
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}, C = (t) => /* @__PURE__ */ s(c.Compact, { style: { width: "100%" }, children: [
|
|
26
|
+
/* @__PURE__ */ e(i, { value: t.value, onChange: t.onChange, attr: t.attr }),
|
|
27
|
+
/* @__PURE__ */ e(d, { ...t.attr.buttonAttributes || {} })
|
|
28
|
+
] }), g = /* @__PURE__ */ new Map([
|
|
29
|
+
["input", i],
|
|
30
|
+
["inputWithBtn", C]
|
|
31
|
+
]), x = (t) => {
|
|
32
|
+
const n = o(() => {
|
|
33
|
+
var r;
|
|
34
|
+
return g.get(((r = t.inputAttributes) == null ? void 0 : r.inputType) ?? "input");
|
|
35
|
+
}, [t.inputAttributes]);
|
|
36
|
+
return /* @__PURE__ */ e(
|
|
37
|
+
h,
|
|
38
|
+
{
|
|
39
|
+
name: t.dataIndex,
|
|
40
|
+
required: t.required ?? !1,
|
|
41
|
+
type: t.type,
|
|
42
|
+
rules: t.rules,
|
|
43
|
+
requiredMessage: t.requiredMessage,
|
|
44
|
+
...f(t),
|
|
45
|
+
...b(t),
|
|
46
|
+
attributes: { ...t.attributes || {} },
|
|
47
|
+
children: /* @__PURE__ */ e(n, { attr: { ...t, placeholder: t.placeholder } })
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
x as default
|
|
53
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { isString as d, classnames as m, isArray as c } from "@spacego/turbo-utils";
|
|
3
|
+
import { Row as f, Space as b, Col as I } from "antd";
|
|
4
|
+
import s from "../fe-form-input/index.js";
|
|
5
|
+
import h from "../fe-form-item/index.js";
|
|
6
|
+
import { getFormItemProps as o, getLabelProps as F } from "../utils/index.js";
|
|
7
|
+
const x = (e) => {
|
|
8
|
+
var u;
|
|
9
|
+
return e = { ...e }, e.attributes = e.attributes ?? {}, /* @__PURE__ */ a(
|
|
10
|
+
s,
|
|
11
|
+
{
|
|
12
|
+
...e,
|
|
13
|
+
placeholder: e.placeholder,
|
|
14
|
+
needLabel: !1,
|
|
15
|
+
inputAttributes: {
|
|
16
|
+
...e.inputInputAttributes,
|
|
17
|
+
inputType: "input"
|
|
18
|
+
},
|
|
19
|
+
requiredMessage: e.requiredMessage ?? e.placeholder,
|
|
20
|
+
attributes: {
|
|
21
|
+
...e.attributes,
|
|
22
|
+
className: m("fe-form-input-input-multi__item", (u = e.attributes) == null ? void 0 : u.className)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}, C = (e) => {
|
|
27
|
+
var i;
|
|
28
|
+
e = { ...e }, e.dataIndex = (d(e.dataIndex) ? [e.dataIndex] : e.dataIndex) ?? [];
|
|
29
|
+
const u = (l) => {
|
|
30
|
+
var r;
|
|
31
|
+
const t = (r = e.inputInputAttributes) == null ? void 0 : r.colSpan, n = 24 / e.dataIndex.length;
|
|
32
|
+
return !e.inputInputAttributes || !t ? n : (c(t) ? t[l] : t) ?? n;
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ a(
|
|
35
|
+
h,
|
|
36
|
+
{
|
|
37
|
+
required: e.required ?? !1,
|
|
38
|
+
type: e.type,
|
|
39
|
+
rules: e.rules,
|
|
40
|
+
...F(e),
|
|
41
|
+
...o(e),
|
|
42
|
+
labelLeft: e.required && /* @__PURE__ */ a("span", { className: "fe-form-custom__required", children: "*" }),
|
|
43
|
+
attributes: {
|
|
44
|
+
...e.attributes || {},
|
|
45
|
+
className: m("fe-form-input-input-multi", (i = e.attributes) == null ? void 0 : i.className)
|
|
46
|
+
},
|
|
47
|
+
children: /* @__PURE__ */ a(f, { children: /* @__PURE__ */ a(b.Compact, { block: !0, children: e.dataIndex.map((l, t) => {
|
|
48
|
+
var n;
|
|
49
|
+
return /* @__PURE__ */ a(I, { span: u(t), children: /* @__PURE__ */ a(
|
|
50
|
+
x,
|
|
51
|
+
{
|
|
52
|
+
...e,
|
|
53
|
+
dataIndex: l,
|
|
54
|
+
placeholder: d(e.placeholder) ? e.placeholder : ((n = e.placeholder) == null ? void 0 : n[t]) ?? `请输入${e.label}`
|
|
55
|
+
}
|
|
56
|
+
) }, l);
|
|
57
|
+
}) }) })
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
C as default
|
|
63
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { thousands as c } from "@spacego/turbo-utils";
|
|
3
|
+
import { useMemo as b } from "react";
|
|
4
|
+
import N from "../../fe-input-number/index.js";
|
|
5
|
+
import h from "../fe-form-item/index.js";
|
|
6
|
+
import { getFormItemProps as P, getLabelProps as g } from "../utils/index.js";
|
|
7
|
+
const T = (e) => {
|
|
8
|
+
const { valueType: u, ...f } = P(e), d = b(() => {
|
|
9
|
+
var r;
|
|
10
|
+
return u || ((r = e.inputNumberAttributes) != null && r.stringMode ? "string" : "number");
|
|
11
|
+
}, [e, u]), l = b(() => {
|
|
12
|
+
var a, m, n;
|
|
13
|
+
if (!e.inputNumberAttributes) return {};
|
|
14
|
+
const { hasThousands: r, thousandsParams: A, ...s } = e.inputNumberAttributes;
|
|
15
|
+
if (r) {
|
|
16
|
+
const i = {
|
|
17
|
+
precision: ((a = e.inputNumberAttributes.thousandsParams) == null ? void 0 : a.precision) ?? 2,
|
|
18
|
+
fillZero: ((m = e.inputNumberAttributes.thousandsParams) == null ? void 0 : m.fillZero) ?? !1,
|
|
19
|
+
separator: ((n = e.inputNumberAttributes.thousandsParams) == null ? void 0 : n.separator) ?? ","
|
|
20
|
+
};
|
|
21
|
+
s.formatter = (t) => t ? c(Number(t), i.precision, i.fillZero, i.separator) : "", s.parser = (t) => t ? t == null ? void 0 : t.replace(/(,*)/g, "") : "";
|
|
22
|
+
}
|
|
23
|
+
return s;
|
|
24
|
+
}, [e.inputNumberAttributes]);
|
|
25
|
+
return /* @__PURE__ */ o(
|
|
26
|
+
h,
|
|
27
|
+
{
|
|
28
|
+
name: e.dataIndex,
|
|
29
|
+
required: e.required ?? !1,
|
|
30
|
+
type: e.type,
|
|
31
|
+
rules: e.rules,
|
|
32
|
+
valueType: d,
|
|
33
|
+
requiredMessage: e.requiredMessage,
|
|
34
|
+
...g(e),
|
|
35
|
+
...f,
|
|
36
|
+
attributes: { ...e.attributes || {} },
|
|
37
|
+
children: /* @__PURE__ */ o(N, { placeholder: `请输入${e.label}`, ...l || {} })
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
T as default
|
|
43
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { Form as n } from "antd";
|
|
3
|
+
import { useMemo as m } from "react";
|
|
4
|
+
import d from "../fe-form-label/index.js";
|
|
5
|
+
const h = (e) => {
|
|
6
|
+
const i = m(() => {
|
|
7
|
+
let l = [], t = `${e.label}不能为空`;
|
|
8
|
+
if (["select", "treeSelect", "cascader", "tagSelect"].includes(e.type) && (t = `请选择${e.label}`), e.required) {
|
|
9
|
+
const u = e.requiredMessage ?? t;
|
|
10
|
+
l.push({
|
|
11
|
+
required: !0,
|
|
12
|
+
message: u,
|
|
13
|
+
validateTrigger: e.validateTrigger ?? "onBlur",
|
|
14
|
+
type: e.valueType ?? "string"
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return e.rules && e.rules.length > 0 && (l = l.concat(e.rules)), l;
|
|
18
|
+
}, [e.label, e.type, e.requiredMessage, e.rules, e.required]), r = typeof e.needLabel == "boolean" ? e.needLabel : !0;
|
|
19
|
+
return /* @__PURE__ */ a(
|
|
20
|
+
n.Item,
|
|
21
|
+
{
|
|
22
|
+
label: r ? /* @__PURE__ */ a(d, { ...e }) : null,
|
|
23
|
+
labelAlign: e.labelAlign ?? "right",
|
|
24
|
+
labelCol: {
|
|
25
|
+
style: {
|
|
26
|
+
width: e.labelWidth ?? "100px",
|
|
27
|
+
overflow: "hidden",
|
|
28
|
+
textOverflow: "ellipsis",
|
|
29
|
+
whiteSpace: "nowrap"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
name: e.name,
|
|
33
|
+
rules: i,
|
|
34
|
+
initialValue: e.initialValue,
|
|
35
|
+
valuePropName: "value",
|
|
36
|
+
validateFirst: !0,
|
|
37
|
+
getValueProps: e.getValueProps,
|
|
38
|
+
normalize: e.normalize,
|
|
39
|
+
...e.attributes ?? {},
|
|
40
|
+
children: e.children
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
h as default
|
|
46
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as i, jsxs as e, Fragment as l } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip as r } from "antd";
|
|
3
|
+
import { QuestionCircleOutlined as h, PlusCircleOutlined as m } from "@ant-design/icons";
|
|
4
|
+
const C = (t) => {
|
|
5
|
+
const n = /* @__PURE__ */ e(l, { children: [
|
|
6
|
+
/* @__PURE__ */ i("span", { children: " " }),
|
|
7
|
+
/* @__PURE__ */ i(m, { style: { color: "#1890ff" }, onClick: (c) => t.onAddClick && t.onAddClick(c) })
|
|
8
|
+
] }), o = /* @__PURE__ */ i(r, { title: t.hintText, children: /* @__PURE__ */ i(h, { style: { marginLeft: "4px", cursor: "pointer", fontSize: "14px" } }) }), d = t.showAdd || t.showHint ? /* @__PURE__ */ e(l, { children: [
|
|
9
|
+
t.showAdd && n,
|
|
10
|
+
t.showHint && o
|
|
11
|
+
] }) : /* @__PURE__ */ i(l, { children: t.labelRight ?? "" });
|
|
12
|
+
return /* @__PURE__ */ e("div", { children: [
|
|
13
|
+
t.labelLeft ?? "",
|
|
14
|
+
t.label ?? "",
|
|
15
|
+
d
|
|
16
|
+
] });
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
C as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import t from "../../fe-radio-group/index.js";
|
|
3
|
+
import i from "../fe-form-item/index.js";
|
|
4
|
+
import { getFormItemProps as a, getLabelProps as m } from "../utils/index.js";
|
|
5
|
+
const f = (e) => /* @__PURE__ */ r(
|
|
6
|
+
i,
|
|
7
|
+
{
|
|
8
|
+
name: e.dataIndex,
|
|
9
|
+
required: e.required ?? !1,
|
|
10
|
+
type: e.type,
|
|
11
|
+
rules: e.rules,
|
|
12
|
+
requiredMessage: e.requiredMessage,
|
|
13
|
+
...m(e),
|
|
14
|
+
...a(e),
|
|
15
|
+
attributes: { ...e.attributes || {} },
|
|
16
|
+
children: /* @__PURE__ */ r(t, { ...e.radioGroupAttributes || {} })
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
export {
|
|
20
|
+
f as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u, useEffect as m } from "react";
|
|
3
|
+
import d from "../../fe-error-block/index.js";
|
|
4
|
+
import l from "../fe-form-item/index.js";
|
|
5
|
+
import { getFormItemProps as a, getLabelProps as c } from "../utils/index.js";
|
|
6
|
+
const f = (e) => {
|
|
7
|
+
var r;
|
|
8
|
+
const [i, t] = u();
|
|
9
|
+
return m(() => {
|
|
10
|
+
e != null && e.children ? typeof (e == null ? void 0 : e.children) != "function" ? t("children must be a function") : t(void 0) : t("children is required");
|
|
11
|
+
}, [e]), /* @__PURE__ */ n(d, { message: i, children: (r = e == null ? void 0 : e.children) == null ? void 0 : r.call(e, e) });
|
|
12
|
+
}, q = (e) => {
|
|
13
|
+
var r;
|
|
14
|
+
const { valueType: i, ...t } = a(e);
|
|
15
|
+
return /* @__PURE__ */ n(
|
|
16
|
+
l,
|
|
17
|
+
{
|
|
18
|
+
name: e.dataIndex,
|
|
19
|
+
required: e.required ?? !1,
|
|
20
|
+
rules: e.rules,
|
|
21
|
+
type: e.type,
|
|
22
|
+
valueType: ((r = e.renderAttributes) == null ? void 0 : r.valueType) ?? i ?? "string",
|
|
23
|
+
requiredMessage: e.requiredMessage,
|
|
24
|
+
...c(e),
|
|
25
|
+
...t,
|
|
26
|
+
attributes: { ...e.attributes || {} },
|
|
27
|
+
children: /* @__PURE__ */ n(f, { ...e.renderAttributes ?? {} })
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
q as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import m from "../../fe-rich-text/index.js";
|
|
3
|
+
import a from "../fe-form-item/index.js";
|
|
4
|
+
import { getFormItemProps as u, getLabelProps as l } from "../utils/index.js";
|
|
5
|
+
const f = (e) => {
|
|
6
|
+
const { valueType: r, ...i } = u(e);
|
|
7
|
+
return /* @__PURE__ */ t(
|
|
8
|
+
a,
|
|
9
|
+
{
|
|
10
|
+
name: e.dataIndex,
|
|
11
|
+
required: e.required ?? !1,
|
|
12
|
+
rules: e.rules,
|
|
13
|
+
type: e.type,
|
|
14
|
+
valueType: r ?? "string",
|
|
15
|
+
requiredMessage: e.requiredMessage,
|
|
16
|
+
...l(e),
|
|
17
|
+
...i,
|
|
18
|
+
attributes: { ...e.attributes || {} },
|
|
19
|
+
children: /* @__PURE__ */ t(m, { placeholder: `请输入${e.label}`, ...e.richTextAttributes })
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
f as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsxs as x, Fragment as v, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Divider as T, Tooltip as w, Form as A, Checkbox as I } from "antd";
|
|
3
|
+
import { useMemo as c } from "react";
|
|
4
|
+
import C from "../../fe-select/index.js";
|
|
5
|
+
import P from "../fe-form-item/index.js";
|
|
6
|
+
import { getFormItemProps as V, getLabelProps as k } from "../utils/index.js";
|
|
7
|
+
const _ = (e) => {
|
|
8
|
+
var f;
|
|
9
|
+
const { valueType: m, ...u } = V(e), i = c(() => !e.selectAttributes || !e.selectAttributes.options ? [] : e.selectAttributes.options.map((l) => ({
|
|
10
|
+
label: l.label,
|
|
11
|
+
value: l.dataIndex,
|
|
12
|
+
disabled: l.disabled || !1
|
|
13
|
+
})), [e.selectAttributes]), s = c(() => i.filter((l) => !l.disabled), [i]), t = c(() => {
|
|
14
|
+
if (!e.selectAttributes) return {};
|
|
15
|
+
const { selectType: l, options: a, showSelectAll: r, onSelectAll: d, ...g } = e.selectAttributes, y = { ...g };
|
|
16
|
+
return l === "multiple" && r && (y.popupRender = (F) => /* @__PURE__ */ x(v, { children: [
|
|
17
|
+
/* @__PURE__ */ n(
|
|
18
|
+
p,
|
|
19
|
+
{
|
|
20
|
+
dataIndex: e.dataIndex,
|
|
21
|
+
selectableOptions: s,
|
|
22
|
+
onSelectAll: d
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ n(T, { style: { margin: "4px 0" } }),
|
|
26
|
+
F
|
|
27
|
+
] })), y;
|
|
28
|
+
}, [e.dataIndex, e.selectAttributes, s]), o = c(() => e.selectAttributes && e.selectAttributes.selectType === "multiple" ? "array" : "string", [e]), h = c(() => {
|
|
29
|
+
var l;
|
|
30
|
+
return ((l = e.selectAttributes) == null ? void 0 : l.selectType) !== "multiple" ? {} : {
|
|
31
|
+
maxTagCount: "responsive",
|
|
32
|
+
maxTagPlaceholder: (a) => /* @__PURE__ */ n(
|
|
33
|
+
w,
|
|
34
|
+
{
|
|
35
|
+
styles: { root: { pointerEvents: "none" } },
|
|
36
|
+
title: a.map(({ label: r }) => r).join(", "),
|
|
37
|
+
children: /* @__PURE__ */ x("span", { children: [
|
|
38
|
+
"+",
|
|
39
|
+
a.length
|
|
40
|
+
] })
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
};
|
|
44
|
+
}, [e]), b = c(() => t != null && t.showSearch ? typeof (t == null ? void 0 : t.showSearch) == "boolean" ? {
|
|
45
|
+
showSearch: {
|
|
46
|
+
optionFilterProp: "label"
|
|
47
|
+
}
|
|
48
|
+
} : {
|
|
49
|
+
optionFilterProp: "label",
|
|
50
|
+
...(t == null ? void 0 : t.showSearch) ?? {}
|
|
51
|
+
} : {}, [t]);
|
|
52
|
+
return /* @__PURE__ */ n(
|
|
53
|
+
P,
|
|
54
|
+
{
|
|
55
|
+
name: e.dataIndex,
|
|
56
|
+
required: e.required ?? !1,
|
|
57
|
+
type: e.type,
|
|
58
|
+
rules: e.rules,
|
|
59
|
+
valueType: m ?? o,
|
|
60
|
+
requiredMessage: e.requiredMessage,
|
|
61
|
+
...k(e),
|
|
62
|
+
...u,
|
|
63
|
+
attributes: { ...e.attributes || {} },
|
|
64
|
+
children: /* @__PURE__ */ n(
|
|
65
|
+
C,
|
|
66
|
+
{
|
|
67
|
+
allowClear: !0,
|
|
68
|
+
options: i,
|
|
69
|
+
placeholder: e.placeholder ?? `请选择${e.label}`,
|
|
70
|
+
mode: ((f = e.selectAttributes) == null ? void 0 : f.selectType) === "multiple" ? "multiple" : void 0,
|
|
71
|
+
...h,
|
|
72
|
+
...t,
|
|
73
|
+
...b
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}, p = ({
|
|
79
|
+
dataIndex: e,
|
|
80
|
+
selectableOptions: m,
|
|
81
|
+
onSelectAll: u
|
|
82
|
+
// 新增回调
|
|
83
|
+
}) => {
|
|
84
|
+
const i = A.useFormInstance(), s = A.useWatch(e, i) || [], t = m.map((l) => l.value), o = s.filter((l) => t.includes(l)).length, h = o === t.length && t.length > 0, b = o > 0 && o < t.length;
|
|
85
|
+
return /* @__PURE__ */ n("div", { style: { padding: "8px 12px" }, children: /* @__PURE__ */ n(I, { checked: h, indeterminate: b, onChange: (l) => {
|
|
86
|
+
const a = l.target.checked;
|
|
87
|
+
let r;
|
|
88
|
+
a ? r = [...s.filter((g) => !t.includes(g)), ...t] : r = s.filter((d) => !t.includes(d)), u == null || u(a, r), i.setFieldValue(e, r);
|
|
89
|
+
}, children: "全选" }) });
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
_ as default
|
|
93
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import r from "../../fe-switch/index.js";
|
|
3
|
+
import i from "../fe-form-item/index.js";
|
|
4
|
+
import { getFormItemProps as m, getLabelProps as a } from "../utils/index.js";
|
|
5
|
+
const f = (e) => /* @__PURE__ */ t(
|
|
6
|
+
i,
|
|
7
|
+
{
|
|
8
|
+
name: e.dataIndex,
|
|
9
|
+
required: e.required ?? !1,
|
|
10
|
+
type: e.type,
|
|
11
|
+
rules: e.rules,
|
|
12
|
+
requiredMessage: e.requiredMessage,
|
|
13
|
+
...a(e),
|
|
14
|
+
...m(e),
|
|
15
|
+
attributes: { ...e.attributes || {} },
|
|
16
|
+
children: /* @__PURE__ */ t(r, { ...e.switchAttributes || {} })
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
export {
|
|
20
|
+
f as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import r from "../fe-form-item/index.js";
|
|
3
|
+
import { getFormItemProps as i, getLabelProps as a } from "../utils/index.js";
|
|
4
|
+
const l = (e) => /* @__PURE__ */ t(
|
|
5
|
+
r,
|
|
6
|
+
{
|
|
7
|
+
name: e.dataIndex,
|
|
8
|
+
required: e.required ?? !1,
|
|
9
|
+
rules: e.rules,
|
|
10
|
+
type: e.type,
|
|
11
|
+
requiredMessage: e.requiredMessage,
|
|
12
|
+
...a(e),
|
|
13
|
+
...i(e),
|
|
14
|
+
attributes: { ...e.attributes || {} },
|
|
15
|
+
children: /* @__PURE__ */ t("div", { ...e.divAttributes, children: e.value ?? "" })
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
export {
|
|
19
|
+
l as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import a from "../../fe-text-area/index.js";
|
|
3
|
+
import m from "../fe-form-item/index.js";
|
|
4
|
+
import { getFormItemProps as l, getLabelProps as i } from "../utils/index.js";
|
|
5
|
+
const x = (e) => {
|
|
6
|
+
const r = a;
|
|
7
|
+
return /* @__PURE__ */ t(
|
|
8
|
+
m,
|
|
9
|
+
{
|
|
10
|
+
name: e.dataIndex,
|
|
11
|
+
required: e.required ?? !1,
|
|
12
|
+
type: e.type,
|
|
13
|
+
rules: e.rules,
|
|
14
|
+
requiredMessage: e.requiredMessage,
|
|
15
|
+
...i(e),
|
|
16
|
+
...l(e),
|
|
17
|
+
attributes: { ...e.attributes || {} },
|
|
18
|
+
children: /* @__PURE__ */ t(r, { allowClear: !0, placeholder: `请输入${e.label}`, ...e.textAreaAttributes || {} })
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
x as default
|
|
24
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import t from "../../fe-time-picker/index.js";
|
|
3
|
+
import i from "../fe-form-item/index.js";
|
|
4
|
+
import { getFormItemProps as m, getLabelProps as a } from "../utils/index.js";
|
|
5
|
+
const c = (e) => /* @__PURE__ */ r(
|
|
6
|
+
i,
|
|
7
|
+
{
|
|
8
|
+
name: e.dataIndex,
|
|
9
|
+
required: e.required ?? !1,
|
|
10
|
+
rules: e.rules,
|
|
11
|
+
type: e.type,
|
|
12
|
+
requiredMessage: e.requiredMessage,
|
|
13
|
+
...a(e),
|
|
14
|
+
...m(e),
|
|
15
|
+
attributes: { ...e.attributes || {} },
|
|
16
|
+
children: /* @__PURE__ */ r(t, { allowClear: !0, placeholder: `请选择${e.label}`, ...e.timePickerAttributes || {} })
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
export {
|
|
20
|
+
c as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { isString as x } from "@spacego/turbo-utils";
|
|
3
|
+
import { useMemo as c } from "react";
|
|
4
|
+
import F from "../../fe-upload/index.js";
|
|
5
|
+
import m from "../fe-form-item/index.js";
|
|
6
|
+
import { getFormItemProps as n, getLabelProps as r } from "../utils/index.js";
|
|
7
|
+
const b = (e) => {
|
|
8
|
+
var a, u;
|
|
9
|
+
e = { ...e }, e.isMulti = e.isMulti ?? !1, e.uploadAttributes = e.uploadAttributes ?? {}, e.uploadAttributes.maxCount = e.uploadAttributes.maxCount ?? (((a = e.uploadAttributes) == null ? void 0 : a.customType) === "card" ? 1 : void 0);
|
|
10
|
+
const i = c(() => {
|
|
11
|
+
let l = {
|
|
12
|
+
label: e.label,
|
|
13
|
+
name: e.dataIndex,
|
|
14
|
+
labelWidth: e.labelWidth,
|
|
15
|
+
required: e.required ?? !1,
|
|
16
|
+
type: e.type,
|
|
17
|
+
rules: e.rules,
|
|
18
|
+
valueType: "array",
|
|
19
|
+
requiredMessage: e.requiredMessage,
|
|
20
|
+
attributes: {
|
|
21
|
+
getValueFromEvent: (f) => f
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return e.isMulti ? (l.label = e.title, l.labelWidth = "0px", l.needLabel = !1) : l = { ...l, ...r(e), ...n(e, { valueType: "array" }) }, l;
|
|
25
|
+
}, [
|
|
26
|
+
e.label,
|
|
27
|
+
e.dataIndex,
|
|
28
|
+
e.labelWidth,
|
|
29
|
+
e.required,
|
|
30
|
+
e.type,
|
|
31
|
+
e.rules,
|
|
32
|
+
e.isMulti,
|
|
33
|
+
e.title
|
|
34
|
+
]), d = e.title || ((u = e.uploadAttributes) == null ? void 0 : u.title);
|
|
35
|
+
return /* @__PURE__ */ t(m, { ...i, children: /* @__PURE__ */ t(F, { ...e.uploadAttributes, title: d }) });
|
|
36
|
+
}, y = (e) => (e = { ...e }, e.dataIndex = x(e.dataIndex) ? [e.dataIndex] : e.dataIndex, /* @__PURE__ */ t(
|
|
37
|
+
m,
|
|
38
|
+
{
|
|
39
|
+
required: e.required ?? !1,
|
|
40
|
+
type: e.type,
|
|
41
|
+
rules: e.rules,
|
|
42
|
+
...r(e),
|
|
43
|
+
...n(e),
|
|
44
|
+
labelLeft: e.required && /* @__PURE__ */ t("span", { className: "fe-form-upload__required", children: "*" }),
|
|
45
|
+
attributes: { className: "fe-form-upload-multi", ...e.attributes || {} },
|
|
46
|
+
children: e.dataIndex.map((i, d) => {
|
|
47
|
+
var a, u;
|
|
48
|
+
return /* @__PURE__ */ t(
|
|
49
|
+
b,
|
|
50
|
+
{
|
|
51
|
+
...e,
|
|
52
|
+
dataIndex: i,
|
|
53
|
+
isMulti: !0,
|
|
54
|
+
title: (u = (a = e.uploadAttributes) == null ? void 0 : a.title) == null ? void 0 : u[d]
|
|
55
|
+
},
|
|
56
|
+
i
|
|
57
|
+
);
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
)), v = (e) => (e = { ...e }, e.uploadMultiple ? /* @__PURE__ */ t(y, { ...e }) : /* @__PURE__ */ t(b, { ...e }));
|
|
61
|
+
export {
|
|
62
|
+
v as default
|
|
63
|
+
};
|