@nmorph/nmorph-ui-kit 2.2.23 → 2.2.25

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 +1 @@
1
- .nmorph-badge{position:relative;display:inline-block;height:fit-content;--dot-size: 4px}.nmorph-badge .nmorph-badge__container{position:absolute;display:inline-flex;justify-content:center;align-items:center;background:var(--nmorph-badge-color);border-radius:var(--default-border-radius);opacity:1}.nmorph-badge.nmorph-badge--tag{position:static;display:inline-flex}.nmorph-badge .nmorph-badge__container--tag{position:static}.nmorph-badge .nmorph-badge__content{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;min-width:calc(1em * var(--line-height-regular) + 4px);padding:2px 4px;color:var(--nmorph-light-shade-color);font-size:var(--font-size-base);line-height:var(--line-height-regular);text-align:center}.nmorph-badge.nmorph-badge--tiny .nmorph-badge__content{font-size:var(--font-size-tiny)}.nmorph-badge.nmorph-badge--extra-small .nmorph-badge__content{font-size:var(--font-size-extra-small)}.nmorph-badge .nmorph-badge__container--hidden{opacity:0}.nmorph-badge .nmorph-badge__dot{width:var(--dot-size);height:var(--dot-size);border-radius:var(--border-radius-circular)}
1
+ .nmorph-badge{position:relative;display:inline-block;height:fit-content;--nmorph-badge-dot-size: 4px;--nmorph-badge-ribbon-height: 24px;--nmorph-badge-ribbon-corner-size: 62px;--nmorph-badge-ribbon-width: 116px;--nmorph-badge-ribbon-offset-x: 0px;--nmorph-badge-ribbon-offset-y: 0px}.nmorph-badge .nmorph-badge__container{position:absolute;display:inline-flex;justify-content:center;align-items:center;background:var(--nmorph-badge-color);border-radius:var(--default-border-radius);opacity:1}.nmorph-badge.nmorph-badge--tag{position:static;display:inline-flex}.nmorph-badge .nmorph-badge__container--tag{position:static}.nmorph-badge .nmorph-badge__content{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;min-width:calc(1em * var(--line-height-regular) + 4px);padding:2px 4px;color:var(--nmorph-light-shade-color);font-size:var(--font-size-base);line-height:var(--line-height-regular);text-align:center}.nmorph-badge.nmorph-badge--tiny .nmorph-badge__content{font-size:var(--font-size-tiny)}.nmorph-badge.nmorph-badge--extra-small .nmorph-badge__content{font-size:var(--font-size-extra-small)}.nmorph-badge .nmorph-badge__container--hidden{opacity:0}.nmorph-badge .nmorph-badge__ribbon-frame{position:absolute;inset:0;overflow:hidden;border-radius:var(--default-border-radius);pointer-events:none}.nmorph-badge .nmorph-badge__ribbon-corner{position:absolute;width:var(--nmorph-badge-ribbon-corner-size);height:var(--nmorph-badge-ribbon-corner-size)}.nmorph-badge .nmorph-badge__container--ribbon{top:50%;left:50%;width:var(--nmorph-badge-ribbon-width);height:var(--nmorph-badge-ribbon-height);border-radius:0;box-shadow:var(--nmorph-shadow-outset)}.nmorph-badge .nmorph-badge__container--ribbon .nmorph-badge__content{width:100%;min-width:0;padding:0 var(--indentation-03);overflow:hidden;font-weight:600;font-size:var(--font-size-extra-small);white-space:nowrap;text-overflow:ellipsis;transform:translateY(-1px)}.nmorph-badge .nmorph-badge__ribbon-corner--top-left{top:var(--nmorph-badge-ribbon-offset-y);left:var(--nmorph-badge-ribbon-offset-x)}.nmorph-badge .nmorph-badge__ribbon-corner--top-left .nmorph-badge__container--ribbon{transform:translate(-50%,-50%) rotate(-45deg)}.nmorph-badge .nmorph-badge__ribbon-corner--top-right{top:var(--nmorph-badge-ribbon-offset-y);right:var(--nmorph-badge-ribbon-offset-x)}.nmorph-badge .nmorph-badge__ribbon-corner--top-right .nmorph-badge__container--ribbon{transform:translate(-50%,-50%) rotate(45deg)}.nmorph-badge .nmorph-badge__ribbon-corner--bottom-left{bottom:var(--nmorph-badge-ribbon-offset-y);left:var(--nmorph-badge-ribbon-offset-x)}.nmorph-badge .nmorph-badge__ribbon-corner--bottom-left .nmorph-badge__container--ribbon{transform:translate(-50%,-50%) rotate(45deg)}.nmorph-badge .nmorph-badge__ribbon-corner--bottom-right{right:var(--nmorph-badge-ribbon-offset-x);bottom:var(--nmorph-badge-ribbon-offset-y)}.nmorph-badge .nmorph-badge__ribbon-corner--bottom-right .nmorph-badge__container--ribbon{transform:translate(-50%,-50%) rotate(-45deg)}.nmorph-badge .nmorph-badge__dot{width:var(--nmorph-badge-dot-size);height:var(--nmorph-badge-dot-size);border-radius:var(--border-radius-circular)}.nmorph-badge.nmorph-badge--tiny{--nmorph-badge-ribbon-height: 18px;--nmorph-badge-ribbon-corner-size: 50px;--nmorph-badge-ribbon-width: 92px}.nmorph-badge.nmorph-badge--extra-small{--nmorph-badge-ribbon-height: 20px;--nmorph-badge-ribbon-corner-size: 56px;--nmorph-badge-ribbon-width: 104px}
@@ -1,54 +1,99 @@
1
1
  import './NmorphBadge.css';
