@nmorph/nmorph-ui-kit 3.0.16 → 3.0.18
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-button/NmorphButton.vue2.js +6 -6
- package/dist/components/basic/nmorph-layout/NmorphLayout.vue.js +32 -29
- package/dist/components/basic/nmorph-layout/NmorphLayout.vue2.js +13 -11
- package/dist/components/basic/nmorph-link/NmorphLink.css +1 -1
- package/dist/components/basic/nmorph-link/NmorphLink.vue2.js +7 -7
- package/dist/components/basic/nmorph-space/NmorphSpace.vue.js +18 -15
- package/dist/components/basic/nmorph-space/NmorphSpace.vue2.js +19 -17
- package/dist/components/basic/nmorph-text/NmorphText.vue.js +21 -18
- package/dist/components/basic/nmorph-text/NmorphText.vue2.js +23 -15
- package/dist/components/data/nmorph-audio-meter/NmorphAudioMeter.css +1 -1
- package/dist/components/data/nmorph-audio-meter/NmorphAudioMeter.vue2.js +15 -15
- package/dist/components/data/nmorph-audio-preview/NmorphAudioPreview.css +1 -1
- package/dist/components/data/nmorph-audio-preview/NmorphAudioPreview.vue2.js +8 -8
- package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +1 -1
- package/dist/components/data/nmorph-card/NmorphCard.vue.js +36 -33
- package/dist/components/data/nmorph-card/NmorphCard.vue2.js +22 -20
- package/dist/components/data/nmorph-empty/NmorphEmpty.css +1 -1
- package/dist/components/data/nmorph-file-card/NmorphFileCard.css +1 -1
- package/dist/components/data/nmorph-file-card/NmorphFileCard.vue2.js +12 -12
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.css +1 -1
- package/dist/components/data/nmorph-media-gallery/NmorphMediaGallery.vue.js +11 -11
- package/dist/components/data/nmorph-media-tile/NmorphMediaTile.css +1 -1
- package/dist/components/data/nmorph-preview-portal/NmorphPreviewPortal.css +1 -1
- package/dist/components/data/nmorph-preview-portal/NmorphPreviewPortal.vue.js +23 -26
- package/dist/components/data/nmorph-preview-portal/NmorphPreviewPortal.vue2.js +21 -19
- package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.css +1 -1
- package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.vue.js +40 -43
- package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.vue2.js +60 -59
- package/dist/components/feedback/nmorph-alert/NmorphAlert.css +1 -1
- package/dist/components/feedback/nmorph-callout/NmorphCallout.css +1 -1
- package/dist/components/feedback/nmorph-callout/NmorphCallout.vue.js +37 -34
- package/dist/components/feedback/nmorph-callout/NmorphCallout.vue2.js +25 -16
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue.js +21 -23
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue2.js +32 -30
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue.js +16 -18
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +32 -30
- package/dist/components/feedback/nmorph-guide/NmorphGuide.vue2.js +3 -3
- package/dist/components/feedback/nmorph-guide/NmorphGuideStep.css +1 -1
- package/dist/components/feedback/nmorph-guide/NmorphGuideStep.vue.js +37 -39
- package/dist/components/feedback/nmorph-guide/NmorphGuideStep.vue2.js +26 -21
- package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.css +1 -1
- package/dist/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-validation-icon/NmorphValidationIcon.css +1 -1
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue.js +13 -14
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +34 -29
- package/dist/components/others/nmorph-overlay/NmorphOverlay.vue.js +24 -29
- package/dist/components/others/nmorph-overlay/NmorphOverlay.vue2.js +38 -36
- package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.css +1 -1
- package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.js +29 -32
- package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue2.js +51 -49
- package/dist/hooks/use-common-styles.js +17 -5
- package/dist/index.umd.js +40 -28
- package/dist/outside-hooks/use-nmorph-theme.js +13 -13
- package/dist/package.json.js +1 -1
- package/dist/src/components/basic/nmorph-button/NmorphButton.vue.d.ts +5 -6
- package/dist/src/components/basic/nmorph-icon/NmorphIcon.vue.d.ts +1 -1
- package/dist/src/components/basic/nmorph-layout/NmorphLayout.vue.d.ts +7 -1
- package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +3 -4
- package/dist/src/components/basic/nmorph-scroll/NmorphScroll.vue.d.ts +3 -3
- package/dist/src/components/basic/nmorph-space/NmorphSpace.vue.d.ts +3 -3
- package/dist/src/components/basic/nmorph-text/NmorphText.vue.d.ts +6 -3
- package/dist/src/components/basic/nmorph-text/types.d.ts +3 -0
- package/dist/src/components/data/nmorph-audio-meter/NmorphAudioMeter.vue.d.ts +0 -6
- package/dist/src/components/data/nmorph-audio-preview/NmorphAudioPreview.vue.d.ts +4 -4
- package/dist/src/components/data/nmorph-avatar/NmorphAvatar.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +4 -5
- package/dist/src/components/data/nmorph-calendar/NmorphCalendar.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-card/NmorphCard.vue.d.ts +6 -2
- package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-emoji-picker/NmorphEmojiPicker.vue.d.ts +2 -2
- package/dist/src/components/data/nmorph-empty/NmorphEmpty.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-file-card/NmorphFileCard.vue.d.ts +4 -4
- package/dist/src/components/data/nmorph-image/NmorphImage.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-preview-portal/NmorphPreviewPortal.vue.d.ts +2 -2
- package/dist/src/components/data/nmorph-tag-list/NmorphTagList.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-video-preview/NmorphVideoPreview.vue.d.ts +4 -4
- package/dist/src/components/feedback/nmorph-alert/NmorphAlert.vue.d.ts +1 -1
- package/dist/src/components/feedback/nmorph-callout/NmorphCallout.vue.d.ts +7 -4
- package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +4 -1
- package/dist/src/components/feedback/nmorph-drawer/NmorphDrawer.vue.d.ts +6 -2
- package/dist/src/components/feedback/nmorph-guide/NmorphGuide.vue.d.ts +2 -2
- package/dist/src/components/feedback/nmorph-guide/NmorphGuideStep.vue.d.ts +2 -2
- package/dist/src/components/feedback/nmorph-tooltip/NmorphTooltip.vue.d.ts +2 -2
- package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-color-picker/NmorphColorPicker.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +3 -3
- package/dist/src/components/form/nmorph-number-input/NmorphNumberInput.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-otp-input/NmorphOTPInput.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +3 -3
- package/dist/src/components/form/nmorph-select-button/NmorphSelectButton.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-select-button/components/nmorph-select-button-item/NmorphSelectButtonItem.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-slider/NmorphSlider.vue.d.ts +9 -9
- package/dist/src/components/form/nmorph-switch/NmorphSwitch.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-text-input/NmorphTextInput.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +1 -1
- package/dist/src/components/navigation/nmorph-backtop/NmorphBacktop.vue.d.ts +1 -1
- package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +3 -3
- package/dist/src/components/navigation/nmorph-stepper/NmorphStepper.vue.d.ts +1 -1
- package/dist/src/components/navigation/nmorph-tabs/NmorphTabs.vue.d.ts +1 -1
- package/dist/src/components/navigation/nmorph-tabs/components/nmorph-tab-pane/NmorphTabPane.vue.d.ts +1 -1
- package/dist/src/components/others/nmorph-overlay/NmorphOverlay.vue.d.ts +1 -1
- package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +1 -1
- package/dist/src/main.d.ts +2 -0
- package/dist/src/outside-hooks/use-nmorph-notification.d.ts +2 -2
- package/dist/src/utils/attrs.d.ts +5 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/utils/attrs.js +15 -0
- package/package.json +1 -1
package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue2.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import './NmorphNotificationProvider.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
2
|
+
import { defineComponent as J, ref as s, inject as Q, computed as l, watch as y, onMounted as W, onBeforeUnmount as X } from "vue";
|
|
3
|
+
import { useMergedAttrs as Y } from "../../../utils/attrs.js";
|
|
4
|
+
import { NmorphNotificationPlacement as ee } from "./types.js";
|
|
5
|
+
import te from "../../feedback/nmorph-alert/NmorphAlert.vue.js";
|
|
6
|
+
const P = 500, U = 250, ie = /* @__PURE__ */ J({
|
|
7
|
+
inheritAttrs: !1,
|
|
6
8
|
__name: "NmorphNotificationProvider",
|
|
7
9
|
props: {
|
|
8
10
|
notifications: { type: Array, required: !0 },
|
|
@@ -12,83 +14,83 @@ const j = 500, L = 250, re = /* @__PURE__ */ H({
|
|
|
12
14
|
teleportTo: { type: null, required: !1, default: "body" },
|
|
13
15
|
disabledTeleport: { type: Boolean, required: !1, default: !1 }
|
|
14
16
|
},
|
|
15
|
-
setup(
|
|
16
|
-
|
|
17
|
-
const
|
|
17
|
+
setup(V, { expose: Z }) {
|
|
18
|
+
Z();
|
|
19
|
+
const T = (e) => typeof e.id == "string" && e.id.length > 0, d = s([]), a = s([]), n = s([]), c = s(Date.now()), f = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
|
|
18
20
|
let i;
|
|
19
|
-
const w = Object.values(
|
|
21
|
+
const w = Object.values(ee), p = (e) => typeof e.duration != "number" || !Number.isFinite(e.duration) ? 0 : Math.max(e.duration, 0), R = (e) => p(e) > 0, C = (e) => e.showDurationValue !== !1, q = (e) => {
|
|
20
22
|
const t = p(e), r = v.get(e.id);
|
|
21
23
|
return !t || !r ? t : Math.max(t - (c.value - r), 0);
|
|
22
|
-
}, z = (e) =>
|
|
24
|
+
}, z = (e) => `${Math.ceil(e / 1e3)}s`, $ = (e) => z(q(e)), F = (e) => ({
|
|
23
25
|
"--nmorph-private-notification-provider-duration": `${p(e)}ms`
|
|
24
26
|
}), h = (e, t = !1) => {
|
|
25
|
-
const r =
|
|
26
|
-
r && clearTimeout(r),
|
|
27
|
+
const r = f.get(e);
|
|
28
|
+
r && clearTimeout(r), f.delete(e), m.delete(e), t || v.delete(e);
|
|
27
29
|
}, k = (e) => {
|
|
28
|
-
n.value = n.value.filter((t) => t.id !== e),
|
|
29
|
-
},
|
|
30
|
-
|
|
30
|
+
n.value = n.value.filter((t) => t.id !== e), a.value = a.value.filter((t) => t !== e), h(e);
|
|
31
|
+
}, g = (e, t = !0) => {
|
|
32
|
+
a.value.includes(e) || (h(e, !0), t && !d.value.includes(e) && (d.value = [...d.value, e]), a.value = [...a.value, e], setTimeout(() => k(e), P));
|
|
31
33
|
}, E = (e) => {
|
|
32
34
|
const t = p(e);
|
|
33
|
-
m.get(e.id) !== t && (h(e.id), t && (c.value = Date.now(), v.set(e.id, c.value),
|
|
35
|
+
m.get(e.id) !== t && (h(e.id), t && (c.value = Date.now(), v.set(e.id, c.value), f.set(
|
|
34
36
|
e.id,
|
|
35
|
-
setTimeout(() =>
|
|
37
|
+
setTimeout(() => g(e.id), t)
|
|
36
38
|
), m.set(e.id, t)));
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
},
|
|
39
|
+
}, o = V, D = s(!1), x = Q("nmorph"), I = s(x?.zIndex.current.value ?? 1e3), N = s(!1), A = () => {
|
|
40
|
+
o.zIndex !== void 0 || N.value || (I.value = x?.zIndex.next() ?? I.value + 1, N.value = !0);
|
|
41
|
+
}, G = l(
|
|
40
42
|
() => w.map((e) => {
|
|
41
43
|
const t = n.value.filter(
|
|
42
|
-
(u) => (u.placement ??
|
|
43
|
-
), r = Math.max(t.length -
|
|
44
|
+
(u) => (u.placement ?? o.placement) === e
|
|
45
|
+
), r = Math.max(t.length - o.quantity, 0);
|
|
44
46
|
return {
|
|
45
47
|
placement: e,
|
|
46
48
|
notifications: t.slice(r)
|
|
47
49
|
};
|
|
48
50
|
})
|
|
49
|
-
), O =
|
|
51
|
+
), O = l(
|
|
50
52
|
() => n.value.some(
|
|
51
|
-
(e) => R(e) && !
|
|
53
|
+
(e) => R(e) && !a.value.includes(e.id)
|
|
52
54
|
)
|
|
53
|
-
),
|
|
54
|
-
() =>
|
|
55
|
-
(e) =>
|
|
55
|
+
), _ = l(() => n.value.length > 0), S = l(
|
|
56
|
+
() => _.value || o.notifications.some(
|
|
57
|
+
(e) => T(e) && !d.value.includes(e.id)
|
|
56
58
|
)
|
|
57
|
-
),
|
|
59
|
+
), B = l(() => o.zIndex ?? I.value), H = l(() => !D.value || o.disabledTeleport), j = l(() => ({ zIndex: B.value })), K = Y("nmorph-notification-provider", j), b = () => {
|
|
58
60
|
i && (clearInterval(i), i = void 0);
|
|
59
61
|
};
|
|
60
|
-
|
|
61
|
-
() =>
|
|
62
|
+
y(
|
|
63
|
+
() => o.notifications,
|
|
62
64
|
() => {
|
|
63
|
-
|
|
65
|
+
S.value && A();
|
|
64
66
|
},
|
|
65
67
|
{ deep: !0, immediate: !0, flush: "sync" }
|
|
66
|
-
),
|
|
67
|
-
|
|
68
|
+
), y(
|
|
69
|
+
_,
|
|
68
70
|
(e) => {
|
|
69
71
|
if (e) {
|
|
70
|
-
|
|
72
|
+
A();
|
|
71
73
|
return;
|
|
72
74
|
}
|
|
73
75
|
N.value = !1;
|
|
74
76
|
},
|
|
75
77
|
{ immediate: !0, flush: "sync" }
|
|
76
|
-
),
|
|
78
|
+
), y(
|
|
77
79
|
O,
|
|
78
80
|
(e) => {
|
|
79
81
|
if (!e) {
|
|
80
|
-
|
|
82
|
+
b();
|
|
81
83
|
return;
|
|
82
84
|
}
|
|
83
85
|
i || (c.value = Date.now(), i = setInterval(() => {
|
|
84
86
|
c.value = Date.now();
|
|
85
|
-
},
|
|
87
|
+
}, U));
|
|
86
88
|
},
|
|
87
89
|
{ immediate: !0 }
|
|
88
|
-
),
|
|
89
|
-
() =>
|
|
90
|
+
), y(
|
|
91
|
+
() => o.notifications,
|
|
90
92
|
(e) => {
|
|
91
|
-
const t = e.filter(
|
|
93
|
+
const t = e.filter(T).filter((r) => !d.value.includes(r.id));
|
|
92
94
|
n.value = n.value.map((r) => {
|
|
93
95
|
const u = t.find((M) => M.id === r.id);
|
|
94
96
|
return u ? { ...r, ...u } : r;
|
|
@@ -98,24 +100,24 @@ const j = 500, L = 250, re = /* @__PURE__ */ H({
|
|
|
98
100
|
) || (n.value = [...n.value, r]);
|
|
99
101
|
}), t.forEach((r) => E(r)), n.value.filter(
|
|
100
102
|
(r) => !t.some((u) => u.id === r.id)
|
|
101
|
-
).forEach((r) =>
|
|
103
|
+
).forEach((r) => g(r.id, !1));
|
|
102
104
|
},
|
|
103
105
|
{ deep: !0, immediate: !0 }
|
|
104
|
-
),
|
|
105
|
-
|
|
106
|
-
}),
|
|
107
|
-
|
|
106
|
+
), W(() => {
|
|
107
|
+
D.value = !0;
|
|
108
|
+
}), X(() => {
|
|
109
|
+
f.forEach((e) => clearTimeout(e)), f.clear(), m.clear(), v.clear(), b();
|
|
108
110
|
});
|
|
109
|
-
const
|
|
111
|
+
const L = { ANIMATION_DURATION: P, DURATION_TICK_INTERVAL: U, hasNotificationId: T, removedIds: d, closingIds: a, renderedNotifications: n, durationTick: c, durationTimers: f, durationById: m, durationStartedAtById: v, get durationTicker() {
|
|
110
112
|
return i;
|
|
111
113
|
}, set durationTicker(e) {
|
|
112
114
|
i = e;
|
|
113
|
-
}, placementList: w, getNotificationDuration: p, hasDurationIndicator: R, hasDurationValue:
|
|
114
|
-
return
|
|
115
|
+
}, placementList: w, getNotificationDuration: p, hasDurationIndicator: R, hasDurationValue: C, getNotificationRemainingDuration: q, formatNotificationDuration: z, getNotificationDurationLabel: $, getNotificationStyle: F, clearDurationTimer: h, removeRenderedNotification: k, closeHandler: g, scheduleDurationTimer: E, props: o, isMounted: D, nmorph: x, dynamicZIndex: I, activeZIndexAllocated: N, allocateZIndex: A, notificationGroups: G, hasRunningDurationIndicator: O, hasRenderedNotifications: _, hasActiveNotifications: S, zIndex: B, teleportDisabled: H, rootStyle: j, rootAttrs: K, stopDurationTicker: b, get NmorphAlert() {
|
|
116
|
+
return te;
|
|
115
117
|
} };
|
|
116
|
-
return Object.defineProperty(
|
|
118
|
+
return Object.defineProperty(L, "__isScriptSetup", { enumerable: !1, value: !0 }), L;
|
|
117
119
|
}
|
|
118
120
|
});
|
|
119
121
|
export {
|
|
120
|
-
|
|
122
|
+
ie as default
|
|
121
123
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { nmorphPlainSurface as h, nmorphCombined as l, nmorphInset as t, nmorphOutset as p, title1 as s, title2 as m, title3 as c, title4 as g, body1 as n, body2 as d, body3 as b, body4 as
|
|
2
|
-
const
|
|
3
|
-
"nmorph-body-4":
|
|
1
|
+
import { nmorphPlainSurface as h, nmorphCombined as l, nmorphInset as t, nmorphOutset as p, title1 as s, title2 as m, title3 as c, title4 as g, body1 as n, body2 as d, body3 as b, body4 as y, typography as o } from "../utils/theme-style.js";
|
|
2
|
+
const v = {
|
|
3
|
+
"nmorph-body-4": y,
|
|
4
4
|
"nmorph-body-3": b,
|
|
5
5
|
"nmorph-body-2": d,
|
|
6
6
|
"nmorph-body-1": n,
|
|
@@ -134,7 +134,7 @@ const y = {
|
|
|
134
134
|
var(--nmorph-dark-shade-color);
|
|
135
135
|
--nmorph-wrapper-padding: calc(var(--base-shadow-width) * 1.5);
|
|
136
136
|
--nmorph-plain-border-color: color-mix(in srgb, var(--nmorph-text-color) 18%, transparent);
|
|
137
|
-
--nmorph-plain-border:
|
|
137
|
+
--nmorph-plain-border: 1px solid var(--nmorph-plain-border-color);
|
|
138
138
|
|
|
139
139
|
--transition-04: 0.4s;
|
|
140
140
|
--transition-03: 0.3s;
|
|
@@ -528,6 +528,18 @@ const y = {
|
|
|
528
528
|
font-weight: var(--font-weight-extrabold);
|
|
529
529
|
}
|
|
530
530
|
|
|
531
|
+
.nmorph-typography--not-selectable {
|
|
532
|
+
user-select: none;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.nmorph-typography--italic {
|
|
536
|
+
font-style: italic;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.nmorph-typography--no-line-height {
|
|
540
|
+
line-height: 0;
|
|
541
|
+
}
|
|
542
|
+
|
|
531
543
|
.nmorph-typography--truncate {
|
|
532
544
|
overflow: hidden;
|
|
533
545
|
white-space: nowrap;
|
|
@@ -668,7 +680,7 @@ const y = {
|
|
|
668
680
|
}
|
|
669
681
|
|
|
670
682
|
`;
|
|
671
|
-
for (const [a, i] of Object.entries(
|
|
683
|
+
for (const [a, i] of Object.entries(v))
|
|
672
684
|
e += `
|
|
673
685
|
.${a} {
|
|
674
686
|
${i()}
|