szld-libs 0.4.49 → 0.4.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/szld-components.es.js +20249 -19514
- package/dist/szld-components.umd.js +229 -113
- package/es/components/DynamicForm/func.d.ts +2 -2
- package/es/components/DynamicForm/func.js +12 -7
- package/es/components/DynamicForm/index.d.ts +1 -0
- package/es/components/DynamicForm/index.js +41 -7
- package/es/components/DynamicForm/myCascader/index.d.ts +2 -1
- package/es/components/DynamicForm/myCascader/index.js +9 -11
- package/es/components/DynamicForm/myRadio/index.d.ts +5 -1
- package/es/components/DynamicForm/myRadio/index.js +63 -17
- package/es/components/DynamicForm/myRichText/index.d.ts +3 -1
- package/es/components/DynamicForm/myRichText/index.js +20 -30
- package/es/components/DynamicForm/mySelect/index.js +1 -1
- package/es/components/DynamicForm/selectModelBackfillFormItem/index.js +1 -1
- package/es/components/DynamicForm/useDynamicForm.d.ts +1 -0
- package/es/components/DynamicForm/useDynamicForm.js +23 -19
- package/es/components/DynamicFormMobile/func.js +4 -0
- package/es/components/DynamicFormMobile/myRichText/enmu.d.ts +5 -0
- package/es/components/DynamicFormMobile/myRichText/enmu.js +68 -0
- package/es/components/DynamicFormMobile/myRichText/index.d.ts +11 -0
- package/es/components/DynamicFormMobile/myRichText/index.js +291 -0
- package/es/components/DynamicFormMobile/myRichText/vite.svg +1 -0
- package/es/components/DynamicFormMobile/mySelect/index.css +9 -1
- package/es/components/DynamicFormMobile/mySelect/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/mySelect/index.js +55 -24
- package/es/components/DynamicFormMobile/myUpload/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/selectModel/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/useDynamicForm.d.ts +2 -2
- package/es/components/DynamicFormMobile/useDynamicForm.js +19 -4
- package/es/index.js +1 -1
- package/es/utils/szxkFunc.d.ts +11 -0
- package/es/utils/szxkFunc.js +25 -0
- package/lib/components/DynamicForm/func.d.ts +2 -2
- package/lib/components/DynamicForm/func.js +12 -7
- package/lib/components/DynamicForm/index.d.ts +1 -0
- package/lib/components/DynamicForm/index.js +38 -4
- package/lib/components/DynamicForm/myCascader/index.d.ts +2 -1
- package/lib/components/DynamicForm/myCascader/index.js +9 -11
- package/lib/components/DynamicForm/myRadio/index.d.ts +5 -1
- package/lib/components/DynamicForm/myRadio/index.js +61 -15
- package/lib/components/DynamicForm/myRichText/index.d.ts +3 -1
- package/lib/components/DynamicForm/myRichText/index.js +19 -29
- package/lib/components/DynamicForm/mySelect/index.js +1 -1
- package/lib/components/DynamicForm/selectModelBackfillFormItem/index.js +1 -1
- package/lib/components/DynamicForm/useDynamicForm.d.ts +1 -0
- package/lib/components/DynamicForm/useDynamicForm.js +19 -15
- package/lib/components/DynamicFormMobile/func.js +4 -0
- package/lib/components/DynamicFormMobile/myRichText/enmu.d.ts +5 -0
- package/lib/components/DynamicFormMobile/myRichText/enmu.js +68 -0
- package/lib/components/DynamicFormMobile/myRichText/index.d.ts +11 -0
- package/lib/components/DynamicFormMobile/myRichText/index.js +290 -0
- package/lib/components/DynamicFormMobile/myRichText/vite.svg +1 -0
- package/lib/components/DynamicFormMobile/mySelect/index.css +9 -1
- package/lib/components/DynamicFormMobile/mySelect/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/mySelect/index.js +55 -24
- package/lib/components/DynamicFormMobile/myUpload/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/selectModel/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/useDynamicForm.d.ts +2 -2
- package/lib/components/DynamicFormMobile/useDynamicForm.js +19 -4
- package/lib/index.js +1 -1
- package/lib/utils/szxkFunc.d.ts +11 -0
- package/lib/utils/szxkFunc.js +25 -0
- package/package.json +2 -1
- package/es/utils/enum.d.ts +0 -4
- package/es/utils/enum.js +0 -10
- package/lib/utils/enum.d.ts +0 -4
- package/lib/utils/enum.js +0 -10
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
2
2
|
import { MinusSquareOutlined, PlusSquareOutlined, CloseOutlined, InfoCircleOutlined } from "@ant-design/icons";
|
|
3
|
-
import { handleSetFormItemInitialValue, handleGetPlaceholder, disabledDate } from "./func";
|
|
3
|
+
import { handleSetFormItemInitialValue, getTitle, handleGetPlaceholder, disabledDate } from "./func";
|
|
4
4
|
import { handleUrlOptions, getJson, base64ToString } from "../../utils/method";
|
|
5
5
|
import SelectModelBackfillFormItem from "./selectModelBackfillFormItem";
|
|
6
|
-
import {
|
|
6
|
+
import { useCallback, Fragment } from "react";
|
|
7
7
|
import isoWeek from "dayjs/plugin/isoWeek";
|
|
8
8
|
import SelectModel from "./selectModel";
|
|
9
9
|
import MyCheckbox from "./myCheckbox";
|
|
@@ -34,17 +34,12 @@ function useDynamicForm(props) {
|
|
|
34
34
|
formShowType = "form",
|
|
35
35
|
// 新增:表单展示类型,默认form
|
|
36
36
|
langId,
|
|
37
|
-
// 新增:语言id
|
|
38
|
-
getTitle
|
|
37
|
+
// 新增:语言id,
|
|
38
|
+
getTitle: getTitle$1,
|
|
39
|
+
langData
|
|
40
|
+
// 新增:组件库固定文字语言匹配数据
|
|
39
41
|
} = props;
|
|
40
|
-
const formConfigRef = useRef([]);
|
|
41
42
|
const { message } = App.useApp();
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
if (!formConfig) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
formConfigRef.current = formConfig;
|
|
47
|
-
}, [formConfig]);
|
|
48
43
|
const handleNormFile = useCallback((e) => {
|
|
49
44
|
if (Array.isArray(e)) {
|
|
50
45
|
return e;
|
|
@@ -250,7 +245,9 @@ function useDynamicForm(props) {
|
|
|
250
245
|
if (fields.length > 1) {
|
|
251
246
|
remove(field.name);
|
|
252
247
|
} else {
|
|
253
|
-
message.warning(
|
|
248
|
+
message.warning(
|
|
249
|
+
langId && getTitle(langData, "006") || "至少保留一个表单"
|
|
250
|
+
);
|
|
254
251
|
}
|
|
255
252
|
}
|
|
256
253
|
}
|
|
@@ -277,7 +274,7 @@ function useDynamicForm(props) {
|
|
|
277
274
|
}),
|
|
278
275
|
!isEdit && /* @__PURE__ */ jsx(Flex, { style: { width: 200 }, children: /* @__PURE__ */ jsxs(Button, { type: "dashed", onClick: () => add(), block: true, children: [
|
|
279
276
|
"+ ",
|
|
280
|
-
|
|
277
|
+
getTitle(langData, "004") || "新增"
|
|
281
278
|
] }) })
|
|
282
279
|
] })
|
|
283
280
|
}
|
|
@@ -331,7 +328,7 @@ function useDynamicForm(props) {
|
|
|
331
328
|
if (itemWithJson.attrtype === 0) {
|
|
332
329
|
const initialValue = handleSetFormItemInitialValue(itemWithJson);
|
|
333
330
|
const message2 = (_c = itemWithJson.json) == null ? void 0 : _c["default-prompt"];
|
|
334
|
-
const placeholder = handleGetPlaceholder(itemWithJson, langId);
|
|
331
|
+
const placeholder = handleGetPlaceholder(itemWithJson, langId, langData);
|
|
335
332
|
const { combinations = [] } = itemWithJson.json || {};
|
|
336
333
|
if (combinations == null ? void 0 : combinations.length) {
|
|
337
334
|
return /* @__PURE__ */ jsx(Col, { span: hidden ? 0 : 24 / colNum, children: /* @__PURE__ */ jsx(
|
|
@@ -498,7 +495,7 @@ function useDynamicForm(props) {
|
|
|
498
495
|
const formatValue = handleSetFormItemInitialValue(item);
|
|
499
496
|
const message2 = ((_b = item.json) == null ? void 0 : _b["default-prompt"]) || "";
|
|
500
497
|
const disableDateGoover = ((_c = item.json) == null ? void 0 : _c["disable-date-goover"]) || false;
|
|
501
|
-
const placeholder = handleGetPlaceholder(item, langId);
|
|
498
|
+
const placeholder = handleGetPlaceholder(item, langId, langData);
|
|
502
499
|
const params = item.json.length && {
|
|
503
500
|
maxLength: item.json.length
|
|
504
501
|
} || {};
|
|
@@ -579,7 +576,7 @@ function useDynamicForm(props) {
|
|
|
579
576
|
interfaceTypeSysDict,
|
|
580
577
|
actionUrlKey,
|
|
581
578
|
actionUrlExtraParams,
|
|
582
|
-
getTitle,
|
|
579
|
+
getTitle: getTitle$1,
|
|
583
580
|
langId,
|
|
584
581
|
onChange: (val) => {
|
|
585
582
|
if (val && typeof val === "object" && !Array.isArray(val)) {
|
|
@@ -622,7 +619,7 @@ function useDynamicForm(props) {
|
|
|
622
619
|
item: item.json,
|
|
623
620
|
form,
|
|
624
621
|
attrid,
|
|
625
|
-
getTitle,
|
|
622
|
+
getTitle: getTitle$1,
|
|
626
623
|
value: item.attrvalue || item.json.default || "",
|
|
627
624
|
commonRequestWidthParams,
|
|
628
625
|
commonRequest,
|
|
@@ -696,13 +693,17 @@ function useDynamicForm(props) {
|
|
|
696
693
|
commonRequestWidthParams,
|
|
697
694
|
item: item.json,
|
|
698
695
|
readonly: readonly || ((_r = item.json) == null ? void 0 : _r.readonly),
|
|
699
|
-
|
|
696
|
+
params,
|
|
700
697
|
handleUrlOptions,
|
|
701
698
|
value: formatValue,
|
|
702
699
|
interfaceTypeDict,
|
|
703
700
|
interfaceTypeSysDict,
|
|
704
701
|
actionUrlKey,
|
|
705
702
|
actionUrlExtraParams,
|
|
703
|
+
getTitle: getTitle$1,
|
|
704
|
+
attrid,
|
|
705
|
+
langId,
|
|
706
|
+
langData,
|
|
706
707
|
onChange: (e) => {
|
|
707
708
|
form.setFieldValue(item.attrid, e.target.value);
|
|
708
709
|
}
|
|
@@ -760,7 +761,8 @@ function useDynamicForm(props) {
|
|
|
760
761
|
interfaceTypeSysDict,
|
|
761
762
|
actionUrlKey,
|
|
762
763
|
actionUrlExtraParams,
|
|
763
|
-
langId
|
|
764
|
+
langId,
|
|
765
|
+
langData
|
|
764
766
|
}
|
|
765
767
|
);
|
|
766
768
|
case "radio-card":
|
|
@@ -784,6 +786,8 @@ function useDynamicForm(props) {
|
|
|
784
786
|
readonly: readonly || ((_v = item.json) == null ? void 0 : _v.readonly),
|
|
785
787
|
style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth },
|
|
786
788
|
value: item.attrvalue,
|
|
789
|
+
langId,
|
|
790
|
+
langData,
|
|
787
791
|
onChange: (value) => {
|
|
788
792
|
form.setFieldValue(item.attrid, value);
|
|
789
793
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import dayjs from "dayjs";
|
|
2
2
|
import { message } from "antd";
|
|
3
|
+
import { base64ToString } from "../../utils/method";
|
|
3
4
|
const handleGetPlaceholder = (itemWithJson, langId) => {
|
|
4
5
|
const { input = "" } = (itemWithJson == null ? void 0 : itemWithJson.json) || {};
|
|
5
6
|
let placeholderCn = "请输入", placeholderEn = "Please input";
|
|
@@ -83,6 +84,9 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
|
83
84
|
if (inputType === "time-picker" && !initialValue && ((_g = itemWithJson.json) == null ? void 0 : _g["auto-generate"]) && ((_h = itemWithJson.json) == null ? void 0 : _h["auto-generate-type"]) === "currenttimestamp") {
|
|
84
85
|
initialValue = dayjs().unix().toString();
|
|
85
86
|
}
|
|
87
|
+
if (inputType === "rich-text" && initialValue) {
|
|
88
|
+
initialValue = base64ToString(initialValue);
|
|
89
|
+
}
|
|
86
90
|
if (itemWithJson.attrtype === 1) {
|
|
87
91
|
initialValue = handleGetSingleAttrListObj(itemWithJson.children || []);
|
|
88
92
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const fontSizes = [
|
|
2
|
+
{ value: "12px", label: "12px" },
|
|
3
|
+
{ value: "14px", label: "14px" },
|
|
4
|
+
{ value: "16px", label: "16px" },
|
|
5
|
+
{ value: "18px", label: "18px" },
|
|
6
|
+
{ value: "20px", label: "20px" },
|
|
7
|
+
{ value: "24px", label: "24px" },
|
|
8
|
+
{ value: "28px", label: "28px" },
|
|
9
|
+
{ value: "32px", label: "32px" },
|
|
10
|
+
{ value: "36px", label: "36px" }
|
|
11
|
+
];
|
|
12
|
+
const colors = [
|
|
13
|
+
"#000000",
|
|
14
|
+
"#ffffff",
|
|
15
|
+
"#333333",
|
|
16
|
+
"#666666",
|
|
17
|
+
"#999999",
|
|
18
|
+
"#cccccc",
|
|
19
|
+
"#ff0000",
|
|
20
|
+
"#cc0000",
|
|
21
|
+
"#ff3333",
|
|
22
|
+
"#ff6666",
|
|
23
|
+
"#ff9999",
|
|
24
|
+
"#ffcccc",
|
|
25
|
+
"#ff6600",
|
|
26
|
+
"#cc5200",
|
|
27
|
+
"#ff8533",
|
|
28
|
+
"#ffad66",
|
|
29
|
+
"#ffd4a3",
|
|
30
|
+
"#ffff00",
|
|
31
|
+
"#cccc00",
|
|
32
|
+
"#ffff33",
|
|
33
|
+
"#ffff66",
|
|
34
|
+
"#ffff99",
|
|
35
|
+
"#00cc00",
|
|
36
|
+
"#009900",
|
|
37
|
+
"#33ff33",
|
|
38
|
+
"#66ff66",
|
|
39
|
+
"#99ff99",
|
|
40
|
+
"#00cccc",
|
|
41
|
+
"#009999",
|
|
42
|
+
"#33ffff",
|
|
43
|
+
"#66ffff",
|
|
44
|
+
"#99ffff",
|
|
45
|
+
"#0066ff",
|
|
46
|
+
"#004dcc",
|
|
47
|
+
"#3385ff",
|
|
48
|
+
"#66a3ff",
|
|
49
|
+
"#99c1ff",
|
|
50
|
+
"#9900ff",
|
|
51
|
+
"#7300cc",
|
|
52
|
+
"#b333ff",
|
|
53
|
+
"#cc66ff",
|
|
54
|
+
"#e0a3ff",
|
|
55
|
+
"#ff0099",
|
|
56
|
+
"#cc007a",
|
|
57
|
+
"#ff33aa",
|
|
58
|
+
"#ff66bb",
|
|
59
|
+
"#ff99cc",
|
|
60
|
+
"#996633",
|
|
61
|
+
"#734d29",
|
|
62
|
+
"#b3804d",
|
|
63
|
+
"#cc9966"
|
|
64
|
+
];
|
|
65
|
+
export {
|
|
66
|
+
colors,
|
|
67
|
+
fontSizes
|
|
68
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface IMyRichTextProps {
|
|
3
|
+
item: any;
|
|
4
|
+
readonly: boolean;
|
|
5
|
+
style: React.CSSProperties;
|
|
6
|
+
value: string;
|
|
7
|
+
onChange: (val: string) => void;
|
|
8
|
+
langId?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const MyRichText: ({ item, readonly, style, value, langId, onChange }: IMyRichTextProps) => import("react").JSX.Element | null;
|
|
11
|
+
export default MyRichText;
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEditor, EditorContent } from "@tiptap/react";
|
|
3
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
4
|
+
import { TextStyle } from "@tiptap/extension-text-style";
|
|
5
|
+
import TextAlign from "@tiptap/extension-text-align";
|
|
6
|
+
import Highlight from "@tiptap/extension-highlight";
|
|
7
|
+
import FontSize from "@tiptap/extension-font-size";
|
|
8
|
+
import Color from "@tiptap/extension-color";
|
|
9
|
+
import { useState, useEffect } from "react";
|
|
10
|
+
import { Space, Button, Popup } from "react-vant";
|
|
11
|
+
import { Undo, Redo, Bold, Italic, Underline, Strikethrough, AlignLeft, AlignCenter, AlignRight, List, ListOrdered } from "lucide-react";
|
|
12
|
+
import { fontSizes, colors } from "./enmu";
|
|
13
|
+
const MyRichText = ({ item, readonly, style, value, langId, onChange }) => {
|
|
14
|
+
const [showFontSizePicker, setShowFontSizePicker] = useState(false);
|
|
15
|
+
const [showColorPicker, setShowColorPicker] = useState(false);
|
|
16
|
+
const [selectedSize, setSelectedSize] = useState("16px");
|
|
17
|
+
const [selectedColor, setSelectedColor] = useState("#1677ff");
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const styleSheet = document.createElement("style");
|
|
20
|
+
styleSheet.textContent = `
|
|
21
|
+
.MyRichText_ProseMirror {
|
|
22
|
+
min-height: 200px !important;
|
|
23
|
+
outline: none !important;
|
|
24
|
+
box-shadow: none !important;
|
|
25
|
+
border: none !important;
|
|
26
|
+
padding: 12px;
|
|
27
|
+
font-size: 16px;
|
|
28
|
+
line-height: 1.6;
|
|
29
|
+
}
|
|
30
|
+
.MyRichText_ProseMirror:focus,
|
|
31
|
+
.MyRichText_ProseMirror:focus-visible {
|
|
32
|
+
outline: none !important;
|
|
33
|
+
box-shadow: none !important;
|
|
34
|
+
border: none !important;
|
|
35
|
+
}
|
|
36
|
+
.MyRichText_ProseMirror p {
|
|
37
|
+
min-height: 1.5em;
|
|
38
|
+
margin: 0 0 8px 0;
|
|
39
|
+
padding: 0;
|
|
40
|
+
}
|
|
41
|
+
.MyRichText_ProseMirror h1,
|
|
42
|
+
.MyRichText_ProseMirror h2,
|
|
43
|
+
.MyRichText_ProseMirror h3 {
|
|
44
|
+
margin: 12px 0;
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
document.head.appendChild(styleSheet);
|
|
48
|
+
return () => {
|
|
49
|
+
document.head.removeChild(styleSheet);
|
|
50
|
+
};
|
|
51
|
+
}, []);
|
|
52
|
+
const editor = useEditor({
|
|
53
|
+
extensions: [
|
|
54
|
+
StarterKit,
|
|
55
|
+
Highlight.configure({ multicolor: true }),
|
|
56
|
+
TextAlign.configure({
|
|
57
|
+
types: ["heading", "paragraph"]
|
|
58
|
+
}),
|
|
59
|
+
TextStyle,
|
|
60
|
+
FontSize,
|
|
61
|
+
Color.configure({
|
|
62
|
+
types: ["textStyle"]
|
|
63
|
+
})
|
|
64
|
+
],
|
|
65
|
+
content: value || "<p><br /></p>",
|
|
66
|
+
editable: !readonly,
|
|
67
|
+
editorProps: {
|
|
68
|
+
attributes: {
|
|
69
|
+
class: "MyRichText_ProseMirror"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
onUpdate: ({ editor: editor2 }) => {
|
|
73
|
+
onChange(editor2.getHTML());
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
if (!editor) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
const formatButtons = [
|
|
80
|
+
{
|
|
81
|
+
key: "bold",
|
|
82
|
+
icon: /* @__PURE__ */ jsx(Bold, { size: 18 }),
|
|
83
|
+
label: "粗",
|
|
84
|
+
action: () => editor.chain().focus().toggleBold().run(),
|
|
85
|
+
active: "bold"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
key: "italic",
|
|
89
|
+
icon: /* @__PURE__ */ jsx(Italic, { size: 18 }),
|
|
90
|
+
label: "斜",
|
|
91
|
+
action: () => editor.chain().focus().toggleItalic().run(),
|
|
92
|
+
active: "italic"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: "underline",
|
|
96
|
+
icon: /* @__PURE__ */ jsx(Underline, { size: 18 }),
|
|
97
|
+
label: "下",
|
|
98
|
+
action: () => editor.chain().focus().toggleUnderline().run(),
|
|
99
|
+
active: "underline"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
key: "strike",
|
|
103
|
+
icon: /* @__PURE__ */ jsx(Strikethrough, { size: 18 }),
|
|
104
|
+
label: "删",
|
|
105
|
+
action: () => editor.chain().focus().toggleStrike().run(),
|
|
106
|
+
active: "strike"
|
|
107
|
+
}
|
|
108
|
+
];
|
|
109
|
+
const alignButtons = [
|
|
110
|
+
{
|
|
111
|
+
key: "align-left",
|
|
112
|
+
icon: /* @__PURE__ */ jsx(AlignLeft, { size: 18 }),
|
|
113
|
+
label: "左",
|
|
114
|
+
action: () => editor.chain().focus().setTextAlign("left").run(),
|
|
115
|
+
active: { textAlign: "left" }
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
key: "align-center",
|
|
119
|
+
icon: /* @__PURE__ */ jsx(AlignCenter, { size: 18 }),
|
|
120
|
+
label: "中",
|
|
121
|
+
action: () => editor.chain().focus().setTextAlign("center").run(),
|
|
122
|
+
active: { textAlign: "center" }
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
key: "align-right",
|
|
126
|
+
icon: /* @__PURE__ */ jsx(AlignRight, { size: 18 }),
|
|
127
|
+
label: "右",
|
|
128
|
+
action: () => editor.chain().focus().setTextAlign("right").run(),
|
|
129
|
+
active: { textAlign: "right" }
|
|
130
|
+
}
|
|
131
|
+
];
|
|
132
|
+
const listButtons = [
|
|
133
|
+
{
|
|
134
|
+
key: "bulletList",
|
|
135
|
+
icon: /* @__PURE__ */ jsx(List, { size: 18 }),
|
|
136
|
+
label: "列",
|
|
137
|
+
action: () => editor.chain().focus().toggleBulletList().run(),
|
|
138
|
+
active: "bulletList"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
key: "orderedList",
|
|
142
|
+
icon: /* @__PURE__ */ jsx(ListOrdered, { size: 20 }),
|
|
143
|
+
label: "序",
|
|
144
|
+
action: () => editor.chain().focus().toggleOrderedList().run(),
|
|
145
|
+
active: "orderedList"
|
|
146
|
+
}
|
|
147
|
+
];
|
|
148
|
+
const handleFontSizeChange = (size) => {
|
|
149
|
+
setSelectedSize(size);
|
|
150
|
+
editor.chain().focus().setFontSize(size).run();
|
|
151
|
+
setShowFontSizePicker(false);
|
|
152
|
+
};
|
|
153
|
+
const handleColorChange = (color) => {
|
|
154
|
+
setSelectedColor(color);
|
|
155
|
+
editor.chain().focus().setColor(color).run();
|
|
156
|
+
setShowColorPicker(false);
|
|
157
|
+
};
|
|
158
|
+
return /* @__PURE__ */ jsxs("div", { style: { ...style, border: "1px solid #eee", borderRadius: 8, overflow: "hidden", backgroundColor: "#fff" }, children: [
|
|
159
|
+
/* @__PURE__ */ jsx(
|
|
160
|
+
"div",
|
|
161
|
+
{
|
|
162
|
+
style: {
|
|
163
|
+
padding: "8px 12px",
|
|
164
|
+
background: "#f8f9fa",
|
|
165
|
+
borderBottom: "1px solid #eee"
|
|
166
|
+
},
|
|
167
|
+
children: /* @__PURE__ */ jsxs(Space, { wrap: true, children: [
|
|
168
|
+
formatButtons.map((btn) => /* @__PURE__ */ jsx(
|
|
169
|
+
Button,
|
|
170
|
+
{
|
|
171
|
+
size: "small",
|
|
172
|
+
type: editor.isActive(btn.active) ? "primary" : "default",
|
|
173
|
+
plain: true,
|
|
174
|
+
onClick: btn.action,
|
|
175
|
+
disabled: readonly,
|
|
176
|
+
icon: btn.icon
|
|
177
|
+
},
|
|
178
|
+
btn.key
|
|
179
|
+
)),
|
|
180
|
+
/* @__PURE__ */ jsx(Button, { size: "small", plain: true, onClick: () => setShowFontSizePicker(true), disabled: readonly, children: selectedSize }),
|
|
181
|
+
/* @__PURE__ */ jsx(
|
|
182
|
+
Button,
|
|
183
|
+
{
|
|
184
|
+
size: "small",
|
|
185
|
+
plain: true,
|
|
186
|
+
onClick: () => setShowColorPicker(true),
|
|
187
|
+
disabled: readonly,
|
|
188
|
+
style: {
|
|
189
|
+
width: "32px",
|
|
190
|
+
height: "32px",
|
|
191
|
+
backgroundColor: selectedColor,
|
|
192
|
+
borderRadius: "4px"
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
alignButtons.map((btn) => /* @__PURE__ */ jsx(
|
|
197
|
+
Button,
|
|
198
|
+
{
|
|
199
|
+
size: "small",
|
|
200
|
+
type: editor.isActive(btn.active) ? "primary" : "default",
|
|
201
|
+
plain: true,
|
|
202
|
+
onClick: btn.action,
|
|
203
|
+
disabled: readonly,
|
|
204
|
+
icon: btn.icon
|
|
205
|
+
},
|
|
206
|
+
btn.key
|
|
207
|
+
)),
|
|
208
|
+
listButtons.map((btn) => /* @__PURE__ */ jsx(
|
|
209
|
+
Button,
|
|
210
|
+
{
|
|
211
|
+
size: "small",
|
|
212
|
+
type: editor.isActive(btn.active) ? "primary" : "default",
|
|
213
|
+
plain: true,
|
|
214
|
+
onClick: btn.action,
|
|
215
|
+
disabled: readonly,
|
|
216
|
+
icon: btn.icon
|
|
217
|
+
},
|
|
218
|
+
btn.key
|
|
219
|
+
)),
|
|
220
|
+
/* @__PURE__ */ jsx(
|
|
221
|
+
Button,
|
|
222
|
+
{
|
|
223
|
+
size: "small",
|
|
224
|
+
plain: true,
|
|
225
|
+
onClick: () => editor.chain().focus().undo().run(),
|
|
226
|
+
disabled: readonly || !editor.can().undo(),
|
|
227
|
+
icon: /* @__PURE__ */ jsx(Undo, { size: 18 })
|
|
228
|
+
}
|
|
229
|
+
),
|
|
230
|
+
/* @__PURE__ */ jsx(
|
|
231
|
+
Button,
|
|
232
|
+
{
|
|
233
|
+
size: "small",
|
|
234
|
+
plain: true,
|
|
235
|
+
onClick: () => editor.chain().focus().redo().run(),
|
|
236
|
+
disabled: readonly || !editor.can().redo(),
|
|
237
|
+
icon: /* @__PURE__ */ jsx(Redo, { size: 18 })
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
] })
|
|
241
|
+
}
|
|
242
|
+
),
|
|
243
|
+
/* @__PURE__ */ jsx("div", { onClick: () => editor.chain().focus().run(), children: /* @__PURE__ */ jsx(
|
|
244
|
+
EditorContent,
|
|
245
|
+
{
|
|
246
|
+
editor,
|
|
247
|
+
style: {
|
|
248
|
+
minHeight: 200,
|
|
249
|
+
outline: "none",
|
|
250
|
+
backgroundColor: "#fff"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
) }),
|
|
254
|
+
/* @__PURE__ */ jsx(Popup, { visible: showFontSizePicker, position: "bottom", onClose: () => setShowFontSizePicker(false), children: /* @__PURE__ */ jsxs("div", { style: { padding: "20px" }, children: [
|
|
255
|
+
/* @__PURE__ */ jsx("h3", { style: { textAlign: "center", marginBottom: "16px", fontSize: "16px", fontWeight: "bold" }, children: "选择字体大小" }),
|
|
256
|
+
/* @__PURE__ */ jsx(Space, { wrap: true, style: { justifyContent: "center" }, children: fontSizes.map((size) => /* @__PURE__ */ jsx(
|
|
257
|
+
Button,
|
|
258
|
+
{
|
|
259
|
+
size: "small",
|
|
260
|
+
type: selectedSize === size.value ? "primary" : "default",
|
|
261
|
+
onClick: () => handleFontSizeChange(size.value),
|
|
262
|
+
style: { padding: "8px 16px", margin: "4px" },
|
|
263
|
+
children: size.label
|
|
264
|
+
},
|
|
265
|
+
size.value
|
|
266
|
+
)) })
|
|
267
|
+
] }) }),
|
|
268
|
+
/* @__PURE__ */ jsx(Popup, { visible: showColorPicker, position: "bottom", onClose: () => setShowColorPicker(false), children: /* @__PURE__ */ jsxs("div", { style: { padding: "20px" }, children: [
|
|
269
|
+
/* @__PURE__ */ jsx("h3", { style: { textAlign: "center", marginBottom: "16px", fontSize: "16px", fontWeight: "bold" }, children: "选择文字颜色" }),
|
|
270
|
+
/* @__PURE__ */ jsx(Space, { wrap: true, children: colors.map((color) => /* @__PURE__ */ jsx(
|
|
271
|
+
Button,
|
|
272
|
+
{
|
|
273
|
+
size: "small",
|
|
274
|
+
plain: true,
|
|
275
|
+
onClick: () => handleColorChange(color),
|
|
276
|
+
style: {
|
|
277
|
+
width: "24px",
|
|
278
|
+
height: "24px",
|
|
279
|
+
borderRadius: "50%",
|
|
280
|
+
backgroundColor: color,
|
|
281
|
+
margin: "4px"
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
color
|
|
285
|
+
)) })
|
|
286
|
+
] }) })
|
|
287
|
+
] });
|
|
288
|
+
};
|
|
289
|
+
export {
|
|
290
|
+
MyRichText as default
|
|
291
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
}
|
|
20
20
|
.index-module_checkbox-group_4684b .index-module_checkbox-group-content_f81a1 {
|
|
21
21
|
overflow-y: auto;
|
|
22
|
-
margin-top:
|
|
22
|
+
margin-top: 16px;
|
|
23
23
|
}
|
|
24
24
|
.index-module_checkbox-group_4684b .index-module_checkbox-group-content_f81a1 .index-module_checkbox-item_1b36c {
|
|
25
25
|
font-size: 14px;
|
|
@@ -29,3 +29,11 @@
|
|
|
29
29
|
font-size: 14px;
|
|
30
30
|
color: #999;
|
|
31
31
|
}
|
|
32
|
+
.index-module_checkbox-group_4684b .index-module_checkbox-group-check-all_1e608 {
|
|
33
|
+
border-bottom: 1px solid #e5e5e5;
|
|
34
|
+
padding-top: 40px;
|
|
35
|
+
padding-bottom: 16px;
|
|
36
|
+
}
|
|
37
|
+
.index-module_checkbox-group_4684b .index-module_checkbox-group-check-all_1e608 .index-module_item_4fef5 {
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Ijson } from '
|
|
2
|
+
import { Ijson } from '../../DynamicForm/index.d';
|
|
3
3
|
import { AxiosResponse } from 'axios';
|
|
4
4
|
declare const MySelect: ({ item, readonly, style, commonRequestWidthParams, commonRequest, value, onChange, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, langId, getTitle, attrid, }: {
|
|
5
5
|
item: Ijson;
|