@web-utils/component 4.0.10 → 4.0.11

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,7 +1,7 @@
1
1
  import { isBlank as _ } from "@web-utils/core";
2
2
  import { formatDate as i } from "@web-utils/integrations/dayjs";
3
3
  import { p as h, M as g, A as b, b as c, q as A, e as S, k as d, t as T, h as C, v, u as x } from "./util.DqFv_pWg.mjs";
4
- import "./fy-u-editor/style.css";
4
+ import "../fy-u-editor/style.css";
5
5
  import { a as D, b as O } from "./dataformat.CpqOeGBl.mjs";
6
6
  import { s as j } from "./slot.DXIbhGat.mjs";
7
7
  import { n as L } from "./_plugin-vue2_normalizer.CeySl7Fu.mjs";
@@ -39,11 +39,11 @@ const r = {
39
39
  a(r, e);
40
40
  };
41
41
  export {
42
- y as a,
43
- f as b,
42
+ b as a,
43
+ m as b,
44
44
  h as c,
45
- m as g,
45
+ y as g,
46
46
  p as h,
47
47
  l as p,
48
- b as r
48
+ f as r
49
49
  };
@@ -47,8 +47,8 @@ const a = (n) => {
47
47
  }), i;
48
48
  };
49
49
  export {
50
- b as a,
51
- j as b,
50
+ j as a,
51
+ a as b,
52
52
  u as f,
53
- a as t
53
+ b as t
54
54
  };
