@czxingyu/xycomponents 0.1.0 → 0.1.2

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.
@@ -9,7 +9,7 @@ import qe from "dayjs/plugin/quarterOfYear.js";
9
9
  import Je from "dayjs/plugin/weekOfYear.js";
10
10
  import Ye from "dayjs/plugin/weekYear.js";
11
11
  //#region package.json
12
- var Xe = "0.1.0";
12
+ var Xe = "0.1.2";
13
13
  //#endregion
14
14
  //#region components/shared/install.ts
15
15
  function Z(e) {
@@ -6297,13 +6297,10 @@ var zr = [
6297
6297
  t.className,
6298
6298
  v.value.item
6299
6299
  ]]),
6300
- style: T([
6301
- t.style,
6302
- e.direction === "vertical" ? { paddingInlineStart: `${r * 16}px` } : void 0,
6303
- y.value.item
6304
- ])
6300
+ style: T([t.style, y.value.item])
6305
6301
  }, [d("a", {
6306
6302
  class: C(["xy-anchor__link", { "xy-anchor__link--disabled": t.disabled }]),
6303
+ style: T(e.direction === "vertical" && r > 0 ? { paddingInlineStart: `calc(var(--xy-anchor-link-padding-inline) + ${r * 16}px)` } : void 0),
6307
6304
  href: t.href,
6308
6305
  target: t.target,
6309
6306
  rel: t.target === "_blank" ? "noreferrer" : void 0,
@@ -6322,11 +6319,11 @@ var zr = [
6322
6319
  depth: r,
6323
6320
  index: i,
6324
6321
  item: t
6325
- }, () => [p(B(D(t)), 1)])], 6)], 10, Gr)], 6))), 128))], 6)) : l("", !0),
6322
+ }, () => [p(B(D(t)), 1)])], 6)], 14, Gr)], 6))), 128))], 6)) : l("", !0),
6326
6323
  F(n.$slots, "default")
6327
6324
  ], 14, Wr));
6328
6325
  }
6329
- }), [["__scopeId", "data-v-93931713"]])), qr = Z($), Jr = ["aria-busy", "role"], Yr = ["aria-label"], Xr = /*#__PURE__*/ Q(/* @__PURE__ */ g({
6326
+ }), [["__scopeId", "data-v-5b2bf520"]])), qr = Z($), Jr = ["aria-busy", "role"], Yr = ["aria-label"], Xr = /*#__PURE__*/ Q(/* @__PURE__ */ g({
6330
6327
  name: "XyMessage",
6331
6328
  __name: "message",
6332
6329
  props: {
@@ -11872,7 +11869,7 @@ var pa = ["aria-roledescription"], ma = ["aria-label", "disabled"], ha = ["aria-
11872
11869
  style: T(O.value.content)
11873
11870
  }, [d("div", so, [F(n.$slots, "default", {}, void 0, !0)])], 6)), [[te, m.value]])], 14, $a));
11874
11871
  }
