starfish-form-custom 1.0.44 → 1.0.45
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/.pnpm-debug.log +828 -828
- package/components.d.ts +0 -2
- package/dist/{formAction-48f1f081.mjs → formAction-47da9ade.mjs} +44 -52
- package/dist/{index-c2fdc90f.mjs → index-2d78c11c.mjs} +55 -81
- package/dist/{index-e7b2d7c0.mjs → index-b3b75fee.mjs} +39 -92
- package/dist/{index-e8b18d70.mjs → index-d029d3de.mjs} +17 -22
- package/dist/{main-c6aa3683.mjs → main-c9f94a75.mjs} +255 -504
- package/dist/{starfish-form-ac5dbff7.mjs → starfish-form-ff99f526.mjs} +3 -5
- package/dist/starfish-form.mjs +1 -1
- package/dist/style.css +23 -130
- package/dist/types/form/src/common/Loading.vue.d.ts +2 -2
- package/dist/types/form/src/main.d.ts +8 -10
- package/dist/types/form/src/starfish-form.vue.d.ts +8 -10
- package/package.json +43 -52
- package/src/components/RichText/index.vue +64 -179
- package/src/components/Rule/index.vue +2 -2
- package/src/components/Rule/rules.js +3 -3
- package/src/starfish-form.vue +0 -1
- package/src/styles/formedit.scss +115 -115
- package/src/styles/keyvalueConfig.scss +56 -56
- package/src/utils/customHooks.ts +0 -1
- package/stats.html +2230 -2123
- package/dist/types/form/src/common/formAction.vue.d.ts +0 -85
- package/dist/types/form/src/components/RichText/MenuBar.vue.d.ts +0 -34
- package/dist/types/form/src/components/RichText/MenuItem.vue.d.ts +0 -42
- package/src/components/RichText/MenuBar.vue +0 -144
- package/src/components/RichText/MenuItem.vue +0 -98
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { _ as _export_sfc, g as getFormConfig, f as fieldProps, a as __unplugin_components_1 } from './main-c6aa3683.mjs';
|
|
2
1
|
import { ElTooltip } from 'element-plus/es';
|
|
3
2
|
import 'element-plus/es/components/base/style/css';
|
|
4
3
|
import 'element-plus/es/components/tooltip/style/css';
|
|
5
|
-
import { defineComponent, ref,
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import Blockquote from '@tiptap/extension-blockquote';
|
|
10
|
-
import HorizontalRule from '@tiptap/extension-horizontal-rule';
|
|
11
|
-
import CodeBlock from '@tiptap/extension-code-block';
|
|
4
|
+
import { defineComponent, ref, computed, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createCommentVNode, toDisplayString, createBlock, withCtx, withModifiers, createVNode } from 'vue';
|
|
5
|
+
import { QuillEditor } from '@vueup/vue-quill';
|
|
6
|
+
import '@vueup/vue-quill/dist/vue-quill.snow.css';
|
|
7
|
+
import { _ as _export_sfc, g as getFormConfig, f as fieldProps, u as useWatch } from './main-c9f94a75.mjs';
|
|
12
8
|
import 'element-plus/es/components/icon/style/css';
|
|
13
9
|
import 'element-plus/es/components/input/style/css';
|
|
14
10
|
import 'element-plus/es/components/checkbox/style/css';
|
|
@@ -52,94 +48,40 @@ const _sfc_main = defineComponent({
|
|
|
52
48
|
...fieldProps
|
|
53
49
|
},
|
|
54
50
|
components: {
|
|
55
|
-
|
|
56
|
-
MenuBar: __unplugin_components_1
|
|
51
|
+
QuillEditor
|
|
57
52
|
},
|
|
58
53
|
setup(props) {
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
codeBlock: {
|
|
65
|
-
HTMLAttributes: {
|
|
66
|
-
class: "code-block"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}),
|
|
70
|
-
Code.configure({
|
|
71
|
-
HTMLAttributes: {
|
|
72
|
-
class: "inline-code"
|
|
73
|
-
}
|
|
74
|
-
}),
|
|
75
|
-
CodeBlock.configure({
|
|
76
|
-
HTMLAttributes: {
|
|
77
|
-
class: "code-block"
|
|
78
|
-
}
|
|
79
|
-
}),
|
|
80
|
-
Blockquote.configure({
|
|
81
|
-
HTMLAttributes: {
|
|
82
|
-
class: "blockquote"
|
|
83
|
-
}
|
|
84
|
-
}),
|
|
85
|
-
HorizontalRule
|
|
86
|
-
],
|
|
87
|
-
editable: !props.readonly,
|
|
88
|
-
editorProps: {
|
|
89
|
-
attributes: {
|
|
90
|
-
class: "prose focus:outline-none max-w-none",
|
|
91
|
-
style: "min-height: 200px; border: 1px solid #DCDFE6; padding: 8px 12px; background-color: #fff;"
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
// 3. 只在失焦时更新到表单数据
|
|
95
|
-
onBlur: ({ editor: editorInstance }) => {
|
|
96
|
-
const html = editorInstance.getHTML();
|
|
97
|
-
console.log("\u5BCC\u6587\u672C\u5931\u7126\uFF0C\u66F4\u65B0\u8868\u5355\u6570\u636E");
|
|
98
|
-
internalContent.value = html;
|
|
99
|
-
props.data[props.item.data.fieldName] = html;
|
|
100
|
-
}
|
|
101
|
-
// 4. 移除 onUpdate 回调,避免实时更新
|
|
102
|
-
});
|
|
103
|
-
watch(
|
|
104
|
-
() => props.data[props.item.data.fieldName],
|
|
105
|
-
(newValue) => {
|
|
106
|
-
if (!editor.value || editor.value.isDestroyed)
|
|
107
|
-
return;
|
|
108
|
-
if (newValue !== internalContent.value) {
|
|
109
|
-
console.log("\u5916\u90E8\u6570\u636E\u53D8\u5316\uFF0C\u66F4\u65B0\u7F16\u8F91\u5668");
|
|
110
|
-
internalContent.value = newValue || "";
|
|
111
|
-
editor.value.commands.setContent(newValue || "", false);
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
{ immediate: true }
|
|
54
|
+
useWatch(props);
|
|
55
|
+
const quillEditorRef = ref();
|
|
56
|
+
const content = ref(props.data[props.item.data.fieldName] || props.item.data.default || "");
|
|
57
|
+
const isReadonly = computed(
|
|
58
|
+
() => props.readonly || props.item.data.state === "readonly"
|
|
115
59
|
);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
editor.value.destroy();
|
|
60
|
+
const handleContentChange = (value) => {
|
|
61
|
+
content.value = value;
|
|
62
|
+
props.data[props.item.data.fieldName] = value;
|
|
63
|
+
};
|
|
64
|
+
watch(() => props.data[props.item.data.fieldName], (newValue) => {
|
|
65
|
+
if (newValue !== content.value) {
|
|
66
|
+
content.value = newValue || "";
|
|
124
67
|
}
|
|
125
68
|
});
|
|
126
69
|
return {
|
|
127
|
-
|
|
70
|
+
content,
|
|
71
|
+
quillEditorRef,
|
|
72
|
+
handleContentChange,
|
|
73
|
+
isReadonly
|
|
128
74
|
};
|
|
129
75
|
}
|
|
130
76
|
});
|
|
131
|
-
const _withScopeId = (n) => (pushScopeId("data-v-715a995e"), n = n(), popScopeId(), n);
|
|
132
77
|
const _hoisted_1 = ["data-control-type", "data-id"];
|
|
133
78
|
const _hoisted_2 = {
|
|
134
79
|
key: 0,
|
|
135
80
|
class: "item_require"
|
|
136
81
|
};
|
|
137
|
-
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "tip iconfontui icon-tishi" }, null, -1));
|
|
138
|
-
const _hoisted_4 = { class: "rich-text-editor" };
|
|
139
82
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
140
83
|
const _component_el_tooltip = ElTooltip;
|
|
141
|
-
const
|
|
142
|
-
const _component_EditorContent = resolveComponent("EditorContent");
|
|
84
|
+
const _component_QuillEditor = resolveComponent("QuillEditor");
|
|
143
85
|
return openBlock(), createElementBlock("div", {
|
|
144
86
|
class: normalizeClass(["starfish-formitem", { formCover: _ctx.drag, "starfish-vertical": _ctx.labelalign != "top", [_ctx.item.data.csslist?.join(" ")]: !!_ctx.item.data.csslist }]),
|
|
145
87
|
"data-control-type": _ctx.item.ControlType,
|
|
@@ -158,9 +100,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
158
100
|
content: _ctx.item.data.tip,
|
|
159
101
|
placement: "top"
|
|
160
102
|
}, {
|
|
161
|
-
default: withCtx(() => [
|
|
162
|
-
|
|
163
|
-
]),
|
|
103
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
104
|
+
createElementVNode("span", { class: "tip iconfontui icon-tishi" }, null, -1)
|
|
105
|
+
])]),
|
|
164
106
|
_: 1
|
|
165
107
|
}, 8, ["content"])) : createCommentVNode("", true)
|
|
166
108
|
], 6),
|
|
@@ -168,19 +110,24 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
168
110
|
class: "control",
|
|
169
111
|
style: normalizeStyle({ marginLeft: _ctx.labelalign != "top" ? _ctx.labelWidth + "px" : "" })
|
|
170
112
|
}, [
|
|
171
|
-
createElementVNode("div",
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
createVNode(
|
|
177
|
-
|
|
113
|
+
createElementVNode("div", {
|
|
114
|
+
class: "rich-text-editor",
|
|
115
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
116
|
+
}, ["stop"]))
|
|
117
|
+
}, [
|
|
118
|
+
createVNode(_component_QuillEditor, {
|
|
119
|
+
ref: "quillEditorRef",
|
|
120
|
+
theme: "snow",
|
|
121
|
+
content: _ctx.content,
|
|
122
|
+
"onUpdate:content": _ctx.handleContentChange,
|
|
123
|
+
toolbar: "full",
|
|
124
|
+
"read-only": _ctx.isReadonly,
|
|
178
125
|
class: "editor-content"
|
|
179
|
-
}, null, 8, ["
|
|
126
|
+
}, null, 8, ["content", "onUpdate:content", "read-only"])
|
|
180
127
|
])
|
|
181
128
|
], 4)
|
|
182
129
|
], 10, _hoisted_1);
|
|
183
130
|
}
|
|
184
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
131
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-44f321dd"]]);
|
|
185
132
|
|
|
186
133
|
export { index as default };
|
|
@@ -6,7 +6,7 @@ import 'element-plus/es/components/button/style/css';
|
|
|
6
6
|
import 'element-plus/es/components/main/style/css';
|
|
7
7
|
import 'element-plus/es/components/tooltip/style/css';
|
|
8
8
|
import { defineComponent, ref, onMounted, watch, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, createCommentVNode, createBlock, withCtx, createVNode, createTextVNode } from 'vue';
|
|
9
|
-
import { _ as _export_sfc,
|
|
9
|
+
import { _ as _export_sfc, a as _, g as getFormConfig, f as fieldProps, u as useWatch } from './main-c9f94a75.mjs';
|
|
10
10
|
import JSONEditor from 'jsoneditor';
|
|
11
11
|
import 'element-plus/es/components/icon/style/css';
|
|
12
12
|
import 'element-plus/es/components/input/style/css';
|
|
@@ -130,21 +130,14 @@ const _hoisted_1 = {
|
|
|
130
130
|
key: 0,
|
|
131
131
|
class: "item_require"
|
|
132
132
|
};
|
|
133
|
-
const _hoisted_2 =
|
|
134
|
-
const _hoisted_3 = {
|
|
133
|
+
const _hoisted_2 = {
|
|
135
134
|
id: "jsoneditor",
|
|
136
135
|
ref: "jsoneditor"
|
|
137
136
|
};
|
|
138
|
-
const
|
|
139
|
-
const _hoisted_5 = [
|
|
140
|
-
_hoisted_4
|
|
141
|
-
];
|
|
142
|
-
const _hoisted_6 = {
|
|
137
|
+
const _hoisted_3 = {
|
|
143
138
|
ref: "JsonViewerDialogDom",
|
|
144
139
|
style: { "height": "calc(100% - 24px)" }
|
|
145
140
|
};
|
|
146
|
-
const _hoisted_7 = /* @__PURE__ */ createTextVNode("\u4FDD\u5B58");
|
|
147
|
-
const _hoisted_8 = /* @__PURE__ */ createTextVNode("\u5173\u95ED");
|
|
148
141
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
149
142
|
const _component_el_tooltip = ElTooltip;
|
|
150
143
|
const _component_el_main = ElMain;
|
|
@@ -172,9 +165,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
172
165
|
content: _ctx.item.data.tip,
|
|
173
166
|
placement: "top"
|
|
174
167
|
}, {
|
|
175
|
-
default: withCtx(() => [
|
|
176
|
-
|
|
177
|
-
]),
|
|
168
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
169
|
+
createElementVNode("span", { class: "tip iconfontui icon-tishi" }, null, -1)
|
|
170
|
+
])]),
|
|
178
171
|
_: 1
|
|
179
172
|
}, 8, ["content"])) : createCommentVNode("", true)
|
|
180
173
|
], 6),
|
|
@@ -182,11 +175,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
182
175
|
class: "control",
|
|
183
176
|
style: normalizeStyle({ marginLeft: _ctx.labelalign != "top" ? _ctx.labelWidth + "px" : "" })
|
|
184
177
|
}, [
|
|
185
|
-
createElementVNode("div",
|
|
178
|
+
createElementVNode("div", _hoisted_2, [
|
|
186
179
|
createElementVNode("div", {
|
|
187
180
|
class: "fullScreen",
|
|
188
181
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.showCustomDialog && _ctx.showCustomDialog(...args))
|
|
189
|
-
},
|
|
182
|
+
}, [..._cache[2] || (_cache[2] = [
|
|
183
|
+
createElementVNode("i", { class: "iconfontui icon-quanping" }, null, -1)
|
|
184
|
+
])])
|
|
190
185
|
], 512)
|
|
191
186
|
], 4),
|
|
192
187
|
createVNode(_component_CustomDialog, {
|
|
@@ -200,7 +195,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
200
195
|
default: withCtx(() => [
|
|
201
196
|
createVNode(_component_el_main, { class: "my-pageMain" }, {
|
|
202
197
|
default: withCtx(() => [
|
|
203
|
-
createElementVNode("div",
|
|
198
|
+
createElementVNode("div", _hoisted_3, null, 512)
|
|
204
199
|
]),
|
|
205
200
|
_: 1
|
|
206
201
|
}),
|
|
@@ -213,15 +208,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
213
208
|
type: "primary",
|
|
214
209
|
onClick: _ctx.saveJson
|
|
215
210
|
}, {
|
|
216
|
-
default: withCtx(() => [
|
|
217
|
-
|
|
218
|
-
]),
|
|
211
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
212
|
+
createTextVNode("\u4FDD\u5B58", -1)
|
|
213
|
+
])]),
|
|
219
214
|
_: 1
|
|
220
215
|
}, 8, ["onClick"]),
|
|
221
216
|
createVNode(_component_el_button, { onClick: _ctx.closeDialog }, {
|
|
222
|
-
default: withCtx(() => [
|
|
223
|
-
|
|
224
|
-
]),
|
|
217
|
+
default: withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
218
|
+
createTextVNode("\u5173\u95ED", -1)
|
|
219
|
+
])]),
|
|
225
220
|
_: 1
|
|
226
221
|
}, 8, ["onClick"])
|
|
227
222
|
]),
|