szld-libs 0.4.46 → 0.4.49

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.
Files changed (110) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/szld-components.es.js +51950 -28754
  3. package/dist/szld-components.umd.js +396 -77
  4. package/es/components/AuthButton/index.d.ts +2 -1
  5. package/es/components/BackHeader/index.d.ts +1 -1
  6. package/es/components/CoralButton/index.d.ts +2 -1
  7. package/es/components/CreateForm/index.d.ts +1 -1
  8. package/es/components/CustomPagination/index.d.ts +2 -1
  9. package/es/components/DynamicForm/func.js +4 -0
  10. package/es/components/DynamicForm/index.d.ts +3 -0
  11. package/es/components/DynamicForm/myCascader/index.d.ts +1 -1
  12. package/es/components/DynamicForm/myCheckbox/index.d.ts +2 -1
  13. package/es/components/DynamicForm/myRadio/index.d.ts +2 -1
  14. package/es/components/DynamicForm/myRichText/index.d.ts +10 -0
  15. package/es/components/DynamicForm/myRichText/index.js +280 -0
  16. package/es/components/DynamicForm/myRichText/vite.svg +1 -0
  17. package/es/components/DynamicForm/mySelect/index.d.ts +2 -1
  18. package/es/components/DynamicForm/mySelect/index.js +51 -15
  19. package/es/components/DynamicForm/myUpload/index.d.ts +2 -1
  20. package/es/components/DynamicForm/radioCard/index.d.ts +1 -1
  21. package/es/components/DynamicForm/selectModel/index.d.ts +1 -1
  22. package/es/components/DynamicForm/selectModelBackfillFormItem/index.d.ts +1 -1
  23. package/es/components/DynamicForm/useDynamicForm.d.ts +1 -1
  24. package/es/components/DynamicForm/useDynamicForm.js +23 -3
  25. package/es/components/DynamicFormMobile/index.js +2 -0
  26. package/es/components/DynamicFormMobile/myCalendar/index.d.ts +2 -1
  27. package/es/components/DynamicFormMobile/myCascader/index.d.ts +1 -1
  28. package/es/components/DynamicFormMobile/myCheckbox/index.d.ts +2 -1
  29. package/es/components/DynamicFormMobile/myRadio/index.d.ts +2 -1
  30. package/es/components/DynamicFormMobile/mySelect/index.d.ts +2 -1
  31. package/es/components/DynamicFormMobile/myUpload/index.d.ts +2 -1
  32. package/es/components/DynamicFormMobile/radioCard/index.d.ts +1 -1
  33. package/es/components/DynamicFormMobile/selectModel/index.d.ts +1 -1
  34. package/es/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +1 -1
  35. package/es/components/DynamicFormMobile/useDynamicForm.d.ts +1 -1
  36. package/es/components/DynamicFormMobile/useDynamicForm.js +2 -0
  37. package/es/components/EditTable/index.d.ts +2 -1
  38. package/es/components/LoopSlide/index.js +1 -0
  39. package/es/components/SearchTable/index.d.ts +2 -1
  40. package/es/components/Upload/index.d.ts +1 -1
  41. package/es/components/VirtualTable/index.d.ts +2 -1
  42. package/es/components/WorkFlowNode/index.d.ts +1 -1
  43. package/es/components/common/403.d.ts +2 -1
  44. package/es/components/common/404.d.ts +2 -1
  45. package/es/hooks/useCaptcha.d.ts +2 -1
  46. package/es/hooks/useChangePwd.js +1 -0
  47. package/es/hooks/useDetailRender.d.ts +3 -2
  48. package/es/hooks/useUniversalTable.js +7 -0
  49. package/es/index.js +6 -9
  50. package/es/mock/index.d.ts +1 -14
  51. package/es/mock/index.js +9 -1404
  52. package/es/utils/formRules.js +6 -0
  53. package/es/utils/hmacSM3.js +40 -4
  54. package/es/utils/method.js +25 -5
  55. package/es/utils/szxkFunc.js +1 -0
  56. package/es/utils/verify-code.js +13 -0
  57. package/lib/components/AuthButton/index.d.ts +2 -1
  58. package/lib/components/BackHeader/index.d.ts +1 -1
  59. package/lib/components/CoralButton/index.d.ts +2 -1
  60. package/lib/components/CreateForm/index.d.ts +1 -1
  61. package/lib/components/CustomPagination/index.d.ts +2 -1
  62. package/lib/components/DynamicForm/func.js +4 -0
  63. package/lib/components/DynamicForm/index.d.ts +3 -0
  64. package/lib/components/DynamicForm/myCascader/index.d.ts +1 -1
  65. package/lib/components/DynamicForm/myCheckbox/index.d.ts +2 -1
  66. package/lib/components/DynamicForm/myRadio/index.d.ts +2 -1
  67. package/lib/components/DynamicForm/myRichText/index.d.ts +10 -0
  68. package/lib/components/DynamicForm/myRichText/index.js +279 -0
  69. package/lib/components/DynamicForm/myRichText/vite.svg +1 -0
  70. package/lib/components/DynamicForm/mySelect/index.d.ts +2 -1
  71. package/lib/components/DynamicForm/mySelect/index.js +49 -13
  72. package/lib/components/DynamicForm/myUpload/index.d.ts +2 -1
  73. package/lib/components/DynamicForm/radioCard/index.d.ts +1 -1
  74. package/lib/components/DynamicForm/selectModel/index.d.ts +1 -1
  75. package/lib/components/DynamicForm/selectModelBackfillFormItem/index.d.ts +1 -1
  76. package/lib/components/DynamicForm/useDynamicForm.d.ts +1 -1
  77. package/lib/components/DynamicForm/useDynamicForm.js +23 -3
  78. package/lib/components/DynamicFormMobile/index.js +2 -0
  79. package/lib/components/DynamicFormMobile/myCalendar/index.d.ts +2 -1
  80. package/lib/components/DynamicFormMobile/myCascader/index.d.ts +1 -1
  81. package/lib/components/DynamicFormMobile/myCheckbox/index.d.ts +2 -1
  82. package/lib/components/DynamicFormMobile/myRadio/index.d.ts +2 -1
  83. package/lib/components/DynamicFormMobile/mySelect/index.d.ts +2 -1
  84. package/lib/components/DynamicFormMobile/myUpload/index.d.ts +2 -1
  85. package/lib/components/DynamicFormMobile/radioCard/index.d.ts +1 -1
  86. package/lib/components/DynamicFormMobile/selectModel/index.d.ts +1 -1
  87. package/lib/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +1 -1
  88. package/lib/components/DynamicFormMobile/useDynamicForm.d.ts +1 -1
  89. package/lib/components/DynamicFormMobile/useDynamicForm.js +2 -0
  90. package/lib/components/EditTable/index.d.ts +2 -1
  91. package/lib/components/LoopSlide/index.js +1 -0
  92. package/lib/components/SearchTable/index.d.ts +2 -1
  93. package/lib/components/Upload/index.d.ts +1 -1
  94. package/lib/components/VirtualTable/index.d.ts +2 -1
  95. package/lib/components/WorkFlowNode/index.d.ts +1 -1
  96. package/lib/components/common/403.d.ts +2 -1
  97. package/lib/components/common/404.d.ts +2 -1
  98. package/lib/hooks/useCaptcha.d.ts +2 -1
  99. package/lib/hooks/useChangePwd.js +1 -0
  100. package/lib/hooks/useDetailRender.d.ts +3 -2
  101. package/lib/hooks/useUniversalTable.js +7 -0
  102. package/lib/index.js +6 -9
  103. package/lib/mock/index.d.ts +1 -14
  104. package/lib/mock/index.js +9 -1404
  105. package/lib/utils/formRules.js +6 -0
  106. package/lib/utils/hmacSM3.js +40 -4
  107. package/lib/utils/method.js +25 -5
  108. package/lib/utils/szxkFunc.js +1 -0
  109. package/lib/utils/verify-code.js +13 -0
  110. package/package.json +10 -1
