@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.
- package/dist/components/basic/nmorph-scroll/NmorphScroll.vue2.js +2 -2
- package/dist/components/data/nmorph-badge/NmorphBadge.css +1 -1
- package/dist/components/data/nmorph-badge/NmorphBadge.vue.js +65 -20
- package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +42 -23
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.css +1 -1
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.css +1 -1
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue.js +12 -12
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue2.js +36 -32
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.css +1 -1
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +25 -22
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +70 -62
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +19 -17
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue.js +8 -7
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +13 -12
- package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue2.js +20 -20
- package/dist/index.umd.js +14 -14
- package/dist/package.json.js +1 -1
- package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +6 -0
- package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +2 -0
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +2 -0
- package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +1 -1
- package/dist/src/outside-hooks/use-nmorph-notification.d.ts +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import './NmorphAutocomplete.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { useVirtualList as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
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(
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
() =>
|
|
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
|
-
),
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
enabled:
|
|
43
|
-
itemHeight:
|
|
44
|
-
overscan:
|
|
45
|
-
dynamic:
|
|
46
|
-
}),
|
|
47
|
-
height: `${
|
|
48
|
-
})),
|
|
49
|
-
transform: `translateY(${
|
|
50
|
-
})),
|
|
51
|
-
c(
|
|
52
|
-
|
|
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
|
|
55
|
-
d("select", e),
|
|
56
|
-
|
|
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
|
-
},
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
c(
|
|
64
|
-
e !== "" &&
|
|
65
|
-
}), c(
|
|
66
|
-
e && (
|
|
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
|
-
|
|
74
|
+
f.value && n.scrollToIndex(e);
|
|
69
75
|
});
|
|
70
|
-
const
|
|
71
|
-
|
|
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
|
-
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
},
|
|
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":
|
|
87
|
+
"aria-expanded": a.value,
|
|
82
88
|
"aria-controls": m.value,
|
|
83
|
-
"aria-activedescendant":
|
|
84
|
-
})),
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
|
|
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
|
|
98
|
+
return W;
|
|
91
99
|
}, get NmorphTextInput() {
|
|
92
|
-
return
|
|
100
|
+
return Q;
|
|
93
101
|
}, get NmorphIconLoader() {
|
|
94
|
-
return
|
|
102
|
+
return ee;
|
|
95
103
|
} };
|
|
96
|
-
return Object.defineProperty(
|
|
104
|
+
return Object.defineProperty(k, "__isScriptSetup", { enumerable: !1, value: !0 }), k;
|
|
97
105
|
}
|
|
98
106
|
});
|
|
99
107
|
export {
|
|
100
|
-
|
|
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
|
|
3
|
-
import
|
|
4
|
-
const
|
|
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
|
-
},
|
|
8
|
-
function
|
|
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",
|
|
17
|
-
e.slots["prepend-icon"] ? (n(), r("div",
|
|
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] =
|
|
37
|
-
}), null, 16,
|
|
38
|
-
e.props.typePassword || e.props.clearable ? (n(),
|
|
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:
|
|
48
|
-
|
|
49
|
-
default:
|
|
50
|
-
(n(),
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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:
|
|
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:
|
|
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)) :
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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,
|
|
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,
|
|
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":
|
|
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:
|
|
46
|
-
top:
|
|
46
|
+
left: n.value.x,
|
|
47
|
+
top: n.value.y,
|
|
47
48
|
visibility: e.open && a.value ? "visible" : "hidden"
|
|
48
49
|
}));
|
|
49
|
-
|
|
50
|
+
b(
|
|
50
51
|
() => e.open,
|
|
51
52
|
(t) => {
|
|
52
53
|
t && s();
|
|
53
54
|
},
|
|
54
55
|
{ flush: "post" }
|
|
55
56
|
);
|
|
56
|
-
const
|
|
57
|
-
|
|
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
|
-
|
|
60
|
+
l("on-escape-keydown");
|
|
60
61
|
}, get NmorphOverlay() {
|
|
61
62
|
return O;
|
|
62
63
|
} };
|
|
63
|
-
return Object.defineProperty(
|
|
64
|
+
return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
|
|
64
65
|
}
|
|
65
66
|
});
|
|
66
67
|
export {
|
package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue2.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import './NmorphNotificationProvider.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { NmorphNotificationPlacement as
|
|
4
|
-
import
|
|
5
|
-
const N = 500,
|
|
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:
|
|
10
|
+
zIndex: { type: Number, required: !1, default: void 0 },
|
|
11
11
|
quantity: { type: Number, required: !1, default: 100 }
|
|
12
12
|
},
|
|
13
|
-
setup(
|
|
14
|
-
|
|
15
|
-
const c = (e) => typeof e.id == "string" && e.id.length > 0, a = u([]),
|
|
16
|
-
r.value = r.value.filter((i) => i.id !== 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
|
-
|
|
19
|
-
}, s =
|
|
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
|
-
(
|
|
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
|
-
|
|
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
|
|
36
|
-
return
|
|
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((
|
|
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
|
|
48
|
-
return
|
|
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(
|
|
50
|
+
return Object.defineProperty(v, "__isScriptSetup", { enumerable: !1, value: !0 }), v;
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
export {
|
|
54
|
-
|
|
54
|
+
P as default
|
|
55
55
|
};
|