@nmorph/nmorph-ui-kit 2.2.26 → 2.2.28

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.
@@ -1,7 +1,7 @@
1
1
  import './NmorphBadge.css';
2
- import { defineComponent as N, computed as t, ref as b, onMounted as B, watch as I, nextTick as T } from "vue";
2
+ import { defineComponent as N, computed as t, ref as b, onMounted as I, watch as T, nextTick as V } from "vue";
3
3
  import { useModifiers as p } from "../../../utils/create-modifiers.js";
4
- const X = /* @__PURE__ */ N({
4
+ const F = /* @__PURE__ */ N({
5
5
  __name: "NmorphBadge",
6
6
  props: {
7
7
  value: { type: [Number, String], required: !1, default: void 0 },
@@ -11,6 +11,7 @@ const X = /* @__PURE__ */ N({
11
11
  isDot: { type: Boolean, required: !1, default: !1 },
12
12
  isTag: { type: Boolean, required: !1, default: !1 },
13
13
  hidden: { type: Boolean, required: !1, default: !1 },
14
+ hideOnFalsyValue: { type: Boolean, required: !1, default: !1 },
14
15
  color: { type: String, required: !1, default: "var(--nmorph-accent-color)" },
15
16
  size: { type: String, required: !1, default: "base" },
16
17
  offsetY: { type: Number, required: !1, default: 0 },
@@ -18,57 +19,60 @@ const X = /* @__PURE__ */ N({
18
19
  zIndex: { type: Number, required: !1, default: 1 },
19
20
  disabled: { type: Boolean, required: !1, default: !1 }
20
21
  },
21
- setup(m, { expose: y }) {
22
- y();
23
- const e = m, o = t(() => e.type !== "default" ? e.type : e.isDot ? "dot" : e.isTag ? "tag" : "default"), c = t(() => o.value === "dot"), n = t(() => o.value === "tag"), r = t(() => o.value === "ribbon"), g = t(
22
+ setup(m, { expose: g }) {
23
+ g();
24
+ const e = m, o = t(() => e.type !== "default" ? e.type : e.isDot ? "dot" : e.isTag ? "tag" : "default"), c = t(() => o.value === "dot"), n = t(() => o.value === "tag"), a = t(() => o.value === "ribbon"), h = t(
24
25
  () => p({
25
26
  "nmorph-badge": [
26
27
  `${e.hidden && "hidden"}`,
27
28
  `${n.value && "tag"}`,
28
- `${r.value && "ribbon"}`,
29
- `${r.value && `ribbon-${e.ribbonCorner}`}`,
29
+ `${a.value && "ribbon"}`,
30
+ `${a.value && `ribbon-${e.ribbonCorner}`}`,
30
31
  e.size
31
32
  ]
32
33
  })
33
- ), h = t(
34
+ ), x = t(
34
35
  () => p({
35
36
  "nmorph-badge__container": [
36
37
  `${e.hidden && "hidden"}`,
37
38
  `${n.value && "tag"}`,
38
- `${r.value && "ribbon"}`,
39
- `${r.value && `ribbon-${e.ribbonCorner}`}`
39
+ `${a.value && "ribbon"}`,
40
+ `${a.value && `ribbon-${e.ribbonCorner}`}`
40
41
  ]
41
42
  })
42
- ), x = t(
43
+ ), $ = t(
43
44
  () => p({
44
45
  "nmorph-badge__ribbon-corner": [`${e.ribbonCorner}`]
45
46
  })
46
- ), $ = t(() => typeof Number(e.value) == "number" && Number(e.value) > e.max ? `${e.max}+` : e.value), _ = t(() => c.value || e.value !== void 0), i = t(() => {
47
- const a = `${(s?.value / 2 + e.offsetX) * -1}px`, C = `${(d?.value / 2 + e.offsetY) * -1}px`;
47
+ ), q = t(() => typeof Number(e.value) == "number" && Number(e.value) > e.max ? `${e.max}+` : e.value), v = t(() => e.hideOnFalsyValue && !e.value), _ = t(() => (c.value || e.value !== void 0) && !v.value), u = t(() => {
48
+ const r = `${(s?.value / 2 + e.offsetX) * -1}px`, C = `${(d?.value / 2 + e.offsetY) * -1}px`;
48
49
  return {
49
- x: a,
50
+ x: r,
50
51
  y: C
51
52
  };
52
- }), q = t(() => n.value || r.value ? {
53
+ }), z = t(() => n.value || a.value ? {
53
54
  zIndex: e.zIndex
54
55
  } : {
55
- right: i.value.x,
56
- top: i.value.y,
56
+ right: u.value.x,
57
+ top: u.value.y,
57
58
  zIndex: e.zIndex
58
- }), l = (a) => typeof a == "number" ? `${a}px` : a, u = b(null), s = b(0), d = b(0), z = t(() => ({
59
+ }), i = (r) => typeof r == "number" ? `${r}px` : r, l = b(null), s = b(0), d = b(0), S = t(() => ({
59
60
  "--nmorph-badge-color": e.color,
60
- ...e.offsetX !== 0 && { "--nmorph-badge-ribbon-offset-x": l(e.offsetX) },
61
- ...e.offsetY !== 0 && { "--nmorph-badge-ribbon-offset-y": l(e.offsetY) }
61
+ ...e.offsetX !== 0 && { "--nmorph-badge-ribbon-offset-x": i(e.offsetX) },
62
+ ...e.offsetY !== 0 && { "--nmorph-badge-ribbon-offset-y": i(e.offsetY) }
62
63
  })), f = async () => {
63
- await T(), !(!u.value || n.value || r.value) && (s.value = u.value.clientWidth, d.value = u.value.clientHeight);
64
- }, S = t(() => ({
64
+ await V(), !(!l.value || n.value || a.value) && (s.value = l.value.clientWidth, d.value = l.value.clientHeight);
65
+ }, B = t(() => ({
65
66
  zIndex: e.zIndex
66
67
  }));
67
- B(f), I(() => [e.value, e.max, o.value, e.ribbonCorner, e.size], f);
68
- const v = { props: e, resolvedType: o, isDotType: c, isTagType: n, isRibbon: r, modifiers: g, containerModifiers: h, ribbonCornerModifiers: x, displayValue: $, shouldShowBadge: _, appliedOffset: i, containerStyle: q, getCssSize: l, badge: u, badgeWidth: s, badgeHeight: d, styles: z, updateBadgeSize: f, ribbonFrameStyle: S };
69
- return Object.defineProperty(v, "__isScriptSetup", { enumerable: !1, value: !0 }), v;
68
+ I(f), T(
69
+ () => [e.value, e.max, o.value, e.ribbonCorner, e.size, e.hideOnFalsyValue],
70
+ f
71
+ );
72
+ const y = { props: e, resolvedType: o, isDotType: c, isTagType: n, isRibbon: a, modifiers: h, containerModifiers: x, ribbonCornerModifiers: $, displayValue: q, shouldHideOnFalsyValue: v, shouldShowBadge: _, appliedOffset: u, containerStyle: z, getCssSize: i, badge: l, badgeWidth: s, badgeHeight: d, styles: S, updateBadgeSize: f, ribbonFrameStyle: B };
73
+ return Object.defineProperty(y, "__isScriptSetup", { enumerable: !1, value: !0 }), y;
70
74
  }
71
75
  });
72
76
  export {
73
- X as default
77
+ F as default
74
78
  };
@@ -1 +1 @@
1
- .nmorph-dialog{position:absolute;top:50%;left:50%;display:flex;flex-direction:column;box-sizing:border-box;width:var(--width);max-width:var(--nmorph-dialog-max-width, calc(100vw - 32px) );max-height:var(--nmorph-dialog-max-height, var(--nmorph-dialog-default-max-height));padding:var(--indentation-02);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);transform:translate(-50%,-50%);--width: var(--nmorph-dialog-width);--nmorph-dialog-default-max-height: calc(100vh - 32px) }@supports (height: 100dvh){.nmorph-dialog{--nmorph-dialog-default-max-height: calc(100dvh - 32px) }}.nmorph-dialog .nmorph-dialog__header{display:flex;flex:0 0 auto;justify-content:space-between;align-items:center;box-sizing:border-box;padding:var(--indentation-02);font-weight:600;font-size:var(--font-size-large);line-height:var(--line-height-loose)}.nmorph-dialog .nmorph-dialog__close-icon{flex:0 0 auto;cursor:pointer}.nmorph-dialog .nmorph-dialog__content{flex:1 1 auto;box-sizing:border-box;min-height:0;padding:var(--indentation-02);overflow-y:auto}
1
+ .nmorph-dialog{position:absolute;top:50%;left:50%;display:flex;flex-direction:column;box-sizing:border-box;width:var(--width);max-width:var(--nmorph-dialog-max-width, calc(100vw - 32px) );max-height:var(--nmorph-dialog-max-height, var(--nmorph-dialog-default-max-height));padding:var(--indentation-02);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);transform:translate(-50%,-50%);--width: var(--nmorph-dialog-width);--nmorph-dialog-default-max-height: calc(100vh - 32px) }@supports (height: 100dvh){.nmorph-dialog{--nmorph-dialog-default-max-height: calc(100dvh - 32px) }}.nmorph-dialog .nmorph-dialog__header{display:flex;flex:0 0 auto;justify-content:space-between;align-items:center;box-sizing:border-box;padding:var(--indentation-02);font-weight:600;font-size:var(--font-size-large);line-height:var(--line-height-loose)}.nmorph-dialog .nmorph-dialog__close-icon{flex:0 0 auto;cursor:pointer}.nmorph-dialog .nmorph-dialog__content{flex:1 1 auto;box-sizing:border-box;min-height:0;padding:var(--indentation-02);overflow:hidden auto}