abl-ui 0.2.76 → 0.2.77

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, 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;
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;
1272
1272
  return {
1273
1273
  [m]: p[m] + F,
1274
1274
  data: {
1275
- [m]: V,
1276
- centerOffset: I - V - F,
1275
+ [m]: z,
1276
+ centerOffset: I - z - 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, z = k[U];
1322
- if (z)
1321
+ const U = (((K = s.flip) == null ? void 0 : K.index) || 0) + 1, V = k[U];
1322
+ if (V)
1323
1323
  return {
1324
1324
  data: {
1325
1325
  index: U,
1326
1326
  overflows: M
1327
1327
  },
1328
1328
  reset: {
1329
- placement: z
1329
+ placement: V
1330
1330
  }
1331
1331
  };
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;
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;
1333
1333
  if (!I)
1334
1334
  switch (m) {
1335
1335
  case "bestFit": {
1336
1336
  var H;
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);
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);
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, z;
2728
+ let U, V;
2729
2729
  try {
2730
2730
  U = q.toString().split(".")[1].length;
2731
2731
  } catch {
2732
2732
  U = 0;
2733
2733
  }
2734
2734
  try {
2735
- z = H.toString().split(".")[1].length;
2735
+ V = H.toString().split(".")[1].length;
2736
2736
  } catch {
2737
- z = 0;
2737
+ V = 0;
2738
2738
  }
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;
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;
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: z, right: I, bottom: V } = H.getBoundingClientRect(), P = document.documentElement.clientWidth, F = document.documentElement.clientHeight;
2759
+ const H = q.target, { top: U, left: V, right: I, bottom: z } = 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 - 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;
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;
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, z) => X((u(), h("div", {
2802
- key: z,
2801
+ (u(!0), h(Y, null, te(e.previewSrcList, (U, V) => X((u(), h("div", {
2802
+ key: V,
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(z),
2809
+ onLoad: (I) => w(V),
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 === z]
2819
+ [J, r.value === V]
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((z) => {
4695
- z.value == a.modelValue && (z.selected = !0);
4696
- }) : a == null || a.options.map((z) => {
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) => {
4697
4697
  a.modelValue.map((I) => {
4698
- z.value == I && (z.selected = !0);
4698
+ V.value == I && (V.selected = !0);
4699
4699
  });
4700
4700
  });
4701
4701
  const o = t, s = ke({
@@ -4711,69 +4711,73 @@ 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((z) => z.selected === !0)
4714
+ (H = a == null ? void 0 : a.options) == null ? void 0 : H.filter((V) => V.selected === !0)
4715
4715
  );
4716
- n.default && (m.list = [], (U = n.default()) == null || U.map((z) => {
4716
+ n.default && (m.list = [], (U = n.default()) == null || U.map((V) => {
4717
4717
  var I;
4718
- if (z.props) {
4719
- const { value: V, name: P, img: F } = z.props;
4718
+ if (V.props) {
4719
+ const { value: z, name: P, img: F } = V.props;
4720
4720
  m.list.push({
4721
- value: V,
4721
+ value: z,
4722
4722
  name: P,
4723
4723
  img: F
4724
- }), f.value === V && $.push({
4725
- value: V,
4724
+ }), f.value === z && $.push({
4725
+ value: z,
4726
4726
  name: P,
4727
4727
  img: F
4728
4728
  });
4729
4729
  } else
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;
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;
4732
4732
  m.list.push({
4733
4733
  value: P,
4734
4734
  name: F,
4735
4735
  img: ee
4736
- }), f.value === P.value && $.push({
4736
+ }), f.value === P && $.push({
4737
4737
  value: P,
4738
4738
  name: F,
4739
4739
  img: ee
4740
4740
  });
4741
4741
  });
4742
4742
  }));
4743
- const L = (z) => {
4743
+ const L = (V) => {
4744
4744
  if (!w.value)
4745
4745
  S.value = "";
4746
4746
  else {
4747
- const I = a.options.filter((V) => V.name.includes(z.target.value));
4747
+ const I = a.options.filter((z) => z.name.includes(V.target.value));
4748
4748
  m.list = I;
4749
4749
  }
4750
- }, k = (z) => {
4751
- a.disabled || (v.value = !0, z.stopPropagation(), d.value === "focus" ? d.value = "blur" : d.value = "focus");
4752
- }, y = (z, I) => {
4750
+ }, k = (V) => {
4751
+ a.disabled || (v.value = !0, V.stopPropagation(), d.value === "focus" ? d.value = "blur" : d.value = "focus");
4752
+ }, y = (V, I) => {
4753
4753
  var P;
4754
4754
  if (a.disabled)
4755
4755
  return;
4756
+ if (V.name == r.value) {
4757
+ g.value.close();
4758
+ return;
4759
+ }
4756
4760
  v.value = !1, I.stopPropagation(), (P = l.value) == null || P.blur();
4757
- let V = null;
4761
+ let z = null;
4758
4762
  if (a.type === "single")
4759
- d.value = "blur", $[0] && $[0].value === z.value ? $.shift() : $[0] = z, V = z.value;
4763
+ d.value = "blur", $[0] && $[0].value === V.value ? $.shift() : $[0] = V, z = V.value;
4760
4764
  else {
4761
- V || (V = []);
4762
- const F = $.findIndex((ee) => ee.value === z.value);
4763
- F > -1 ? $.splice(F, 1) : $.push(z), $.map((ee) => {
4764
- V.push(ee.value);
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
4769
  });
4766
4770
  }
4767
- o("update:modelValue", V), o("change", at($)), g.value.close();
4771
+ o("update:modelValue", z), o("change", at($)), g.value.close();
4768
4772
  };
4769
4773
  Ie("handleSlotClick", y);
4770
4774
  const A = () => {
4771
- var z;
4772
- (z = l.value) == null || z.focus(), !w.value && d.value === "focus" && $.length > 0 && ($.pop(), o("change", at($)));
4773
- }, M = (z) => {
4774
4775
  var V;
4775
- (V = l.value) == null || V.focus();
4776
- const I = $.findIndex((P) => P.value === z.value);
4776
+ (V = l.value) == null || V.focus(), !w.value && d.value === "focus" && $.length > 0 && ($.pop(), o("change", at($)));
4777
+ }, M = (V) => {
4778
+ var z;
4779
+ (z = l.value) == null || z.focus();
4780
+ const I = $.findIndex((P) => P.value === V.value);
4777
4781
  $.splice(I, 1), o("change", at($));
4778
4782
  }, K = () => {
4779
4783
  d.value = "blur";
@@ -4782,20 +4786,20 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4782
4786
  };
4783
4787
  return ue(
4784
4788
  v,
4785
- (z) => {
4786
- w.value = a.search && d.value === "focus" && z;
4789
+ (V) => {
4790
+ w.value = a.search && d.value === "focus" && V;
4787
4791
  },
4788
4792
  { immediate: !0, deep: !0 }
4789
4793
  ), ue(
4790
4794
  $,
4791
- (z) => {
4792
- r.value = z.map((I) => I == null ? void 0 : I.name).join(",");
4795
+ (V) => {
4796
+ r.value = V.map((I) => I == null ? void 0 : I.name).join(",");
4793
4797
  },
4794
4798
  { immediate: !0, deep: !0 }
4795
4799
  ), me(() => {
4796
- ue(d, (z) => {
4797
- var I, V;
4798
- z === "focus" ? (I = l.value) == null || I.focus() : (V = l.value) == null || V.blur(), w.value = a.search && z === "focus" && v;
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;
4799
4803
  }), document.body.addEventListener("click", () => {
4800
4804
  d.value = "blur";
4801
4805
  });
@@ -4803,7 +4807,7 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4803
4807
  f.value = a.modelValue;
4804
4808
  }, {
4805
4809
  immediate: !0
4806
- }), (z, I) => (u(), h("div", {
4810
+ }), (V, I) => (u(), h("div", {
4807
4811
  ref_key: "selectRef",
4808
4812
  ref: i
4809
4813
  }, [
@@ -4819,19 +4823,19 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4819
4823
  class: "abl-select-options-warpper",
4820
4824
  style: O(p.value)
4821
4825
  }, [
4822
- m.list.length > 0 ? (u(!0), h(Y, { key: 0 }, te(m.list, (V, P) => (u(), h("div", {
4823
- class: B(["abl-select-options-item", $.some((F) => F.value === V.value) ? "abl-options-item-active" : ""]),
4824
- key: V.name + V.value,
4825
- onClick: (F) => y(V, F)
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
4830
  }, [
4827
- V.img ? (u(), h("img", {
4831
+ z.img ? (u(), h("img", {
4828
4832
  key: 0,
4829
4833
  class: "abl-select-options-item-img",
4830
- src: V.img
4834
+ src: z.img
4831
4835
  }, null, 8, oi)) : E("", !0),
4832
4836
  c("span", {
4833
- class: B(V.img ? "haveImg" : "")
4834
- }, N(V.name), 3)
4837
+ class: B(z.img ? "haveImg" : "")
4838
+ }, N(z.name), 3)
4835
4839
  ], 10, ai))), 128)) : (u(), h("div", si, " 暂无数据 "))
4836
4840
  ], 4)
4837
4841
  ]),
@@ -4846,14 +4850,14 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4846
4850
  c("div", Kl, [
4847
4851
  X(c("div", Gl, [
4848
4852
  b.value ? (u(), h("div", Jl, [
4849
- (u(!0), h(Y, null, te($, (V) => (u(), h("div", {
4853
+ (u(!0), h(Y, null, te($, (z) => (u(), h("div", {
4850
4854
  class: "abl-select-tag",
4851
- key: V.value
4855
+ key: z.value
4852
4856
  }, [
4853
- G(N(V.name) + " ", 1),
4857
+ G(N(z.name) + " ", 1),
4854
4858
  c("span", {
4855
4859
  class: "abl-select-tag-close",
4856
- onClick: j((P) => M(V), ["stop"])
4860
+ onClick: j((P) => M(z), ["stop"])
4857
4861
  }, "x", 8, Zl)
4858
4862
  ]))), 128))
4859
4863
  ])) : (u(), h("span", Ql, N(r.value), 1))
@@ -4861,12 +4865,12 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4861
4865
  [J, $.length && !w.value]
4862
4866
  ]),
4863
4867
  X(c("input", {
4864
- onBlur: I[0] || (I[0] = (V) => K()),
4868
+ onBlur: I[0] || (I[0] = (z) => K()),
4865
4869
  type: "text",
4866
4870
  class: B(["abl-select-input-focus", w.value ? "abl-select-input-search" : ""]),
4867
4871
  ref_key: "inputFocus",
4868
4872
  ref: l,
4869
- "onUpdate:modelValue": I[1] || (I[1] = (V) => S.value = V),
4873
+ "onUpdate:modelValue": I[1] || (I[1] = (z) => S.value = z),
4870
4874
  onInput: L,
4871
4875
  placeholder: "请输入筛选条件"
4872
4876
  }, null, 34), [
@@ -4896,7 +4900,7 @@ const Yl = { class: "abl-select-warpper-content" }, Kl = { class: "abl-select-in
4896
4900
  }, 16, ["disabled"])
4897
4901
  ], 512));
4898
4902
  }
4899
- }, Vt = /* @__PURE__ */ Q(li, [["__scopeId", "data-v-8ec1659a"]]);
4903
+ }, Vt = /* @__PURE__ */ Q(li, [["__scopeId", "data-v-7842e6e7"]]);
4900
4904
  const ii = { class: "abl-header" }, ri = { class: "abl-title" }, ci = { class: "abl-extra" }, di = { key: 0 }, ui = ["colspan"], fi = { key: 1 }, pi = {
4901
4905
  __name: "index",
4902
4906
  props: {
@@ -5317,13 +5321,13 @@ const on = (e) => (ge("data-v-349f6091"), e = e(), be(), e), Ci = {
5317
5321
  } else
5318
5322
  H(de, !0);
5319
5323
  setTimeout(() => {
5320
- document.addEventListener("mousedown", z, { once: !0 });
5324
+ document.addEventListener("mousedown", V, { once: !0 });
5321
5325
  });
5322
- }, z = () => {
5326
+ }, V = () => {
5323
5327
  x.value = !1;
5324
5328
  }, I = (C) => {
5325
5329
  n.disabled || (d.start(C), r = n.modelValue, b(r) ? s = r.map(M) : s = M(r), l.value = "start");
5326
- }, V = (C) => {
5330
+ }, z = (C) => {
5327
5331
  if (n.disabled)
5328
5332
  return;
5329
5333
  l.value === "start" && a("dragStart"), d.move(C), l.value = "draging", C.type.startsWith("touch") && (x.value = !0);
@@ -5331,11 +5335,11 @@ const on = (e) => (ge("data-v-349f6091"), e = e(), be(), e), Ci = {
5331
5335
  let D = d.deltaX.value, Z = W.width, re = D / Z * f.value;
5332
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);
5333
5337
  }, P = (C) => {
5334
- 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(() => {
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(() => {
5335
5339
  l.value = "";
5336
5340
  }));
5337
5341
  }, F = (C) => {
5338
- 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));
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));
5339
5343
  }, ee = (C) => Array.isArray(n.modelValue) && typeof C == "number" ? n.modelValue[C] : Number(n.modelValue);
5340
5344
  return (C, W) => (u(), h("div", {
5341
5345
  class: B(m.value)