@a2simcode/ui 0.0.167 → 0.0.169

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,4 +1,4 @@
1
- import { Fragment as Ce, computed as O, createBlock as N, createCommentVNode as ee, createElementBlock as L, createElementVNode as B, createSlots as Dn, createTextVNode as on, createVNode as Z, defineComponent as he, getCurrentInstance as uc, guardReactiveProps as ji, h as vi, inject as kd, mergeModels as So, mergeProps as Fe, nextTick as zt, normalizeClass as Ne, normalizeProps as Ro, normalizeStyle as le, onBeforeUnmount as To, onMounted as jt, onUnmounted as Ao, openBlock as E, provide as Ed, reactive as na, ref as I, render as yi, renderList as He, renderSlot as Ye, resolveComponent as V, resolveDirective as Pi, resolveDynamicComponent as Ya, shallowRef as Bi, toDisplayString as ve, unref as J, useModel as ko, useSlots as Rd, useTemplateRef as ka, vShow as mo, watch as at, watchEffect as dc, withCtx as K, withDirectives as zn, withKeys as fr, withModifiers as $t } from "vue";
1
+ import { Fragment as Ce, computed as O, createBlock as N, createCommentVNode as ee, createElementBlock as L, createElementVNode as B, createSlots as Dn, createTextVNode as on, createVNode as Z, defineComponent as he, getCurrentInstance as uc, guardReactiveProps as ji, h as vi, inject as kd, mergeModels as So, mergeProps as Fe, nextTick as Dt, normalizeClass as Ne, normalizeProps as Ro, normalizeStyle as le, onBeforeUnmount as To, onMounted as jt, onUnmounted as Ao, openBlock as E, provide as Ed, reactive as na, ref as I, render as yi, renderList as He, renderSlot as Ye, resolveComponent as V, resolveDirective as Pi, resolveDynamicComponent as Ya, shallowRef as Bi, toDisplayString as ve, unref as J, useModel as ko, useSlots as Rd, useTemplateRef as ka, vShow as mo, watch as at, watchEffect as dc, withCtx as K, withDirectives as zn, withKeys as fr, withModifiers as $t } from "vue";
2
2
  import { Icon as jl, getIcon as Sa } from "@iconify/vue";
3
3
  import fc from "dayjs";
4
4
  import Td from "sortablejs";