@@ -0,0 +1,279 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const antd = require("antd");
4
+ const react$1 = require("@tiptap/react");
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 StarterKit = require("@tiptap/starter-kit");
10
+ const Color = require("@tiptap/extension-color");
11
+ const react = require("react");
12
+ const icons = require("@ant-design/icons");
13
+ const MyRichText = ({ item, readonly, style, value, onChange }) => {
14
+ const [color, setColor] = react.useState("#1677ff");
15
+ react.useEffect(() => {
16
+ const styleSheet = document.createElement("style");
17
+ styleSheet.textContent = `
18
+ .MyRichText_ProseMirror {
19
+ min-height: 300px !important;
20
+ outline: none !important;
21
+ box-shadow: none !important;
22
+ border: none !important;
23
+ }
24
+ .MyRichText_ProseMirror:focus,
25
+ .MyRichText_ProseMirror:focus-visible {
26
+ outline: none !important;
27
+ box-shadow: none !important;
28
+ border: none !important;
29
+ }
30
+ .MyRichText_ProseMirror p {
31
+ min-height: 1.5em;
32
+ margin: 0;
33
+ padding: 0;
34
+ }
35
+ `;
36
+ document.head.appendChild(styleSheet);
37
+ return () => {
38
+ document.head.removeChild(styleSheet);
39
+ };
40
+ }, []);
41
+ const editor = react$1.useEditor({
42
+ extensions: [
43
+ StarterKit,
44
+ Highlight.configure({ multicolor: true }),
45
+ TextAlign.configure({
46
+ types: ["heading", "paragraph"]
47
+ }),
48
+ extensionTextStyle.TextStyle,
49
+ FontSize,
50
+ Color.configure({
51
+ types: ["textStyle"]
52
+ })
53
+ ],
54
+ content: value,
55
+ editable: !readonly,
56
+ editorProps: {
57
+ attributes: {
58
+ class: "MyRichText_ProseMirror"
59
+ }
60
+ },
61
+ onUpdate: ({ editor: editor2 }) => {
62
+ onChange(editor2.getHTML());
63
+ }
64
+ });
65
+ if (!editor) {
66
+ return null;
67
+ }
68
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { ...style, border: "1px solid #d9d9d9", borderRadius: 6, overflow: "hidden" }, children: [
69
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { borderBottom: "1px solid #d9d9d9", padding: 8, background: "#fafafa" }, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { wrap: true, children: [
70
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "加粗", children: /* @__PURE__ */ jsxRuntime.jsx(
71
+ antd.Button,
72
+ {
73
+ type: "text",
74
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.BoldOutlined, {}),
75
+ onClick: () => editor.chain().focus().toggleBold().run(),
76
+ disabled: readonly,
77
+ className: editor.isActive("bold") ? "ant-btn-primary" : ""
78
+ }
79
+ ) }),
80
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "斜体", children: /* @__PURE__ */ jsxRuntime.jsx(
81
+ antd.Button,
82
+ {
83
+ type: "text",
84
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ItalicOutlined, {}),
85
+ onClick: () => editor.chain().focus().toggleItalic().run(),
86
+ disabled: readonly,
87
+ className: editor.isActive("italic") ? "ant-btn-primary" : ""
88
+ }
89
+ ) }),
90
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "下划线", children: /* @__PURE__ */ jsxRuntime.jsx(
91
+ antd.Button,
92
+ {
93
+ type: "text",
94
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.UnderlineOutlined, {}),
95
+ onClick: () => editor.chain().focus().toggleUnderline().run(),
96
+ disabled: readonly,
97
+ className: editor.isActive("underline") ? "ant-btn-primary" : ""
98
+ }
99
+ ) }),
100
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "删除线", children: /* @__PURE__ */ jsxRuntime.jsx(
101
+ antd.Button,
102
+ {
103
+ type: "text",
104
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.StrikethroughOutlined, {}),
105
+ onClick: () => editor.chain().focus().toggleStrike().run(),
106
+ disabled: readonly,
107
+ className: editor.isActive("strike") ? "ant-btn-primary" : ""
108
+ }
109
+ ) }),
110
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "清除格式", children: /* @__PURE__ */ jsxRuntime.jsx(
111
+ antd.Button,
112
+ {
113
+ type: "text",
114
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ClearOutlined, {}),
115
+ onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run(),
116
+ disabled: readonly
117
+ }
118
+ ) }),
119
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "文字颜色", children: /* @__PURE__ */ jsxRuntime.jsx(
120
+ antd.ColorPicker,
121
+ {
122
+ value: color,
123
+ size: "small",
124
+ disabled: readonly,
125
+ onChangeComplete: (newColor) => {
126
+ setColor(newColor);
127
+ editor.chain().focus().setColor(newColor.toHexString()).run();
128
+ }
129
+ }
130
+ ) }),
131
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "字体大小", children: /* @__PURE__ */ jsxRuntime.jsx(
132
+ antd.Select,
133
+ {
134
+ defaultValue: "16px",
135
+ style: { width: 100 },
136
+ disabled: readonly,
137
+ onChange: (value2) => {
138
+ editor.chain().focus().setFontSize(value2).run();
139
+ },
140
+ options: [
141
+ { value: "12px", label: "12px" },
142
+ { value: "14px", label: "14px" },
143
+ { value: "16px", label: "16px" },
144
+ { value: "18px", label: "18px" },
145
+ { value: "20px", label: "20px" },
146
+ { value: "24px", label: "24px" },
147
+ { value: "28px", label: "28px" },
148
+ { value: "32px", label: "32px" }
149
+ ],
150
+ suffixIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.FontSizeOutlined, {})
151
+ }
152
+ ) }),
153
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "左对齐", children: /* @__PURE__ */ jsxRuntime.jsx(
154
+ antd.Button,
155
+ {
156
+ type: "text",
157
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.AlignLeftOutlined, {}),
158
+ onClick: () => editor.chain().focus().setTextAlign("left").run(),
159
+ disabled: readonly,
160
+ className: editor.isActive({ textAlign: "left" }) ? "ant-btn-primary" : ""
161
+ }
162
+ ) }),
163
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "居中对齐", children: /* @__PURE__ */ jsxRuntime.jsx(
164
+ antd.Button,
165
+ {
166
+ type: "text",
167
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.AlignCenterOutlined, {}),
168
+ onClick: () => editor.chain().focus().setTextAlign("center").run(),
169
+ disabled: readonly,
170
+ className: editor.isActive({ textAlign: "center" }) ? "ant-btn-primary" : ""
171
+ }
172
+ ) }),
173
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "右对齐", children: /* @__PURE__ */ jsxRuntime.jsx(
174
+ antd.Button,
175
+ {
176
+ type: "text",
177
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.AlignRightOutlined, {}),
178
+ onClick: () => editor.chain().focus().setTextAlign("right").run(),
179
+ disabled: readonly,
180
+ className: editor.isActive({ textAlign: "right" }) ? "ant-btn-primary" : ""
181
+ }
182
+ ) }),
183
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "两端对齐", children: /* @__PURE__ */ jsxRuntime.jsx(
184
+ antd.Button,
185
+ {
186
+ type: "text",
187
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.BlockOutlined, {}),
188
+ onClick: () => editor.chain().focus().setTextAlign("justify").run(),
189
+ disabled: readonly,
190
+ className: editor.isActive({ textAlign: "justify" }) ? "ant-btn-primary" : ""
191
+ }
192
+ ) }),
193
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { width: 1, height: 20, background: "#d9d9d9", margin: "0 8px" } }),
194
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "无序列表", children: /* @__PURE__ */ jsxRuntime.jsx(
195
+ antd.Button,
196
+ {
197
+ type: "text",
198
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.UnorderedListOutlined, {}),
199
+ onClick: () => editor.chain().focus().toggleBulletList().run(),
200
+ disabled: readonly,
201
+ className: editor.isActive("bulletList") ? "ant-btn-primary" : ""
202
+ }
203
+ ) }),
204
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "有序列表", children: /* @__PURE__ */ jsxRuntime.jsx(
205
+ antd.Button,
206
+ {
207
+ type: "text",
208
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.OrderedListOutlined, {}),
209
+ onClick: () => editor.chain().focus().toggleOrderedList().run(),
210
+ disabled: readonly,
211
+ className: editor.isActive("orderedList") ? "ant-btn-primary" : ""
212
+ }
213
+ ) }),
214
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { width: 1, height: 20, background: "#d9d9d9", margin: "0 8px" } }),
215
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "高亮", children: /* @__PURE__ */ jsxRuntime.jsx(
216
+ antd.Button,
217
+ {
218
+ type: "text",
219
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ToolOutlined, {}),
220
+ onClick: () => editor.chain().focus().toggleHighlight().run(),
221
+ disabled: readonly,
222
+ className: editor.isActive("highlight") ? "ant-btn-primary" : ""
223
+ }
224
+ ) }),
225
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { width: 1, height: 20, background: "#d9d9d9", margin: "0 8px" } }),
226
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "链接", children: /* @__PURE__ */ jsxRuntime.jsx(
227
+ antd.Button,
228
+ {
229
+ type: "text",
230
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.LinkOutlined, {}),
231
+ onClick: () => {
232
+ const previousUrl = editor.getAttributes("link").href;
233
+ const url = window.prompt("请输入链接地址", previousUrl);
234
+ if (url === null) {
235
+ return;
236
+ }
237
+ if (url === "") {
238
+ editor.chain().focus().extendMarkRange("link").unsetLink().run();
239
+ return;
240
+ }
241
+ editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
242
+ },
243
+ disabled: readonly
244
+ }
245
+ ) }),
246
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { width: 1, height: 20, background: "#d9d9d9", margin: "0 8px" } }),
247
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "撤销", children: /* @__PURE__ */ jsxRuntime.jsx(
248
+ antd.Button,
249
+ {
250
+ type: "text",
251
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.UndoOutlined, {}),
252
+ onClick: () => editor.chain().focus().undo().run(),
253
+ disabled: readonly || !editor.can().undo()
254
+ }
255
+ ) }),
256
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "前进", children: /* @__PURE__ */ jsxRuntime.jsx(
257
+ antd.Button,
258
+ {
259
+ type: "text",
260
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.RedoOutlined, {}),
261
+ onClick: () => editor.chain().focus().redo().run(),
262
+ disabled: readonly || !editor.can().redo()
263
+ }
264
+ ) })
265
+ ] }) }),
266
+ /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: () => editor.chain().focus().run(), children: /* @__PURE__ */ jsxRuntime.jsx(
267
+ react$1.EditorContent,
268
+ {
269
+ editor,
270
+ style: {
271
+ minHeight: 300,
272
+ padding: "8px",
273
+ outline: "none"
274
+ }
275
+ }
276
+ ) })
277
+ ] });
278
+ };
279
+ 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>
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { Ijson } from '../index.d';
2
3
  import { AxiosResponse } from 'axios';
