@kp-ui/lowcode 1.0.62 → 1.0.65

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.
@@ -1,13 +1,13 @@
1
1
  if (typeof window !== "undefined") {
2
2
  let loadSvg = function() {
3
3
  var body = document.body;
4
- var svgDom = document.getElementById("__svg__icons__dom__1748505452022__");
4
+ var svgDom = document.getElementById("__svg__icons__dom__1748583090408__");
5
5
  if (!svgDom) {
6
6
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
7
7
  svgDom.style.position = "absolute";
8
8
  svgDom.style.width = "0";
9
9
  svgDom.style.height = "0";
10
- svgDom.id = "__svg__icons__dom__1748505452022__";
10
+ svgDom.id = "__svg__icons__dom__1748583090408__";
11
11
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
12
12
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
13
13
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@kp-ui/lowcode",
3
- "version": "1.0.62",
3
+ "version": "1.0.65",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "main": "index.js",
8
8
  "module": "index.js",
9
- "types": "main.d.ts",
9
+ "types": "./types/install.d.ts",
10
10
  "dependencies": {
11
11
  "@element-plus/icons-vue": "^0.2.4",
12
12
  "@kp-ui/tool": "1.0.24",
@@ -23,8 +23,8 @@
23
23
  "lodash-es": "^4.17.21",
24
24
  "mitt": "^3.0.0",
25
25
  "query-string": "^9.1.1",
26
+ "quill": "^2.0.3",
26
27
  "sortablejs": "1.14.0",
27
- "vue": "3.5.11",
28
- "vue3-quill": "^0.3.1"
28
+ "vue": "3.5.11"
29
29
  }
30
30
  }
@@ -3,8 +3,7 @@ import emitter from "../../../../utils/emitter.js";
3
3
  import i18n from "../../../../utils/i18n.js";
4
4
  import { deepClone } from "../../../../utils/util.js";
5
5
  import fieldMixin from "./fieldMixin.js";
6
- import { quillEditor } from "vue3-quill";
7
- import { resolveComponent, createBlock, createCommentVNode, openBlock, withCtx, createElementVNode, normalizeClass, createVNode, normalizeStyle } from "vue";
6
+ import { defineAsyncComponent, resolveComponent, createBlock, createCommentVNode, openBlock, withCtx, createElementVNode, normalizeClass, createVNode, normalizeStyle } from "vue";
8
7
  /* empty css */
9
8
  import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.js";
10
9
  const _sfc_main = {
@@ -40,7 +39,9 @@ const _sfc_main = {
40
39
  },
41
40
  components: {
42
41
  FormItemWrapper,
43
- quillEditor
42
+ QuillEditor: defineAsyncComponent(
43
+ () => import("../../../public/QuillEditor/index.vue.js")
44
+ )
44
45
  },
45
46
  data() {
46
47
  return {
@@ -96,7 +97,7 @@ const _sfc_main = {
96
97
  }
97
98
  };
98
99
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
99
- const _component_quill_editor = resolveComponent("quill-editor");
100
+ const _component_QuillEditor = resolveComponent("QuillEditor");
100
101
  const _component_form_item_wrapper = resolveComponent("form-item-wrapper");
101
102
  return !_ctx.handleHidden() ? (openBlock(), createBlock(_component_form_item_wrapper, {
102
103
  key: 0,
@@ -115,7 +116,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
115
116
  createElementVNode("div", {
116
117
  class: normalizeClass({ "readonly-mode-rich-editor": _ctx.isReadMode })
117
118
  }, [
118
- createVNode(_component_quill_editor, {
119
+ createVNode(_component_QuillEditor, {
119
120
  ref: "fieldEditor",
120
121
  value: $data.fieldModel,
121
122
  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
@@ -133,7 +134,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
133
134
  _: 1
134
135
  }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"])) : createCommentVNode("", true);
135
136
  }
136
- const richEditorWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-29a3f226"]]);
137
+ const richEditorWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-acfa12d8"]]);
137
138
  export {
138
139
  richEditorWidget as default
139
140
  };
@@ -42,12 +42,6 @@ const _sfc_main = {
42
42
  resizable: true,
43
43
  width: 100
44
44
  },
45
- {
46
- title: "最大宽度",
47
- dataIndex: "maxWidth",
48
- resizable: true,
49
- width: 100
50
- },
51
45
  {
52
46
  title: "最小宽度",
53
47
  dataIndex: "minWidth",
@@ -371,7 +365,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
371
365
  }, null, 8, ["onSave", "title"])
372
366
  ], 64);
373
367
  }
374
- const dataTableTableColumnsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-16e10431"]]);
368
+ const dataTableTableColumnsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-790d0d62"]]);
375
369
  export {
376
370
  dataTableTableColumnsEditor as default
377
371
  };
@@ -0,0 +1,150 @@
1
+ /* empty css */
2
+ /* empty css */
3
+ /* empty css */
4
+ import Quill from "quill";
5
+ import { createElementBlock, openBlock, watch, ref, onBeforeUnmount, onMounted, onUnmounted } from "vue";
6
+ import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.js";
7
+ const defaultOptions = {
8
+ theme: "snow",
9
+ boundary: document.body,
10
+ modules: {
11
+ toolbar: [
12
+ ["bold", "italic", "underline", "strike"],
13
+ ["blockquote", "code-block"],
14
+ [{ header: 1 }, { header: 2 }],
15
+ [{ list: "ordered" }, { list: "bullet" }],
16
+ [{ script: "sub" }, { script: "super" }],
17
+ [{ indent: "-1" }, { indent: "+1" }],
18
+ [{ direction: "rtl" }],
19
+ [{ size: ["small", false, "large", "huge"] }],
20
+ [{ header: [1, 2, 3, 4, 5, 6, false] }],
21
+ [{ color: [] }, { background: [] }],
22
+ [{ font: [] }],
23
+ [{ align: [] }],
24
+ ["clean"],
25
+ ["link", "image", "video"]
26
+ ]
27
+ },
28
+ placeholder: "Insert content here ...",
29
+ readOnly: false
30
+ };
31
+ const _sfc_main = {
32
+ name: "quill-editor",
33
+ props: {
34
+ content: String,
35
+ value: String,
36
+ disabled: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ options: {
41
+ type: Object,
42
+ required: false,
43
+ default: () => ({})
44
+ }
45
+ },
46
+ emits: ["ready", "change", "input", "blur", "focus", "update:value"],
47
+ setup(props, context) {
48
+ const state = {
49
+ editorOption: {},
50
+ quill: null
51
+ };
52
+ let _content = "";
53
+ watch(
54
+ () => props.value,
55
+ (val) => {
56
+ if (state.quill) {
57
+ if (val && val !== _content) {
58
+ _content = val;
59
+ state.quill.pasteHTML(val);
60
+ } else if (!val) {
61
+ state.quill.setText("");
62
+ }
63
+ }
64
+ }
65
+ );
66
+ watch(
67
+ () => props.content,
68
+ (val) => {
69
+ if (state.quill) {
70
+ if (val && val !== _content) {
71
+ _content = val;
72
+ state.quill.pasteHTML(val);
73
+ } else if (!val) {
74
+ state.quill.setText("");
75
+ }
76
+ }
77
+ }
78
+ );
79
+ watch(
80
+ () => props.disabled,
81
+ (val) => {
82
+ if (state.quill) {
83
+ state.quill.enable(!val);
84
+ }
85
+ }
86
+ );
87
+ const editor = ref(null);
88
+ const mergeOptions = (def, custom) => {
89
+ for (const key in custom) {
90
+ if (!def[key] || key !== "modules") {
91
+ def[key] = custom[key];
92
+ } else {
93
+ mergeOptions(def[key], custom[key]);
94
+ }
95
+ }
96
+ return def;
97
+ };
98
+ const initialize = () => {
99
+ if (editor.value) {
100
+ state.editorOption = mergeOptions(defaultOptions, props.options);
101
+ state.editorOption.readOnly = props.disabled ? true : false;
102
+ state.quill = new Quill(editor.value, state.editorOption);
103
+ if (props.value) {
104
+ state.quill.pasteHTML(props.value);
105
+ }
106
+ state.quill.on("selection-change", (range) => {
107
+ if (!range) {
108
+ context.emit("blur", state.quill);
109
+ } else {
110
+ context.emit("focus", state.quill);
111
+ }
112
+ });
113
+ state.quill.on("text-change", () => {
114
+ if (props.disabled) {
115
+ state.quill.enable(false);
116
+ }
117
+ let html = editor.value.children[0].innerHTML;
118
+ const quill = state.quill;
119
+ const text = state.quill.getText();
120
+ if (html === "<p><br></p>") html = "";
121
+ _content = html;
122
+ context.emit("update:value", _content);
123
+ context.emit("change", { html, text, quill });
124
+ });
125
+ context.emit("ready", state.quill);
126
+ }
127
+ };
128
+ onBeforeUnmount(() => {
129
+ const editorToolbar = editor.value.previousSibling;
130
+ if (editorToolbar && editorToolbar.nodeType === 1 && editorToolbar.className.indexOf("ql-toolbar") > -1) {
131
+ editorToolbar.parentNode.removeChild(editorToolbar);
132
+ }
133
+ });
134
+ onMounted(() => {
135
+ initialize();
136
+ });
137
+ onUnmounted(() => {
138
+ state.quill = null;
139
+ });
140
+ return { editor };
141
+ }
142
+ };
143
+ const _hoisted_1 = { ref: "editor" };
144
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
145
+ return openBlock(), createElementBlock("section", _hoisted_1, null, 512);
146
+ }
147
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
148
+ export {
149
+ index as default
150
+ };