@fox-js/foxui 4.0.1-92 → 4.0.1-93

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/dist/index.esm.js CHANGED
@@ -4542,20 +4542,21 @@ function Cc(e, t, a = !1) {
4542
4542
  };
4543
4543
  }
4544
4544
  var { componentName: Tc, create: $c, scope: xc } = re("mapping"), Nc = $c(Cc(Tc, xc, !1)), ir = Nc;
4545
- function st(e, t, a, n) {
4546
- const o = "fox-browse-item";
4547
- let r = null;
4548
- a ? r = P(ir, {
4549
- class: [`${o}__mapping`],
4545
+ function st(e, t, a, n, o) {
4546
+ const r = "fox-browse-item";
4547
+ let l = null;
4548
+ a ? l = P(ir, {
4549
+ class: [`${r}__mapping`],
4550
4550
  source: a,
4551
4551
  modelValue: e,
4552
- separator: n
4553
- }, { default: (s) => P(Wn, { class: [`${o}__text`] }, { default: () => s.text }) }) : r = P(Wn, { class: [`${o}__text`] }, { default: () => e });
4554
- const l = {
4552
+ separator: n,
4553
+ emptyText: o
4554
+ }, { default: (i) => P(Wn, { class: [`${r}__text`] }, { default: () => i.text }) }) : l = P(Wn, { class: [`${r}__text`] }, { default: () => e });
4555
+ const s = {
4555
4556
  label: t.default,
4556
- default: () => r
4557
+ default: () => l
4557
4558
  };
4558
- return P(ml, { class: [o] }, l);
4559
+ return P(ml, { class: [r] }, s);
4559
4560
  }
4560
4561
  var sr = {
4561
4562
  type: {
@@ -7580,7 +7581,8 @@ var wr = {
7580
7581
  },
7581
7582
  unit: { type: [String] },
7582
7583
  clearable: { type: [Boolean] },
7583
- maxLength: { type: [Number] }
7584
+ maxLength: { type: [Number] },
7585
+ emptyText: { type: [String] }
7584
7586
  }, zf = {
7585
7587
  ...Me,
7586
7588
  ...Oe,
@@ -7623,16 +7625,17 @@ function Kf(e, t, a, n, o, r, l, s = !1) {
7623
7625
  }
7624
7626
  }, i.prop ?? c.attrs.name), { toLocaleRefs: d } = Be(t), f = d(i, ["placeholder"]), b = R(!1), $ = Ff(), p = R([]), g = R([]), V = k(() => {
7625
7627
  if (Array.isArray(g.value)) {
7628
+ if (g.value.length === 0 && i.emptyText) return i.emptyText;
7626
7629
  if (i.showAllLevels === !1) {
7627
7630
  const Q = g.value.length - 1;
7628
7631
  return g.value[Q];
7629
7632
  }
7630
7633
  return g.value.join(i.separator);
7631
- } else return g.value;
7634
+ } else return g.value ?? i.emptyText;
7632
7635
  }), N = R([]), T = R([]);
7633
7636
  ve([() => i.modelValue, () => p.value], async ([Q, E]) => {
7634
7637
  if (w("setValue", Q), i.lazy === !0) {
7635
- T.value.length == 0 && (g.value = Array.isArray(Q) ? Q : [], N.value = Array.isArray(Q) ? Q : []);
7638
+ T.value.length == 0 && (i.emptyText ? g.value = [i.emptyText] : g.value = Array.isArray(Q) ? Q : [], N.value = Array.isArray(Q) ? Q : []);
7636
7639
  return;
7637
7640
  }
7638
7641
  if (i.valueType === "item") {
@@ -7740,7 +7743,7 @@ function Kf(e, t, a, n, o, r, l, s = !1) {
7740
7743
  m.value = Q;
7741
7744
  }
7742
7745
  }), () => {
7743
- if (S.value === "on" && (C.value || v.value)) return n(V.value, c.slots);
7746
+ if (S.value === "on" && (C.value || v.value)) return n(V.value, c.slots, i.emptyText);
7744
7747
  const Q = {
7745
7748
  class: O.value,
7746
7749
  style: I.value,
@@ -14886,6 +14889,7 @@ var G0 = /* @__PURE__ */ me(X0, [["render", Q0]]), { create: Z0 } = re("tabbar-i
14886
14889
  default: ""
14887
14890
  },
14888
14891
  icon: { type: Object },
14892
+ activeIcon: { type: Object },
14889
14893
  num: {
14890
14894
  type: [String],
14891
14895
  default: ""
@@ -14905,14 +14909,16 @@ var G0 = /* @__PURE__ */ me(X0, [["render", Q0]]), { create: Z0 } = re("tabbar-i
14905
14909
  },
14906
14910
  setup(e, t) {
14907
14911
  const { parent: a, index: n } = In(Hr, { props: e }), o = k(() => n.value === a.state.value);
14908
- function r(l) {
14909
- a && typeof a.state.changeIndex == "function" && a.state.changeIndex(l);
14912
+ function r(s) {
14913
+ a && typeof a.state.changeIndex == "function" && a.state.changeIndex(s);
14910
14914
  }
14915
+ const l = k(() => o.value ? e.activeIcon ?? e.icon : e.icon);
14911
14916
  return {
14912
14917
  state: a.state,
14913
14918
  index: n,
14914
14919
  active: o,
14915
- change: r
14920
+ change: r,
14921
+ currentIcon: l
14916
14922
  };
14917
14923
  }
14918
14924
  }), eb = { class: "fox-tabbar-item_icon-box" }, tb = {
@@ -14933,7 +14939,7 @@ function rb(e, t, a, n, o, r) {
14933
14939
  }, [j("view", eb, [
14934
14940
  e.dot ? te("", !0) : (x(), D(be, { key: 0 }, [e.num && e.num <= 99 ? (x(), D("view", tb, se(e.num), 1)) : e.num && e.num > 100 ? (x(), D("view", nb, se("99+"))) : te("", !0)], 64)),
14935
14941
  e.dot ? (x(), D("div", ab)) : te("", !0),
14936
- e.icon ? (x(), D("view", lb, [(x(), Se(St(e.icon), {
14942
+ e.icon ? (x(), D("view", lb, [(x(), Se(St(e.currentIcon), {
14937
14943
  class: "fox-tabbar-item_icon-box_icon",
14938
14944
  width: e.state.size,
14939
14945
  height: e.state.size
@@ -18927,7 +18933,10 @@ function V2(e, t, a, n, o, r) {
18927
18933
  lineHeight: e.toPxString(e.height)
18928
18934
  }),
18929
18935
  onClick: (u) => e.go(c)
18930
- }, [ue(e.$slots, "item", {}, () => [Le(se(c), 1)])], 12, N2))), 128))], 4)), j("view", {
18936
+ }, [ue(e.$slots, "item", {
18937
+ item: c,
18938
+ index: h
18939
+ }, () => [Le(se(c), 1)])], 12, N2))), 128))], 4)), j("view", {
18931
18940
  class: "go",
18932
18941
  onClick: t[4] || (t[4] = (c) => !e.slots.rightIcon && e.handleClickIcon())
18933
18942
  }, [ue(e.$slots, "right-icon", {}, () => [e.closeMode ? (x(), Se(s, {