@@ -1507,7 +1507,7 @@ var Gf = /* @__PURE__ */ an(((e, t) => {
1507
1507
  }, K1 = (e, t) => Rc(e, t).toString(_i);
1508
1508
  function gh(e, t) {
1509
1509
  function n() {
1510
- zt(() => {
1510
+ Dt(() => {
1511
1511
  e = J(e), e && Td.create(e, {
1512
1512
  animation: 100,
1513
1513
  delay: 400,
@@ -1700,7 +1700,7 @@ var Eh = /* @__PURE__ */ he({
1700
1700
  }, 100);
1701
1701
  }
1702
1702
  }, k = (z) => {
1703
- u.value = z?.name, a.value = z?.width || 600, o.value = z?.height || 400, i.value = z?.hasBtns !== !1, r.value = z?.hasSaveBtn !== !1, l.value = z?.hasHeader !== !1, z?.destroyOnClose !== !1 && (d.value = !0), h.value = z?.config || {}, c.value = z?.btnText || "保存", w = z?.afterOk || null, S = z?.afterClose || null, m = z?.afterCancel || null, n.value.open(z.title, z.type, z.subtitle), zt(async () => {
1703
+ u.value = z?.name, a.value = z?.width || 600, o.value = z?.height || 400, i.value = z?.hasBtns !== !1, r.value = z?.hasSaveBtn !== !1, l.value = z?.hasHeader !== !1, z?.destroyOnClose !== !1 && (d.value = !0), h.value = z?.config || {}, c.value = z?.btnText || "保存", w = z?.afterOk || null, S = z?.afterClose || null, m = z?.afterCancel || null, n.value.open(z.title, z.type, z.subtitle), Dt(async () => {
1704
1704
  n.value.showLoading("加载中"), await C(z.param || {});
1705
1705
  });
1706
1706
  }, T = async () => {
@@ -5837,10 +5837,10 @@ var zp = { class: "j-table-footer" }, Dp = {
5837
5837
  flexWrap: "nowrap"
5838
5838
  });
5839
5839
  if (tt.forEach((me, pt) => {
5840
- const Ve = me.config?.disabled === !0, Dt = Ve ? "#c9cdd4" : me.config?.danger ? "#f53f3f" : "#165dff", cn = new Q({
5840
+ const Ve = me.config?.disabled === !0, zt = Ve ? "#c9cdd4" : me.config?.danger ? "#f53f3f" : "#165dff", cn = new Q({
5841
5841
  text: me.label,
5842
5842
  fontSize: 14,
5843
- fill: Dt,
5843
+ fill: zt,
5844
5844
  boundsPadding: [
5845
5845
  0,
5846
5846
  12,
@@ -5855,9 +5855,9 @@ var zp = { class: "j-table-footer" }, Dp = {
5855
5855
  openLayer: u
5856
5856
  });
5857
5857
  }), cn.addEventListener("mouseenter", (gn) => {
5858
- Ve || (gn.target.setAttribute("fill", ne(Dt, -20)), xe.scenegraph.stage.renderNextFrame());
5858
+ Ve || (gn.target.setAttribute("fill", ne(zt, -20)), xe.scenegraph.stage.renderNextFrame());
5859
5859
  }), cn.addEventListener("mouseleave", (gn) => {
5860
- Ve || (gn.target.setAttribute("fill", Dt), xe.scenegraph.stage.renderNextFrame());
5860
+ Ve || (gn.target.setAttribute("fill", zt), xe.scenegraph.stage.renderNextFrame());
5861
5861
  }), nt.add(cn);
5862
5862
  }), et && ut.length > 0) {
5863
5863
  const me = "#1677ff", pt = new Q({
@@ -5874,8 +5874,8 @@ var zp = { class: "j-table-footer" }, Dp = {
5874
5874
  });
5875
5875
  pt.addEventListener("mouseenter", (Ve) => {
5876
5876
  Ve.target.setAttribute("fill", ne(me, -20)), xe.scenegraph.stage.renderNextFrame();
5877
- const Dt = b.value?.getBoundingClientRect();
5878
- Dt && se(ut, Te, Qe, Ve.canvasX + Dt.left - 64, Ve.canvasY + Dt.top + 8), q = !0, F();
5877
+ const zt = b.value?.getBoundingClientRect();
5878
+ zt && se(ut, Te, Qe, Ve.canvasX + zt.left - 64, Ve.canvasY + zt.top + 8), q = !0, F();
5879
5879
  }), pt.addEventListener("mouseleave", (Ve) => {
5880
5880
  Ve.target.setAttribute("fill", me), xe.scenegraph.stage.renderNextFrame(), q = !1, j();
5881
5881
  }), nt.add(pt);
@@ -5972,19 +5972,19 @@ var zp = { class: "j-table-footer" }, Dp = {
5972
5972
  formData: r || {},
5973
5973
  getTableData: ht,
5974
5974
  row: fe
5975
- }) || {}, Re = Number(xe.min) || 0, Be = Number(xe.max) || 100, Te = Number(Q) || 0, Qe = Be - Re, Le = Qe === 0 ? 0 : Math.max(0, Math.min(100, (Te - Re) / Qe * 100)), Ae = 4, et = 8, tt = 8, ut = (ae.height - Ae) / 2, nt = String(Te), me = bn(nt) || 0, pt = et, Ve = ut, Dt = ae.width - et * 2 - me - tt, cn = Dt * Le / 100, gn = [], vn = (Wt, rt, At) => {
5975
+ }) || {}, Re = Number(xe.min) || 0, Be = Number(xe.max) || 100, Te = Number(Q) || 0, Qe = Be - Re, Le = Qe === 0 ? 0 : Math.max(0, Math.min(100, (Te - Re) / Qe * 100)), Ae = 4, et = 8, tt = 8, ut = (ae.height - Ae) / 2, nt = String(Te), me = bn(nt) || 0, pt = et, Ve = ut, zt = ae.width - et * 2 - me - tt, cn = zt * Le / 100, gn = [], vn = (Wt, rt, At) => {
5976
5976
  const vt = Math.min(At, rt / 2, Wt / 2);
5977
5977
  return `M ${vt} 0 L ${Wt - vt} 0 Q ${Wt} 0 ${Wt} ${vt} L ${Wt} ${rt - vt} Q ${Wt} ${rt} ${Wt - vt} ${rt} L ${vt} ${rt} Q 0 ${rt} 0 ${rt - vt} L 0 ${vt} Q 0 0 ${vt} 0 Z`;
5978
5978
  }, ro = (Wt, rt, At) => {
5979
5979
  const vt = Math.min(At, rt / 2, Wt / 2);
5980
5980
  return Wt <= vt * 2 ? vn(Wt, rt, At) : `M ${vt} 0 L ${Wt} 0 L ${Wt} ${rt} L ${vt} ${rt} Q 0 ${rt} 0 ${rt - vt} L 0 ${vt} Q 0 0 ${vt} 0 Z`;
5981
- }, Go = vn(Dt, Ae, Ae / 2);
5981
+ }, Go = vn(zt, Ae, Ae / 2);
5982
5982
  if (gn.push({
5983
5983
  type: "icon",
5984
- svg: `<svg xmlns="http://www.w3.org/2000/svg" width="${Dt}" height="${Ae}" viewBox="0 0 ${Dt} ${Ae}"><path d="${Go}" fill="#e5e6eb"/></svg>`,
5984
+ svg: `<svg xmlns="http://www.w3.org/2000/svg" width="${zt}" height="${Ae}" viewBox="0 0 ${zt} ${Ae}"><path d="${Go}" fill="#e5e6eb"/></svg>`,
5985
5985
  x: pt,
5986
5986
  y: Ve,
5987
- width: Dt,
5987
+ width: zt,
5988
5988
  height: Ae
5989
5989
  }), cn > 0) {
5990
5990
  const Wt = ro(cn, Ae, Ae / 2);
@@ -5997,7 +5997,7 @@ var zp = { class: "j-table-footer" }, Dp = {
5997
5997
  height: Ae
5998
5998
  });
5999
5999
  }
6000
- const Ko = pt + Dt + tt, Zi = ae.height / 2;
6000
+ const Ko = pt + zt + tt, Zi = ae.height / 2;
6001
6001
  return gn.push({
6002
6002
  type: "text",
6003
6003
  text: nt,
@@ -6087,7 +6087,7 @@ var zp = { class: "j-table-footer" }, Dp = {
6087
6087
  };
6088
6088
  const Qe = 14, Le = 28, Ae = 2, et = 12, tt = 8, ut = 6;
6089
6089
  let nt = 8, me = Math.max(0, ae.width - nt * 2), pt = Math.max(0, me - et * 2);
6090
- const Ve = [], Dt = (rt) => {
6090
+ const Ve = [], zt = (rt) => {
6091
6091
  const At = bn(_t(rt, pt)) || 0;
6092
6092
  return Math.min(me, At + et * 2);
6093
6093
  }, cn = (rt, At, vt, En, Rn) => {
@@ -6104,7 +6104,7 @@ var zp = { class: "j-table-footer" }, Dp = {
6104
6104
  const rt = [];
6105
6105
  let At = [], vt = 0;
6106
6106
  for (let En = 0; En < Te.length; En++) {
6107
- const Rn = Te[En], ma = Rn.label, ba = Dt(ma), qo = {
6107
+ const Rn = Te[En], ma = Rn.label, ba = zt(ma), qo = {
6108
6108
  label: ma,
6109
6109
  bg: Rn.color || "#f2f3f5",
6110
6110
  text: Rn.textColor || ln(Rn.color || "#f2f3f5"),
@@ -6216,7 +6216,7 @@ var zp = { class: "j-table-footer" }, Dp = {
6216
6216
  }, Ht = (D) => {
6217
6217
  const { table: U, row: Q, col: ae, rect: Y } = D, { height: te, width: re } = Y ?? U.getCellRect(ae, Q), { Group: pe, CheckBox: de } = We.CustomLayout, fe = U.getBodyField(ae, Q), xe = dt(U.options?.columns || [], fe), Re = U.getCellOriginRecord(ae, Q) || {}, Be = xe?.style?.textAlign === "right" ? "flex-end" : xe?.style?.textAlign === "center" ? "center" : "flex-start", Te = xe?.style?.textAlign === "right" ? "flex-end" : xe?.style?.textAlign === "center" ? "center" : "flex-start", Qe = (nt, me) => {
6218
6218
  const pt = Re?.[fe];
6219
- Re[fe] = (Array.isArray(pt) ? pt : []).map((Ve, Dt) => Dt !== nt ? Ve : Ve && typeof Ve == "object" ? {
6219
+ Re[fe] = (Array.isArray(pt) ? pt : []).map((Ve, zt) => zt !== nt ? Ve : Ve && typeof Ve == "object" ? {
6220
6220
  ...Ve,
6221
6221
  ...me
6222
6222
  } : { ...me });
@@ -6267,8 +6267,8 @@ var zp = { class: "j-table-footer" }, Dp = {
6267
6267
  ]
6268
6268
  });
6269
6269
  Ve.render?.(), ut.add(Ve), Ve.addEventListener("checkbox_state_change", () => {
6270
- const Dt = !!Ve.attribute?.checked;
6271
- Qe(nt, { checked: Dt }), Le();
6270
+ const zt = !!Ve.attribute?.checked;
6271
+ Qe(nt, { checked: zt }), Le();
6272
6272
  });
6273
6273
  }
6274
6274
  return {
@@ -7002,7 +7002,7 @@ var zp = { class: "j-table-footer" }, Dp = {
7002
7002
  _top: 0
7003
7003
  }), g = I(0), y = I(), _ = I(48), b = I(0), v = I(0);
7004
7004
  at(() => a.visible, (P) => {
7005
- g.value = 1, g.value = 0, r.value = P, P === !0 && a.zoomControls && zt(() => {
7005
+ g.value = 1, g.value = 0, r.value = P, P === !0 && a.zoomControls && Dt(() => {
7006
7006
  typeof document < "u" && (y.value = document.querySelector(".j-dialog"), y.value && (y.value.onmousemove = F));
7007
7007
  });
7008
7008
  }, { immediate: !0 });
@@ -7027,7 +7027,7 @@ var zp = { class: "j-table-footer" }, Dp = {
7027
7027
  }, A = () => {
7028
7028
  o("ok", C, k);
7029
7029
  }, H = () => {
7030
- p.left = 0, p.top = 0, v.value = 0, b.value = 0, a.isStep && (z.value = 0, zt(() => {
7030
+ p.left = 0, p.top = 0, v.value = 0, b.value = 0, a.isStep && (z.value = 0, Dt(() => {
7031
7031
  W();
7032
7032
  })), o("closed");
7033
7033
  }, z = O({
@@ -7038,11 +7038,11 @@ var zp = { class: "j-table-footer" }, Dp = {
7038
7038
  h.value = P, o("update:stepActive", P);
7039
7039
  }
7040
7040
  }), $ = () => {
7041
- z.value > 0 && z.value--, zt(() => {
7041
+ z.value > 0 && z.value--, Dt(() => {
7042
7042
  W();
7043
7043
  });
7044
7044
  }, M = async () => {
7045
- await R() && (z.value < a.steps.length - 1 && (z.value += 1), zt(() => {
7045
+ await R() && (z.value < a.steps.length - 1 && (z.value += 1), Dt(() => {
7046
7046
  W();
7047
7047
  }));
7048
7048
  }, R = async () => {
@@ -7304,7 +7304,7 @@ var zp = { class: "j-table-footer" }, Dp = {
7304
7304
  }, _ = () => {
7305
7305
  o("ok", v, w);
7306
7306
  }, b = () => {
7307
- a.isStep && (g.value = 0, zt(() => {
7307
+ a.isStep && (g.value = 0, Dt(() => {
7308
7308
  C();
7309
7309
  })), o("closed");
7310
7310
  }, v = (A) => {
@@ -7312,11 +7312,11 @@ var zp = { class: "j-table-footer" }, Dp = {
7312
7312
  }, w = () => {
7313
7313
  c.value = !1;
7314
7314
  }, S = () => {
7315
- g.value > 0 && g.value--, zt(() => {
7315
+ g.value > 0 && g.value--, Dt(() => {
7316
7316
  C();
7317
7317
  });
7318
7318
  }, m = async () => {
7319
- await x() && (g.value < a.steps.length - 1 && (g.value += 1), zt(() => {
7319
+ await x() && (g.value < a.steps.length - 1 && (g.value += 1), Dt(() => {
7320
7320
  C();
7321
7321
  }));
7322
7322
  }, x = async () => {
@@ -7559,7 +7559,7 @@ var zp = { class: "j-table-footer" }, Dp = {
7559
7559
  }, f = () => {
7560
7560
  r.value = !1;
7561
7561
  }, u = () => {
7562
- a.isStep && (S.value = 0, zt(() => {
7562
+ a.isStep && (S.value = 0, Dt(() => {
7563
7563
  k();
7564
7564
  })), i("closed");
7565
7565
  }, h = () => {
@@ -7576,11 +7576,11 @@ var zp = { class: "j-table-footer" }, Dp = {
7576
7576
  w.value = A, i("update:stepActive", A);
7577
7577
  }
7578
7578
  }), m = () => {
7579
- S.value > 0 && S.value--, zt(() => {
7579
+ S.value > 0 && S.value--, Dt(() => {
7580
7580
  k();
7581
7581
  });
7582
7582
  }, x = async () => {
7583
- await C() && (S.value < a.steps.length - 1 && (S.value += 1), zt(() => {
7583
+ await C() && (S.value < a.steps.length - 1 && (S.value += 1), Dt(() => {
7584
7584
  k();
7585
7585
  }));
7586
7586
  }, C = async () => {
@@ -10702,7 +10702,7 @@ var zp = { class: "j-table-footer" }, Dp = {
10702
10702
  }), at(() => a.mode, () => {
10703
10703
  l && f();
10704
10704
  }), jt(async () => {
10705
- await zt(), await d(), typeof window < "u" && window.ResizeObserver && i.value && (p = new ResizeObserver(() => {
10705
+ await Dt(), await d(), typeof window < "u" && window.ResizeObserver && i.value && (p = new ResizeObserver(() => {
10706
10706
  l && l.dispatch({ scrollIntoView: !0 });
10707
10707
  }), p.observe(i.value));
10708
10708
  }), Ao(() => {
@@ -12224,15 +12224,15 @@ var zp = { class: "j-table-footer" }, Dp = {
12224
12224
  };
12225
12225
  let dt;
12226
12226
  jt(() => {
12227
- zt(Ot), dt = new ResizeObserver(() => {
12227
+ Dt(Ot), dt = new ResizeObserver(() => {
12228
12228
  Ot();
12229
12229
  }), Jt.value && dt.observe(Jt.value);
12230
12230
  }), To(() => {
12231
12231
  dt?.disconnect();
12232
12232
  }), at(() => ln.value, () => {
12233
- zt(Ot);
12233
+ Dt(Ot);
12234
12234
  }, { deep: !0 }), at(Oe, () => {
12235
- zt(Ot);
12235
+ Dt(Ot);
12236
12236
  });
12237
12237
  const Vt = O(() => {
12238
12238
  const Se = ln.value;
@@ -12797,7 +12797,7 @@ var zp = { class: "j-table-footer" }, Dp = {
12797
12797
  d.value = !0, a.loadData && (u.value = await a.loadData() || []), c && await c({
12798
12798
  type: "j-tree",
12799
12799
  config: a
12800
- }), d.value = !1, zt(() => {
12800
+ }), d.value = !1, Dt(() => {
12801
12801
  a.afterLoadData && a.afterLoadData(g.value || []);
12802
12802
  });
12803
12803
  }, _ = ($, M = !0) => {
@@ -12835,10 +12835,6 @@ var zp = { class: "j-table-footer" }, Dp = {
12835
12835
  }, z = ($, M, R) => a.allowDrop ? a.allowDrop($, M, R) : !(R == "inner" && !M.data.canInner);
12836
12836
  return jt(async () => {
12837
12837
  (a.immediate && a.loadData || a.dataType || a.dataCode) && await y();
12838
- }), at(() => a.list, () => {
12839
- d.value = !0, zt(() => {
12840
- d.value = !1;
12841
- });
12842
12838
  }), at(() => a.dataCode || a.dataType, () => {
12843
12839
  y();
12844
12840
  }), t({
@@ -13191,7 +13187,7 @@ var vb = ({ data: e, actions: t, utils: n, inputParams: a, notRunActions: o }) =
13191
13187
  }, j = async (X, ce) => {
13192
13188
  y.value = !1;
13193
13189
  const ne = !!ce;
13194
- C.splice(0, C.length), T = {}, A = {}, H = [], W = ce, wo(m), wo(k), ne && q(ce, ""), ye(X, C, ne), z = xn(m), await zt(), y.value = !0, await zt(), a.config?.codeInit && await Vt(JSON.parse(a.config?.codeInit), { param: {} });
13190
+ C.splice(0, C.length), T = {}, A = {}, H = [], W = ce, wo(m), wo(k), ne && q(ce, ""), ye(X, C, ne), z = xn(m), await Dt(), y.value = !0, await Dt(), a.config?.codeInit && await Vt(JSON.parse(a.config?.codeInit), { param: {} });
13195
13191
  }, F = (X, ce, ne) => {
13196
13192
  const oe = [];
13197
13193
  return ce.forEach((ge) => {
@@ -13506,7 +13502,7 @@ var vb = ({ data: e, actions: t, utils: n, inputParams: a, notRunActions: o }) =
13506
13502
  i[y.id] = _, _.config = [], wi(_.config, y.config || {}, ["defaultValue"]), y?.config?.defaultValue !== void 0 && (r[y.id] = y.config.defaultValue), g.push(_), b && b.length > 0 && (_.children = [], l(b, _.children));
13507
13503
  });
13508
13504
  }, c = (p) => {
13509
- a.value = !1, o.splice(0, o.length), wo(i), wo(r), l(p, o), zt(() => {
13505
+ a.value = !1, o.splice(0, o.length), wo(i), wo(r), l(p, o), Dt(() => {
13510
13506
  a.value = !0;
13511
13507
  });
13512
13508
  };
@@ -13737,7 +13733,7 @@ var vb = ({ data: e, actions: t, utils: n, inputParams: a, notRunActions: o }) =
13737
13733
  }, { deep: !0 });
13738
13734
  const _ = (S) => {
13739
13735
  const m = {};
13740
- return !a.isCompact && S.config?.width && (m.width = `${S.config.width}px`), m;
13736
+ return !a.isCompact && S.config?.colWidth && (m.width = `${S.config.colWidth}px`), m;
13741
13737
  }, b = () => {
13742
13738
  const S = { _i: ta() };
13743
13739
  a.columns.forEach((m) => {