@@ -1,15 +1,15 @@
1
- import { a as g, b as l } from "./core.0Exl13Mz.mjs";
2
- import { a as d, b } from "./configComponents.DQaqUQFs.mjs";
3
- const $ = {}, h = {}, m = {}, w = (t, i = !0, { options: r, treeDict: o, idAsValue: n, labelAsValue: c } = {}) => {
1
+ import { t as D, a as l } from "./core.DJEgjQW6.mjs";
2
+ import { g as d, r as w } from "./configComponents.CpKi15WN.mjs";
3
+ const $ = {}, h = {}, m = {}, C = (t, i = !0, { options: r, treeDict: o, idAsValue: n, labelAsValue: c } = {}) => {
4
4
  let e = t;
5
5
  o && (e = `${t}-${n}-${c}${r ? "-options" : ""}`);
6
6
  const a = $[e];
7
- return i && a ? a : o ? K(t, i, { idAsValue: n, labelAsValue: c }) : C(t, i);
8
- }, C = (t, i = !0) => {
7
+ return i && a ? a : o ? O(t, i, { idAsValue: n, labelAsValue: c }) : K(t, i);
8
+ }, K = (t, i = !0) => {
9
9
  if (m[t])
10
10
  return m[t];
11
11
  const r = new Promise((o, n) => {
12
- i && $[t] ? o($[t]) : b(t).then((c) => {
12
+ i && $[t] ? o($[t]) : w(t).then((c) => {
13
13
  let e = c.data.data;
14
14
  if (i) {
15
15
  const a = {};
@@ -23,20 +23,20 @@ const $ = {}, h = {}, m = {}, w = (t, i = !0, { options: r, treeDict: o, idAsVal
23
23
  });
24
24
  });
25
25
  return m[t] = r, r;
26
- }, K = (t, i = !0, { idAsValue: r, labelAsValue: o } = {}) => {
26
+ }, O = (t, i = !0, { idAsValue: r, labelAsValue: o } = {}) => {
27
27
  const n = `${t}-${r}-${o}`;
28
28
  if (m[n])
29
29
  return m[n];
30
30
  const c = new Promise((e, a) => {
31
31
  i && $[n] ? e($[n]) : d(t, { idAsValue: r, labelAsValue: o }).then((f) => {
32
32
  const s = f.data.data;
33
- i && ($[n] = s, $[`${n}-options`] = g(s), h[n] = l(s)), m[n] = null, e(s);
33
+ i && ($[n] = s, $[`${n}-options`] = D(s), h[n] = l(s)), m[n] = null, e(s);
34
34
  }).catch((f) => {
35
35
  m[n] = null, a(f);
36
36
  });
37
37
  });
38
38
  return m[n] = c, c;
39
- }, O = async (t, i, r = !0, { treeDict: o, idAsValue: n, labelAsValue: c } = {}) => {
39
+ }, T = async (t, i, r = !0, { treeDict: o, idAsValue: n, labelAsValue: c } = {}) => {
40
40
  let e = t;
41
41
  o && (e = `${t}-${n}-${c}`);
42
42
  const a = h[e];
@@ -44,15 +44,15 @@ const $ = {}, h = {}, m = {}, w = (t, i = !0, { options: r, treeDict: o, idAsVal
44
44
  if (r && a)
45
45
  f = a[i];
46
46
  else {
47
- let s = await w(t, r, { treeDict: o, idAsValue: n, labelAsValue: c });
47
+ let s = await C(t, r, { treeDict: o, idAsValue: n, labelAsValue: c });
48
48
  if (r)
49
49
  f = h[e][i];
50
50
  else {
51
- o && (s = g(s));
52
- for (let u = 0; u < s.length; u++) {
53
- const D = s[u];
54
- if (D.value === i) {
55
- f = D;
51
+ o && (s = D(s));
52
+ for (let g = 0; g < s.length; g++) {
53
+ const u = s[g];
54
+ if (u.value === i) {
55
+ f = u;
56
56
  break;
57
57
  }
58
58
  }
@@ -61,7 +61,7 @@ const $ = {}, h = {}, m = {}, w = (t, i = !0, { options: r, treeDict: o, idAsVal
61
61
  return f;
62
62
  }, z = async (t, i, r = !0, { treeDict: o, idAsValue: n, labelAsValue: c } = {}) => {
63
63
  var e;
64
- return ((e = await O(t, i, r, { treeDict: o, idAsValue: n, labelAsValue: c })) == null ? void 0 : e.label) || i || "";
64
+ return ((e = await T(t, i, r, { treeDict: o, idAsValue: n, labelAsValue: c })) == null ? void 0 : e.label) || i || "";
65
65
  };
66
66
  export {
67
67
  z as g
@@ -0,0 +1,47 @@
1
+ import s from "photoswipe";
2
+ import "photoswipe/dist/photoswipe.css";
3
+ function d(h) {
4
+ new s(h).init();
5
+ }
6
+ async function b(h, n, r = { selector: "chat-image" }) {
7
+ const a = h.target;
8
+ if (!(!a || a.classList.contains(r.selector) || a.tagName === "IMG"))
9
+ return;
10
+ const t = n.querySelectorAll(r.selector === "img" ? r.selector : `.${r.selector}`), i = [...t].findIndex((o) => o === a);
11
+ i >= 0 && (r.index = i);
12
+ const e = await u(t);
13
+ await d({ dataSource: e, index: i });
14
+ }
15
+ async function u(h) {
16
+ const n = [];
17
+ for (let r = 0, a = h.length; r < a; r++) {
18
+ const t = h[r], i = t.getAttribute("data-src") || t.getAttribute("src"), e = {
19
+ src: i,
20
+ msrc: i,
21
+ alt: t.getAttribute("data-title") || t.getAttribute("alt"),
22
+ element: t
23
+ }, o = t.getAttribute("data-height"), g = t.getAttribute("data-width");
24
+ let c = { width: g, height: o };
25
+ !o && !g && (c = await w(t), t.setAttribute("data-height", c.height), t.setAttribute("data-width", c.width)), e.w = c.width, e.width = c.width, e.h = c.height, e.height = c.height, n.push(e);
26
+ }
27
+ return n;
28
+ }
29
+ function w(h) {
30
+ const n = h.getAttribute("data-src") || h.getAttribute("src"), r = h.getAttribute("data-height"), a = h.getAttribute("data-width");
31
+ return r && a ? { width: a, height: r } : h.complete ? {
32
+ width: h.naturalWidth,
33
+ height: h.naturalHeight
34
+ } : new Promise((t) => {
35
+ const i = new Image();
36
+ i.src = n;
37
+ const e = {};
38
+ i.complete ? (e.width = i.width, e.height = i.height, t(e)) : (i.onload = () => {
39
+ e.width = i.width, e.height = i.height, t(e);
40
+ }, i.onerror = () => {
41
+ e.width = 0, e.height = 0, t(e);
42
+ });
43
+ });
44
+ }
45
+ export {
46
+ b as p
47
+ };
@@ -0,0 +1,123 @@
1
+ const g = /[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, O = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
2
+ let s, p;
3
+ const d = {
4
+ // table of character substitutions
5
+ "\b": "\\b",
6
+ " ": "\\t",
7
+ "\n": "\\n",
8
+ "\f": "\\f",
9
+ "\r": "\\r",
10
+ '"': '\\"',
11
+ "'": "\\'",
12
+ "\\": "\\\\"
13
+ };
14
+ let h;
15
+ function N(r, i = {}) {
16
+ const n = i.space || 2, t = i.dropQuotesOnKeys !== !1, e = i.dropQuotesOnNumbers || !1, l = i.inlineShortArrays || !1, o = i.inlineShortArraysDepth || 1, a = i.quoteType || "single", c = i.minify || !1;
17
+ e && S(r);
18
+ let u = x(r, null, c ? void 0 : n, t, a);
19
+ if (l && !c) {
20
+ let f = j(u);
21
+ if (o > 1)
22
+ for (let m = 1; m < o && (u = f, f = j(u), f !== u); m++)
23
+ ;
24
+ u = f;
25
+ }
26
+ return u;
27
+ }
28
+ function S(r) {
29
+ if (!$(r)) return;
30
+ const i = Object.keys(r);
31
+ i && i.forEach(function(n) {
32
+ const t = r[n];
33
+ if (typeof t == "string") {
34
+ const e = t - 0;
35
+ r[n] = isNaN(e) ? t : e;
36
+ } else ($(t) || Array.isArray(t)) && S(t);
37
+ });
38
+ }
39
+ function $(r) {
40
+ return r && typeof r == "object";
41
+ }
42
+ function j(r, i) {
43
+ if (i || (i = 80), typeof i != "number" || i < 20)
44
+ throw Error(`Invalid width '${i}'. Expecting number equal or larger than 20.`);
45
+ const n = r.split(`
46
+ `);
47
+ let t = 0, e = null, l = [];
48
+ for (; t < n.length; ) {
49
+ const o = !!n[t].match(/\[/), a = !!n[t].match(/\],?/);
50
+ if (o && !a)
51
+ l = [n[t]], e = t;
52
+ else if (a && !o && e) {
53
+ l.push((n[t] || "").trim());
54
+ const c = l.join(" ");
55
+ c.length < i && (n.splice(e, t - e + 1, c), t = e), e = null, l = [];
56
+ } else
57
+ e && l.push((n[t] || "").trim());
58
+ t += 1;
59
+ }
60
+ return n.join(`
61
+ `);
62
+ }
63
+ function x(r, i, n, t, e) {
64
+ let l;
65
+ if (s = "", p = "", typeof n == "number")
66
+ for (l = 0; l < n; l += 1)
67
+ p += " ";
68
+ else typeof n == "string" && (p = n);
69
+ return h = i, b("", { "": r }, t, e);
70
+ }
71
+ function b(r, i, n, t) {
72
+ let e, l, o, a;
73
+ const c = s;
74
+ let u, f = i[r];
75
+ switch (f && typeof f == "object" && typeof f.toJSON == "function" && (f = f.toJSON(r)), typeof h == "function" && (f = h.call(i, r, f)), typeof f) {
76
+ case "function":
77
+ return f;
78
+ case "string":
79
+ return y(f, t);
80
+ case "number":
81
+ return isFinite(f) ? String(f) : "null";
82
+ case "boolean":
83
+ case "null":
84
+ return String(f);
85
+ // If the type is 'object', we might be dealing with an object or an array or
86
+ // null.
87
+ case "object":
88
+ if (!f)
89
+ return "null";
90
+ if (s += p, u = [], Object.prototype.toString.apply(f) === "[object Array]") {
91
+ for (a = f.length, e = 0; e < a; e += 1)
92
+ u[e] = b(e, f, n, t) || "null";
93
+ return o = u.length === 0 ? "[]" : s ? `[
94
+ ${s}${u.join(`,
95
+ ${s}`)}
96
+ ${c}]` : `[${u.join(",")}]`, s = c, o;
97
+ }
98
+ if (h && typeof h == "object")
99
+ for (a = h.length, e = 0; e < a; e += 1)
100
+ typeof h[e] == "string" && (l = h[e], o = b(l, f, n, t), o && u.push((n ? A(l, t) : y(l, t)) + (s ? ": " : ":") + o));
101
+ else
102
+ for (l in f)
103
+ Object.prototype.hasOwnProperty.call(f, l) && (o = b(l, f, n, t), o && u.push((n ? A(l, t) : y(l, t)) + (s ? ": " : ":") + o));
104
+ return o = u.length === 0 ? "{}" : s ? `{
105
+ ${s}${u.join(`,
106
+ ${s}`)}
107
+ ${c}}` : `{${u.join(",")}}`, s = c, o;
108
+ }
109
+ }
110
+ function y(r, i) {
111
+ g.lastIndex = 0;
112
+ let n = '"';
113
+ return i === "single" && (n = "'"), g.test(r) ? n + r.replace(g, function(t) {
114
+ const e = d[t];
115
+ return typeof e == "string" ? e : `\\u${`0000${t.charCodeAt(0).toString(16)}`.slice(-4)}`;
116
+ }) + n : n + r + n;
117
+ }
118
+ function A(r, i) {
119
+ return O.test(r) ? r : y(r, i);
120
+ }
121
+ export {
122
+ N as c
123
+ };
@@ -22,7 +22,7 @@ import Ee from "highlight.js/lib/languages/xml";
22
22
  import Te from "highlight.js/lib/languages/json";
23
23
  import { isArray as K } from "@web-utils/core";
24
24
  import Ce from "../highlight-j-s/index.mjs";
25
- import "./highlight-j-s/style.css";
25
+ import "../highlight-j-s/style.css";
26
26
  function G(n, e, t, i, r, a, p, o, y, S, l, s, m) {
27
27
  n = n || {}, i.registerProvider(this), this._contextPad = i, this._modeling = r, this._elementFactory = a, this._connect = p, this._create = o, this._popupMenu = y, this._canvas = S, this._rules = l, this._translate = s, n.autoPlace !== !1 && (this._autoPlace = e.get("autoPlace", !1)), t.on("create.end", 250, function(g) {
28
28
  const A = g.context.shape;
@@ -3,7 +3,7 @@ import c from "diagram-js/lib/navigation/zoomscroll/ZoomScroll";
3
3
  import { create as l, attr as a, append as p } from "tiny-svg";
4
4
  import { query as w } from "min-dom";
5
5
  import y from "../easy-popup/index.mjs";
6
- import "./easy-popup/style.css";
6
+ import "../easy-popup/style.css";
7
7
  import { n as v } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
8
8
  const m = c.prototype._handleWheel, k = {
9
9
  __init__: ["zoomScroll"],
@@ -1,7 +1,7 @@
1
1
  import { isInContainer as d, animate as m, hasOwn as a, toStringArray as h } from "@web-utils/core";
2
2
  import { merge as p } from "@web-utils/integrations/lodash";
3
3
  import b from "../resize-observer/index.mjs";
4
- import "./resize-observer/style.css";
4
+ import "../resize-observer/style.css";
5
5
  import { n as v } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
6
6
  const f = [
7
7
  "back",
package/fy-curd/index.mjs CHANGED
@@ -6,10 +6,10 @@ import { o as h, j as C, d as a, u as B, D as b, k as P, i as D, l as T, s as z
6
6
  import { isBlank as c } from "@web-utils/core";
7
7
  import { s as M } from "../chunks/slot.DXIbhGat.mjs";
8
8
  import { n as f } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
9
- import { F as L, d as w } from "../chunks/FormTemp.BQxO5IQq.mjs";
9
+ import { F as L, d as w } from "../chunks/FormTemp.Bu2VCxUh.mjs";
10
10
  import { s as V } from "../chunks/dic.Dkl-leRW.mjs";
11
11
  import R from "../icon-temp/index.mjs";
12
- import "./icon-temp/style.css";
12
+ import "../icon-temp/style.css";
13
13
  const p = {
14
14
  menuWidth: 220,
15
15
  menuFixed: "right",
package/fy-form/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { F as N, d as P } from "../chunks/FormTemp.BQxO5IQq.mjs";
1
+ import { F as N, d as P } from "../chunks/FormTemp.Bu2VCxUh.mjs";
2
2
  import { i as z } from "../chunks/init.DAsXSoLW.mjs";
3
3
  import { u as B, d as D, s as v, j as S, x as j, o as I, D as L, y as V, p as M } from "../chunks/util.DqFv_pWg.mjs";
4
4
  import { a as A, b as W, f as R, d as G, c as H } from "../chunks/dataformat.CpqOeGBl.mjs";
@@ -1,10 +1,11 @@
1
1
  import { isBlank as E } from "@web-utils/core";
2
- import { c as v, M as f } from "../chunks/MonacoEditor.D31t4FTy.mjs";
3
- import "./monaco-editor/style.css";
2
+ import f from "../monaco-editor/index.mjs";
3
+ import "../monaco-editor/style.css";
4
4
  import b from "vuedraggable";
5
+ import { c as v } from "../chunks/json-beautifier.Bp3GslGm.mjs";
5
6
  import { d as p, z as u } from "../chunks/util.DqFv_pWg.mjs";
6
7
  import { cloneDeep as g } from "@web-utils/integrations/lodash";
7
- import "./fy-u-editor/style.css";
8
+ import "../fy-u-editor/style.css";
8
9
  import { n as c } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
9
10
  const _ = [
10
11
  {
@@ -781,7 +782,7 @@ var R = function() {
781
782
  } } }, [t("i", { staticClass: "iconfont icon-clear" })]) : e._e(), e.selectWidget.prop === e.column.prop ? t("ElButton", { staticClass: "widget-action-clone", attrs: { title: "复制", circle: "", plain: "", size: "small", type: "primary" }, on: { click: function(a) {
782
783
  return a.stopPropagation(), e.handleWidgetCloneTable(e.index);
783
784
  } } }, [t("i", { staticClass: "iconfont icon-copy" })]) : e._e()], 1);
784
- }, P = [], M = /* @__PURE__ */ c(
785
+ }, P = [], D = /* @__PURE__ */ c(
785
786
  z,
786
787
  R,
787
788
  P,
@@ -789,9 +790,9 @@ var R = function() {
789
790
  null,
790
791
  null
791
792
  );
792
- const D = M.exports, Q = {
793
+ const M = D.exports, Q = {
793
794
  name: "WidgetForm",
794
- components: { Draggable: b, WidgetFormItem: y, WidgetFormTable: x, WidgetFormGroup: D },
795
+ components: { Draggable: b, WidgetFormItem: y, WidgetFormTable: x, WidgetFormGroup: M },
795
796
  props: {
796
797
  data: Object,
797
798
  select: Object
@@ -1228,15 +1229,15 @@ var Pe = function() {
1228
1229
  return t("div", [t("ElFormItem", { attrs: { label: "占位内容" } }, [t("ElInput", { attrs: { clearable: "", placeholder: "占位内容" }, model: { value: e.data.placeholder, callback: function(a) {
1229
1230
  e.$set(e.data, "placeholder", a);
1230
1231
  }, expression: "data.placeholder" } })], 1)], 1);
1231
- }, Me = [], De = /* @__PURE__ */ c(
1232
+ }, De = [], Me = /* @__PURE__ */ c(
1232
1233
  Re,
1233
1234
  Pe,
1234
- Me,
1235
+ De,
1235
1236
  !1,
1236
1237
  null,
1237
1238
  null
1238
1239
  );
1239
- const Qe = De.exports, Ke = {
1240
+ const Qe = Me.exports, Ke = {
1240
1241
  name: "ConfigSelect",
1241
1242
  components: { Draggable: b, MonacoEditor: f },
1242
1243
  props: {
@@ -1993,7 +1994,7 @@ const Rt = zt.exports, Pt = [
1993
1994
  label: "年",
1994
1995
  value: "year"
1995
1996
  }
1996
- ], Mt = {
1997
+ ], Dt = {
1997
1998
  name: "AfdColumn",
1998
1999
  props: {
1999
2000
  column: {
@@ -2027,7 +2028,7 @@ const Rt = zt.exports, Pt = [
2027
2028
  }
2028
2029
  }
2029
2030
  };
2030
- var Dt = function() {
2031
+ var Mt = function() {
2031
2032
  var e = this, t = e._self._c;
2032
2033
  return t("ElDrawer", { attrs: { visible: e.visible, size: "80%", "append-to-body": "" }, on: { "update:visible": function(a) {
2033
2034
  e.visible = a;
@@ -2065,8 +2066,8 @@ var Dt = function() {
2065
2066
  e.visible = !1;
2066
2067
  } } }, [e._v("取消")])], 1)], 1);
2067
2068
  }, Qt = [], Kt = /* @__PURE__ */ c(
2068
- Mt,
2069
2069
  Dt,
2070
+ Mt,
2070
2071
  Qt,
2071
2072
  !1,
2072
2073
  null,
@@ -2846,7 +2847,7 @@ var ta = function() {
2846
2847
  null,
2847
2848
  null
2848
2849
  );
2849
- const ua = la.exports;
2850
+ const ma = la.exports;
2850
2851
  export {
2851
- ua as default
2852
+ ma as default
2852
2853
  };
@@ -1,6 +1,6 @@
1
1
  import { p as s, e as l } from "../chunks/event.9aDS6jcw.mjs";
2
2
  import a from "../icon-temp/index.mjs";
3
- import "./icon-temp/style.css";
3
+ import "../icon-temp/style.css";
4
4
  import { n as r } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
5
5
  const o = {
6
6
  name: "FyInputIcon",