3
4
  declare const MySelect: ({ item, readonly, style, commonRequestWidthParams, commonRequest, value, onChange, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, langId, getTitle, attrid, }: {
@@ -17,5 +18,5 @@ declare const MySelect: ({ item, readonly, style, commonRequestWidthParams, comm
17
18
  langId?: string | undefined;
18
19
  getTitle?: ((pageID: string, dataID: string) => string) | undefined;
19
20
  attrid: string;
20
- }) => import("react/jsx-runtime").JSX.Element;
21
+ }) => import("react").JSX.Element;
21
22
  export default MySelect;
@@ -17,11 +17,14 @@ const MySelect = ({
17
17
  actionUrlKey,
18
18
  actionUrlExtraParams,
19
19
  langId,
20
+ // 新增:语言id,默认10001
20
21
  getTitle,
22
+ // 新增:获取下拉框选项的语言匹配数据
21
23
  attrid
22
24
  }) => {
23
25
  const [options, setOptions] = react.useState([]);
24
26
  const [loading, setLoading] = react.useState(false);
27
+ const [checkedAll, setCheckedAll] = react.useState(false);
25
28
  const [instanceList, setInstanceList] = react.useState([]);
26
29
  react.useEffect(() => {
27
30
  handleLoadOptions();
@@ -77,6 +80,22 @@ const MySelect = ({
77
80
  setLoading(false);
78
81
  }
79
82
  };
83
+ const handleChange = (val) => {
84
+ if (attrid && (instanceList == null ? void 0 : instanceList.length) > 0 && (item == null ? void 0 : item.inputType) === "instance-url") {
85
+ const keyField = item == null ? void 0 : item["key-field"];
86
+ const row = func.findRowByValue(instanceList, String(val));
87
+ const keys = Object.keys(keyField || {});
88
+ const newObj = keys == null ? void 0 : keys.reduce((prev, cur) => {
89
+ const { list, delimiter } = (keyField == null ? void 0 : keyField[cur]) || {};
90
+ const value2 = list == null ? void 0 : list.map((x) => row == null ? void 0 : row[x]).join(delimiter || "-");
91
+ prev[cur] = value2;
92
+ return prev;
93
+ }, {});
94
+ onChange(newObj);
95
+ return;
96
+ }
97
+ onChange(val);
98
+ };
80
99
  return /* @__PURE__ */ jsxRuntime.jsx(
81
100
  antd.Select,
82
101
  {
@@ -95,20 +114,37 @@ const MySelect = ({
95
114
  maxTagCount: 1,
96
115
  allowClear: true,
97
116
  onChange: (val) => {
98
- if (attrid && (instanceList == null ? void 0 : instanceList.length) > 0 && (item == null ? void 0 : item.inputType) === "instance-url") {
99
- const keyField = item == null ? void 0 : item["key-field"];
100
- const row = func.findRowByValue(instanceList, String(val));
101
- const keys = Object.keys(keyField || {});
102
- const newObj = keys == null ? void 0 : keys.reduce((prev, cur) => {
103
- const { list, delimiter } = (keyField == null ? void 0 : keyField[cur]) || {};
104
- const value2 = list == null ? void 0 : list.map((x) => row == null ? void 0 : row[x]).join(delimiter || "-");
105
- prev[cur] = value2;
106
- return prev;
107
- }, {});
108
- onChange(newObj);
109
- return;
117
+ if (Array.isArray(val) && (item == null ? void 0 : item["custom-operation"]) && item.input === "mult-select") {
118
+ setCheckedAll(false);
119
+ if ((val == null ? void 0 : val.length) === (options == null ? void 0 : options.length)) {
120
+ setCheckedAll(true);
121
+ }
110
122
  }
111
- onChange(val);
123
+ handleChange(val);
124
+ },
125
+ popupRender: (menu) => {
126
+ var _a;
127
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
128
+ menu,
129
+ (item == null ? void 0 : item["custom-operation"]) && item.input === "mult-select" && ((_a = item == null ? void 0 : item["operation-types"]) == null ? void 0 : _a.includes("check-all")) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
130
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Divider, { style: { margin: "8px 0" } }),
131
+ /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "space-between", children: [
132
+ /* @__PURE__ */ jsxRuntime.jsx("div", {}),
133
+ /* @__PURE__ */ jsxRuntime.jsx(
134
+ antd.Checkbox,
135
+ {
136
+ checked: checkedAll,
137
+ onChange: (e) => {
138
+ const val = e.target.checked ? options == null ? void 0 : options.map((v) => v.value) : [];
139
+ setCheckedAll(e.target.checked);
140
+ handleChange(val);
141
+ },
142
+ children: langId === "10001" ? "全选" : "check all"
143
+ }
144
+ )
145
+ ] })
146
+ ] })
147
+ ] });
112
148
  }