2
- import m from "./NmorphBadge.vue2.js";
3
- import { openBlock as o, createElementBlock as a, normalizeStyle as i, normalizeClass as d, renderSlot as s, createCommentVNode as l, Fragment as c, createTextVNode as t, toDisplayString as n } from "vue";
2
+ import c from "./NmorphBadge.vue2.js";
3
+ import { openBlock as o, createElementBlock as a, normalizeStyle as r, normalizeClass as i, renderSlot as d, createCommentVNode as s, createElementVNode as n, createTextVNode as t, toDisplayString as y, Fragment as m } from "vue";
4
4
  /* empty css */
5
- import p from "../../../_virtual/_plugin-vue_export-helper.js";
6
- const y = {
5
+ import f from "../../../_virtual/_plugin-vue_export-helper.js";
6
+ const _ = { class: "nmorph-badge__content" }, b = {
7
7
  key: 0,
8
8
  class: "nmorph-badge__dot"
9
- }, f = {
9
+ }, g = {
10
10
  key: 1,
11
11
  class: "nmorph-badge__content"
12
12
  };
13
- function _(r, g, h, e, k, v) {
14
- return !e.props.disabled && (!e.props.isTag || e.shouldShowBadge) ? (o(), a(
13
+ function h(l, v, p, e, k, T) {
14
+ return !e.props.disabled && (!e.isTagType || e.shouldShowBadge) ? (o(), a(
15
15
  "div",
16
16
  {
17
17
  key: 0,
18
- class: d(e.modifiers),
19
- style: i(e.styles)
18
+ class: i(e.modifiers),
19
+ style: r(e.styles)
20
20
  },
21
21
  [
22
- e.props.isTag ? l("v-if", !0) : s(r.$slots, "default", { key: 0 }),
23
- e.shouldShowBadge ? (o(), a(
22
+ e.isTagType ? s("v-if", !0) : d(l.$slots, "default", { key: 0 }),
23
+ e.shouldShowBadge && e.isRibbon ? (o(), a(
24
24
  "div",
25
25
  {
26
26
  key: 1,
27
+ class: "nmorph-badge__ribbon-frame",
28
+ style: r(e.ribbonFrameStyle)
29
+ },
30
+ [
31
+ n(
32
+ "div",
33
+ {
34
+ class: i(e.ribbonCornerModifiers)
35
+ },
36
+ [
37
+ n(
38
+ "div",
39
+ {
40
+ ref: "badge",
41
+ class: i(e.containerModifiers),
42
+ style: r(e.containerStyle)
43
+ },
44
+ [
45
+ n("div", _, [
46
+ d(l.$slots, "value", {
47
+ value: e.props.value,
48
+ displayValue: e.displayValue
49
+ }, () => [
50
+ t(
51
+ y(e.displayValue),
52
+ 1
53
+ /* TEXT */
54
+ )
55
+ ])
56
+ ])
57
+ ],
58
+ 6
59
+ /* CLASS, STYLE */
60
+ )
61
+ ],
62
+ 2
63
+ /* CLASS */
64
+ )
65
+ ],
66
+ 4
67
+ /* STYLE */
68
+ )) : e.shouldShowBadge ? (o(), a(
69
+ "div",
70
+ {
71
+ key: 2,
27
72
  ref: "badge",
28
- class: d(e.containerModifiers),
29
- style: i(e.containerStyle)
73
+ class: i(e.containerModifiers),
74
+ style: r(e.containerStyle)
30
75
  },
31
76
  [
32
- e.props.isDot ? (o(), a("div", y)) : (o(), a("div", f, [
33
- e.props.isTag ? (o(), a(
34
- c,
77
+ e.isDotType ? (o(), a("div", b)) : (o(), a("div", g, [
78
+ e.isTagType ? (o(), a(
79
+ m,
35
80
  { key: 0 },
36
81
  [
37
82
  t(
38
- n(e.displayValue),
83
+ y(e.displayValue),
39
84
  1
40
85
  /* TEXT */
41
86
  )
42
87
  ],
43
88
  64
44
89
  /* STABLE_FRAGMENT */
45
- )) : s(r.$slots, "value", {
90
+ )) : d(l.$slots, "value", {
46
91
  key: 1,
47
92
  value: e.props.value,
48
93
  displayValue: e.displayValue
49
94
  }, () => [
50
95
  t(
51
- n(e.displayValue),
96
+ y(e.displayValue),
52
97
  1
53
98
  /* TEXT */
54
99
  )
@@ -57,13 +102,13 @@ function _(r, g, h, e, k, v) {
57
102
  ],
58
103
  6
59
104
  /* CLASS, STYLE */
60
- )) : l("v-if", !0)
105
+ )) : s("v-if", !0)
61
106
  ],
62
107
  6
63
108
  /* CLASS, STYLE */
64
- )) : e.props.isTag ? l("v-if", !0) : s(r.$slots, "default", { key: 1 });
109
+ )) : e.isTagType ? s("v-if", !0) : d(l.$slots, "default", { key: 1 });
65
110
  }
66
- const T = /* @__PURE__ */ p(m, [["render", _], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-badge/NmorphBadge.vue"]]);
111
+ const w = /* @__PURE__ */ f(c, [["render", h], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-badge/NmorphBadge.vue"]]);
67
112
  export {
68
- T as default
113
+ w as default
69
114
  };
@@ -1,11 +1,13 @@
1
1
  import './NmorphBadge.css';
2
- import { defineComponent as z, computed as t, ref as n, onMounted as S, watch as q, nextTick as _ } from "vue";
3
- import { useModifiers as f } from "../../../utils/create-modifiers.js";
4
- const B = /* @__PURE__ */ z({
2
+ import { defineComponent as C, computed as t, ref as b, onMounted as B, watch as I, nextTick as T } from "vue";
3
+ import { useModifiers as p } from "../../../utils/create-modifiers.js";
4
+ const X = /* @__PURE__ */ C({
5
5
  __name: "NmorphBadge",
6
6
  props: {
7
7
  value: { type: [Number, String], required: !1, default: void 0 },
8
8
  max: { type: Number, required: !1, default: 99 },
9
+ type: { type: String, required: !1, default: "default" },
10
+ ribbonCorner: { type: String, required: !1, default: "top-right" },
9
11
  isDot: { type: Boolean, required: !1, default: !1 },
10
12
  isTag: { type: Boolean, required: !1, default: !1 },
11
13
  hidden: { type: Boolean, required: !1, default: !1 },
@@ -17,39 +19,58 @@ const B = /* @__PURE__ */ z({
17
19
  disabled: { type: Boolean, required: !1, default: !1 },
18
20
  dotSize: { type: [Number, String], required: !1, default: void 0 }
19
21
  },
20
- setup(p, { expose: c }) {
21
- c();
22
- const e = p, m = t(
23
- () => f({
24
- "nmorph-badge": [`${e.hidden && "hidden"}`, `${e.isTag && "tag"}`, e.size]
22
+ setup(m, { expose: g }) {
23
+ g();
24
+ const e = m, a = t(() => e.type !== "default" ? e.type : e.isDot ? "dot" : e.isTag ? "tag" : "default"), c = t(() => a.value === "dot"), n = t(() => a.value === "tag"), r = t(() => a.value === "ribbon"), y = t(
25
+ () => p({
26
+ "nmorph-badge": [
27
+ `${e.hidden && "hidden"}`,
28
+ `${n.value && "tag"}`,
29
+ `${r.value && "ribbon"}`,
30
+ `${r.value && `ribbon-${e.ribbonCorner}`}`,
31
+ e.size
32
+ ]
25
33
  })
26
- ), g = t(
27
- () => f({
28
- "nmorph-badge__container": [`${e.hidden && "hidden"}`, `${e.isTag && "tag"}`]
34
+ ), h = t(
35
+ () => p({
36
+ "nmorph-badge__container": [
37
+ `${e.hidden && "hidden"}`,
38
+ `${n.value && "tag"}`,
39
+ `${r.value && "ribbon"}`,
40
+ `${r.value && `ribbon-${e.ribbonCorner}`}`
41
+ ]
29
42
  })
30
- ), v = t(() => typeof Number(e.value) == "number" && Number(e.value) > e.max ? `${e.max}+` : e.value), y = t(() => e.isDot || e.value !== void 0), o = t(() => {
31
- const a = `${(i?.value / 2 + e.offsetX) * -1}px`, h = `${(s?.value / 2 + e.offsetY) * -1}px`;
43
+ ), x = t(
44
+ () => p({
45
+ "nmorph-badge__ribbon-corner": [`${e.ribbonCorner}`]
46
+ })
47
+ ), z = t(() => typeof Number(e.value) == "number" && Number(e.value) > e.max ? `${e.max}+` : e.value), S = t(() => c.value || e.value !== void 0), d = t(() => {
48
+ const o = `${(l?.value / 2 + e.offsetX) * -1}px`, N = `${(s?.value / 2 + e.offsetY) * -1}px`;
32
49
  return {
33
- x: a,
34
- y: h
50
+ x: o,
51
+ y: N
35
52
  };
36
- }), b = t(() => e.isTag ? {
53
+ }), $ = t(() => n.value || r.value ? {
37
54
  zIndex: e.zIndex
38
55
  } : {
39
- right: o.value.x,
40
- top: o.value.y,
56
+ right: d.value.x,
57
+ top: d.value.y,
41
58
  zIndex: e.zIndex
42
- }), u = (a) => typeof a == "number" ? `${a}px` : a, x = t(() => ({
59
+ }), i = (o) => typeof o == "number" ? `${o}px` : o, u = b(null), l = b(0), s = b(0), q = t(() => ({
43
60
  "--nmorph-badge-color": e.color,
44
- ...e.dotSize !== void 0 && { "--dot-size": u(e.dotSize) }
45
- })), r = n(null), i = n(0), s = n(0), d = async () => {
46
- await _(), !(!r.value || e.isTag) && (i.value = r.value.clientWidth, s.value = r.value.clientHeight);
47
- };
48
- S(d), q(() => [e.value, e.max, e.isDot, e.isTag, e.size], d);
49
- const l = { props: e, modifiers: m, containerModifiers: g, displayValue: v, shouldShowBadge: y, appliedOffset: o, containerStyle: b, getCssSize: u, styles: x, badge: r, badgeWidth: i, badgeHeight: s, updateBadgeSize: d };
50
- return Object.defineProperty(l, "__isScriptSetup", { enumerable: !1, value: !0 }), l;
61
+ ...e.offsetX !== 0 && { "--nmorph-badge-ribbon-offset-x": i(e.offsetX) },
62
+ ...e.offsetY !== 0 && { "--nmorph-badge-ribbon-offset-y": i(e.offsetY) },
63
+ ...e.dotSize !== void 0 && { "--nmorph-badge-dot-size": i(e.dotSize) }
64
+ })), f = async () => {
65
+ await T(), !(!u.value || n.value || r.value) && (l.value = u.value.clientWidth, s.value = u.value.clientHeight);
66
+ }, _ = t(() => ({
67
+ zIndex: e.zIndex
68
+ }));
69
+ B(f), I(() => [e.value, e.max, a.value, e.ribbonCorner, e.size], f);
70
+ const v = { props: e, resolvedType: a, isDotType: c, isTagType: n, isRibbon: r, modifiers: y, containerModifiers: h, ribbonCornerModifiers: x, displayValue: z, shouldShowBadge: S, appliedOffset: d, containerStyle: $, getCssSize: i, badge: u, badgeWidth: l, badgeHeight: s, styles: q, updateBadgeSize: f, ribbonFrameStyle: _ };
71
+ return Object.defineProperty(v, "__isScriptSetup", { enumerable: !1, value: !0 }), v;
51
72
  }
52
73
  });
53
74
  export {
54
- B as default
75
+ X as default
55
76
  };
@@ -1 +1 @@
1
- .nmorph-dialog{position:absolute;top:50%;left:50%;width:var(--width);padding:var(--indentation-04);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);transform:translate(-50%,-50%)}.nmorph-dialog .nmorph-dialog__header{display:flex;justify-content:space-between;align-items:center;font-weight:600;font-size:var(--font-size-large);line-height:var(--line-height-loose)}.nmorph-dialog .nmorph-dialog__close-icon{cursor:pointer}.nmorph-dialog{--width: var(--nmorph-dialog-width)}
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-04);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;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{min-height:0;overflow-y:auto}
@@ -1,11 +1,11 @@
1
1
  import './NmorphDialog.css';
2
2
  import s from "./NmorphDialog.vue2.js";
3
- import { openBlock as l, createBlock as c, withCtx as i, createElementVNode as e, normalizeStyle as d, normalizeClass as t, renderSlot as a, toDisplayString as m, createElementBlock as p, createVNode as n, createCommentVNode as _ } from "vue";
3
+ import { openBlock as r, createBlock as c, withCtx as a, createElementVNode as e, normalizeStyle as d, normalizeClass as t, renderSlot as i, toDisplayString as m, createElementBlock as _, createVNode as n, createCommentVNode as p } from "vue";
4
4
  /* empty css */
5
5
  import h from "../../../_virtual/_plugin-vue_export-helper.js";
6
6
  const f = ["aria-label"], g = { class: "nmorph-dialog__header" }, v = { class: "nmorph-dialog__title" }, k = { class: "nmorph-dialog__content" };
7
- function y(r, N, w, o, C, O) {
8
- return l(), c(o.NmorphOverlay, {
7
+ function y(l, N, C, o, O, b) {
8
+ return r(), c(o.NmorphOverlay, {
9
9
  show: o.isVisible,
10
10
  "z-index": o.props.zIndex,
11
11
  "close-on-escape": o.props.closeOnEscape,
@@ -13,16 +13,16 @@ function y(r, N, w, o, C, O) {
13
13
  onOnOutsideClick: o.clickOnOverlay,
14
14
  onOnEscapeKeydown: o.closeHandler
15
15
  }, {
16
- default: i(() => [
16
+ default: a(() => [
17
17
  e("div", {
18
18
  class: t(o.modifiers),
19
- style: d({ "--nmorph-dialog-width": o.props.width }),
19
+ style: d(o.dialogStyle),
20
20
  role: "dialog",
21
21
  "aria-modal": "true",
22
22
  "aria-label": o.props.title || void 0
23
23
  }, [
24
24
  e("div", g, [
25
- a(r.$slots, "header", {}, () => [
25
+ i(l.$slots, "header", {}, () => [
26
26
  e(
27
27
  "div",
28
28
  v,
@@ -30,23 +30,23 @@ function y(r, N, w, o, C, O) {
30
30
  1
31
31
  /* TEXT */
32
32
  ),
33
- o.props.showClose ? (l(), p("div", {
33
+ o.props.showClose ? (r(), _("div", {
34
34
  key: 0,
35
35
  class: "nmorph-dialog__close-icon",
36
36
  onClick: o.closeHandler
37
37
  }, [
38
38
  n(o.NmorphIcon, null, {
39
- default: i(() => [
39
+ default: a(() => [
40
40
  n(o.NmorphIconCross)
41
41
  ]),
42
42
  _: 1
43
43
  /* STABLE */
44
44
  })
45
- ])) : _("v-if", !0)
45
+ ])) : p("v-if", !0)
46
46
  ])
47
47
  ]),
48
48
  e("div", k, [
49
- a(r.$slots, "default")
49
+ i(l.$slots, "default")
50
50
  ])
51
51
  ], 14, f)
52
52
  ]),
@@ -54,7 +54,7 @@ function y(r, N, w, o, C, O) {
54
54
  /* FORWARDED */
55
55
  }, 8, ["show", "z-index", "close-on-escape"]);
56
56
  }
57
- const V = /* @__PURE__ */ h(s, [["render", y], ["__file", "/builds/ketjo/nmorph/library/src/components/feedback/nmorph-dialog/NmorphDialog.vue"]]);
57
+ const S = /* @__PURE__ */ h(s, [["render", y], ["__file", "/builds/ketjo/nmorph/library/src/components/feedback/nmorph-dialog/NmorphDialog.vue"]]);
58
58
  export {
59
- V as default
59
+ S as default
60
60
  };
@@ -1,15 +1,16 @@
1
1
  import './NmorphDialog.css';
2
- import { defineComponent as f, computed as c, ref as d, watch as y } from "vue";
3
- import { useModifiers as O } from "../../../utils/create-modifiers.js";
2
+ import { defineComponent as c, computed as s, ref as y, watch as h } from "vue";
3
+ import { useModifiers as g } from "../../../utils/create-modifiers.js";
4
4
  import v from "../../basic/nmorph-icon/NmorphIcon.vue.js";
5
- import T from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
6
- import h from "../../../assets/icons/cross.svg.js";
7
- const C = /* @__PURE__ */ f({
5
+ import O from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
6
+ import T from "../../../assets/icons/cross.svg.js";
7
+ const C = /* @__PURE__ */ c({
8
8
  __name: "NmorphDialog",
9
9
  props: {
10
10
  modelValue: { type: Boolean, required: !1, default: !1 },
11
11
  title: { type: String, required: !1, default: "" },
12
12
  width: { type: String, required: !1, default: "330px" },
13
+ maxHeight: { type: String, required: !1, default: void 0 },
13
14
  openDelay: { type: Number, required: !1, default: 0 },
14
15
  closeDelay: { type: Number, required: !1, default: 0 },
15
16
  closeOnClickModal: { type: Boolean, required: !1, default: !0 },
@@ -19,49 +20,52 @@ const C = /* @__PURE__ */ f({
19
20
  closeOnEscape: { type: Boolean, required: !1, default: !0 }
20
21
  },
21
22
  emits: ["on-close", "update:model-value"],
22
- setup(i, { expose: n, emit: m }) {
23
- n();
24
- const e = i, r = m, p = c(
25
- () => O({
23
+ setup(n, { expose: m, emit: d }) {
24
+ m();
25
+ const e = n, r = d, p = s(
26
+ () => g({
26
27
  "nmorph-dialog": []
27
28
  })
28
- ), u = d(e.modelValue);
29
- let t = null, l = null;
30
- y(
29
+ ), f = s(() => ({
30
+ "--nmorph-dialog-width": e.width,
31
+ ...e.maxHeight && { "--nmorph-dialog-max-height": e.maxHeight }
32
+ })), a = y(e.modelValue);
33
+ let o = null, l = null;
34
+ h(
31
35
  () => e.modelValue,
32
- (o) => {
33
- o ? (l && clearTimeout(l), t = setTimeout(() => {
34
- u.value = !0;
35
- }, e.openDelay)) : (t && clearTimeout(t), l = setTimeout(() => {
36
- u.value = !1;
36
+ (t) => {
37
+ t ? (l && clearTimeout(l), o = setTimeout(() => {
38
+ a.value = !0;
39
+ }, e.openDelay)) : (o && clearTimeout(o), l = setTimeout(() => {
40
+ a.value = !1;
37
41
  }, e.closeDelay));
38
42
  },
39
43
  { immediate: !0 }
40
44
  );
41
- const a = () => {
42
- r("on-close"), t && clearTimeout(t);
43
- const o = () => {
45
+ const i = () => {
46
+ r("on-close"), o && clearTimeout(o);
47
+ const t = () => {
44
48
  r("update:model-value", !1);
45
49
  };
46
- e.closeDelay <= 0 ? o() : l = setTimeout(o, e.closeDelay);
47
- }, s = { props: e, emit: r, modifiers: p, isVisible: u, get openTimeout() {
48
- return t;
49
- }, set openTimeout(o) {
50
- t = o;
50
+ e.closeDelay <= 0 ? t() : l = setTimeout(t, e.closeDelay);
51
+ }, u = { props: e, emit: r, modifiers: p, dialogStyle: f, isVisible: a, get openTimeout() {
52
+ return o;
53
+ }, set openTimeout(t) {
54
+ o = t;
51
55
  }, get closeTimeout() {
52
56
  return l;
53
- }, set closeTimeout(o) {
54
- l = o;
55
- }, closeHandler: a, clickOnOverlay: () => {
56
- e.closeOnOverlay && a();
57
+ }, set closeTimeout(t) {
58
+ l = t;
59
+ }, closeHandler: i, clickOnOverlay: () => {
60
+ e.closeOnOverlay && i();
57
61
  }, get NmorphOverlay() {
58
- return T;
62
+ return O;
59
63
  }, get NmorphIcon() {
60
64
  return v;
61
65
  }, get NmorphIconCross() {
62
- return h;
66
+ return T;
63
67
  } };
64
- return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
68
+ return Object.defineProperty(u, "__isScriptSetup", { enumerable: !1, value: !0 }), u;
65
69
  }
66
70
  });
67
71
  export {
@@ -1,25 +1,25 @@
1
1
  import './NmorphNotificationProvider.css';
2
- import { defineComponent as x, ref as u, computed as v, watch as g } from "vue";
3
- import { NmorphNotificationPlacement as q } from "./types.js";
4
- import A from "../../feedback/nmorph-alert/NmorphAlert.vue.js";
5
- const N = 500, z = /* @__PURE__ */ x({
2
+ import { defineComponent as g, ref as u, inject as q, computed as h, watch as A } from "vue";
3
+ import { NmorphNotificationPlacement as b } from "./types.js";
4
+ import z from "../../feedback/nmorph-alert/NmorphAlert.vue.js";
5
+ const N = 500, P = /* @__PURE__ */ g({
6
6
  __name: "NmorphNotificationProvider",
7
7
  props: {
8
8
  notifications: { type: Array, required: !0 },
9
9
  placement: { type: null, required: !1, default: "top-right" },
10
- zIndex: { type: Number, required: !1, default: 1e3 },
10
+ zIndex: { type: Number, required: !1, default: void 0 },
11
11
  quantity: { type: Number, required: !1, default: 100 }
12
12
  },
13
- setup(h, { expose: _ }) {
14
- _();
15
- const c = (e) => typeof e.id == "string" && e.id.length > 0, a = u([]), n = u([]), r = u([]), d = Object.values(q), f = (e) => {
16
- r.value = r.value.filter((i) => i.id !== e), n.value = n.value.filter((i) => i !== e);
13
+ setup(_, { expose: I }) {
14
+ I();
15
+ const c = (e) => typeof e.id == "string" && e.id.length > 0, a = u([]), o = u([]), r = u([]), d = Object.values(b), f = (e) => {
16
+ r.value = r.value.filter((i) => i.id !== e), o.value = o.value.filter((i) => i !== e);
17
17
  }, p = (e, i = !0) => {
18
- n.value.includes(e) || (i && !a.value.includes(e) && (a.value = [...a.value, e]), n.value = [...n.value, e], setTimeout(() => f(e), N));
19
- }, s = h, y = v(
18
+ o.value.includes(e) || (i && !a.value.includes(e) && (a.value = [...a.value, e]), o.value = [...o.value, e], setTimeout(() => f(e), N));
19
+ }, s = _, m = q("nmorph", void 0), y = h(
20
20
  () => d.map((e) => {
21
21
  const i = r.value.filter(
22
- (o) => (o.placement ?? s.placement) === e
22
+ (n) => (n.placement ?? s.placement) === e
23
23
  ), t = Math.max(i.length - s.quantity, 0);
24
24
  return {
25
25
  placement: e,
@@ -27,29 +27,29 @@ const N = 500, z = /* @__PURE__ */ x({
27
27
  };
28
28
  })
29
29
  );
30
- g(
30
+ A(
31
31
  () => s.notifications,
32
32
  (e) => {
33
33
  const i = e.filter(c).filter((t) => !a.value.includes(t.id));
34
34
  r.value = r.value.map((t) => {
35
- const o = i.find((l) => l.id === t.id);
36
- return o ? { ...t, ...o } : t;
35
+ const n = i.find((l) => l.id === t.id);
36
+ return n ? { ...t, ...n } : t;
37
37
  }), i.forEach((t) => {
38
38
  r.value.some(
39
39
  (l) => l.id === t.id
40
40
  ) || r.value.push(t);
41
41
  }), r.value.filter(
42
- (t) => !i.some((o) => o.id === t.id)
42
+ (t) => !i.some((n) => n.id === t.id)
43
43
  ).forEach((t) => p(t.id, !1));
44
44
  },
45
45
  { deep: !0, immediate: !0 }
46
46
  );
47
- const I = v(() => s.zIndex), m = { ANIMATION_DURATION: N, hasNotificationId: c, removedIds: a, closingIds: n, renderedNotifications: r, placementList: d, removeRenderedNotification: f, closeHandler: p, props: s, notificationGroups: y, zIndex: I, get NmorphAlert() {
48
- return A;
47
+ const x = h(() => s.zIndex ?? (m?.zIndex.current.value ?? 1e3) + 1), v = { ANIMATION_DURATION: N, hasNotificationId: c, removedIds: a, closingIds: o, renderedNotifications: r, placementList: d, removeRenderedNotification: f, closeHandler: p, props: s, nmorph: m, notificationGroups: y, zIndex: x, get NmorphAlert() {
48
+ return z;
49
49
  } };
50
- return Object.defineProperty(m, "__isScriptSetup", { enumerable: !1, value: !0 }), m;
50
+ return Object.defineProperty(v, "__isScriptSetup", { enumerable: !1, value: !0 }), v;
51
51
  }
52
52
  });
53
53
  export {
54
- z as default
54
+ P as default
55
55
  };