@nmorph/nmorph-ui-kit 2.2.22 → 2.2.24

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.
Files changed (24) hide show
  1. package/dist/components/basic/nmorph-scroll/NmorphScroll.vue2.js +2 -2
  2. package/dist/components/data/nmorph-badge/NmorphBadge.css +1 -1
  3. package/dist/components/data/nmorph-badge/NmorphBadge.vue.js +65 -20
  4. package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +42 -23
  5. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.css +1 -1
  6. package/dist/components/feedback/nmorph-dialog/NmorphDialog.css +1 -1
  7. package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue.js +12 -12
  8. package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue2.js +36 -32
  9. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.css +1 -1
  10. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +25 -22
  11. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +70 -62
  12. package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +19 -17
  13. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue.js +8 -7
  14. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +13 -12
  15. package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue2.js +20 -20
  16. package/dist/index.umd.js +14 -14
  17. package/dist/package.json.js +1 -1
  18. package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +6 -0
  19. package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +2 -0
  20. package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +2 -0
  21. package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +1 -1
  22. package/dist/src/outside-hooks/use-nmorph-notification.d.ts +2 -2
  23. package/dist/style.css +1 -1
  24. package/package.json +1 -1
@@ -1,12 +1,13 @@
1
1
  import './NmorphAutocomplete.css';