11875
- }), [["__scopeId", "data-v-438f5930"]]), uo = /*#__PURE__*/ Q(/* @__PURE__ */ g({
11872
+ }), [["__scopeId", "data-v-3ba91eb0"]]), uo = /*#__PURE__*/ Q(/* @__PURE__ */ g({
11876
11873
  name: "XyCollapse",
11877
11874
  __name: "collapse",
11878
11875
  props: {
@@ -14863,7 +14860,7 @@ var Jo = ["aria-label"], Yo = ["aria-label", "disabled"], Xo = ["aria-label", "d
14863
14860
  }
14864
14861
  },
14865
14862
  setup(e) {
14866
- let n = e, r = G(), i = M(), { width: a } = or(i), o = z([]), f = {
14863
+ let n = e, r = G(), i = M(Object.keys(r)), a = M(), { width: o } = or(a), f = z([]), p = {
14867
14864
  xs: 0,
14868
14865
  sm: 576,
14869
14866
  md: 768,
@@ -14871,28 +14868,28 @@ var Jo = ["aria-label"], Yo = ["aria-label", "disabled"], Xo = ["aria-label", "d
14871
14868
  xl: 1200,
14872
14869
  xxl: 1600,
14873
14870
  xxxl: 1920
14874
- }, p = Object.keys(f);
14875
- function h(e) {
14871
+ }, h = Object.keys(p);
14872
+ function g(e) {
14876
14873
  let t = Number(e);
14877
14874
  return Number.isFinite(t) ? Math.max(1, Math.floor(t)) : 1;
14878
14875
  }
14879
- function g(e, t) {
14880
- return e === "filled" ? t : Math.min(h(e), t);
14881
- }
14882
14876
  function _(e, t) {
14883
- if (typeof e == "number") return h(e);
14884
- let n = p.filter((t) => e[t] !== void 0);
14877
+ return e === "filled" ? t : Math.min(g(e), t);
14878
+ }
14879
+ function v(e, t) {
14880
+ if (typeof e == "number") return g(e);
14881
+ let n = h.filter((t) => e[t] !== void 0);
14885
14882
  if (n.length === 0) return 1;
14886
14883
  let r = e[n[0]];
14887
- for (let i of n) t >= f[i] && (r = e[i]);
14888
- return h(r);
14884
+ for (let i of n) t >= p[i] && (r = e[i]);
14885
+ return g(r);
14889
14886
  }
14890
- let v = s(() => n.bordered), y = s(() => n.colon), b = s(() => _(n.column, a.value)), x = s(() => n.layout), S = s(() => n.size), w = s(() => n.title !== void 0 || !!r.title), E = s(() => n.extra !== void 0 || !!r.extra), D = s(() => w.value || E.value), O = s(() => n.items !== void 0), j = s(() => {
14887
+ let y = s(() => n.bordered), b = s(() => n.colon), x = s(() => v(n.column, o.value)), S = s(() => n.layout), w = s(() => n.size), E = s(() => n.title !== void 0 || i.value.includes("title")), O = s(() => n.extra !== void 0 || i.value.includes("extra")), j = s(() => E.value || O.value), N = s(() => n.items !== void 0), I = s(() => {
14891
14888
  let e = /* @__PURE__ */ new Map(), t = 0, n = 0;
14892
- for (let r of o.value) {
14893
- let i = r.span.value, a = g(i, b.value);
14894
- i === "filled" ? a = Math.max(b.value - t, 1) : t + a > b.value && (t = 0, n += 1);
14895
- let o = t + a >= b.value;
14889
+ for (let r of f.value) {
14890
+ let i = r.span.value, a = _(i, x.value);
14891
+ i === "filled" ? a = Math.max(x.value - t, 1) : t + a > x.value && (t = 0, n += 1);
14892
+ let o = t + a >= x.value;
14896
14893
  e.set(r.id, {
14897
14894
  isLastColumn: o,
14898
14895
  isLastRow: !1,
@@ -14903,78 +14900,82 @@ var Jo = ["aria-label"], Yo = ["aria-label", "disabled"], Xo = ["aria-label", "d
14903
14900
  let r = Math.max(...[...e.values()].map((e) => e.row), 0);
14904
14901
  for (let t of e.values()) t.isLastRow = t.row === r;
14905
14902
  return e;
14906
- }), N = s(() => ({ "--xy-descriptions-column": String(b.value) })), I = s(() => ({
14903
+ }), L = s(() => ({ "--xy-descriptions-column": String(x.value) })), R = s(() => ({
14907
14904
  bordered: n.bordered,
14908
14905
  colon: n.colon,
14909
- column: b.value,
14910
- hasExtra: E.value,
14911
- hasTitle: w.value,
14906
+ column: x.value,
14907
+ hasExtra: O.value,
14908
+ hasTitle: E.value,
14912
14909
  layout: n.layout,
14913
14910
  size: n.size
14914
- })), L = s(() => it(n.classNames, I.value)), R = s(() => at(n.styles, I.value)), B = s(() => [
14911
+ })), B = s(() => it(n.classNames, R.value)), V = s(() => at(n.styles, R.value)), H = s(() => [
14915
14912
  "xy-descriptions",
14916
14913
  `xy-descriptions--${n.layout}`,
14917
14914
  `xy-descriptions--${n.size}`,
14918
14915
  { "xy-descriptions--bordered": n.bordered },
14919
- L.value.root
14920
- ]), V = s(() => L.value.item), H = s(() => R.value.item), W = s(() => L.value.label), ee = s(() => ({
14916
+ B.value.root
14917
+ ]), W = s(() => B.value.item), ee = s(() => V.value.item), K = s(() => B.value.label), te = s(() => ({
14921
14918
  ...n.labelStyle,
14922
- ...R.value.label
14923
- })), K = s(() => L.value.content), te = s(() => ({
14919
+ ...V.value.label
14920
+ })), ne = s(() => B.value.content), re = s(() => ({
14924
14921
  ...n.contentStyle,
14925
- ...R.value.content
14922
+ ...V.value.content
14926
14923
  }));
14927
- function ne(e) {
14928
- return o.value = [...o.value, e], () => {
14929
- o.value = o.value.filter((t) => t.id !== e.id);
14924
+ D(() => {
14925
+ let e = Object.keys(r);
14926
+ e.length === i.value.length && e.every((e, t) => e === i.value[t]) || (i.value = e);
14927
+ });
14928
+ function ie(e) {
14929
+ return f.value = [...f.value, e], () => {
14930
+ f.value = f.value.filter((t) => t.id !== e.id);
14930
14931
  };
14931
14932
  }
14932
- function re(e, t) {
14933
- return ie(e, t).span;
14933
+ function J(e, t) {
14934
+ return ae(e, t).span;
14934
14935
  }
14935
- function ie(e, t) {
14936
- return j.value.get(e) ?? {
14936
+ function ae(e, t) {
14937
+ return I.value.get(e) ?? {
14937
14938
  isLastColumn: !0,
14938
14939
  isLastRow: !0,
14939
- span: g(t, b.value)
14940
+ span: _(t, x.value)
14940
14941
  };
14941
14942
  }
14942
14943
  return A(Ws, {
14943
- bordered: v,
14944
- colon: y,
14945
- column: b,
14946
- contentClassName: K,
14947
- contentStyle: te,
14948
- itemClassName: V,
14949
- itemStyle: H,
14950
- labelClassName: W,
14951
- labelStyle: ee,
14952
- layout: x,
14953
- registerItem: ne,
14954
- resolveItemLayout: ie,
14955
- resolveItemSpan: re,
14956
- size: S
14944
+ bordered: y,
14945
+ colon: b,
14946
+ column: x,
14947
+ contentClassName: ne,
14948
+ contentStyle: re,
14949
+ itemClassName: W,
14950
+ itemStyle: ee,
14951
+ labelClassName: K,
14952
+ labelStyle: te,
14953
+ layout: S,
14954
+ registerItem: ie,
14955
+ resolveItemLayout: ae,
14956
+ resolveItemSpan: J,
14957
+ size: w
14957
14958
  }), (n, r) => (k(), u("section", {
14958
14959
  ref_key: "rootRef",
14959
- ref: i,
14960
- class: C(B.value),
14961
- style: T(R.value.root)
14962
- }, [D.value ? (k(), u("header", {
14960
+ ref: a,
14961
+ class: C(H.value),
14962
+ style: T(V.value.root)
14963
+ }, [j.value ? (k(), u("header", {
14963
14964
  key: 0,
14964
- class: C(["xy-descriptions__header", L.value.header]),
14965
- style: T(R.value.header)
14966
- }, [w.value ? (k(), u("div", {
14965
+ class: C(["xy-descriptions__header", B.value.header]),
14966
+ style: T(V.value.header)
14967
+ }, [E.value ? (k(), u("div", {
14967
14968
  key: 0,
14968
- class: C(["xy-descriptions__title", L.value.title]),
14969
- style: T(R.value.title)
14970
- }, [F(n.$slots, "title", {}, () => [m(U(Gs), { value: e.title }, null, 8, ["value"])], !0)], 6)) : l("", !0), E.value ? (k(), u("div", {
14969
+ class: C(["xy-descriptions__title", B.value.title]),
14970
+ style: T(V.value.title)
14971
+ }, [F(n.$slots, "title", {}, () => [m(U(Gs), { value: e.title }, null, 8, ["value"])], !0)], 6)) : l("", !0), O.value ? (k(), u("div", {
14971
14972
  key: 1,
14972
- class: C(["xy-descriptions__extra", L.value.extra]),
14973
- style: T(R.value.extra)
14973
+ class: C(["xy-descriptions__extra", B.value.extra]),
14974
+ style: T(V.value.extra)
14974
14975
  }, [F(n.$slots, "extra", {}, () => [m(U(Gs), { value: e.extra }, null, 8, ["value"])], !0)], 6)) : l("", !0)], 6)) : l("", !0), d("dl", {
14975
- class: C(["xy-descriptions__view", L.value.view]),
14976
- style: T([N.value, R.value.view])
14977
- }, [O.value ? (k(!0), u(t, { key: 0 }, P(e.items, (e, t) => (k(), c(qs, {
14976
+ class: C(["xy-descriptions__view", B.value.view]),
14977
+ style: T([L.value, V.value.view])
14978
+ }, [N.value ? (k(!0), u(t, { key: 0 }, P(e.items, (e, t) => (k(), c(qs, {
14978
14979
  key: e.key ?? t,
14979
14980
  "class-names": e.classNames,
14980
14981
  "content-style": e.contentStyle,
@@ -14994,7 +14995,7 @@ var Jo = ["aria-label"], Yo = ["aria-label", "disabled"], Xo = ["aria-label", "d
14994
14995
  "styles"
14995
14996
  ]))), 128)) : F(n.$slots, "default", { key: 1 }, void 0, !0)], 6)], 6));
14996
14997
  }
14997
- }), [["__scopeId", "data-v-604e62a9"]]), Ys = Z(qs), Xs = Object.assign(Z(Js), { Item: Ys }), Zs = ["aria-orientation"], Qs = Z(/* @__PURE__ */ Q(/* @__PURE__ */ g({
14998
+ }), [["__scopeId", "data-v-103d68c3"]]), Ys = Z(qs), Xs = Object.assign(Z(Js), { Item: Ys }), Zs = ["aria-orientation"], Qs = Z(/* @__PURE__ */ Q(/* @__PURE__ */ g({
14998
14999
  name: "XyDivider",
14999
15000
  __name: "divider",
15000
15001
  props: {
@@ -22859,11 +22860,7 @@ var od = ["aria-busy", "aria-label"], sd = Z(/* @__PURE__ */ Q(/* @__PURE__ */ g
22859
22860
  style: T([O.value.item, t.style]),
22860
22861
  "data-status": N(t, r),
22861
22862
  "data-step-key": t.key
22862
- }, [d("span", {
22863
- class: C(["xy-steps__tail", D.value.tail]),
22864
- style: T(O.value.tail),
22865
- "aria-hidden": "true"
22866
- }, null, 6), (k(), c(L(y.value ? "button" : "div"), {
22863
+ }, [(k(), c(L(y.value ? "button" : "div"), {
22867
22864
  class: "xy-steps__main",
22868
22865
  "aria-current": r === v.value ? "step" : void 0,
22869
22866
  "aria-disabled": e.disabled || t.disabled || void 0,
@@ -22896,19 +22893,27 @@ var od = ["aria-busy", "aria-label"], sd = Z(/* @__PURE__ */ Q(/* @__PURE__ */ g
22896
22893
  })) : (k(), u("span", dd, B(r + 1), 1)), R(t, r, N(t, r)) ? (k(), u("span", fd, B(S.value) + "% ", 1)) : l("", !0)], !0)], 6), d("span", {
22897
22894
  class: C(["xy-steps__content", D.value.content]),
22898
22895
  style: T(O.value.content)
22899
- }, [d("span", pd, [d("span", {
22900
- class: C(["xy-steps__title", D.value.title]),
22901
- style: T(O.value.title)
22902
- }, [F(n.$slots, "title", {
22903
- current: r === v.value,
22904
- index: r,
22905
- item: t,
22906
- status: N(t, r)
22907
- }, () => [m(U(i), { content: t.title }, null, 8, ["content"])], !0)], 6), t.subTitle ? (k(), u("span", {
22908
- key: 0,
22909
- class: C(["xy-steps__subtitle", D.value.subTitle]),
22910
- style: T(O.value.subTitle)
22911
- }, [m(U(i), { content: t.subTitle }, null, 8, ["content"])], 6)) : l("", !0)]), t.description || U(f).description ? (k(), u("span", {
22896
+ }, [d("span", pd, [
22897
+ d("span", {
22898
+ class: C(["xy-steps__title", D.value.title]),
22899
+ style: T(O.value.title)
22900
+ }, [F(n.$slots, "title", {
22901
+ current: r === v.value,
22902
+ index: r,
22903
+ item: t,
22904
+ status: N(t, r)
22905
+ }, () => [m(U(i), { content: t.title }, null, 8, ["content"])], !0)], 6),
22906
+ t.subTitle ? (k(), u("span", {
22907
+ key: 0,
22908
+ class: C(["xy-steps__subtitle", D.value.subTitle]),
22909
+ style: T(O.value.subTitle)
22910
+ }, [m(U(i), { content: t.subTitle }, null, 8, ["content"])], 6)) : l("", !0),
22911
+ d("span", {
22912
+ class: C(["xy-steps__tail", D.value.tail]),
22913
+ style: T(O.value.tail),
22914
+ "aria-hidden": "true"
22915
+ }, null, 6)
22916
+ ]), t.description || U(f).description ? (k(), u("span", {
22912
22917
  key: 0,
22913
22918
  class: C(["xy-steps__description", D.value.description]),
22914
22919
  style: T(O.value.description)
@@ -22929,7 +22934,7 @@ var od = ["aria-busy", "aria-label"], sd = Z(/* @__PURE__ */ Q(/* @__PURE__ */ g
22929
22934
  "onClick"
22930
22935
  ]))], 14, ld))), 128))], 46, cd)], 6));
22931
22936
  }
22932
- }), [["__scopeId", "data-v-740b4545"]])), hd = [
22937
+ }), [["__scopeId", "data-v-0975956e"]])), hd = [
22933
22938
  "id",
22934
22939
  "aria-checked",
22935
22940
  "aria-describedby",