113
149
  }
114
150
  );
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { UploadFile } from 'antd/es/upload/interface';
2
3
  import { Ijson } from '../index.d';
3
4
  interface IMYUpload {
@@ -13,5 +14,5 @@ interface IMYUpload {
13
14
  relatedidKey: string;
14
15
  langId?: string;
15
16
  }
16
- declare const MyUpload: (props: IMYUpload) => import("react/jsx-runtime").JSX.Element;
17
+ declare const MyUpload: (props: IMYUpload) => import("react").JSX.Element;
17
18
  export default MyUpload;
@@ -9,5 +9,5 @@ interface RadioCardProps {
9
9
  commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
10
10
  langId?: string;
11
11
  }
12
- declare const RadioCard: ({ item, readonly, value, onChange, style, commonRequestWidthParams, langId }: RadioCardProps) => import("react/jsx-runtime").JSX.Element;
12
+ declare const RadioCard: ({ item, readonly, value, onChange, style, commonRequestWidthParams, langId }: RadioCardProps) => import("react").JSX.Element;
13
13
  export default RadioCard;
@@ -12,7 +12,7 @@ interface SelectModelProps {
12
12
  CustomModalComponent?: React.FC<ICustomModal>;
13
13
  langId?: string;
14
14
  }
15
- declare function SelectModel(props: SelectModelProps): import("react/jsx-runtime").JSX.Element;
15
+ declare function SelectModel(props: SelectModelProps): React.JSX.Element;
16
16
  /**
17
17
  *
18
18
  * @param selectedRows 选中的行数据
@@ -18,5 +18,5 @@ interface SelectModelProps {
18
18
  form: FormInstance;
19
19
  langId?: string;
20
20
  }
21
- declare function SelectModel(props: SelectModelProps): import("react/jsx-runtime").JSX.Element;
21
+ declare function SelectModel(props: SelectModelProps): React.JSX.Element;
22
22
  export default SelectModel;
@@ -37,7 +37,7 @@ declare function useDynamicForm(props: IDynamicFormProps): {
37
37
  isFormListItem?: boolean | undefined;
38
38
  formListField?: NestedFormListFieldData | undefined;
39
39
  isShowLabel?: boolean | undefined;
40
- }) => import("react/jsx-runtime").JSX.Element | null;
40
+ }) => import("react").JSX.Element | null;
41
41
  handleSetFormItemInitialValue: (itemWithJson: IformConfigItem) => any;
42
42
  };
43
43
  export default useDynamicForm;
@@ -15,6 +15,7 @@ const MySelect = require("./mySelect");
15
15
  const MyUpload = require("./myUpload");
16
16
  const MyRadio = require("./myRadio");
17
17
  const antd = require("antd");
18
+ const MyRichText = require("./myRichText");
18
19
  dayjs.extend(isoWeek);
19
20
  function useDynamicForm(props) {
20
21
  const {
@@ -30,8 +31,11 @@ function useDynamicForm(props) {
30
31
  actionUrlExtraParams,
31
32
  CustomModalComponent,
32
33
  isEdit,
34
+ // 新增:是否编辑模式,默认false
33
35
  formShowType = "form",
36
+ // 新增:表单展示类型,默认form
34
37
  langId,
38
+ // 新增:语言id,默认10001
35
39
  getTitle
36
40
  } = props;
37
41
  const formConfigRef = react.useRef([]);
@@ -167,7 +171,8 @@ function useDynamicForm(props) {
167
171
  var _a, _b, _c, _d, _e;
168
172
  return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 10, vertical: instructionShowMode === "flex", align: "center", children: [
169
173
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: itemWithJson.attrname }),
170
- ((_a = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _a.instruction) && instructionShowMode === "icon" && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: (_b = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _b.instruction, children: /* @__PURE__ */ jsxRuntime.jsx(
174
+ ((_a = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _a.instruction) && instructionShowMode === "icon" && // 兼容语言匹配不到时直接展示instruction内容
175
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: (_b = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _b.instruction, children: /* @__PURE__ */ jsxRuntime.jsx(
171
176
  icons.InfoCircleOutlined,
172
177
  {
173
178
  style: {
@@ -487,7 +492,7 @@ function useDynamicForm(props) {
487
492
  defaultWidth = 358,
488
493
  customWidth = {}
489
494
  }) => {
490
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
495
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
491
496
  const mode = item.json.input || "text";
492
497
  const format = ((_a = item.json) == null ? void 0 : _a.format) || "";
493
498
  const attrid = item.attrid;
@@ -582,6 +587,7 @@ function useDynamicForm(props) {
582
587
  form.setFieldsValue({
583
588
  ...form.getFieldsValue(),
584
589
  ...val
590
+ // 此时 TypeScript 能确定 val 是对象,不会报错
585
591
  });
586
592
  return;
587
593
  }
@@ -771,6 +777,19 @@ function useDynamicForm(props) {
771
777
  commonRequestWidthParams
772
778
  }
773
779
  );
780
+ case "rich-text":
781
+ return /* @__PURE__ */ jsxRuntime.jsx(
782
+ MyRichText,
783
+ {
784
+ item: item.json,
785
+ readonly: readonly || ((_v = item.json) == null ? void 0 : _v.readonly),
786
+ style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth },
787
+ value: item.attrvalue,
788
+ onChange: (value) => {
789
+ form.setFieldValue(item.attrid, value);
790
+ }
791
+ }
792
+ );
774
793
  default:
775
794
  return /* @__PURE__ */ jsxRuntime.jsx(
776
795
  antd.Input,
@@ -778,7 +797,7 @@ function useDynamicForm(props) {
778
797
  placeholder: message2 || placeholder,
779
798
  ...params,
780
799
  showCount: true,
781
- disabled: readonly || ((_v = item.json) == null ? void 0 : _v.readonly),
800
+ disabled: readonly || ((_w = item.json) == null ? void 0 : _w.readonly),
782
801
  style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
783
802
  }
784
803
  );
@@ -805,6 +824,7 @@ function useDynamicForm(props) {
805
824
  json: {
806
825
  ...json,
807
826
  ...item.json || {}
827
+ // 确保 item.json 中的动态更新能覆盖解析的值
808
828
  }
809
829
  };
810
830
  if (((_a = itemWithJson.json) == null ? void 0 : _a.hide) === true) {
@@ -81,6 +81,7 @@ const DynamicForm = react.forwardRef((props, ref) => {
81
81
  justify: "space-between",
82
82
  style: {
83
83
  height: 44,
84
+ // width: 'calc(100vw - 32px)',
84
85
  marginLeft: 16,
85
86
  marginRight: 16,
86
87
  borderBottom: "1px solid #E3E3E3"
@@ -104,6 +105,7 @@ const DynamicForm = react.forwardRef((props, ref) => {
104
105
  formItemStyle,
105
106
  isFormListItem: true,
106
107
  formListField: field
108
+ // isShowLabel: false,
107
109
  }) }, index);
108
110
  }) })
109
111
  ]
@@ -1,8 +1,9 @@
1
+ /// <reference types="react" />
1
2
  import { CalendarProps, CalendarType } from 'react-vant';
2
3
  declare const StringCompatibleCalendar: (props: {
3
4
  value?: string | string[] | undefined;
4
5
  onChange?: ((date: string | string[]) => void) | undefined;
5
6
  langId: string;
6
7
  type?: CalendarType | undefined;
7
- } & CalendarProps) => import("react/jsx-runtime").JSX.Element;
8
+ } & CalendarProps) => import("react").JSX.Element;
8
9
  export default StringCompatibleCalendar;
