abl-ui 0.2.77 → 0.2.78

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/lib/abl-ui.es.js CHANGED
@@ -1268,12 +1268,12 @@ const Ta = (e) => ({
1268
1268
  }, m = ht(o), v = pt(m), w = await r.getDimensions(d), x = m === "y", b = x ? "top" : "left", S = x ? "bottom" : "right", $ = x ? "clientHeight" : "clientWidth", L = s.reference[v] + s.reference[m] - p[m] - s.floating[v], k = p[m] - s.reference[m], y = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(d));
1269
1269
  let A = y ? y[$] : 0;
1270
1270
  (!A || !await (r.isElement == null ? void 0 : r.isElement(y))) && (A = i.floating[$] || s.floating[v]);
1271
- const M = L / 2 - k / 2, K = A / 2 - w[v] / 2 - 1, q = Ee(f[b], K), H = Ee(f[S], K), U = q, V = A - w[v] - H, I = A / 2 - w[v] / 2 + M, z = lt(U, I, V), P = !l.arrow && Fe(o) != null && I !== z && s.reference[v] / 2 - (I < U ? q : H) - w[v] / 2 < 0, F = P ? I < U ? I - U : I - V : 0;
1271
+ const M = L / 2 - k / 2, K = A / 2 - w[v] / 2 - 1, q = Ee(f[b], K), H = Ee(f[S], K), U = q, z = A - w[v] - H, I = A / 2 - w[v] / 2 + M, V = lt(U, I, z), P = !l.arrow && Fe(o) != null && I !== V && s.reference[v] / 2 - (I < U ? q : H) - w[v] / 2 < 0, F = P ? I < U ? I - U : I - z : 0;
1272
1272
  return {
1273
1273
  [m]: p[m] + F,
1274
1274
  data: {
1275
- [m]: z,
1276
- centerOffset: I - z - F,
1275
+ [m]: V,
1276
+ centerOffset: I - V - F,
1277
1277
  ...P && {
1278
1278
  alignmentOffset: F
1279
1279
  }
@@ -1318,24 +1318,24 @@ const Ta = (e) => ({
1318
1318
  overflows: A
1319
1319
  }], !A.every((U) => U <= 0)) {
1320
1320
  var K, q;
1321
- const U = (((K = s.flip) == null ? void 0 : K.index) || 0) + 1, V = k[U];
1322
- if (V)
1321
+ const U = (((K = s.flip) == null ? void 0 : K.index) || 0) + 1, z = k[U];
1322
+ if (z)
1323
1323
  return {
1324
1324
  data: {
1325
1325
  index: U,
1326
1326
  overflows: M
1327
1327
  },
1328
1328
  reset: {
1329
- placement: V
1329
+ placement: z
1330
1330
  }
1331
1331
  };
1332
- let I = (q = M.filter((z) => z.overflows[0] <= 0).sort((z, P) => z.overflows[1] - P.overflows[1])[0]) == null ? void 0 : q.placement;
1332
+ let I = (q = M.filter((V) => V.overflows[0] <= 0).sort((V, P) => V.overflows[1] - P.overflows[1])[0]) == null ? void 0 : q.placement;
1333
1333
  if (!I)
1334
1334
  switch (m) {
1335
1335
  case "bestFit": {
1336
1336
  var H;
1337
- const z = (H = M.map((P) => [P.placement, P.overflows.filter((F) => F > 0).reduce((F, ee) => F + ee, 0)]).sort((P, F) => P[1] - F[1])[0]) == null ? void 0 : H[0];
1338
- z && (I = z);
1337
+ const V = (H = M.map((P) => [P.placement, P.overflows.filter((F) => F > 0).reduce((F, ee) => F + ee, 0)]).sort((P, F) => P[1] - F[1])[0]) == null ? void 0 : H[0];
1338
+ V && (I = V);
1339
1339
  break;
1340
1340
  }
1341
1341
  case "initialPlacement":
@@ -2725,19 +2725,19 @@ const Yo = /* @__PURE__ */ c("div", {
2725
2725
  emits: ["close"],
2726
2726
  setup(e, { emit: t }) {
2727
2727
  const n = typeof window < "u" && typeof document < "u", a = e, o = T(() => a.previewSrcList.length), s = _(Array(o.value).fill(!1)), r = _(a.initialIndex), i = _(1), l = _(0), d = _(0), g = _(0), f = _(0), p = _(0), m = t, v = (q, H) => {
2728
- let U, V;
2728
+ let U, z;
2729
2729
  try {
2730
2730
  U = q.toString().split(".")[1].length;
2731
2731
  } catch {
2732
2732
  U = 0;
2733
2733
  }
2734
2734
  try {
2735
- V = H.toString().split(".")[1].length;
2735
+ z = H.toString().split(".")[1].length;
2736
2736
  } catch {
2737
- V = 0;
2737
+ z = 0;
2738
2738
  }
2739
- const I = Math.max(U, V), z = Math.pow(10, I);
2740
- return q = Math.round(q * z), H = Math.round(H * z), (q + H) / z;
2739
+ const I = Math.max(U, z), V = Math.pow(10, I);
2740
+ return q = Math.round(q * V), H = Math.round(H * V), (q + H) / V;
2741
2741
  }, w = (q) => {
2742
2742
  s.value[q] = !0;
2743
2743
  }, x = (q) => {
@@ -2756,13 +2756,13 @@ const Yo = /* @__PURE__ */ c("div", {
2756
2756
  p.value = 0, i.value = 1, g.value = 0, f.value = 0;
2757
2757
  }, A = (q) => {
2758
2758
  console.log("e====", q);
2759
- const H = q.target, { top: U, left: V, right: I, bottom: z } = H.getBoundingClientRect(), P = document.documentElement.clientWidth, F = document.documentElement.clientHeight;
2759
+ const H = q.target, { top: U, left: z, right: I, bottom: V } = H.getBoundingClientRect(), P = document.documentElement.clientWidth, F = document.documentElement.clientHeight;
2760
2760
  l.value = q.clientX, d.value = q.clientY;
2761
2761
  const ee = g.value, C = f.value;
2762
2762
  document.onmousemove = (W) => {
2763
2763
  g.value = ee + W.clientX - l.value, f.value = C + W.clientY - d.value;
2764
2764
  }, document.onmouseup = (W) => {
2765
- g.value > ee + P - I && (g.value = ee + P - I), g.value < ee - V && (g.value = ee - V), f.value > C + F - z && (f.value = C + F - z), f.value < C - U && (f.value = C - U), document.onmousemove = null;
2765
+ g.value > ee + P - I && (g.value = ee + P - I), g.value < ee - z && (g.value = ee - z), f.value > C + F - V && (f.value = C + F - V), f.value < C - U && (f.value = C - U), document.onmousemove = null;
2766
2766
  };
2767
2767
  }, M = (q) => {
2768
2768
  const H = q.deltaY * a.zoomRate * 0.1;
@@ -2798,15 +2798,15 @@ const Yo = /* @__PURE__ */ c("div", {
2798
2798
  class: "abl-image-preview",
2799
2799
  style: O(`transform: translate3d(${g.value}px, ${f.value}px, 0px);`)
2800
2800
  }, [
2801
- (u(!0), h(Y, null, te(e.previewSrcList, (U, V) => X((u(), h("div", {
2802
- key: V,
2801
+ (u(!0), h(Y, null, te(e.previewSrcList, (U, z) => X((u(), h("div", {
2802
+ key: z,
2803
2803
  class: "abl-image-preview__box"
2804
2804
  }, [
2805
2805
  c("img", {
2806
2806
  src: U,
2807
2807
  class: "abl-image-preview__img",
2808
2808
  style: O(`transform: scale3d(${i.value}, ${i.value}, 1) rotate(${p.value}deg);`),
2809
- onLoad: (I) => w(V),
2809
+ onLoad: (I) => w(z),
2810
2810
  onMousedown: H[0] || (H[0] = j((I) => A(I), ["prevent"])),
2811
2811
  onClick: H[1] || (H[1] = j(() => {
2812
2812
  }, ["stop"]))
@@ -2816,7 +2816,7 @@ const Yo = /* @__PURE__ */ c("div", {
2816
2816
  c("div", Zo, N(`${r.value + 1}/${o.value}`), 1)
2817
2817
  ])) : E("", !0)
2818
2818
  ])), [
2819
- [J, r.value === V]
2819
+ [J, r.value === z]
2820
2820
  ])), 128))
2821
2821
  ], 4),
2822
2822
  o.value > 1 ? (u(), h(Y, { key: 0 }, [
@@ -4691,11 +4691,11 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4691
4691
  setup(e, { emit: t }) {
4692
4692
  var H, U;
4693
4693
  const n = De(), a = e;
4694
- a.type == "single" ? a == null || a.options.map((V) => {
4695
- V.value == a.modelValue && (V.selected = !0);
4696
- }) : a == null || a.options.map((V) => {
4694
+ a.type == "single" ? a == null || a.options.map((z) => {
4695
+ z.value == a.modelValue && (z.selected = !0);
4696
+ }) : a == null || a.options.map((z) => {
4697
4697
  a.modelValue.map((I) => {
4698
- V.value == I && (V.selected = !0);
4698
+ z.value == I && (z.selected = !0);
4699
4699
  });
4700
4700
  });
4701
4701
  const o = t, s = ke({
@@ -4711,24 +4711,24 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4711
4711
  }), v = _(!1), w = _(
4712
4712
  a.search && d.value === "focus" && v.value
4713
4713
  ), x = _(a.disabled), b = _(a.mode === "tag"), S = _(""), $ = ke(
4714
- (H = a == null ? void 0 : a.options) == null ? void 0 : H.filter((V) => V.selected === !0)
4714
+ (H = a == null ? void 0 : a.options) == null ? void 0 : H.filter((z) => z.selected === !0)
4715
4715
  );
4716
- n.default && (m.list = [], (U = n.default()) == null || U.map((V) => {
4716
+ n.default && (m.list = [], (U = n.default()) == null || U.map((z) => {
4717
4717
  var I;
4718
- if (V.props) {
4719
- const { value: z, name: P, img: F } = V.props;
4718
+ if (z.props) {
4719
+ const { value: V, name: P, img: F } = z.props;
4720
4720
  m.list.push({
4721
- value: z,
4721
+ value: V,
4722
4722
  name: P,
4723
4723
  img: F
4724
- }), f.value === z && $.push({
4725
- value: z,
4724
+ }), f.value === V && $.push({
4725
+ value: V,
4726
4726
  name: P,
4727
4727
  img: F
4728
4728
  });
4729
4729
  } else
4730
- ((I = V == null ? void 0 : V.children) == null ? void 0 : I.length) > 0 && V.children.map((z) => {
4731
- const { value: P, name: F, img: ee } = z.props;
4730
+ ((I = z == null ? void 0 : z.children) == null ? void 0 : I.length) > 0 && z.children.map((V) => {
4731
+ const { value: P, name: F, img: ee } = V.props;
4732
4732
  m.list.push({
4733
4733
  value: P,
4734
4734
  name: F,
@@ -4740,44 +4740,44 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4740
4740
  });
4741
4741
  });
4742
4742
  }));
4743
- const L = (V) => {
4743
+ const L = (z) => {
4744
4744
  if (!w.value)
4745
4745
  S.value = "";
4746
4746
  else {
4747
- const I = a.options.filter((z) => z.name.includes(V.target.value));
4747
+ const I = a.options.filter((V) => V.name.includes(z.target.value));
4748
4748
  m.list = I;
4749
4749
  }
4750
- }, k = (V) => {
4751
- a.disabled || (v.value = !0, V.stopPropagation(), d.value === "focus" ? d.value = "blur" : d.value = "focus");
4752
- }, y = (V, I) => {
4750
+ }, k = (z) => {
4751
+ a.disabled || (v.value = !0, z.stopPropagation(), d.value === "focus" ? d.value = "blur" : d.value = "focus");
4752
+ }, y = (z, I) => {
4753
4753
  var P;
4754
4754
  if (a.disabled)
4755
4755
  return;
4756
- if (V.name == r.value) {
4756
+ if (z.name == r.value) {
4757
4757
  g.value.close();
4758
4758
  return;
4759
4759
  }
4760
4760
  v.value = !1, I.stopPropagation(), (P = l.value) == null || P.blur();
4761
- let z = null;
4761
+ let V = null;
4762
4762
  if (a.type === "single")
4763
- d.value = "blur", $[0] && $[0].value === V.value ? $.shift() : $[0] = V, z = V.value;
4763
+ d.value = "blur", $[0] && $[0].value === z.value ? $.shift() : $[0] = z, V = z.value;
4764
4764
  else {
4765
- z || (z = []);
4766
- const F = $.findIndex((ee) => ee.value === V.value);
4767
- F > -1 ? $.splice(F, 1) : $.push(V), $.map((ee) => {
4768
- z.push(ee.value);
4765
+ V || (V = []);
4766
+ const F = $.findIndex((ee) => ee.value === z.value);
4767
+ F > -1 ? $.splice(F, 1) : $.push(z), $.map((ee) => {
4768
+ V.push(ee.value);
4769
4769
  });
4770
4770
  }
4771
- o("update:modelValue", z), o("change", at($)), g.value.close();
4771
+ o("update:modelValue", V), o("change", V, at($)), g.value.close();
4772
4772
  };
4773
4773
  Ie("handleSlotClick", y);
4774
4774
  const A = () => {
4775
- var V;
4776
- (V = l.value) == null || V.focus(), !w.value && d.value === "focus" && $.length > 0 && ($.pop(), o("change", at($)));
4777
- }, M = (V) => {
4778
4775
  var z;
4779
- (z = l.value) == null || z.focus();
4780
- const I = $.findIndex((P) => P.value === V.value);
4776
+ (z = l.value) == null || z.focus(), !w.value && d.value === "focus" && $.length > 0 && ($.pop(), o("change", at($)));
4777
+ }, M = (z) => {
4778
+ var V;
4779
+ (V = l.value) == null || V.focus();
4780
+ const I = $.findIndex((P) => P.value === z.value);
4781
4781
  $.splice(I, 1), o("change", at($));
4782
4782
  }, K = () => {
4783
4783
  d.value = "blur";
@@ -4786,20 +4786,20 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4786
4786
  };
4787
4787
  return ue(
4788
4788
  v,
4789
- (V) => {
4790
- w.value = a.search && d.value === "focus" && V;
4789
+ (z) => {
4790
+ w.value = a.search && d.value === "focus" && z;
4791
4791
  },
4792
4792
  { immediate: !0, deep: !0 }
4793
4793
  ), ue(
4794
4794
  $,
4795
- (V) => {
4796
- r.value = V.map((I) => I == null ? void 0 : I.name).join(",");
4795
+ (z) => {
4796
+ r.value = z.map((I) => I == null ? void 0 : I.name).join(",");
4797
4797
  },
4798
4798
  { immediate: !0, deep: !0 }
4799
4799
  ), me(() => {
4800
- ue(d, (V) => {
4801
- var I, z;
4802
- V === "focus" ? (I = l.value) == null || I.focus() : (z = l.value) == null || z.blur(), w.value = a.search && V === "focus" && v;
4800
+ ue(d, (z) => {
4801
+ var I, V;
4802
+ z === "focus" ? (I = l.value) == null || I.focus() : (V = l.value) == null || V.blur(), w.value = a.search && z === "focus" && v;
4803
4803
  }), document.body.addEventListener("click", () => {
4804
4804
  d.value = "blur";
4805
4805
  });
@@ -4807,7 +4807,7 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4807
4807
  f.value = a.modelValue;
4808
4808
  }, {
4809
4809
  immediate: !0
4810
- }), (V, I) => (u(), h("div", {
4810
+ }), (z, I) => (u(), h("div", {
4811
4811
  ref_key: "selectRef",
4812
4812
  ref: i
4813
4813
  }, [
@@ -4823,19 +4823,19 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4823
4823
  class: "abl-select-options-warpper",
4824
4824
  style: O(p.value)
4825
4825
  }, [
4826
- m.list.length > 0 ? (u(!0), h(Y, { key: 0 }, te(m.list, (z, P) => (u(), h("div", {
4827
- class: B(["abl-select-options-item", $.some((F) => F.value === z.value) ? "abl-options-item-active" : ""]),
4828
- key: z.name + z.value,
4829
- onClick: (F) => y(z, F)
4826
+ m.list.length > 0 ? (u(!0), h(Y, { key: 0 }, te(m.list, (V, P) => (u(), h("div", {
4827
+ class: B(["abl-select-options-item", $.some((F) => F.value === V.value) ? "abl-options-item-active" : ""]),
4828
+ key: V.name + V.value,
4829
+ onClick: (F) => y(V, F)
4830
4830
  }, [
4831
- z.img ? (u(), h("img", {
4831
+ V.img ? (u(), h("img", {
4832
4832
  key: 0,
4833
4833
  class: "abl-select-options-item-img",
4834
- src: z.img
4834
+ src: V.img
4835
4835
  }, null, 8, oi)) : E("", !0),
4836
4836
  c("span", {
4837
- class: B(z.img ? "haveImg" : "")
4838
- }, N(z.name), 3)
4837
+ class: B(V.img ? "haveImg" : "")
4838
+ }, N(V.name), 3)
4839
4839
  ], 10, ai))), 128)) : (u(), h("div", si, " 暂无数据 "))
4840
4840
  ], 4)
4841
4841
  ]),
@@ -4850,14 +4850,14 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4850
4850
  c("div", Kl, [
4851
4851
  X(c("div", Gl, [
4852
4852
  b.value ? (u(), h("div", Jl, [
4853
- (u(!0), h(Y, null, te($, (z) => (u(), h("div", {
4853
+ (u(!0), h(Y, null, te($, (V) => (u(), h("div", {
4854
4854
  class: "abl-select-tag",
4855
- key: z.value
4855
+ key: V.value
4856
4856
  }, [
4857
- G(N(z.name) + " ", 1),
4857
+ G(N(V.name) + " ", 1),
4858
4858
  c("span", {
4859
4859
  class: "abl-select-tag-close",
4860
- onClick: j((P) => M(z), ["stop"])
4860
+ onClick: j((P) => M(V), ["stop"])
4861
4861
  }, "x", 8, Zl)
4862
4862
  ]))), 128))
4863
4863
  ])) : (u(), h("span", Ql, N(r.value), 1))
@@ -4865,12 +4865,12 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4865
4865
  [J, $.length && !w.value]
4866
4866
  ]),
4867
4867
  X(c("input", {
4868
- onBlur: I[0] || (I[0] = (z) => K()),
4868
+ onBlur: I[0] || (I[0] = (V) => K()),
4869
4869
  type: "text",
4870
4870
  class: B(["abl-select-input-focus", w.value ? "abl-select-input-search" : ""]),
4871
4871
  ref_key: "inputFocus",
4872
4872
  ref: l,
4873
- "onUpdate:modelValue": I[1] || (I[1] = (z) => S.value = z),
4873
+ "onUpdate:modelValue": I[1] || (I[1] = (V) => S.value = V),
4874
4874
  onInput: L,
4875
4875
  placeholder: "请输入筛选条件"
4876
4876
  }, null, 34), [
@@ -4900,7 +4900,7 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4900
4900
  }, 16, ["disabled"])
4901
4901
  ], 512));
4902
4902
  }
4903
- }, Vt = /* @__PURE__ */ Q(li, [["__scopeId", "data-v-7842e6e7"]]);
4903
+ }, Vt = /* @__PURE__ */ Q(li, [["__scopeId", "data-v-8fe6fc00"]]);
4904
4904
  const ii = { class: "abl-header" }, ri = { class: "abl-title" }, ci = { class: "abl-extra" }, di = { key: 0 }, ui = ["colspan"], fi = { key: 1 }, pi = {
4905
4905
  __name: "index",
4906
4906
  props: {
@@ -5321,13 +5321,13 @@ const on = (e) => (ge("data-v-349f6091"), e = e(), be(), e), Ci = {
5321
5321
  } else
5322
5322
  H(de, !0);
5323
5323
  setTimeout(() => {
5324
- document.addEventListener("mousedown", V, { once: !0 });
5324
+ document.addEventListener("mousedown", z, { once: !0 });
5325
5325
  });
5326
- }, V = () => {
5326
+ }, z = () => {
5327
5327
  x.value = !1;
5328
5328
  }, I = (C) => {
5329
5329
  n.disabled || (d.start(C), r = n.modelValue, b(r) ? s = r.map(M) : s = M(r), l.value = "start");
5330
- }, z = (C) => {
5330
+ }, V = (C) => {
5331
5331
  if (n.disabled)
5332
5332
  return;
5333
5333
  l.value === "start" && a("dragStart"), d.move(C), l.value = "draging", C.type.startsWith("touch") && (x.value = !0);
@@ -5335,11 +5335,11 @@ const on = (e) => (ge("data-v-349f6091"), e = e(), be(), e), Ci = {
5335
5335
  let D = d.deltaX.value, Z = W.width, re = D / Z * f.value;
5336
5336
  n.vertical && (D = d.deltaY.value, Z = W.height, re = D / Z * f.value), b(s) ? r[o.value] = s[o.value] + re : r = s + re, H(r);
5337
5337
  }, P = (C) => {
5338
- n.disabled || l.value === "draging" && (H(r, !0), a("dragEnd"), window.removeEventListener("mousemove", z), window.removeEventListener("touchmove", z), window.removeEventListener("mouseup", P), window.removeEventListener("touchend", P), window.removeEventListener("contextmenu", P), C.type.startsWith("touch") && (x.value = !1), setTimeout(() => {
5338
+ n.disabled || l.value === "draging" && (H(r, !0), a("dragEnd"), window.removeEventListener("mousemove", V), window.removeEventListener("touchmove", V), window.removeEventListener("mouseup", P), window.removeEventListener("touchend", P), window.removeEventListener("contextmenu", P), C.type.startsWith("touch") && (x.value = !1), setTimeout(() => {
5339
5339
  l.value = "";
5340
5340
  }));
5341
5341
  }, F = (C) => {
5342
- n.disabled || (C.preventDefault(), I(C), window.addEventListener("mousemove", z), window.addEventListener("touchmove", z), window.addEventListener("mouseup", P), window.addEventListener("touchend", P), window.addEventListener("contextmenu", P));
5342
+ n.disabled || (C.preventDefault(), I(C), window.addEventListener("mousemove", V), window.addEventListener("touchmove", V), window.addEventListener("mouseup", P), window.addEventListener("touchend", P), window.addEventListener("contextmenu", P));
5343
5343
  }, ee = (C) => Array.isArray(n.modelValue) && typeof C == "number" ? n.modelValue[C] : Number(n.modelValue);
5344
5344
  return (C, W) => (u(), h("div", {
5345
5345
  class: B(m.value)