@nmorph/nmorph-ui-kit 3.0.7 → 3.0.8
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-icon/NmorphIcon.css +1 -1
- package/dist/components/data/nmorph-carousel/NmorphCarousel.css +1 -1
- package/dist/components/data/nmorph-carousel/NmorphCarousel.vue.js +26 -24
- package/dist/components/data/nmorph-carousel/NmorphCarousel.vue2.js +80 -30
- package/dist/components/data/nmorph-carousel/components/nmorph-carousel-item/NmorphCarouselItem.vue.js +21 -14
- package/dist/components/data/nmorph-carousel/components/nmorph-carousel-item/NmorphCarouselItem.vue2.js +20 -16
- package/dist/components/data/nmorph-media-tile/NmorphMediaTile.css +1 -1
- package/dist/components/data/nmorph-media-tile/NmorphMediaTile.vue2.js +17 -13
- package/dist/components/navigation/nmorph-stepper/NmorphStepper.css +1 -1
- package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.js +101 -96
- package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue2.js +84 -60
- package/dist/hooks/use-z-index.js +10 -10
- package/dist/index.umd.js +10 -10
- package/dist/package.json.js +1 -1
- package/dist/src/components/data/nmorph-carousel/NmorphCarousel.vue.d.ts +3 -1
- package/dist/src/components/data/nmorph-carousel/types.d.ts +1 -0
- package/dist/src/components/data/nmorph-media-tile/NmorphMediaTile.vue.d.ts +3 -1
- package/dist/src/components/data/nmorph-media-tile/types.d.ts +4 -0
- package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +3 -1
- package/dist/src/components/providers/nmorph-notification-provider/types.d.ts +2 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.js
CHANGED
|
@@ -1,105 +1,110 @@
|
|
|
1
1
|
import './NmorphNotificationProvider.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as e,
|
|
2
|
+
import h from "./NmorphNotificationProvider.vue2.js";
|
|
3
|
+
import { openBlock as e, createBlock as d, Teleport as _, createElementVNode as l, normalizeStyle as n, createElementBlock as i, Fragment as s, renderList as c, TransitionGroup as v, normalizeClass as p, withCtx as u, createVNode as b, toDisplayString as f, createCommentVNode as m } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import y from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
-
const
|
|
6
|
+
const k = ["title"], N = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "nmorph-notification-provider__duration-value"
|
|
9
9
|
};
|
|
10
|
-
function
|
|
11
|
-
return e(),
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
r.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
title
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
10
|
+
function g(D, a, w, r, I, x) {
|
|
11
|
+
return e(), d(_, {
|
|
12
|
+
to: r.props.teleportTo,
|
|
13
|
+
disabled: r.teleportDisabled
|
|
14
|
+
}, [
|
|
15
|
+
l(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
class: "nmorph-notification-provider",
|
|
19
|
+
style: n({ zIndex: r.zIndex })
|
|
20
|
+
},
|
|
21
|
+
[
|
|
22
|
+
(e(!0), i(
|
|
23
|
+
s,
|
|
24
|
+
null,
|
|
25
|
+
c(r.notificationGroups, (t) => (e(), d(v, {
|
|
26
|
+
key: t.placement,
|
|
27
|
+
appear: "",
|
|
28
|
+
name: "nmorph-notification",
|
|
29
|
+
tag: "div",
|
|
30
|
+
class: p(`nmorph-notification-provider__list nmorph-notification-provider__list--${t.placement}`)
|
|
31
|
+
}, {
|
|
32
|
+
default: u(() => [
|
|
33
|
+
(e(!0), i(
|
|
34
|
+
s,
|
|
35
|
+
null,
|
|
36
|
+
c(t.notifications, (o) => (e(), i(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
key: o.id,
|
|
40
|
+
style: n(r.getNotificationStyle(o)),
|
|
41
|
+
class: p([
|
|
42
|
+
"nmorph-notification-provider__notification",
|
|
43
|
+
r.hasDurationIndicator(o) && "nmorph-notification-provider__notification--with-duration",
|
|
44
|
+
r.closingIds.includes(o.id) && "nmorph-notification-provider__notification--closing"
|
|
45
|
+
])
|
|
46
|
+
},
|
|
47
|
+
[
|
|
48
|
+
b(r.NmorphAlert, {
|
|
49
|
+
id: o.id,
|
|
50
|
+
class: "nmorph-notification-provider__alert",
|
|
51
|
+
style: n({ width: o.width }),
|
|
52
|
+
type: o.type,
|
|
53
|
+
closable: o.closable,
|
|
54
|
+
title: o.title,
|
|
55
|
+
content: o.content,
|
|
56
|
+
fill: o.fill,
|
|
57
|
+
"show-icon": o.showIcon,
|
|
58
|
+
bordered: o.bordered,
|
|
59
|
+
html: o.html,
|
|
60
|
+
"close-icon-position": o.closeIconPosition,
|
|
61
|
+
"background-color": o.backgroundColor,
|
|
62
|
+
onClose: () => r.closeHandler(o.id)
|
|
63
|
+
}, null, 8, ["id", "style", "type", "closable", "title", "content", "fill", "show-icon", "bordered", "html", "close-icon-position", "background-color", "onClose"]),
|
|
64
|
+
r.hasDurationIndicator(o) ? (e(), i("div", {
|
|
65
|
+
key: `${o.id}-${r.getNotificationDuration(o)}`,
|
|
66
|
+
class: "nmorph-notification-provider__duration",
|
|
67
|
+
title: r.hasDurationValue(o) ? r.getNotificationDurationLabel(o) : void 0,
|
|
68
|
+
"aria-hidden": "true"
|
|
69
|
+
}, [
|
|
70
|
+
a[0] || (a[0] = l(
|
|
71
|
+
"span",
|
|
72
|
+
{ class: "nmorph-notification-provider__duration-track" },
|
|
73
|
+
[
|
|
74
|
+
l("span", { class: "nmorph-notification-provider__duration-bar" })
|
|
75
|
+
],
|
|
76
|
+
-1
|
|
77
|
+
/* CACHED */
|
|
78
|
+
)),
|
|
79
|
+
r.hasDurationValue(o) ? (e(), i(
|
|
80
|
+
"span",
|
|
81
|
+
N,
|
|
82
|
+
f(r.getNotificationDurationLabel(o)),
|
|
83
|
+
1
|
|
84
|
+
/* TEXT */
|
|
85
|
+
)) : m("v-if", !0)
|
|
86
|
+
], 8, k)) : m("v-if", !0)
|
|
87
|
+
],
|
|
88
|
+
6
|
|
89
|
+
/* CLASS, STYLE */
|
|
90
|
+
))),
|
|
91
|
+
128
|
|
92
|
+
/* KEYED_FRAGMENT */
|
|
93
|
+
))
|
|
94
|
+
]),
|
|
95
|
+
_: 2
|
|
96
|
+
/* DYNAMIC */
|
|
97
|
+
}, 1032, ["class"]))),
|
|
98
|
+
128
|
|
99
|
+
/* KEYED_FRAGMENT */
|
|
100
|
+
))
|
|
101
|
+
],
|
|
102
|
+
4
|
|
103
|
+
/* STYLE */
|
|
104
|
+
)
|
|
105
|
+
], 8, ["to", "disabled"]);
|
|
101
106
|
}
|
|
102
|
-
const
|
|
107
|
+
const L = /* @__PURE__ */ y(h, [["render", g], ["__file", "/builds/ketjo/nmorph/library/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue"]]);
|
|
103
108
|
export {
|
|
104
|
-
|
|
109
|
+
L as default
|
|
105
110
|
};
|
package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue2.js
CHANGED
|
@@ -1,97 +1,121 @@
|
|
|
1
1
|
import './NmorphNotificationProvider.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { NmorphNotificationPlacement as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
2
|
+
import { defineComponent as H, ref as s, inject as K, computed as f, watch as T, onMounted as J, onBeforeUnmount as Q } from "vue";
|
|
3
|
+
import { NmorphNotificationPlacement as W } from "./types.js";
|
|
4
|
+
import X from "../../feedback/nmorph-alert/NmorphAlert.vue.js";
|
|
5
|
+
const j = 500, L = 250, re = /* @__PURE__ */ H({
|
|
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
10
|
zIndex: { type: Number, required: !1, default: void 0 },
|
|
11
|
-
quantity: { type: Number, required: !1, default: 100 }
|
|
11
|
+
quantity: { type: Number, required: !1, default: 100 },
|
|
12
|
+
teleportTo: { type: null, required: !1, default: "body" },
|
|
13
|
+
disabledTeleport: { type: Boolean, required: !1, default: !1 }
|
|
12
14
|
},
|
|
13
|
-
setup(
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
let
|
|
17
|
-
const
|
|
18
|
-
const t =
|
|
19
|
-
return !t || !r ? t : Math.max(t - (
|
|
20
|
-
},
|
|
21
|
-
"--nmorph-private-notification-provider-duration": `${
|
|
22
|
-
}),
|
|
23
|
-
const r =
|
|
24
|
-
r && clearTimeout(r),
|
|
25
|
-
},
|
|
26
|
-
n.value = n.value.filter((t) => t.id !== e), o.value = o.value.filter((t) => t !== e),
|
|
27
|
-
},
|
|
28
|
-
o.value.includes(e) || (
|
|
29
|
-
},
|
|
30
|
-
const t =
|
|
31
|
-
|
|
15
|
+
setup(P, { expose: U }) {
|
|
16
|
+
U();
|
|
17
|
+
const y = (e) => typeof e.id == "string" && e.id.length > 0, l = s([]), o = s([]), n = s([]), c = s(Date.now()), d = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
|
|
18
|
+
let i;
|
|
19
|
+
const w = Object.values(W), p = (e) => typeof e.duration != "number" || !Number.isFinite(e.duration) ? 0 : Math.max(e.duration, 0), R = (e) => p(e) > 0, V = (e) => e.showDurationValue !== !1, q = (e) => {
|
|
20
|
+
const t = p(e), r = v.get(e.id);
|
|
21
|
+
return !t || !r ? t : Math.max(t - (c.value - r), 0);
|
|
22
|
+
}, z = (e) => e < 1e3 ? `${Math.ceil(e)}ms` : `${Math.ceil(e / 1e3)}s`, Z = (e) => z(q(e)), $ = (e) => ({
|
|
23
|
+
"--nmorph-private-notification-provider-duration": `${p(e)}ms`
|
|
24
|
+
}), h = (e, t = !1) => {
|
|
25
|
+
const r = d.get(e);
|
|
26
|
+
r && clearTimeout(r), d.delete(e), m.delete(e), t || v.delete(e);
|
|
27
|
+
}, k = (e) => {
|
|
28
|
+
n.value = n.value.filter((t) => t.id !== e), o.value = o.value.filter((t) => t !== e), h(e);
|
|
29
|
+
}, D = (e, t = !0) => {
|
|
30
|
+
o.value.includes(e) || (h(e, !0), t && !l.value.includes(e) && (l.value = [...l.value, e]), o.value = [...o.value, e], setTimeout(() => k(e), j));
|
|
31
|
+
}, E = (e) => {
|
|
32
|
+
const t = p(e);
|
|
33
|
+
m.get(e.id) !== t && (h(e.id), t && (c.value = Date.now(), v.set(e.id, c.value), d.set(
|
|
32
34
|
e.id,
|
|
33
|
-
setTimeout(() =>
|
|
34
|
-
),
|
|
35
|
-
},
|
|
36
|
-
(
|
|
35
|
+
setTimeout(() => D(e.id), t)
|
|
36
|
+
), m.set(e.id, t)));
|
|
37
|
+
}, a = P, g = s(!1), x = K("nmorph"), I = s(x?.zIndex.current.value ?? 1e3), N = s(!1), _ = () => {
|
|
38
|
+
a.zIndex !== void 0 || N.value || (I.value = x?.zIndex.next() ?? I.value + 1, N.value = !0);
|
|
39
|
+
}, C = f(
|
|
40
|
+
() => w.map((e) => {
|
|
37
41
|
const t = n.value.filter(
|
|
38
|
-
(
|
|
39
|
-
), r = Math.max(t.length -
|
|
42
|
+
(u) => (u.placement ?? a.placement) === e
|
|
43
|
+
), r = Math.max(t.length - a.quantity, 0);
|
|
40
44
|
return {
|
|
41
45
|
placement: e,
|
|
42
46
|
notifications: t.slice(r)
|
|
43
47
|
};
|
|
44
48
|
})
|
|
45
|
-
),
|
|
49
|
+
), O = f(
|
|
46
50
|
() => n.value.some(
|
|
47
|
-
(e) =>
|
|
51
|
+
(e) => R(e) && !o.value.includes(e.id)
|
|
48
52
|
)
|
|
49
|
-
),
|
|
50
|
-
|
|
53
|
+
), b = f(() => n.value.length > 0), B = f(
|
|
54
|
+
() => b.value || a.notifications.some(
|
|
55
|
+
(e) => y(e) && !l.value.includes(e.id)
|
|
56
|
+
)
|
|
57
|
+
), F = f(() => a.zIndex ?? I.value), G = f(() => !g.value || a.disabledTeleport), A = () => {
|
|
58
|
+
i && (clearInterval(i), i = void 0);
|
|
51
59
|
};
|
|
52
|
-
|
|
60
|
+
T(
|
|
61
|
+
() => a.notifications,
|
|
62
|
+
() => {
|
|
63
|
+
B.value && _();
|
|
64
|
+
},
|
|
65
|
+
{ deep: !0, immediate: !0, flush: "sync" }
|
|
66
|
+
), T(
|
|
53
67
|
b,
|
|
68
|
+
(e) => {
|
|
69
|
+
if (e) {
|
|
70
|
+
_();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
N.value = !1;
|
|
74
|
+
},
|
|
75
|
+
{ immediate: !0, flush: "sync" }
|
|
76
|
+
), T(
|
|
77
|
+
O,
|
|
54
78
|
(e) => {
|
|
55
79
|
if (!e) {
|
|
56
|
-
|
|
80
|
+
A();
|
|
57
81
|
return;
|
|
58
82
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
83
|
+
i || (c.value = Date.now(), i = setInterval(() => {
|
|
84
|
+
c.value = Date.now();
|
|
85
|
+
}, L));
|
|
62
86
|
},
|
|
63
87
|
{ immediate: !0 }
|
|
64
|
-
),
|
|
65
|
-
() =>
|
|
88
|
+
), T(
|
|
89
|
+
() => a.notifications,
|
|
66
90
|
(e) => {
|
|
67
|
-
const t = e.filter(
|
|
91
|
+
const t = e.filter(y).filter((r) => !l.value.includes(r.id));
|
|
68
92
|
n.value = n.value.map((r) => {
|
|
69
|
-
const
|
|
70
|
-
return
|
|
93
|
+
const u = t.find((M) => M.id === r.id);
|
|
94
|
+
return u ? { ...r, ...u } : r;
|
|
71
95
|
}), t.forEach((r) => {
|
|
72
96
|
n.value.some(
|
|
73
|
-
(
|
|
74
|
-
) || n.value.
|
|
75
|
-
}), t.forEach((r) =>
|
|
76
|
-
(r) => !t.some((
|
|
77
|
-
).forEach((r) =>
|
|
97
|
+
(M) => M.id === r.id
|
|
98
|
+
) || (n.value = [...n.value, r]);
|
|
99
|
+
}), t.forEach((r) => E(r)), n.value.filter(
|
|
100
|
+
(r) => !t.some((u) => u.id === r.id)
|
|
101
|
+
).forEach((r) => D(r.id, !1));
|
|
78
102
|
},
|
|
79
103
|
{ deep: !0, immediate: !0 }
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
104
|
+
), J(() => {
|
|
105
|
+
g.value = !0;
|
|
106
|
+
}), Q(() => {
|
|
107
|
+
d.forEach((e) => clearTimeout(e)), d.clear(), m.clear(), v.clear(), A();
|
|
84
108
|
});
|
|
85
|
-
const
|
|
86
|
-
return
|
|
109
|
+
const S = { ANIMATION_DURATION: j, DURATION_TICK_INTERVAL: L, hasNotificationId: y, removedIds: l, closingIds: o, renderedNotifications: n, durationTick: c, durationTimers: d, durationById: m, durationStartedAtById: v, get durationTicker() {
|
|
110
|
+
return i;
|
|
87
111
|
}, set durationTicker(e) {
|
|
88
|
-
|
|
89
|
-
}, placementList:
|
|
90
|
-
return
|
|
112
|
+
i = e;
|
|
113
|
+
}, placementList: w, getNotificationDuration: p, hasDurationIndicator: R, hasDurationValue: V, getNotificationRemainingDuration: q, formatNotificationDuration: z, getNotificationDurationLabel: Z, getNotificationStyle: $, clearDurationTimer: h, removeRenderedNotification: k, closeHandler: D, scheduleDurationTimer: E, props: a, isMounted: g, nmorph: x, dynamicZIndex: I, activeZIndexAllocated: N, allocateZIndex: _, notificationGroups: C, hasRunningDurationIndicator: O, hasRenderedNotifications: b, hasActiveNotifications: B, zIndex: F, teleportDisabled: G, stopDurationTicker: A, get NmorphAlert() {
|
|
114
|
+
return X;
|
|
91
115
|
} };
|
|
92
|
-
return Object.defineProperty(
|
|
116
|
+
return Object.defineProperty(S, "__isScriptSetup", { enumerable: !1, value: !0 }), S;
|
|
93
117
|
}
|
|
94
118
|
});
|
|
95
119
|
export {
|
|
96
|
-
|
|
120
|
+
re as default
|
|
97
121
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
(
|
|
7
|
-
|
|
1
|
+
import { inject as o, ref as r, watch as i, computed as s } from "vue";
|
|
2
|
+
const d = (e, t) => {
|
|
3
|
+
const u = o("nmorph"), n = r(u?.zIndex.current.value ?? 1e3);
|
|
4
|
+
return i(
|
|
5
|
+
() => typeof e == "function" ? e() : e.value,
|
|
6
|
+
(c) => {
|
|
7
|
+
c && t() === void 0 && (n.value = u?.zIndex.next() ?? n.value + 1);
|
|
8
8
|
},
|
|
9
|
-
{ immediate: !0 }
|
|
10
|
-
),
|
|
9
|
+
{ immediate: !0, flush: "sync" }
|
|
10
|
+
), s(() => t() ?? n.value);
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
d as useZIndex
|
|
14
14
|
};
|