@@ -14,5 +14,5 @@ interface MyCascaderProps {
14
14
  actionUrlExtraParams: object;
15
15
  langId: string;
16
16
  }
17
- declare const MyCascader: ({ item, readonly, value, onChange, style, commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, langId, }: MyCascaderProps) => import("react/jsx-runtime").JSX.Element;
17
+ declare const MyCascader: ({ item, readonly, value, onChange, style, commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, langId, }: MyCascaderProps) => import("react").JSX.Element;
18
18
  export default MyCascader;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AxiosResponse } from 'axios';
2
3
  import { Ijson } from '../../DynamicForm/index.d';
3
4
  export interface IMYRadio {
@@ -16,5 +17,5 @@ export interface IMYRadio {
16
17
  actionUrlExtraParams: object;
17
18
  langId?: string;
18
19
  }
19
- declare const MyCheckbox: (props: IMYRadio) => import("react/jsx-runtime").JSX.Element;
20
+ declare const MyCheckbox: (props: IMYRadio) => import("react").JSX.Element;
20
21
  export default MyCheckbox;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { RadioChangeEvent } from 'antd';
2
3
  import { AxiosResponse } from 'axios';
3
4
  import { Ijson } from '../../DynamicForm/index.d';
@@ -17,5 +18,5 @@ export interface IMYRadio {
17
18
  actionUrlExtraParams: object;
18
19
  langId?: string;
19
20
  }
20
- declare const MyRadio: (props: IMYRadio) => import("react/jsx-runtime").JSX.Element;
21
+ declare const MyRadio: (props: IMYRadio) => import("react").JSX.Element;
21
22
  export default MyRadio;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { Ijson } from '../index.d';
2
3
  import { AxiosResponse } from 'axios';
3
4
  declare const MySelect: ({ item, readonly, style, commonRequestWidthParams, commonRequest, value, onChange, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, langId, getTitle, attrid, }: {
@@ -15,5 +16,5 @@ declare const MySelect: ({ item, readonly, style, commonRequestWidthParams, comm
15
16
  langId?: string | undefined;
16
17
  getTitle?: ((pageID: string, dataID: string) => string) | undefined;
17
18
  attrid?: string | undefined;
18
- }) => import("react/jsx-runtime").JSX.Element;
19
+ }) => import("react").JSX.Element;
19
20
  export default MySelect;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { UploadFile } from 'antd/es/upload/interface';
2
3
  import { Ijson } from '../index.d';
3
4
  interface IMYUpload {
@@ -13,5 +14,5 @@ interface IMYUpload {
13
14
  relatedidKey: string;
14
15
  langId?: string;
15
16
  }
16
- declare const MyUpload: (props: IMYUpload) => import("react/jsx-runtime").JSX.Element;
17
+ declare const MyUpload: (props: IMYUpload) => import("react").JSX.Element;
17
18
  export default MyUpload;
@@ -8,5 +8,5 @@ interface RadioCardProps {
8
8
  style?: React.CSSProperties;
9
9
  commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
10
10
  }
11
- declare const RadioCard: ({ item, readonly, value, onChange, style, commonRequestWidthParams }: RadioCardProps) => import("react/jsx-runtime").JSX.Element;
11
+ declare const RadioCard: ({ item, readonly, value, onChange, style, commonRequestWidthParams }: RadioCardProps) => import("react").JSX.Element;
12
12
  export default RadioCard;
@@ -12,7 +12,7 @@ interface SelectModelProps {
12
12
  CustomModalComponent?: React.FC<ICustomModal>;
13
13
  langId?: string;
14
14
  }
15
- declare function SelectModel(props: SelectModelProps): import("react/jsx-runtime").JSX.Element;
15
+ declare function SelectModel(props: SelectModelProps): React.JSX.Element;
16
16
  /**
17
17
  *
18
18
  * @param selectedRows 选中的行数据
@@ -18,7 +18,7 @@ interface SelectModelProps {
18
18
  langId?: string;
19
19
  getTitle?: (pageID: string, dataID: string) => string;
20
20
  }
21
- declare function SelectModel(props: SelectModelProps): import("react/jsx-runtime").JSX.Element;
21
+ declare function SelectModel(props: SelectModelProps): React.JSX.Element;
22
22
  /**
23
23
  *
24
24
  * @param selectedRows 选中的行数据
@@ -40,7 +40,7 @@ declare function useDynamicForm(props: IDynamicFormProps): {
40
40
  isFormListItem?: boolean | undefined;
41
41
  formListField?: NestedFormListFieldData | undefined;
42
42
  isShowLabel?: boolean | undefined;
43
- }) => import("react/jsx-runtime").JSX.Element | null;
43
+ }) => import("react").JSX.Element | null;
44
44
  handleSetFormItemInitialValue: (itemWithJson: import(".").IformConfigItem) => any;
45
45
  };
46
46
  export default useDynamicForm;