asai-vue-host-form 0.2.9 → 0.2.13

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.
@@ -0,0 +1,44 @@
1
+ import { defineComponent as p, onUnmounted as c, resolveComponent as u, createElementBlock as n, openBlock as d, createVNode as l } from "vue";
2
+ const A = { class: "as-form-area" }, f = /* @__PURE__ */ p({
3
+ __name: "AsaiForm",
4
+ props: {
5
+ ujt: {},
6
+ asaidata: {},
7
+ opt: {}
8
+ },
9
+ setup(e) {
10
+ const a = e, { $fn: s } = a.ujt, { get: r, clear: m } = s.createComponentLoader({
11
+ files: /* @__PURE__ */ Object.assign({ "./AsaiFormLabel.vue": () => import("./AsaiFormLabel-BAXvUybW.mjs"), "./AsaiFormLabelArea.vue": () => import("./AsaiFormLabelArea-CmjCZFfF.mjs"), "./AsaiFormLi.vue": () => import("./AsaiFormLi-B-Po6qaB.mjs"), "./AsaiFormObject.vue": () => import("./AsaiFormObject-B8WHlNwq.mjs"), "./AsaiFormShow.vue": () => import("./AsaiFormShow-Da4NJXK7.mjs"), "./AsaiInput.vue": () => import("./AsaiInput-DahcJZqh.mjs"), "./AsaiRichEditor.vue": () => import("./AsaiRichEditor-DDOCr12f.mjs"), "./AsaiSelect.vue": () => import("./AsaiSelect-B4KZbNRO.mjs"), "./AsaiSelectCl.vue": () => import("./AsaiSelectCl-DY_5Y--8.mjs"), "./AsaiSelectLv.vue": () => import("./AsaiSelectLv-DNjfTp67.mjs"), "./AsaiTextJson.vue": () => import("./AsaiTextJson-Dr7yX0_I.mjs"), "./AsaiTextarea.vue": () => import("./AsaiTextarea-O38xA-tq.mjs"), "./AsaiUpBinary.vue": () => import("./AsaiUpBinary-DFmYr2_2.mjs"), "./AsaiUpload.vue": () => import("./AsaiUpload-D4kzZ5_G.mjs"), "./AsaiUploadImg.vue": () => import("./AsaiUploadImg-D8mMVNdc.mjs"), "./AsaiUploadImgCut.vue": () => import("./AsaiUploadImgCut-B3Y2hppn.mjs"), "./AsaiUploadImgCutPop.vue": () => import("./AsaiUploadImgCutPop-0gVLGw9m.mjs") }),
12
+ // 扫描当前目录下所有.vue文件
13
+ eager: !1,
14
+ // 异步加载(按需加载)
15
+ cache: !0,
16
+ // 启用缓存
17
+ cacheKey: "form_",
18
+ // 缓存键前缀(避免冲突)
19
+ target: a.asaidata,
20
+ // 将组件映射写入 asaidata
21
+ targetKey: "comp"
22
+ // 写入 asaidata.comp
23
+ });
24
+ return a.asaidata.cmComp = (t) => {
25
+ const { comp: i, rule: o } = a.asaidata;
26
+ return o?.[t]?.comp && i[o[t].comp] ? r(o[t].comp) : i[t] ? r(t) : t === "object" && i?.object ? r("object") : null;
27
+ }, a.opt?.isedit && (a.asaidata.isedit = 1), c(() => {
28
+ m(), a.asaidata && (a.asaidata.cmComp = null);
29
+ }), (t, i) => {
30
+ const o = u("AsaiFormLi");
31
+ return d(), n("div", A, [
32
+ l(o, {
33
+ ujt: e.ujt,
34
+ asaidata: e.asaidata,
35
+ formdata: e.asaidata.data,
36
+ opt: e.opt
37
+ }, null, 8, ["ujt", "asaidata", "formdata", "opt"])
38
+ ]);
39
+ };
40
+ }
41
+ });
42
+ export {
43
+ f as default
44
+ };
@@ -0,0 +1,46 @@
1
+ import { defineComponent as n, resolveComponent as d, createBlock as f, openBlock as t, withCtx as s, createElementBlock as r, renderSlot as c, createCommentVNode as u, Fragment as y, normalizeClass as i, toDisplayString as m } from "vue";
2
+ const k = { key: 3 }, A = /* @__PURE__ */ n({
3
+ __name: "AsaiFormLabel",
4
+ props: {
5
+ ujt: {},
6
+ asaidata: {},
7
+ formdata: {},
8
+ formkey: {}
9
+ },
10
+ setup(a) {
11
+ const e = a;
12
+ return (o, b) => {
13
+ const l = d("AsaiFormLabelArea");
14
+ return t(), f(l, {
15
+ ujt: a.ujt,
16
+ asaidata: a.asaidata,
17
+ formdata: a.formdata,
18
+ formkey: a.formkey
19
+ }, {
20
+ default: s(() => [
21
+ e.asaidata.notit ? (t(), r(y, { key: 0 }, [], 64)) : Array.isArray(e.formdata) ? (t(), r("span", {
22
+ key: 1,
23
+ class: i({
24
+ "as-label-ico-arr": a.asaidata.ic > 1 && typeof e.formdata[a.formkey] != "number",
25
+ "as-label-ico-arr-num": a.asaidata.ic > 1 && typeof e.formdata[a.formkey] == "number",
26
+ "as-label-require": a.asaidata?.rule?.[a.formkey]?.require
27
+ })
28
+ }, null, 2)) : (t(), r("span", {
29
+ key: 2,
30
+ class: i({
31
+ "as-label-ico": a.asaidata.ic > 1 && typeof e.formdata[a.formkey] != "number",
32
+ "as-label-ico-num": a.asaidata.ic > 1 && typeof e.formdata[a.formkey] == "number",
33
+ "as-label-require": a.asaidata?.rule?.[a.formkey]?.require
34
+ })
35
+ }, m(a.asaidata.eq > 2 ? '"' : "") + m(e.asaidata?.lang?.[a.formkey] || a.formkey) + m(a.asaidata.eq > 2 ? '"' : "") + m(a.asaidata.eq ? ":" : ""), 3)),
36
+ c(o.$slots, "default"),
37
+ a.asaidata.eq > 2 ? (t(), r("span", k, ",")) : u("", !0)
38
+ ]),
39
+ _: 3
40
+ }, 8, ["ujt", "asaidata", "formdata", "formkey"]);
41
+ };
42
+ }
43
+ });
44
+ export {
45
+ A as default
46
+ };
@@ -0,0 +1,29 @@
1
+ import { defineComponent as f, createElementBlock as t, openBlock as s, normalizeStyle as o, normalizeClass as r, renderSlot as m } from "vue";
2
+ const d = /* @__PURE__ */ f({
3
+ __name: "AsaiFormLabelArea",
4
+ props: {
5
+ ujt: {},
6
+ asaidata: {},
7
+ formdata: {},
8
+ formkey: {}
9
+ },
10
+ setup(a) {
11
+ const e = a;
12
+ return (l, n) => e.asaidata.rule?.[a.formkey]?.nolabel || typeof e.formdata?.[a.formkey] == "object" ? (s(), t("div", {
13
+ key: 0,
14
+ class: r(["label", a.asaidata?.rule?.[a.formkey]?.class || ""]),
15
+ style: o(a.asaidata?.rule?.[a.formkey]?.style || "")
16
+ }, [
17
+ m(l.$slots, "default")
18
+ ], 6)) : (s(), t("label", {
19
+ key: 1,
20
+ class: r(a.asaidata?.rule?.[a.formkey]?.class || ""),
21
+ style: o(a.asaidata?.rule?.[a.formkey]?.style || "")
22
+ }, [
23
+ m(l.$slots, "default")
24
+ ], 6));
25
+ }
26
+ });
27
+ export {
28
+ d as default
29
+ };
@@ -0,0 +1,56 @@
1
+ import { defineComponent as l, resolveComponent as n, createElementBlock as d, openBlock as o, Fragment as i, renderList as j, createBlock as e, createCommentVNode as k, resolveDynamicComponent as r } from "vue";
2
+ const F = /* @__PURE__ */ l({
3
+ __name: "AsaiFormLi",
4
+ props: {
5
+ ujt: {},
6
+ asaidata: {},
7
+ formdata: {},
8
+ opt: {}
9
+ },
10
+ setup(a) {
11
+ const m = a;
12
+ return (y, C) => {
13
+ const u = n("AsaiFormShow"), f = n("AsaiFormObject"), c = n("AsaiInput");
14
+ return o(!0), d(i, null, j(m.formdata, (s, t) => (o(), d(i, null, [
15
+ m.asaidata.rule?.[t]?.[m.opt?.isedit ? "noedit" : "noadd"] == 2 ? (o(), e(u, {
16
+ key: 0,
17
+ ujt: a.ujt,
18
+ asaidata: a.asaidata,
19
+ formdata: a.formdata,
20
+ formkey: t
21
+ }, null, 8, ["ujt", "asaidata", "formdata", "formkey"])) : m.asaidata.rule?.[t]?.[m.opt?.isedit ? "noedit" : "noadd"] ? k("", !0) : (o(), d(i, { key: 1 }, [
22
+ a.asaidata?.cmComp && a.asaidata?.cmComp(t) ? (o(), e(r(a.asaidata.cmComp(t)), {
23
+ key: 0,
24
+ ujt: a.ujt,
25
+ asaidata: a.asaidata,
26
+ formdata: a.formdata,
27
+ formkey: t
28
+ }, null, 8, ["ujt", "asaidata", "formdata", "formkey"])) : typeof s == "object" ? (o(), d(i, { key: 1 }, [
29
+ a.asaidata?.cmComp && a.asaidata?.cmComp("object") ? (o(), e(r(a.asaidata.cmComp("object")), {
30
+ key: 0,
31
+ ujt: a.ujt,
32
+ asaidata: a.asaidata,
33
+ formdata: a.formdata,
34
+ formkey: t
35
+ }, null, 8, ["ujt", "asaidata", "formdata", "formkey"])) : (o(), e(f, {
36
+ key: 1,
37
+ ujt: a.ujt,
38
+ asaidata: a.asaidata,
39
+ formdata: a.formdata,
40
+ formkey: t
41
+ }, null, 8, ["ujt", "asaidata", "formdata", "formkey"]))
42
+ ], 64)) : (o(), e(c, {
43
+ key: 2,
44
+ ujt: a.ujt,
45
+ asaidata: a.asaidata,
46
+ formdata: a.formdata,
47
+ formkey: t
48
+ }, null, 8, ["ujt", "asaidata", "formdata", "formkey"]))
49
+ ], 64))
50
+ ], 64))), 256);
51
+ };
52
+ }
53
+ });
54
+ export {
55
+ F as default
56
+ };
@@ -0,0 +1,42 @@
1
+ import { defineComponent as f, ref as c, onUnmounted as y, resolveComponent as u, createElementBlock as o, createCommentVNode as i, openBlock as m, normalizeClass as s, createElementVNode as k, createTextVNode as d, toDisplayString as e, Fragment as A, createVNode as q } from "vue";
2
+ const v = { key: 0 }, g = /* @__PURE__ */ f({
3
+ __name: "AsaiFormObject",
4
+ props: {
5
+ ujt: {},
6
+ asaidata: {},
7
+ formdata: {},
8
+ formkey: {}
9
+ },
10
+ setup(a) {
11
+ const t = a, r = c(!0);
12
+ return y(() => {
13
+ r.value = null;
14
+ }), (j, n) => {
15
+ const l = u("AsaiFormLi");
16
+ return typeof t.formdata[a.formkey] == "object" ? (m(), o("div", {
17
+ key: 0,
18
+ class: s(`${a.asaidata.ic ? "as-form-row as-form-obj" : "as-form-row"}`)
19
+ }, [
20
+ k("span", {
21
+ class: s(`${a.asaidata.ic > 1 ? r.value ? "as-label-ico-close" : "as-label-ico-open" : ""}`),
22
+ onClick: n[0] || (n[0] = (b) => r.value = !r.value)
23
+ }, [
24
+ d(e(a.asaidata.eq > 2 ? '"' : "") + e(t.asaidata?.lang && t.asaidata?.lang[a.formkey] || a.formkey) + e(a.asaidata.eq > 2 ? '"' : "") + e(a.asaidata.eq ? ":" : "") + " ", 1),
25
+ r.value ? i("", !0) : (m(), o("span", v, e(a.asaidata.eq > 1 ? Array.isArray(t.formdata[a.formkey]) ? "[" : "{" : "") + " ... " + e(a.asaidata.eq > 1 ? Array.isArray(t.formdata[a.formkey]) ? "]" : "}" : "") + e(a.asaidata.eq > 2 ? "," : ""), 1))
26
+ ], 2),
27
+ r.value ? (m(), o(A, { key: 0 }, [
28
+ d(e(a.asaidata.eq > 1 ? Array.isArray(t.formdata[a.formkey]) ? "[" : "{" : "") + " ", 1),
29
+ q(l, {
30
+ ujt: a.ujt,
31
+ asaidata: a.asaidata,
32
+ formdata: t.formdata[a.formkey]
33
+ }, null, 8, ["ujt", "asaidata", "formdata"]),
34
+ d(" " + e(a.asaidata.eq > 1 ? Array.isArray(t.formdata[a.formkey]) ? "]" : "}" : "") + e(a.asaidata.eq > 2 ? "," : ""), 1)
35
+ ], 64)) : i("", !0)
36
+ ], 2)) : i("", !0);
37
+ };
38
+ }
39
+ });
40
+ export {
41
+ g as default
42
+ };
@@ -0,0 +1,43 @@
1
+ import { defineComponent as u, resolveComponent as o, createBlock as i, openBlock as l, withCtx as y, createTextVNode as m, createVNode as k, toDisplayString as f } from "vue";
2
+ const j = /* @__PURE__ */ u({
3
+ __name: "AsaiFormShow",
4
+ props: {
5
+ ujt: {},
6
+ asaidata: {},
7
+ formdata: {},
8
+ formkey: {}
9
+ },
10
+ setup(a) {
11
+ const t = a;
12
+ return (s, e) => {
13
+ const r = o("AsfInput"), n = o("AsaiFormLabel");
14
+ return l(), i(n, {
15
+ ujt: a.ujt,
16
+ asaidata: a.asaidata,
17
+ formdata: a.formdata,
18
+ formkey: a.formkey
19
+ }, {
20
+ default: y(() => [
21
+ m(f(typeof t.formdata[a.formkey] == "string" && a.asaidata.eq > 2 ? '"' : "") + " ", 1),
22
+ k(r, {
23
+ ujt: a.ujt,
24
+ opt: {
25
+ ...t.asaidata.rule?.[a.formkey]?.opt || {},
26
+ type: t.asaidata.rule?.[a.formkey]?.type || (typeof t.formdata[a.formkey] == "number" ? "number" : "text"),
27
+ max: t.asaidata.rule?.[a.formkey]?.max,
28
+ min: t.asaidata.rule?.[a.formkey]?.min,
29
+ noedit: !0
30
+ },
31
+ modelValue: t.formdata[a.formkey],
32
+ "onUpdate:modelValue": e[0] || (e[0] = (d) => t.formdata[a.formkey] = d)
33
+ }, null, 8, ["ujt", "opt", "modelValue"]),
34
+ m(" " + f(typeof t.formdata[a.formkey] == "string" && a.asaidata.eq > 2 ? '"' : ""), 1)
35
+ ]),
36
+ _: 1
37
+ }, 8, ["ujt", "asaidata", "formdata", "formkey"]);
38
+ };
39
+ }
40
+ });
41
+ export {
42
+ j as default
43
+ };
@@ -0,0 +1,54 @@
1
+ import { defineComponent as s, computed as c, resolveComponent as f, createBlock as r, openBlock as d, withCtx as A, createTextVNode as n, toDisplayString as u } from "vue";
2
+ const V = /* @__PURE__ */ s({
3
+ __name: "AsaiInput",
4
+ props: {
5
+ ujt: {},
6
+ asaidata: {},
7
+ formdata: {},
8
+ formkey: {}
9
+ },
10
+ setup(a) {
11
+ const t = a, { $fn: e } = t.ujt, l = c(() => e.As.toArr(t.asaidata?.lang?.[t.formkey + "data"]) || e.As.toArr(
12
+ t.asaidata?.rule?.[t.formkey]?.[t.formkey + "data"]
13
+ ) || e.As.toArr(e.lg(t.asaidata?.rule?.[t.formkey]?.data)) || []);
14
+ return (j, o) => {
15
+ const y = f("AsfCheck"), i = f("AsfInput"), k = f("AsaiFormLabel");
16
+ return d(), r(k, {
17
+ ujt: a.ujt,
18
+ asaidata: a.asaidata,
19
+ formdata: a.formdata,
20
+ formkey: a.formkey
21
+ }, {
22
+ default: A(() => [
23
+ n(u(typeof t.formdata[a.formkey] == "string" && a.asaidata.eq > 2 ? '"' : "") + " ", 1),
24
+ t.asaidata.rule?.[a.formkey]?.type === "checkbox" || typeof t.formdata[a.formkey] == "boolean" ? (d(), r(y, {
25
+ key: 0,
26
+ ujt: a.ujt,
27
+ opt: {
28
+ ...t.asaidata.rule?.[a.formkey]?.opt || {},
29
+ selectdata: l.value
30
+ },
31
+ modelValue: t.formdata[a.formkey],
32
+ "onUpdate:modelValue": o[0] || (o[0] = (m) => t.formdata[a.formkey] = m)
33
+ }, null, 8, ["ujt", "opt", "modelValue"])) : (d(), r(i, {
34
+ key: 1,
35
+ ujt: a.ujt,
36
+ opt: {
37
+ ...t.asaidata.rule?.[a.formkey]?.opt || {},
38
+ type: t.asaidata.rule?.[a.formkey]?.type || (typeof t.formdata[a.formkey] == "number" ? "number" : "text"),
39
+ max: t.asaidata.rule?.[a.formkey]?.max,
40
+ min: t.asaidata.rule?.[a.formkey]?.min
41
+ },
42
+ modelValue: t.formdata[a.formkey],
43
+ "onUpdate:modelValue": o[1] || (o[1] = (m) => t.formdata[a.formkey] = m)
44
+ }, null, 8, ["ujt", "opt", "modelValue"])),
45
+ n(" " + u(typeof t.formdata[a.formkey] == "string" && a.asaidata.eq > 2 ? '"' : ""), 1)
46
+ ]),
47
+ _: 1
48
+ }, 8, ["ujt", "asaidata", "formdata", "formkey"]);
49
+ };
50
+ }
51
+ });
52
+ export {
53
+ V as default
54
+ };
@@ -0,0 +1,271 @@
1
+ import { defineComponent as P, ref as C, onMounted as V, createElementBlock as p, openBlock as y, normalizeStyle as $, createElementVNode as i, toDisplayString as k, unref as d, Fragment as A, renderList as D, createCommentVNode as U, withDirectives as q, vModelText as N, nextTick as M } from "vue";
2
+ import { _ as Q } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
3
+ const G = { class: "as-richtext-toolbar" }, J = { value: "" }, K = ["value"], X = { value: "p" }, Y = ["value"], Z = ["title"], _ = ["title"], tt = ["title"], et = ["title"], ot = ["title"], it = ["title"], nt = ["title"], rt = ["title"], lt = { class: "as-richtext-content" }, at = ["placeholder"], st = /* @__PURE__ */ P({
4
+ __name: "AsaiRichEditor",
5
+ props: {
6
+ ujt: {},
7
+ asaidata: {},
8
+ formdata: {},
9
+ formkey: {}
10
+ },
11
+ setup(S) {
12
+ const s = S, { $global: u } = s.ujt, c = {
13
+ img: {
14
+ maxWidth: 288,
15
+ quality: 0.8
16
+ },
17
+ imgurls: {}
18
+ }, w = C(null), h = C(null), T = C(null), g = C(s.asaidata?.rule?.[s.formkey]?.editorty || 0);
19
+ V(L);
20
+ function L() {
21
+ h.value && (h.value.innerHTML = s.formdata[s.formkey]);
22
+ }
23
+ function R(o, t = 0) {
24
+ const e = /* @__PURE__ */ new Set(["a", "figure", "img", "video", "ul", "ol", "li", "h1", "h2", "h3", "h4", "h5", "h6", "p", "strong", "em", "span", "font", "b", "u", "i", "strike", "nav", "footer", "section", "article", "div"]), n = /* @__PURE__ */ new Set(["href", "src", "alt", "size", "color", "title", "style", "controls", "download", "target"]), l = new DOMParser().parseFromString(o, "text/html");
25
+ return Array.from(l.body.querySelectorAll("*")).reverse().forEach((a) => {
26
+ const v = a.tagName.toLowerCase();
27
+ if (!e.has(v))
28
+ return a.remove();
29
+ t && v == "img" && a?.src && !c.imgurls?.[a.src] && (a.setAttribute("crossOrigin", "anonymous"), c.imgurls[a.src] = "1"), Array.from(a.attributes).forEach(({ name: f, value: m }) => {
30
+ if (!n.has(f))
31
+ return a.removeAttribute(f);
32
+ if (["href", "src"].includes(f)) {
33
+ const b = z(m, t);
34
+ b ? a.setAttribute(f, b) : a.removeAttribute(f);
35
+ }
36
+ });
37
+ }), l.body.innerHTML;
38
+ }
39
+ function z(o, t = 0) {
40
+ if (!o) return "";
41
+ if (t) return o;
42
+ try {
43
+ const e = new URL(o, location.href);
44
+ if (["http:", "https:", "mailto:", "tel:", "blob:", "data:", "ftp:"].includes(e.protocol))
45
+ return e.href;
46
+ } catch {
47
+ return o.startsWith("#") || !/:/.test(o) ? o : "";
48
+ }
49
+ return "";
50
+ }
51
+ function F() {
52
+ const o = window.prompt("请输入链接地址");
53
+ o && r("createLink", { target: { value: o } });
54
+ }
55
+ function x(o) {
56
+ w.value.accept = `${o}/*`, M(() => w.value?.click());
57
+ }
58
+ async function O(o) {
59
+ const t = o.target.files?.[0];
60
+ if (!t)
61
+ return;
62
+ let e, n = "";
63
+ t.type.startsWith("image") ? (e = await E(t), n = `<img src="${e}" style="max-width:100%">`) : (t.size > 1024 * 1024 ? e = URL.createObjectURL(t) : e = await E(t), t.type.startsWith("video") ? n = `<video controls src="${e}" style="max-width:100%"></video>` : n = `<a href="${e}" download="${t.name}">${t.name}</a>`), r("insertHTML", { target: { value: n } });
64
+ }
65
+ function E(o) {
66
+ return new Promise((t, e) => {
67
+ if (!o)
68
+ return e(new Error("Invalid file"));
69
+ const n = new FileReader();
70
+ n.onload = (l) => {
71
+ o.type.startsWith("image/") ? I(l.target.result).then((a) => {
72
+ t(a);
73
+ }).catch((a) => {
74
+ e(a);
75
+ }) : t(l.target.result);
76
+ }, n.onerror = () => e(new Error("File read failed")), n.readAsDataURL(o);
77
+ });
78
+ }
79
+ function I(o) {
80
+ return new Promise((t, e) => {
81
+ const n = new Image(), l = document.createElement("canvas"), a = l.getContext("2d", {
82
+ willReadFrequently: !1
83
+ });
84
+ let v = !1;
85
+ const f = () => {
86
+ v || (n.onload = n.onerror = null, n.src = "", l.width = l.height = 0, v = !0);
87
+ };
88
+ n.crossOrigin = "anonymous", n.src = o, n.onload = () => {
89
+ try {
90
+ const m = Math.min(c.img.maxWidth / n.width, 1);
91
+ l.width = m < 1 ? c.img.maxWidth : n.width, l.height = m < 1 ? n.height * m : n.height, a.imageSmoothingEnabled = !0, a.imageSmoothingQuality = "high", a.clearRect(0, 0, l.width, l.height), a.drawImage(n, 0, 0, l.width, l.height);
92
+ const b = l.toDataURL("image/jpeg", c.img.quality);
93
+ f(), t(b);
94
+ } catch (m) {
95
+ f(), e(m);
96
+ }
97
+ }, n.onerror = (m) => {
98
+ f(), e(new Error("Image load failed"));
99
+ };
100
+ });
101
+ }
102
+ function W(o) {
103
+ o.preventDefault();
104
+ const t = Object.keys(c.imgurls);
105
+ for (let e = 0; e < t.length; e++) {
106
+ const n = t[e];
107
+ c.imgurls[n] === "1" && I(n).then((l) => {
108
+ c.imgurls[n] = l, s.formdata[s.formkey] = s.formdata[s.formkey].replaceAll(n, l);
109
+ });
110
+ }
111
+ }
112
+ function j(o) {
113
+ o.preventDefault();
114
+ const t = o.clipboardData?.getData("text/html") || "", e = R(t, 1) || o.clipboardData?.getData("text/plain") || "";
115
+ r("insertHTML", { target: { value: e } });
116
+ }
117
+ function H(o) {
118
+ h.value && (s.formdata[s.formkey] = R(h.value.innerHTML));
119
+ }
120
+ function r(o, t = null) {
121
+ if (h.value) {
122
+ if (t?.target?.tagName === "SELECT" && t?.target?.value) {
123
+ document.execCommand(o, !1, t.target.value);
124
+ return;
125
+ }
126
+ document.execCommand(o, !1, t?.target?.value);
127
+ }
128
+ }
129
+ function B() {
130
+ g.value++, g.value > 2 && (g.value = 0), M(L);
131
+ }
132
+ return (o, t) => (y(), p("div", {
133
+ class: "as-richtext-area",
134
+ style: $(s.asaidata.rule?.[s.formkey]?.style || {})
135
+ }, [
136
+ i("div", G, [
137
+ i("select", {
138
+ onChange: t[0] || (t[0] = (e) => r("fontSize", e))
139
+ }, [
140
+ i("option", J, k(d(u).lang.richtexteditor.fontsize), 1),
141
+ (y(), p(A, null, D(7, (e) => i("option", {
142
+ key: "size" + e,
143
+ value: e + 1
144
+ }, k((e + 1) * 2 + 6) + "px", 9, K)), 64))
145
+ ], 32),
146
+ i("select", {
147
+ onChange: t[1] || (t[1] = (e) => r("formatBlock", e))
148
+ }, [
149
+ i("option", X, k(d(u).lang.richtexteditor.paragraph), 1),
150
+ (y(), p(A, null, D(6, (e) => i("option", {
151
+ key: "h" + e,
152
+ value: "h" + e
153
+ }, k(d(u).lang.richtexteditor.title) + k(e), 9, Y)), 64))
154
+ ], 32),
155
+ i("button", {
156
+ onClick: t[2] || (t[2] = (e) => r("bold")),
157
+ title: d(u).lang.richtexteditor.bold
158
+ }, "B", 8, Z),
159
+ i("button", {
160
+ onClick: t[3] || (t[3] = (e) => r("underline")),
161
+ title: d(u).lang.richtexteditor.underline
162
+ }, "U", 8, _),
163
+ i("button", {
164
+ onClick: t[4] || (t[4] = (e) => r("italic")),
165
+ title: d(u).lang.richtexteditor.italic
166
+ }, "I", 8, tt),
167
+ i("button", {
168
+ onClick: t[5] || (t[5] = (e) => r("strikethrough")),
169
+ title: d(u).lang.richtexteditor.strikethrough
170
+ }, "S", 8, et),
171
+ i("input", {
172
+ type: "color",
173
+ onInput: t[6] || (t[6] = (e) => r("foreColor", e)),
174
+ title: d(u).lang.richtexteditor.foreColor
175
+ }, null, 40, ot),
176
+ i("input", {
177
+ type: "color",
178
+ onInput: t[7] || (t[7] = (e) => r("backColor", e)),
179
+ title: d(u).lang.richtexteditor.backColor
180
+ }, null, 40, it),
181
+ i("button", {
182
+ onClick: t[8] || (t[8] = (e) => r("insertOrderedList")),
183
+ title: d(u).lang.richtexteditor.insertOrderedList
184
+ }, "有", 8, nt),
185
+ i("button", {
186
+ onClick: t[9] || (t[9] = (e) => r("insertUnorderedList")),
187
+ title: d(u).lang.richtexteditor.insertUnorderedList
188
+ }, "无", 8, rt),
189
+ i("button", {
190
+ onClick: t[10] || (t[10] = (e) => r("justifyCenter")),
191
+ title: "居中"
192
+ }, "中"),
193
+ i("button", {
194
+ onClick: t[11] || (t[11] = (e) => r("justifyFull")),
195
+ title: "两端对齐"
196
+ }, "两"),
197
+ i("button", {
198
+ onClick: t[12] || (t[12] = (e) => r("justifyRight")),
199
+ title: "右对齐"
200
+ }, "右"),
201
+ i("button", {
202
+ onClick: t[13] || (t[13] = (e) => r("justifyLeft")),
203
+ title: "左对齐"
204
+ }, "左"),
205
+ i("button", {
206
+ onClick: t[14] || (t[14] = (e) => r("delete")),
207
+ title: "删除"
208
+ }, "删"),
209
+ i("button", {
210
+ onClick: t[15] || (t[15] = (e) => F()),
211
+ title: "链接"
212
+ }, "链"),
213
+ i("button", {
214
+ onClick: t[16] || (t[16] = (e) => r("unlink")),
215
+ title: "删除链接"
216
+ }, "除"),
217
+ i("button", {
218
+ onClick: t[17] || (t[17] = (e) => x("image")),
219
+ title: "图片"
220
+ }, "🖼️"),
221
+ i("button", {
222
+ onClick: t[18] || (t[18] = (e) => x("video")),
223
+ title: "视频"
224
+ }, "🎬"),
225
+ i("button", {
226
+ onClick: t[19] || (t[19] = (e) => x("file")),
227
+ title: "文件"
228
+ }, "📎"),
229
+ i("button", {
230
+ onClick: W,
231
+ title: "上传"
232
+ }, "上"),
233
+ i("button", {
234
+ onClick: t[20] || (t[20] = (e) => B()),
235
+ title: "切换"
236
+ }, "HTML")
237
+ ]),
238
+ i("div", lt, [
239
+ g.value != 1 ? (y(), p("div", {
240
+ key: 0,
241
+ style: $({ width: g.value > 1 ? "50%" : "100%" }),
242
+ ref_key: "rfRichEditor",
243
+ ref: h,
244
+ contenteditable: "true",
245
+ onPaste: j,
246
+ onInput: H
247
+ }, null, 36)) : U("", !0),
248
+ g.value > 0 ? q((y(), p("textarea", {
249
+ key: 1,
250
+ placeholder: s?.opt?.placeholder || "",
251
+ ref_key: "rfRichCode",
252
+ ref: T,
253
+ "onUpdate:modelValue": t[21] || (t[21] = (e) => s.formdata[s.formkey] = e),
254
+ style: $({ width: g.value > 1 ? "50%" : "100%" })
255
+ }, null, 12, at)), [
256
+ [N, s.formdata[s.formkey]]
257
+ ]) : U("", !0)
258
+ ]),
259
+ i("input", {
260
+ ref_key: "fileInput",
261
+ ref: w,
262
+ type: "file",
263
+ hidden: "",
264
+ onChange: O
265
+ }, null, 544)
266
+ ], 4));
267
+ }
268
+ }), ft = /* @__PURE__ */ Q(st, [["__scopeId", "data-v-01c836b2"]]);
269
+ export {
270
+ ft as default
271
+ };
@@ -0,0 +1,38 @@
1
+ import { defineComponent as n, computed as u, resolveComponent as r, createBlock as s, openBlock as c, withCtx as i, createVNode as k } from "vue";
2
+ const j = /* @__PURE__ */ n({
3
+ __name: "AsaiSelect",
4
+ props: {
5
+ ujt: {},
6
+ asaidata: {},
7
+ formdata: {},
8
+ formkey: {}
9
+ },
10
+ setup(t) {
11
+ const a = t, { $fn: e } = a.ujt, m = u(() => e.As.toArr(a.asaidata?.lang?.[a.formkey + "data"]) || e.As.toArr(a.asaidata?.rule?.[a.formkey]?.[a.formkey + "data"]) || e.As.toArr(e.lg(a.asaidata?.rule?.[a.formkey]?.data)) || []);
12
+ return (y, o) => {
13
+ const d = r("AsfSelect"), l = r("AsaiFormLabel");
14
+ return c(), s(l, {
15
+ ujt: t.ujt,
16
+ asaidata: t.asaidata,
17
+ formdata: t.formdata,
18
+ formkey: t.formkey
19
+ }, {
20
+ default: i(() => [
21
+ k(d, {
22
+ ujt: t.ujt,
23
+ opt: {
24
+ ...a.asaidata.rule?.[t.formkey]?.opt || {},
25
+ selectdata: m.value
26
+ },
27
+ modelValue: a.formdata[t.formkey],
28
+ "onUpdate:modelValue": o[0] || (o[0] = (f) => a.formdata[t.formkey] = f)
29
+ }, null, 8, ["ujt", "opt", "modelValue"])
30
+ ]),
31
+ _: 1
32
+ }, 8, ["ujt", "asaidata", "formdata", "formkey"]);
33
+ };
34
+ }
35
+ });
36
+ export {
37
+ j as default
38
+ };
@@ -0,0 +1,38 @@
1
+ import { defineComponent as l, resolveComponent as o, createBlock as r, openBlock as n, withCtx as u, createVNode as c } from "vue";
2
+ const k = /* @__PURE__ */ l({
3
+ __name: "AsaiSelectCl",
4
+ props: {
5
+ ujt: {},
6
+ asaidata: {},
7
+ formdata: {},
8
+ formkey: {}
9
+ },
10
+ setup(a) {
11
+ const t = a;
12
+ return (i, e) => {
13
+ const m = o("AsfSelect"), d = o("AsaiFormLabel");
14
+ return n(), r(d, {
15
+ ujt: a.ujt,
16
+ asaidata: a.asaidata,
17
+ formdata: a.formdata,
18
+ formkey: a.formkey
19
+ }, {
20
+ default: u(() => [
21
+ c(m, {
22
+ ujt: a.ujt,
23
+ opt: {
24
+ ...t.asaidata.rule?.[a.formkey]?.opt || {},
25
+ selectdata: t.asaidata?.rule?.[a.formkey]?.[a.formkey + "data"]
26
+ },
27
+ modelValue: t.formdata[a.formkey],
28
+ "onUpdate:modelValue": e[0] || (e[0] = (f) => t.formdata[a.formkey] = f)
29
+ }, null, 8, ["ujt", "opt", "modelValue"])
30
+ ]),
31
+ _: 1
32
+ }, 8, ["ujt", "asaidata", "formdata", "formkey"]);
33
+ };
34
+ }
35
+ });
36
+ export {
37
+ k as default
38
+ };