szld-libs 0.4.49 → 0.4.50
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 +18408 -17763
- package/dist/szld-components.umd.js +217 -101
- package/es/components/DynamicForm/myRichText/index.d.ts +2 -1
- package/es/components/DynamicForm/myRichText/index.js +1 -1
- 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 +6 -4
- package/es/mock/index.js +2 -2
- package/lib/components/DynamicForm/myRichText/index.d.ts +2 -1
- package/lib/components/DynamicForm/myRichText/index.js +1 -1
- 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 +6 -4
- package/lib/mock/index.js +2 -2
- 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,21 +1,22 @@
|
|
|
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 {
|
|
3
|
+
import { App, Col, Collapse, Card, Flex, Button, DatePicker, Tooltip } from "antd";
|
|
4
4
|
import { handleUrlOptions, getJson, base64ToString } from "../../utils/method";
|
|
5
|
+
import { handleSetFormItemInitialValue, handleGetPlaceholder } from "./func";
|
|
5
6
|
import SelectModelBackfillFormItem from "./selectModelBackfillFormItem";
|
|
7
|
+
import { Form, Input, DatetimePicker } from "react-vant";
|
|
6
8
|
import { useRef, useEffect, useCallback, Fragment } from "react";
|
|
7
9
|
import isoWeek from "dayjs/plugin/isoWeek";
|
|
8
10
|
import SelectModel from "./selectModel";
|
|
9
11
|
import MyCheckbox from "./myCheckbox";
|
|
10
12
|
import MyCascader from "./myCascader";
|
|
13
|
+
import MyCalendar from "./myCalendar";
|
|
14
|
+
import MyRichText from "./myRichText";
|
|
11
15
|
import dayjs from "dayjs";
|
|
12
16
|
import RadioCard from "./radioCard";
|
|
13
17
|
import MySelect from "./mySelect";
|
|
14
18
|
import MyUpload from "./myUpload";
|
|
15
19
|
import MyRadio from "./myRadio";
|
|
16
|
-
import { App, Col, Collapse, Card, Flex, Button, DatePicker, Tooltip } from "antd";
|
|
17
|
-
import { Form, Input, DatetimePicker } from "react-vant";
|
|
18
|
-
import MyCalendar from "./myCalendar";
|
|
19
20
|
dayjs.extend(isoWeek);
|
|
20
21
|
function useDynamicForm(props) {
|
|
21
22
|
const {
|
|
@@ -757,6 +758,20 @@ function useDynamicForm(props) {
|
|
|
757
758
|
commonRequestWidthParams
|
|
758
759
|
}
|
|
759
760
|
);
|
|
761
|
+
case "rich-text":
|
|
762
|
+
return /* @__PURE__ */ jsx(
|
|
763
|
+
MyRichText,
|
|
764
|
+
{
|
|
765
|
+
langId,
|
|
766
|
+
readonly,
|
|
767
|
+
item: item.json,
|
|
768
|
+
onChange: (val) => {
|
|
769
|
+
form.setFieldValue(item.attrid, val);
|
|
770
|
+
},
|
|
771
|
+
value: formatValue,
|
|
772
|
+
style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
|
|
773
|
+
}
|
|
774
|
+
);
|
|
760
775
|
default:
|
|
761
776
|
return /* @__PURE__ */ jsx(
|
|
762
777
|
Input,
|
package/es/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { handleAttrList, handleSubmitForm } from "./utils/method";
|
|
3
|
-
import { BackHeader,
|
|
3
|
+
import { BackHeader, DynamicFormMobile } from "./main";
|
|
4
4
|
import { BrowserRouter } from "react-router-dom";
|
|
5
|
-
import { ConfigProvider, App
|
|
5
|
+
import { ConfigProvider, App } from "antd";
|
|
6
|
+
import { Form } from "react-vant";
|
|
6
7
|
import { useRef, useState, useEffect } from "react";
|
|
7
8
|
import ReactDOM from "react-dom/client";
|
|
8
9
|
import zhCN from "antd/es/locale/zh_CN";
|
|
@@ -33,13 +34,14 @@ const Demo = () => {
|
|
|
33
34
|
/* @__PURE__ */ jsx(BackHeader, { title: "页头组件", isBack: true }),
|
|
34
35
|
/* @__PURE__ */ jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxs(Form, { form, onValuesChange, layout: "vertical", onFinish, children: [
|
|
35
36
|
/* @__PURE__ */ jsx(
|
|
36
|
-
|
|
37
|
+
DynamicFormMobile,
|
|
37
38
|
{
|
|
38
39
|
formConfig: list,
|
|
39
40
|
readonly: false,
|
|
40
41
|
form,
|
|
41
42
|
relatedid: "guid",
|
|
42
43
|
colNum: 1,
|
|
44
|
+
defaultWidth: 358,
|
|
43
45
|
commonRequestWidthParams: () => {
|
|
44
46
|
return new Promise((resolve, reject) => {
|
|
45
47
|
});
|
|
@@ -54,7 +56,7 @@ const Demo = () => {
|
|
|
54
56
|
langId
|
|
55
57
|
}
|
|
56
58
|
),
|
|
57
|
-
/* @__PURE__ */ jsx(Form.Item, { name: "submit", style: { marginLeft: "auto" }
|
|
59
|
+
/* @__PURE__ */ jsx(Form.Item, { name: "submit", style: { marginLeft: "auto" } })
|
|
58
60
|
] }) }),
|
|
59
61
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
60
62
|
"2. 测试循环滚动组件",
|
package/es/mock/index.js
CHANGED
|
@@ -8,10 +8,10 @@ const attrList = [
|
|
|
8
8
|
attrid: "30BDE6E7977E40069B55DDE61C8795AE",
|
|
9
9
|
attrname: "Dates",
|
|
10
10
|
attrtype: 0,
|
|
11
|
-
info: '{"input":"
|
|
11
|
+
info: '{"input":"mult-select","dataType":"string","data":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],"inputType":"local","length":500,"must":true}',
|
|
12
12
|
info_base64: 0,
|
|
13
13
|
createtime: "2026-02-11 15:12:26",
|
|
14
|
-
attrvalue: "
|
|
14
|
+
attrvalue: "",
|
|
15
15
|
serialnum: 1,
|
|
16
16
|
children: []
|
|
17
17
|
}
|
|
@@ -4,7 +4,8 @@ interface IMyRichTextProps {
|
|
|
4
4
|
readonly: boolean;
|
|
5
5
|
style: React.CSSProperties;
|
|
6
6
|
value: string;
|
|
7
|
+
langId?: string;
|
|
7
8
|
onChange: (val: string) => void;
|
|
8
9
|
}
|
|
9
|
-
declare const MyRichText: ({ item, readonly, style, value, onChange }: IMyRichTextProps) => import("react").JSX.Element | null;
|
|
10
|
+
declare const MyRichText: ({ item, readonly, style, value, langId, onChange }: IMyRichTextProps) => import("react").JSX.Element | null;
|
|
10
11
|
export default MyRichText;
|
|
@@ -10,7 +10,7 @@ const StarterKit = require("@tiptap/starter-kit");
|
|
|
10
10
|
const Color = require("@tiptap/extension-color");
|
|
11
11
|
const react = require("react");
|
|
12
12
|
const icons = require("@ant-design/icons");
|
|
13
|
-
const MyRichText = ({ item, readonly, style, value, onChange }) => {
|
|
13
|
+
const MyRichText = ({ item, readonly, style, value, langId, onChange }) => {
|
|
14
14
|
const [color, setColor] = react.useState("#1677ff");
|
|
15
15
|
react.useEffect(() => {
|
|
16
16
|
const styleSheet = document.createElement("style");
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const dayjs = require("dayjs");
|
|
4
4
|
const antd = require("antd");
|
|
5
|
+
const method = require("../../utils/method");
|
|
5
6
|
const handleGetPlaceholder = (itemWithJson, langId) => {
|
|
6
7
|
const { input = "" } = (itemWithJson == null ? void 0 : itemWithJson.json) || {};
|
|
7
8
|
let placeholderCn = "请输入", placeholderEn = "Please input";
|
|
@@ -85,6 +86,9 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
|
85
86
|
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") {
|
|
86
87
|
initialValue = dayjs().unix().toString();
|
|
87
88
|
}
|
|
89
|
+
if (inputType === "rich-text" && initialValue) {
|
|
90
|
+
initialValue = method.base64ToString(initialValue);
|
|
91
|
+
}
|
|
88
92
|
if (itemWithJson.attrtype === 1) {
|
|
89
93
|
initialValue = handleGetSingleAttrListObj(itemWithJson.children || []);
|
|
90
94
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const fontSizes = [
|
|
4
|
+
{ value: "12px", label: "12px" },
|
|
5
|
+
{ value: "14px", label: "14px" },
|
|
6
|
+
{ value: "16px", label: "16px" },
|
|
7
|
+
{ value: "18px", label: "18px" },
|
|
8
|
+
{ value: "20px", label: "20px" },
|
|
9
|
+
{ value: "24px", label: "24px" },
|
|
10
|
+
{ value: "28px", label: "28px" },
|
|
11
|
+
{ value: "32px", label: "32px" },
|
|
12
|
+
{ value: "36px", label: "36px" }
|
|
13
|
+
];
|
|
14
|
+
const colors = [
|
|
15
|
+
"#000000",
|
|
16
|
+
"#ffffff",
|
|
17
|
+
"#333333",
|
|
18
|
+
"#666666",
|
|
19
|
+
"#999999",
|
|
20
|
+
"#cccccc",
|
|
21
|
+
"#ff0000",
|
|
22
|
+
"#cc0000",
|
|
23
|
+
"#ff3333",
|
|
24
|
+
"#ff6666",
|
|
25
|
+
"#ff9999",
|
|
26
|
+
"#ffcccc",
|
|
27
|
+
"#ff6600",
|
|
28
|
+
"#cc5200",
|
|
29
|
+
"#ff8533",
|
|
30
|
+
"#ffad66",
|
|
31
|
+
"#ffd4a3",
|
|
32
|
+
"#ffff00",
|
|
33
|
+
"#cccc00",
|
|
34
|
+
"#ffff33",
|
|
35
|
+
"#ffff66",
|
|
36
|
+
"#ffff99",
|
|
37
|
+
"#00cc00",
|
|
38
|
+
"#009900",
|
|
39
|
+
"#33ff33",
|
|
40
|
+
"#66ff66",
|
|
41
|
+
"#99ff99",
|
|
42
|
+
"#00cccc",
|
|
43
|
+
"#009999",
|
|
44
|
+
"#33ffff",
|
|
45
|
+
"#66ffff",
|
|
46
|
+
"#99ffff",
|
|
47
|
+
"#0066ff",
|
|
48
|
+
"#004dcc",
|
|
49
|
+
"#3385ff",
|
|
50
|
+
"#66a3ff",
|
|
51
|
+
"#99c1ff",
|
|
52
|
+
"#9900ff",
|
|
53
|
+
"#7300cc",
|
|
54
|
+
"#b333ff",
|
|
55
|
+
"#cc66ff",
|
|
56
|
+
"#e0a3ff",
|
|
57
|
+
"#ff0099",
|
|
58
|
+
"#cc007a",
|
|
59
|
+
"#ff33aa",
|
|
60
|
+
"#ff66bb",
|
|
61
|
+
"#ff99cc",
|
|
62
|
+
"#996633",
|
|
63
|
+
"#734d29",
|
|
64
|
+
"#b3804d",
|
|
65
|
+
"#cc9966"
|
|
66
|
+
];
|
|
67
|
+
exports.colors = colors;
|
|
68
|
+
exports.fontSizes = fontSizes;
|
|
@@ -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,290 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const react$1 = require("@tiptap/react");
|
|
4
|
+
const StarterKit = require("@tiptap/starter-kit");
|
|
5
|
+
const extensionTextStyle = require("@tiptap/extension-text-style");
|
|
6
|
+
const TextAlign = require("@tiptap/extension-text-align");
|
|
7
|
+
const Highlight = require("@tiptap/extension-highlight");
|
|
8
|
+
const FontSize = require("@tiptap/extension-font-size");
|
|
9
|
+
const Color = require("@tiptap/extension-color");
|
|
10
|
+
const react = require("react");
|
|
11
|
+
const reactVant = require("react-vant");
|
|
12
|
+
const lucideReact = require("lucide-react");
|
|
13
|
+
const enmu = require("./enmu");
|
|
14
|
+
const MyRichText = ({ item, readonly, style, value, langId, onChange }) => {
|
|
15
|
+
const [showFontSizePicker, setShowFontSizePicker] = react.useState(false);
|
|
16
|
+
const [showColorPicker, setShowColorPicker] = react.useState(false);
|
|
17
|
+
const [selectedSize, setSelectedSize] = react.useState("16px");
|
|
18
|
+
const [selectedColor, setSelectedColor] = react.useState("#1677ff");
|
|
19
|
+
react.useEffect(() => {
|
|
20
|
+
const styleSheet = document.createElement("style");
|
|
21
|
+
styleSheet.textContent = `
|
|
22
|
+
.MyRichText_ProseMirror {
|
|
23
|
+
min-height: 200px !important;
|
|
24
|
+
outline: none !important;
|
|
25
|
+
box-shadow: none !important;
|
|
26
|
+
border: none !important;
|
|
27
|
+
padding: 12px;
|
|
28
|
+
font-size: 16px;
|
|
29
|
+
line-height: 1.6;
|
|
30
|
+
}
|
|
31
|
+
.MyRichText_ProseMirror:focus,
|
|
32
|
+
.MyRichText_ProseMirror:focus-visible {
|
|
33
|
+
outline: none !important;
|
|
34
|
+
box-shadow: none !important;
|
|
35
|
+
border: none !important;
|
|
36
|
+
}
|
|
37
|
+
.MyRichText_ProseMirror p {
|
|
38
|
+
min-height: 1.5em;
|
|
39
|
+
margin: 0 0 8px 0;
|
|
40
|
+
padding: 0;
|
|
41
|
+
}
|
|
42
|
+
.MyRichText_ProseMirror h1,
|
|
43
|
+
.MyRichText_ProseMirror h2,
|
|
44
|
+
.MyRichText_ProseMirror h3 {
|
|
45
|
+
margin: 12px 0;
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
document.head.appendChild(styleSheet);
|
|
49
|
+
return () => {
|
|
50
|
+
document.head.removeChild(styleSheet);
|
|
51
|
+
};
|
|
52
|
+
}, []);
|
|
53
|
+
const editor = react$1.useEditor({
|
|
54
|
+
extensions: [
|
|
55
|
+
StarterKit,
|
|
56
|
+
Highlight.configure({ multicolor: true }),
|
|
57
|
+
TextAlign.configure({
|
|
58
|
+
types: ["heading", "paragraph"]
|
|
59
|
+
}),
|
|
60
|
+
extensionTextStyle.TextStyle,
|
|
61
|
+
FontSize,
|
|
62
|
+
Color.configure({
|
|
63
|
+
types: ["textStyle"]
|
|
64
|
+
})
|
|
65
|
+
],
|
|
66
|
+
content: value || "<p><br /></p>",
|
|
67
|
+
editable: !readonly,
|
|
68
|
+
editorProps: {
|
|
69
|
+
attributes: {
|
|
70
|
+
class: "MyRichText_ProseMirror"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
onUpdate: ({ editor: editor2 }) => {
|
|
74
|
+
onChange(editor2.getHTML());
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
if (!editor) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const formatButtons = [
|
|
81
|
+
{
|
|
82
|
+
key: "bold",
|
|
83
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bold, { size: 18 }),
|
|
84
|
+
label: "粗",
|
|
85
|
+
action: () => editor.chain().focus().toggleBold().run(),
|
|
86
|
+
active: "bold"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
key: "italic",
|
|
90
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Italic, { size: 18 }),
|
|
91
|
+
label: "斜",
|
|
92
|
+
action: () => editor.chain().focus().toggleItalic().run(),
|
|
93
|
+
active: "italic"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
key: "underline",
|
|
97
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Underline, { size: 18 }),
|
|
98
|
+
label: "下",
|
|
99
|
+
action: () => editor.chain().focus().toggleUnderline().run(),
|
|
100
|
+
active: "underline"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
key: "strike",
|
|
104
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Strikethrough, { size: 18 }),
|
|
105
|
+
label: "删",
|
|
106
|
+
action: () => editor.chain().focus().toggleStrike().run(),
|
|
107
|
+
active: "strike"
|
|
108
|
+
}
|
|
109
|
+
];
|
|
110
|
+
const alignButtons = [
|
|
111
|
+
{
|
|
112
|
+
key: "align-left",
|
|
113
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignLeft, { size: 18 }),
|
|
114
|
+
label: "左",
|
|
115
|
+
action: () => editor.chain().focus().setTextAlign("left").run(),
|
|
116
|
+
active: { textAlign: "left" }
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
key: "align-center",
|
|
120
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignCenter, { size: 18 }),
|
|
121
|
+
label: "中",
|
|
122
|
+
action: () => editor.chain().focus().setTextAlign("center").run(),
|
|
123
|
+
active: { textAlign: "center" }
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
key: "align-right",
|
|
127
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignRight, { size: 18 }),
|
|
128
|
+
label: "右",
|
|
129
|
+
action: () => editor.chain().focus().setTextAlign("right").run(),
|
|
130
|
+
active: { textAlign: "right" }
|
|
131
|
+
}
|
|
132
|
+
];
|
|
133
|
+
const listButtons = [
|
|
134
|
+
{
|
|
135
|
+
key: "bulletList",
|
|
136
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.List, { size: 18 }),
|
|
137
|
+
label: "列",
|
|
138
|
+
action: () => editor.chain().focus().toggleBulletList().run(),
|
|
139
|
+
active: "bulletList"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
key: "orderedList",
|
|
143
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListOrdered, { size: 20 }),
|
|
144
|
+
label: "序",
|
|
145
|
+
action: () => editor.chain().focus().toggleOrderedList().run(),
|
|
146
|
+
active: "orderedList"
|
|
147
|
+
}
|
|
148
|
+
];
|
|
149
|
+
const handleFontSizeChange = (size) => {
|
|
150
|
+
setSelectedSize(size);
|
|
151
|
+
editor.chain().focus().setFontSize(size).run();
|
|
152
|
+
setShowFontSizePicker(false);
|
|
153
|
+
};
|
|
154
|
+
const handleColorChange = (color) => {
|
|
155
|
+
setSelectedColor(color);
|
|
156
|
+
editor.chain().focus().setColor(color).run();
|
|
157
|
+
setShowColorPicker(false);
|
|
158
|
+
};
|
|
159
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { ...style, border: "1px solid #eee", borderRadius: 8, overflow: "hidden", backgroundColor: "#fff" }, children: [
|
|
160
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
161
|
+
"div",
|
|
162
|
+
{
|
|
163
|
+
style: {
|
|
164
|
+
padding: "8px 12px",
|
|
165
|
+
background: "#f8f9fa",
|
|
166
|
+
borderBottom: "1px solid #eee"
|
|
167
|
+
},
|
|
168
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(reactVant.Space, { wrap: true, children: [
|
|
169
|
+
formatButtons.map((btn) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
170
|
+
reactVant.Button,
|
|
171
|
+
{
|
|
172
|
+
size: "small",
|
|
173
|
+
type: editor.isActive(btn.active) ? "primary" : "default",
|
|
174
|
+
plain: true,
|
|
175
|
+
onClick: btn.action,
|
|
176
|
+
disabled: readonly,
|
|
177
|
+
icon: btn.icon
|
|
178
|
+
},
|
|
179
|
+
btn.key
|
|
180
|
+
)),
|
|
181
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactVant.Button, { size: "small", plain: true, onClick: () => setShowFontSizePicker(true), disabled: readonly, children: selectedSize }),
|
|
182
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
183
|
+
reactVant.Button,
|
|
184
|
+
{
|
|
185
|
+
size: "small",
|
|
186
|
+
plain: true,
|
|
187
|
+
onClick: () => setShowColorPicker(true),
|
|
188
|
+
disabled: readonly,
|
|
189
|
+
style: {
|
|
190
|
+
width: "32px",
|
|
191
|
+
height: "32px",
|
|
192
|
+
backgroundColor: selectedColor,
|
|
193
|
+
borderRadius: "4px"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
alignButtons.map((btn) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
198
|
+
reactVant.Button,
|
|
199
|
+
{
|
|
200
|
+
size: "small",
|
|
201
|
+
type: editor.isActive(btn.active) ? "primary" : "default",
|
|
202
|
+
plain: true,
|
|
203
|
+
onClick: btn.action,
|
|
204
|
+
disabled: readonly,
|
|
205
|
+
icon: btn.icon
|
|
206
|
+
},
|
|
207
|
+
btn.key
|
|
208
|
+
)),
|
|
209
|
+
listButtons.map((btn) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
210
|
+
reactVant.Button,
|
|
211
|
+
{
|
|
212
|
+
size: "small",
|
|
213
|
+
type: editor.isActive(btn.active) ? "primary" : "default",
|
|
214
|
+
plain: true,
|
|
215
|
+
onClick: btn.action,
|
|
216
|
+
disabled: readonly,
|
|
217
|
+
icon: btn.icon
|
|
218
|
+
},
|
|
219
|
+
btn.key
|
|
220
|
+
)),
|
|
221
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
222
|
+
reactVant.Button,
|
|
223
|
+
{
|
|
224
|
+
size: "small",
|
|
225
|
+
plain: true,
|
|
226
|
+
onClick: () => editor.chain().focus().undo().run(),
|
|
227
|
+
disabled: readonly || !editor.can().undo(),
|
|
228
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Undo, { size: 18 })
|
|
229
|
+
}
|
|
230
|
+
),
|
|
231
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
232
|
+
reactVant.Button,
|
|
233
|
+
{
|
|
234
|
+
size: "small",
|
|
235
|
+
plain: true,
|
|
236
|
+
onClick: () => editor.chain().focus().redo().run(),
|
|
237
|
+
disabled: readonly || !editor.can().redo(),
|
|
238
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Redo, { size: 18 })
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
] })
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { onClick: () => editor.chain().focus().run(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
245
|
+
react$1.EditorContent,
|
|
246
|
+
{
|
|
247
|
+
editor,
|
|
248
|
+
style: {
|
|
249
|
+
minHeight: 200,
|
|
250
|
+
outline: "none",
|
|
251
|
+
backgroundColor: "#fff"
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
) }),
|
|
255
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactVant.Popup, { visible: showFontSizePicker, position: "bottom", onClose: () => setShowFontSizePicker(false), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "20px" }, children: [
|
|
256
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: { textAlign: "center", marginBottom: "16px", fontSize: "16px", fontWeight: "bold" }, children: "选择字体大小" }),
|
|
257
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactVant.Space, { wrap: true, style: { justifyContent: "center" }, children: enmu.fontSizes.map((size) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
258
|
+
reactVant.Button,
|
|
259
|
+
{
|
|
260
|
+
size: "small",
|
|
261
|
+
type: selectedSize === size.value ? "primary" : "default",
|
|
262
|
+
onClick: () => handleFontSizeChange(size.value),
|
|
263
|
+
style: { padding: "8px 16px", margin: "4px" },
|
|
264
|
+
children: size.label
|
|
265
|
+
},
|
|
266
|
+
size.value
|
|
267
|
+
)) })
|
|
268
|
+
] }) }),
|
|
269
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactVant.Popup, { visible: showColorPicker, position: "bottom", onClose: () => setShowColorPicker(false), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "20px" }, children: [
|
|
270
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: { textAlign: "center", marginBottom: "16px", fontSize: "16px", fontWeight: "bold" }, children: "选择文字颜色" }),
|
|
271
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactVant.Space, { wrap: true, children: enmu.colors.map((color) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
272
|
+
reactVant.Button,
|
|
273
|
+
{
|
|
274
|
+
size: "small",
|
|
275
|
+
plain: true,
|
|
276
|
+
onClick: () => handleColorChange(color),
|
|
277
|
+
style: {
|
|
278
|
+
width: "24px",
|
|
279
|
+
height: "24px",
|
|
280
|
+
borderRadius: "50%",
|
|
281
|
+
backgroundColor: color,
|
|
282
|
+
margin: "4px"
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
color
|
|
286
|
+
)) })
|
|
287
|
+
] }) })
|
|
288
|
+
] });
|
|
289
|
+
};
|
|
290
|
+
module.exports = MyRichText;
|
|
@@ -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;
|