@dskripchenko/ui 1.6.0 → 1.6.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.
package/dist/index.mjs CHANGED
@@ -874,6 +874,7 @@ var it = ["for"], at = {
874
874
  ]]) }, [e.dot ? s("", !0) : A(t.$slots, "default", { key: 0 })], 2));
875
875
  }
876
876
  }), nn = {
877
+ code: "ru-RU",
877
878
  common: {
878
879
  clear: "Очистить",
879
880
  close: "Закрыть",
@@ -6255,14 +6256,15 @@ var Cc = {
6255
6256
  variant: { default: "card" },
6256
6257
  icon: {},
6257
6258
  loading: { type: Boolean },
6258
- footer: {}
6259
+ footer: {},
6260
+ locale: { default: void 0 }
6259
6261
  },
6260
6262
  setup(t) {
6261
- let n = t, r = a(() => n.value === void 0 ? "" : n.formatter ? n.formatter(n.value) : typeof n.value == "number" ? n.value.toLocaleString("ru-RU", {
6263
+ let n = t, r = $(), i = a(() => n.locale ?? r.value.code ?? "ru-RU"), d = a(() => n.value === void 0 ? "" : n.formatter ? n.formatter(n.value) : typeof n.value == "number" ? n.value.toLocaleString(i.value, {
6262
6264
  minimumFractionDigits: n.precision,
6263
6265
  maximumFractionDigits: n.precision
6264
- }) : String(n.value)), i = a(() => n.trend === void 0 ? null : n.trend > 0 ? "up" : n.trend < 0 ? "down" : "flat"), d = a(() => i.value === "up" ? ne : i.value === "down" ? te : null), f = a(() => n.trend === void 0 ? "" : `${Math.abs(n.trend).toLocaleString("ru-RU", { maximumFractionDigits: 2 })}${n.trendSuffix}`);
6265
- return (n, a) => (T(), c("div", { class: y(["uid-stat", [
6266
+ }) : String(n.value)), f = a(() => n.trend === void 0 ? null : n.trend > 0 ? "up" : n.trend < 0 ? "down" : "flat"), p = a(() => f.value === "up" ? ne : f.value === "down" ? te : null), m = a(() => n.trend === void 0 ? "" : `${Math.abs(n.trend).toLocaleString(i.value, { maximumFractionDigits: 2 })}${n.trendSuffix}`);
6267
+ return (n, r) => (T(), c("div", { class: y(["uid-stat", [
6266
6268
  `uid-stat--${t.tone}`,
6267
6269
  t.variant === "ghost" && "uid-stat--ghost",
6268
6270
  t.loading && "uid-stat--loading"
@@ -6274,16 +6276,16 @@ var Cc = {
6274
6276
  t.title ? (T(), c("p", Qc, P(t.title), 1)) : s("", !0),
6275
6277
  l("div", $c, [l("span", el, [A(n.$slots, "value", {}, () => [
6276
6278
  t.prefix ? (T(), c("span", tl, P(t.prefix), 1)) : s("", !0),
6277
- l("span", null, P(r.value), 1),
6279
+ l("span", null, P(d.value), 1),
6278
6280
  t.suffix ? (T(), c("span", nl, P(t.suffix), 1)) : s("", !0)
6279
6281
  ])]), t.trend !== void 0 || n.$slots.trend ? (T(), c("span", {
6280
6282
  key: 0,
6281
- class: y(["uid-stat__trend", i.value && `uid-stat__trend--${i.value}`])
6282
- }, [A(n.$slots, "trend", {}, () => [d.value ? (T(), o(e, {
6283
+ class: y(["uid-stat__trend", f.value && `uid-stat__trend--${f.value}`])
6284
+ }, [A(n.$slots, "trend", {}, () => [p.value ? (T(), o(e, {
6283
6285
  key: 0,
6284
- icon: d.value,
6286
+ icon: p.value,
6285
6287
  size: 12
6286
- }, null, 8, ["icon"])) : s("", !0), l("span", null, P(f.value), 1)])], 2)) : s("", !0)]),
6288
+ }, null, 8, ["icon"])) : s("", !0), l("span", null, P(m.value), 1)])], 2)) : s("", !0)]),
6287
6289
  t.footer || n.$slots.footer ? (T(), c("p", rl, [A(n.$slots, "footer", {}, () => [u(P(t.footer), 1)])])) : s("", !0)
6288
6290
  ])], 2));
6289
6291
  }
@@ -8615,14 +8617,16 @@ var Cc = {
8615
8617
  center: "center",
8616
8618
  end: "end",
8617
8619
  stretch: "stretch"
8618
- }, r = a(() => ({
8619
- gridTemplateColumns: typeof t.cols == "number" ? `repeat(${t.cols}, minmax(0, 1fr))` : t.cols,
8620
- gap: t.rowGap || t.colGap ? void 0 : t.gap,
8621
- rowGap: t.rowGap,
8622
- columnGap: t.colGap,
8623
- alignItems: t.align ? n[t.align] : void 0,
8624
- justifyItems: t.justify ? n[t.justify] : void 0
8625
- }));
8620
+ }, r = a(() => {
8621
+ let e = !!(t.rowGap || t.colGap), r = {
8622
+ gridTemplateColumns: typeof t.cols == "number" ? `repeat(${t.cols}, minmax(0, 1fr))` : t.cols,
8623
+ rowGap: e ? t.rowGap : t.gap,
8624
+ columnGap: e ? t.colGap : t.gap,
8625
+ alignItems: t.align ? n[t.align] : void 0,
8626
+ justifyItems: t.justify ? n[t.justify] : void 0
8627
+ };
8628
+ return Object.fromEntries(Object.entries(r).filter(([, e]) => e !== void 0 && e !== ""));
8629
+ });
8626
8630
  return (t, n) => (T(), o(M(e.as), {
8627
8631
  class: "uid-grid",
8628
8632
  style: b(r.value)
@@ -9089,6 +9093,7 @@ var wp = { class: "uid-layout-sidebar__sidebar" }, Tp = { class: "uid-layout-sid
9089
9093
  return on(a(() => t.locale)), (e, t) => A(e.$slots, "default");
9090
9094
  }
9091
9095
  }), Hp = {
9096
+ code: "en-US",
9092
9097
  common: {
9093
9098
  clear: "Clear",
9094
9099
  close: "Close",
@@ -1,4 +1,6 @@
1
1
  export interface UidLocale {
2
+ /** BCP 47 tag used for Intl / toLocaleString number and date formatting. */
3
+ code?: string;
2
4
  common: {
3
5
  clear: string;
4
6
  close: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dskripchenko/ui",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "Vue 3 component, token, and theme library on CSS custom properties",
5
5
  "keywords": [
6
6
  "vue",