2
- import { defineComponent as z, ref as i, computed as t, watch as c, nextTick as U } from "vue";
3
- import { useModifiers as F } from "../../../utils/create-modifiers.js";
4
- import { useVirtualList as P } from "../../../hooks/use-virtual-list.js";
5
- import Y from "../nmorph-text-input/NmorphTextInput.vue.js";
6
- import G from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
7
- import J from "../../basic/nmorph-icon/NmorphIcon.vue.js";
8
- import K from "../../../assets/icons/loader.svg.js";
9
- const le = /* @__PURE__ */ z({
2
+ import { defineComponent as P, ref as s, computed as l, watch as c, nextTick as Y } from "vue";
3
+ import { useModifiers as G } from "../../../utils/create-modifiers.js";
4
+ import { useVirtualList as J } from "../../../hooks/use-virtual-list.js";
5
+ import { useZIndex as K } from "../../../hooks/use-z-index.js";
6
+ import Q from "../nmorph-text-input/NmorphTextInput.vue.js";
7
+ import W from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
8
+ import X from "../../basic/nmorph-icon/NmorphIcon.vue.js";
9
+ import ee from "../../../assets/icons/loader.svg.js";
10
+ const se = /* @__PURE__ */ P({
10
11
  __name: "NmorphAutocomplete",
11
12
  props: {
12
13
  modelValue: { type: String, required: !1, default: "" },
@@ -28,74 +29,81 @@ const le = /* @__PURE__ */ z({
28
29
  tabindex: { type: Number, required: !1 }
29
30
  },
30
31
  emits: ["update:model-value", "select"],
31
- setup(D, { expose: k, emit: _ }) {
32
- k();
33
- const a = D, n = i(a.modelValue), d = _, C = t(
34
- () => F({
35
- "nmorph-autocomplete": []
32
+ setup(_, { expose: C, emit: $ }) {
33
+ C();
34
+ const t = _, u = s(t.modelValue), d = $, L = l(
35
+ () => G({
36
+ "nmorph-autocomplete": [`${a.value && "open"}`]
36
37
  })
37
- ), L = (e) => {
38
- n.value = e, d("update:model-value", n.value);
39
- }, r = i(!1), O = i(null), g = () => {
40
- r.value = !1;
41
- }, l = t(() => a.list.filter((e) => Object.keys(e).some((h) => String(e[h]).toLowerCase().includes(n.value.toLowerCase())))), p = t(() => a.virtual && l.value.length > 0), y = t(() => a.virtualItemHeight), b = t(() => a.virtualOverscan), I = t(() => a.virtualDynamicHeight), u = P(l, {
42
- enabled: p,
43
- itemHeight: y,
44
- overscan: b,
45
- dynamic: I
46
- }), T = t(() => u.virtualItems.value), V = t(() => ({
47
- height: `${u.totalHeight.value}px`
48
- })), $ = t(() => ({
49
- transform: `translateY(${u.offsetTop.value}px)`
50
- })), x = (e) => typeof e == "number" ? `${e}px` : e, A = t(() => x(a.virtualMaxHeight)), o = i(0), f = t(() => l.value[o.value]), m = t(() => `${a.id || a.name || "nmorph-autocomplete"}-listbox`), H = (e) => `${m.value}-option-${e}`;
51
- c(l, async (e) => {
52
- r.value = e.length > 0, o.value = 0, await U(), u.scrollToIndex(0), u.refresh();
38
+ ), i = s(!1), O = (e) => {
39
+ i.value = e === "", u.value = e, a.value = !i.value && r.value.length > 0, o.value = 0, d("update:model-value", u.value);
40
+ }, a = s(!1), T = s(null), y = () => {
41
+ i.value = !0, a.value = !1;
42
+ }, r = l(() => t.list.filter((e) => Object.keys(e).some((g) => String(e[g]).toLowerCase().includes(u.value.toLowerCase())))), f = l(() => t.virtual && r.value.length > 0), x = l(() => t.virtualItemHeight), I = l(() => t.virtualOverscan), b = l(() => t.virtualDynamicHeight), n = J(r, {
43
+ enabled: f,
44
+ itemHeight: x,
45
+ overscan: I,
46
+ dynamic: b
47
+ }), A = l(() => n.virtualItems.value), V = l(() => ({
48
+ height: `${n.totalHeight.value}px`
49
+ })), M = l(() => ({
50
+ transform: `translateY(${n.offsetTop.value}px)`
51
+ })), H = (e) => typeof e == "number" ? `${e}px` : e, z = l(() => H(t.virtualMaxHeight)), o = s(0), v = l(() => r.value[o.value]), m = l(() => `${t.id || t.name || "nmorph-autocomplete"}-listbox`), q = (e) => `${m.value}-option-${e}`;
52
+ c(
53
+ () => t.modelValue,
54
+ (e) => {
55
+ e !== u.value && (u.value = e);
56
+ }
57
+ ), c(r, async (e) => {
58
+ a.value = !i.value && u.value !== "" && e.length > 0, o.value = 0, await Y(), n.scrollToIndex(0), n.refresh();
53
59
  });
54
- const v = (e) => {
55
- d("select", e), n.value = e.value, setTimeout(() => {
56
- r.value = !1;
60
+ const h = (e) => {
61
+ d("select", e), u.value = e.value, d("update:model-value", u.value), setTimeout(() => {
62
+ i.value = !0, a.value = !1;
57
63
  });
58
- }, M = (e) => {
59
- v(e);
60
- }, B = () => {
61
- r.value = l.value.length > 0;
62
- }, s = i(!1);
63
- c(n, async (e) => {
64
- e !== "" && a.actionCallback && (s.value = !0, await a.actionCallback(), s.value = !1);
65
- }), c(s, (e) => {
66
- e && (r.value = !0);
64
+ }, B = (e) => {
65
+ h(e);
66
+ }, E = () => {
67
+ i.value = !1, a.value = r.value.length > 0;
68
+ }, p = s(!1);
69
+ c(u, async (e) => {
70
+ e !== "" && t.actionCallback && (p.value = !0, await t.actionCallback(), p.value = !1);
71
+ }), c(p, (e) => {
72
+ e && (a.value = !0);
67
73
  }), c(o, (e) => {
68
- p.value && u.scrollToIndex(e);
74
+ f.value && n.scrollToIndex(e);
69
75
  });
70
- const q = () => {
71
- l.value.length && (r.value = !0, o.value = (o.value + 1) % l.value.length);
72
- }, w = () => {
73
- l.value.length && (r.value = !0, o.value = (o.value - 1 + l.value.length) % l.value.length);
76
+ const w = () => {
77
+ r.value.length && (a.value = !0, o.value = (o.value + 1) % r.value.length);
74
78
  }, N = () => {
75
- !r.value || !f.value || v(f.value);
76
- }, E = (e) => {
77
- e.key === "ArrowDown" ? (e.preventDefault(), q()) : e.key === "ArrowUp" ? (e.preventDefault(), w()) : e.key === "Enter" ? (e.preventDefault(), N()) : e.key === "Escape" && (e.preventDefault(), g());
78
- }, R = t(() => ({
79
+ r.value.length && (a.value = !0, o.value = (o.value - 1 + r.value.length) % r.value.length);
80
+ }, S = () => {
81
+ !a.value || !v.value || h(v.value);
82
+ }, j = (e) => {
83
+ e.key === "ArrowDown" ? (e.preventDefault(), w()) : e.key === "ArrowUp" ? (e.preventDefault(), N()) : e.key === "Enter" ? (e.preventDefault(), S()) : e.key === "Escape" && (e.preventDefault(), y());
84
+ }, R = l(() => ({
79
85
  role: "combobox",
80
86
  "aria-autocomplete": "list",
81
- "aria-expanded": r.value,
87
+ "aria-expanded": a.value,
82
88
  "aria-controls": m.value,
83
- "aria-activedescendant": r.value ? H(o.value) : void 0
84
- })), S = { props: a, initialValue: n, emit: d, modifiers: C, updateValueHandler: L, open: r, nmorphAutocompleteDOMRef: O, closeHandler: g, filteredList: l, virtualEnabled: p, virtualItemHeight: y, virtualOverscan: b, virtualDynamicHeight: I, virtualList: u, virtualItems: T, virtualSpacerStyle: V, virtualContentStyle: $, getCssSize: x, virtualMaxHeight: A, currentIndex: o, activeItem: f, listboxId: m, getOptionId: H, selectItem: v, clickHandler: M, focusHandler: B, loader: s, arrowDownHandler: q, arrowUpHandler: w, enterHandler: N, keydownHandler: E, inputAttrs: R, setVirtualItemRef: (e, h) => {
85
- const j = e instanceof Element ? e : e?.$el;
86
- u.measureElement(h, j);
87
- }, get NmorphIcon() {
88
- return J;
89
+ "aria-activedescendant": a.value ? q(o.value) : void 0
90
+ })), U = (e, g) => {
91
+ const F = e instanceof Element ? e : e?.$el;
92
+ n.measureElement(g, F);
93
+ }, D = K(a, () => t.zIndex), Z = l(() => ({
94
+ "--nmorph-autocomplete-input-z-index": D.value + 1
95
+ })), k = { props: t, initialValue: u, emit: d, modifiers: L, userClosed: i, updateValueHandler: O, open: a, nmorphAutocompleteDOMRef: T, closeHandler: y, filteredList: r, virtualEnabled: f, virtualItemHeight: x, virtualOverscan: I, virtualDynamicHeight: b, virtualList: n, virtualItems: A, virtualSpacerStyle: V, virtualContentStyle: M, getCssSize: H, virtualMaxHeight: z, currentIndex: o, activeItem: v, listboxId: m, getOptionId: q, selectItem: h, clickHandler: B, focusHandler: E, loader: p, arrowDownHandler: w, arrowUpHandler: N, enterHandler: S, keydownHandler: j, inputAttrs: R, setVirtualItemRef: U, dropdownZIndex: D, styles: Z, get NmorphIcon() {
96
+ return X;
89
97
  }, get NmorphDropdown() {
90
- return G;
98
+ return W;
91
99
  }, get NmorphTextInput() {
92
- return Y;
100
+ return Q;
93
101
  }, get NmorphIconLoader() {
94
- return K;
102
+ return ee;
95
103
  } };
96
- return Object.defineProperty(S, "__isScriptSetup", { enumerable: !1, value: !0 }), S;
104
+ return Object.defineProperty(k, "__isScriptSetup", { enumerable: !1, value: !0 }), k;
97
105
  }
98
106
  });
99
107
  export {
100
- le as default
108
+ se as default
101
109
  };
@@ -1,11 +1,11 @@
1
1
  import s from "./NmorphTextInput.vue2.js";
2
- import { openBlock as n, createElementBlock as r, normalizeStyle as m, normalizeClass as c, createElementVNode as i, renderSlot as h, createCommentVNode as l, mergeProps as _, withKeys as f, createBlock as a, withCtx as d, createVNode as y, resolveDynamicComponent as b } from "vue";
3
- import u from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const x = { class: "nmorph-text-input__input-side" }, v = {
2
+ import { openBlock as n, createElementBlock as r, normalizeStyle as m, normalizeClass as c, createElementVNode as i, renderSlot as h, createCommentVNode as l, mergeProps as f, withKeys as y, createBlock as d, withModifiers as _, withCtx as a, createVNode as u, resolveDynamicComponent as b } from "vue";
3
+ import x from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const v = { class: "nmorph-text-input__input-side" }, k = {
5
5
  key: 0,
6
6
  class: "nmorph-text-input__prepend-icon"
7
- }, k = ["id", "name", "autocomplete", "tabindex", "type", "placeholder", "disabled", "value"];
8
- function w(p, o, B, e, N, C) {
7
+ }, w = ["id", "name", "autocomplete", "tabindex", "type", "placeholder", "disabled", "value"];
8
+ function B(p, o, N, e, C, I) {
9
9
  return n(), r(
10
10
  "div",
11
11
  {
@@ -13,11 +13,11 @@ function w(p, o, B, e, N, C) {
13
13
  style: m(e.styles)
14
14
  },
15
15
  [
16
- i("div", x, [
17
- e.slots["prepend-icon"] ? (n(), r("div", v, [
16
+ i("div", v, [
17
+ e.slots["prepend-icon"] ? (n(), r("div", k, [
18
18
  h(p.$slots, "prepend-icon")
19
19
  ])) : l("v-if", !0),
20
- i("input", _({
20
+ i("input", f({
21
21
  id: e.id,
22
22
  ref: "inputDOMRef",
23
23
  name: e.name,
@@ -33,21 +33,23 @@ function w(p, o, B, e, N, C) {
33
33
  onFocus: e.handleFocus,
34
34
  onBlur: e.handleBlur,
35
35
  onKeydown: o[0] || (o[0] = (t) => e.emit("keydown", t)),
36
- onKeyup: o[1] || (o[1] = f((t) => e.emit("on-enter"), ["enter"]))
37
- }), null, 16, k),
38
- e.props.typePassword || e.props.clearable ? (n(), a(e.NmorphButton, {
36
+ onKeyup: o[1] || (o[1] = y((t) => e.emit("on-enter"), ["enter"]))
37
+ }), null, 16, w),
38
+ e.props.typePassword || e.props.clearable ? (n(), d(e.NmorphButton, {
39
39
  key: 1,
40
40
  disabled: e.props.disabled,
41
41
  class: "nmorph-text-input__password-btn",
42
42
  "style-type": "transparent",
43
43
  width: "32px",
44
44
  height: e.props.height,
45
+ onMousedown: o[2] || (o[2] = _(() => {
46
+ }, ["prevent"])),
45
47
  onClick: e.actionButtonClickHandler
46
48
  }, {
47
- default: d(() => [
48
- y(e.NmorphIcon, null, {
49
- default: d(() => [
50
- (n(), a(b(e.actionIcon)))
49
+ default: a(() => [
50
+ u(e.NmorphIcon, null, {
51
+ default: a(() => [
52
+ (n(), d(b(e.actionIcon)))
51
53
  ]),
52
54
  _: 1
53
55
  /* STABLE */
@@ -62,7 +64,7 @@ function w(p, o, B, e, N, C) {
62
64
  /* CLASS, STYLE */
63
65
  );
64
66
  }
65
- const K = /* @__PURE__ */ u(s, [["render", w], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-text-input/NmorphTextInput.vue"]]);
67
+ const M = /* @__PURE__ */ x(s, [["render", B], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-text-input/NmorphTextInput.vue"]]);
66
68
  export {
67
- K as default
69
+ M as default
68
70
  };
@@ -1,8 +1,8 @@
1
1
  import './NmorphDropdown.css';
2
2
  import n from "./NmorphDropdown.vue2.js";
3
- import { openBlock as r, createBlock as a, withCtx as l, createElementBlock as p, normalizeStyle as s, normalizeClass as c, renderSlot as i, createCommentVNode as d } from "vue";
3
+ import { openBlock as r, createBlock as a, withCtx as s, createElementBlock as p, normalizeStyle as l, normalizeClass as c, renderSlot as i, createCommentVNode as t } from "vue";
4
4
  /* empty css */
5
- import t from "../../../_virtual/_plugin-vue_export-helper.js";
5
+ import d from "../../../_virtual/_plugin-vue_export-helper.js";
6
6
  const m = ["role", "aria-label"];
7
7
  function f(e, _, h, o, w, k) {
8
8
  return r(), a(o.NmorphOverlay, {
@@ -11,26 +11,27 @@ function f(e, _, h, o, w, k) {
11
11
  "z-index": o.props.zIndex,
12
12
  "close-on-escape": o.props.closeOnEscape,
13
13
  "trap-focus": o.props.trapFocus,
14
+ "restore-focus": o.props.restoreFocus,
14
15
  onOnOutsideClick: o.outsideClickHandler,
15
16
  onOnEscapeKeydown: o.escapeHandler
16
17
  }, {
17
- default: l(() => [
18
+ default: s(() => [
18
19
  o.props.open ? (r(), p("div", {
19
20
  key: 0,
20
21
  ref: "dropdownDOMRef",
21
22
  class: c([o.modifiers, o.props.contentClass]),
22
- style: s(o.dropdownStyle),
23
+ style: l(o.dropdownStyle),
23
24
  role: o.props.role || void 0,
24
25
  "aria-label": o.props.ariaLabel || void 0
25
26
  }, [
26
27
  i(e.$slots, "default")
27
- ], 14, m)) : d("v-if", !0)
28
+ ], 14, m)) : t("v-if", !0)
28
29
  ]),
29
30
  _: 3
30
31
  /* FORWARDED */
31
- }, 8, ["show", "z-index", "close-on-escape", "trap-focus"]);
32
+ }, 8, ["show", "z-index", "close-on-escape", "trap-focus", "restore-focus"]);
32
33
  }
33
- const O = /* @__PURE__ */ t(n, [["render", f], ["__file", "/builds/ketjo/nmorph/library/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue"]]);
34
+ const O = /* @__PURE__ */ d(n, [["render", f], ["__file", "/builds/ketjo/nmorph/library/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue"]]);
34
35
  export {
35
36
  O as default
36
37
  };
@@ -1,9 +1,9 @@
1
1
  import './NmorphDropdown.css';
2
- import { defineComponent as w, ref as b, toRef as r, computed as i, watch as q } from "vue";
2
+ import { defineComponent as q, ref as w, toRef as r, computed as i, watch as b } from "vue";
3
3
  import { useModifiers as v } from "../../../utils/create-modifiers.js";
4
4
  import { usePlacement as x } from "../../../hooks/use-placement.js";
5
5
  import O from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
6
- const k = /* @__PURE__ */ w({
6
+ const k = /* @__PURE__ */ q({
7
7
  __name: "NmorphDropdown",
8
8
  props: {
9
9
  open: { type: Boolean, required: !0 },
@@ -18,6 +18,7 @@ const k = /* @__PURE__ */ w({
18
18
  zIndex: { type: Number, required: !1, default: void 0 },
19
19
  closeOnEscape: { type: Boolean, required: !1, default: !0 },
20
20
  trapFocus: { type: Boolean, required: !1, default: !1 },
21
+ restoreFocus: { type: Boolean, required: !1, default: !0 },
21
22
  role: { type: String, required: !1, default: "listbox" },
22
23
  ariaLabel: { type: String, required: !1, default: "" },
23
24
  contentClass: { type: String, required: !1, default: "" }
@@ -25,7 +26,7 @@ const k = /* @__PURE__ */ w({
25
26
  emits: ["on-outside-click", "on-escape-keydown"],
26
27
  setup(f, { expose: m, emit: c }) {
27
28
  m();
28
- const e = f, n = c, d = b(null), { placementCoords: l, placementReady: a, adjustPlacement: s } = x({
29
+ const e = f, l = c, d = w(null), { placementCoords: n, placementReady: a, adjustPlacement: s } = x({
29
30
  initialPlacement: r(e, "placement"),
30
31
  contentDOMElement: d,
31
32
  relativeElement: r(e, "relativeElement"),
@@ -36,31 +37,31 @@ const k = /* @__PURE__ */ w({
36
37
  () => v({
37
38
  "nmorph-dropdown": [`${!e.open && "closed"}`]
38
39
  })
39
- ), o = (t) => typeof t == "number" ? `${t}px` : t, p = i(
40
+ ), o = (t) => typeof t == "number" ? `${t}px` : t, u = i(
40
41
  () => e.fillWidth && e.relativeElement ? `${e.relativeElement.clientWidth}px` : o(e.width)
41
42
  ), h = i(() => ({
42
- "--nmorph-dropdown-width": p.value,
43
+ "--nmorph-dropdown-width": u.value,
43
44
  "--nmorph-dropdown-min-width": o(e.minWidth) || "auto",
44
45
  "--nmorph-dropdown-max-width": o(e.maxWidth) || "none",
45
- left: l.value.x,
46
- top: l.value.y,
46
+ left: n.value.x,
47
+ top: n.value.y,
47
48
  visibility: e.open && a.value ? "visible" : "hidden"
48
49
  }));
49
- q(
50
+ b(
50
51
  () => e.open,
51
52
  (t) => {
52
53
  t && s();
53
54
  },
54
55
  { flush: "post" }
55
56
  );
56
- const u = { props: e, emit: n, dropdownDOMRef: d, placementCoords: l, placementReady: a, adjustPlacement: s, modifiers: y, getCssSize: o, width: p, dropdownStyle: h, outsideClickHandler: () => {
57
- n("on-outside-click");
57
+ const p = { props: e, emit: l, dropdownDOMRef: d, placementCoords: n, placementReady: a, adjustPlacement: s, modifiers: y, getCssSize: o, width: u, dropdownStyle: h, outsideClickHandler: () => {
58
+ l("on-outside-click");
58
59
  }, escapeHandler: () => {
59
- n("on-escape-keydown");
60
+ l("on-escape-keydown");
60
61
  }, get NmorphOverlay() {
61
62
  return O;
62
63
  } };
63
- return Object.defineProperty(u, "__isScriptSetup", { enumerable: !1, value: !0 }), u;
64
+ return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
64
65
  }
65
66
  });
66
67
  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
  };