@nmorph/nmorph-ui-kit 3.0.15 → 3.0.17

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 (88) hide show
  1. package/dist/components/basic/nmorph-layout/NmorphLayout.vue.js +32 -29
  2. package/dist/components/basic/nmorph-layout/NmorphLayout.vue2.js +13 -11
  3. package/dist/components/basic/nmorph-space/NmorphSpace.vue.js +18 -15
  4. package/dist/components/basic/nmorph-space/NmorphSpace.vue2.js +19 -17
  5. package/dist/components/basic/nmorph-text/NmorphText.vue.js +24 -15
  6. package/dist/components/basic/nmorph-text/NmorphText.vue2.js +24 -14
  7. package/dist/components/data/nmorph-card/NmorphCard.vue.js +36 -33
  8. package/dist/components/data/nmorph-card/NmorphCard.vue2.js +22 -20
  9. package/dist/components/data/nmorph-preview-portal/NmorphPreviewPortal.vue.js +23 -26
  10. package/dist/components/data/nmorph-preview-portal/NmorphPreviewPortal.vue2.js +21 -19
  11. package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.vue.js +40 -43
  12. package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.vue2.js +55 -54
  13. package/dist/components/feedback/nmorph-callout/NmorphCallout.vue.js +37 -34
  14. package/dist/components/feedback/nmorph-callout/NmorphCallout.vue2.js +22 -14
  15. package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue.js +21 -23
  16. package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue2.js +32 -30
  17. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue.js +16 -18
  18. package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +32 -30
  19. package/dist/components/feedback/nmorph-guide/NmorphGuideStep.vue.js +37 -39
  20. package/dist/components/feedback/nmorph-guide/NmorphGuideStep.vue2.js +26 -21
  21. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue.js +13 -14
  22. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +34 -29
  23. package/dist/components/others/nmorph-overlay/NmorphOverlay.vue.js +24 -29
  24. package/dist/components/others/nmorph-overlay/NmorphOverlay.vue2.js +38 -36
  25. package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.js +29 -32
  26. package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue2.js +47 -45
  27. package/dist/hooks/use-common-styles.js +16 -4
  28. package/dist/index.umd.js +39 -27
  29. package/dist/outside-hooks/use-nmorph-theme.js +1 -1
  30. package/dist/package.json.js +1 -1
  31. package/dist/src/components/basic/nmorph-button/NmorphButton.vue.d.ts +6 -6
  32. package/dist/src/components/basic/nmorph-icon/NmorphIcon.vue.d.ts +1 -1
  33. package/dist/src/components/basic/nmorph-layout/NmorphLayout.vue.d.ts +7 -1
  34. package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +3 -3
  35. package/dist/src/components/basic/nmorph-scroll/NmorphScroll.vue.d.ts +3 -3
  36. package/dist/src/components/basic/nmorph-space/NmorphSpace.vue.d.ts +3 -3
  37. package/dist/src/components/basic/nmorph-text/NmorphText.vue.d.ts +7 -3
  38. package/dist/src/components/basic/nmorph-text/types.d.ts +4 -0
  39. package/dist/src/components/data/nmorph-audio-preview/NmorphAudioPreview.vue.d.ts +4 -4
  40. package/dist/src/components/data/nmorph-avatar/NmorphAvatar.vue.d.ts +1 -1
  41. package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +4 -4
  42. package/dist/src/components/data/nmorph-calendar/NmorphCalendar.vue.d.ts +1 -1
  43. package/dist/src/components/data/nmorph-card/NmorphCard.vue.d.ts +6 -2
  44. package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +1 -1
  45. package/dist/src/components/data/nmorph-emoji-picker/NmorphEmojiPicker.vue.d.ts +2 -2
  46. package/dist/src/components/data/nmorph-empty/NmorphEmpty.vue.d.ts +1 -1
  47. package/dist/src/components/data/nmorph-file-card/NmorphFileCard.vue.d.ts +4 -4
  48. package/dist/src/components/data/nmorph-image/NmorphImage.vue.d.ts +1 -1
  49. package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +1 -1
  50. package/dist/src/components/data/nmorph-preview-portal/NmorphPreviewPortal.vue.d.ts +2 -2
  51. package/dist/src/components/data/nmorph-tag-list/NmorphTagList.vue.d.ts +1 -1
  52. package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.d.ts +1 -1
  53. package/dist/src/components/data/nmorph-video-preview/NmorphVideoPreview.vue.d.ts +4 -4
  54. package/dist/src/components/feedback/nmorph-alert/NmorphAlert.vue.d.ts +1 -1
  55. package/dist/src/components/feedback/nmorph-callout/NmorphCallout.vue.d.ts +7 -3
  56. package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +4 -1
  57. package/dist/src/components/feedback/nmorph-drawer/NmorphDrawer.vue.d.ts +6 -2
  58. package/dist/src/components/feedback/nmorph-guide/NmorphGuide.vue.d.ts +2 -2
  59. package/dist/src/components/feedback/nmorph-guide/NmorphGuideStep.vue.d.ts +2 -2
  60. package/dist/src/components/feedback/nmorph-tooltip/NmorphTooltip.vue.d.ts +2 -2
  61. package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +1 -1
  62. package/dist/src/components/form/nmorph-color-picker/NmorphColorPicker.vue.d.ts +1 -1
  63. package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +1 -1
  64. package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +3 -3
  65. package/dist/src/components/form/nmorph-number-input/NmorphNumberInput.vue.d.ts +1 -1
  66. package/dist/src/components/form/nmorph-otp-input/NmorphOTPInput.vue.d.ts +1 -1
  67. package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +3 -3
  68. package/dist/src/components/form/nmorph-select-button/NmorphSelectButton.vue.d.ts +1 -1
  69. package/dist/src/components/form/nmorph-select-button/components/nmorph-select-button-item/NmorphSelectButtonItem.vue.d.ts +1 -1
  70. package/dist/src/components/form/nmorph-slider/NmorphSlider.vue.d.ts +9 -9
  71. package/dist/src/components/form/nmorph-switch/NmorphSwitch.vue.d.ts +1 -1
  72. package/dist/src/components/form/nmorph-text-input/NmorphTextInput.vue.d.ts +1 -1
  73. package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +1 -1
  74. package/dist/src/components/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +1 -1
  75. package/dist/src/components/navigation/nmorph-backtop/NmorphBacktop.vue.d.ts +1 -1
  76. package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +3 -3
  77. package/dist/src/components/navigation/nmorph-stepper/NmorphStepper.vue.d.ts +1 -1
  78. package/dist/src/components/navigation/nmorph-tabs/NmorphTabs.vue.d.ts +1 -1
  79. package/dist/src/components/navigation/nmorph-tabs/components/nmorph-tab-pane/NmorphTabPane.vue.d.ts +1 -1
  80. package/dist/src/components/others/nmorph-overlay/NmorphOverlay.vue.d.ts +1 -1
  81. package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +1 -1
  82. package/dist/src/outside-hooks/use-nmorph-notification.d.ts +2 -2
  83. package/dist/src/types/common.types.d.ts +1 -0
  84. package/dist/src/utils/attrs.d.ts +5 -0
  85. package/dist/src/utils/index.d.ts +1 -0
  86. package/dist/types/common.types.js +1 -0
  87. package/dist/utils/attrs.js +15 -0
  88. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
1
  import './NmorphDropdown.css';
2
2
  import n from "./NmorphDropdown.vue2.js";
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";
3
+ import { openBlock as r, createBlock as p, withCtx as a, createElementBlock as s, mergeProps as c, renderSlot as t, createCommentVNode as l } from "vue";
4
4
  /* empty css */
5
5
  import d from "../../../_virtual/_plugin-vue_export-helper.js";
6
- const m = ["role", "aria-label"];
7
- function f(e, h, _, o, w, k) {
8
- return r(), a(o.NmorphOverlay, {
6
+ const i = ["role", "aria-label"];
7
+ function m(e, f, h, o, _, w) {
8
+ return r(), p(o.NmorphOverlay, {
9
9
  show: o.props.open,
10
10
  transparent: "",
11
11
  "z-index": o.props.zIndex,
@@ -15,23 +15,22 @@ function f(e, h, _, o, w, k) {
15
15
  onOnOutsideClick: o.outsideClickHandler,
16
16
  onOnEscapeKeydown: o.escapeHandler
17
17
  }, {
18
- default: s(() => [
19
- o.props.open ? (r(), p("div", {
18
+ default: a(() => [
19
+ o.props.open ? (r(), s("div", c({
20
20
  key: 0,
21
- ref: "dropdownDOMRef",
22
- class: c([o.modifiers, o.props.contentClass]),
23
- style: l(o.dropdownStyle),
21
+ ref: "dropdownDOMRef"
22
+ }, o.rootAttrs, {
24
23
  role: o.props.role || void 0,
25
24
  "aria-label": o.props.ariaLabel || void 0
26
- }, [
27
- i(e.$slots, "default")
28
- ], 14, m)) : t("v-if", !0)
25
+ }), [
26
+ t(e.$slots, "default")
27
+ ], 16, i)) : l("v-if", !0)
29
28
  ]),
30
29
  _: 3
31
30
  /* FORWARDED */
32
31
  }, 8, ["show", "z-index", "close-on-escape", "trap-focus", "restore-focus"]);
33
32
  }
34
- const O = /* @__PURE__ */ d(n, [["render", f], ["__file", "/home/runner/work/nmorph/nmorph/library/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue"]]);
33
+ const u = /* @__PURE__ */ d(n, [["render", m], ["__file", "/home/runner/work/nmorph/nmorph/library/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue"]]);
35
34
  export {
36
- O as default
35
+ u as default
37
36
  };
@@ -1,10 +1,12 @@
1
1
  import './NmorphDropdown.css';
2
- import { defineComponent as y, ref as v, toRef as t, computed as i, watch as w } from "vue";
3
- import { useModifiers as q } from "../../../utils/create-modifiers.js";
4
- import { toCssSize as b, createCssSizeVariables as x } from "../../../utils/common.js";
5
- import { usePlacement as S } from "../../../hooks/use-placement.js";
6
- import O from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
7
- const B = /* @__PURE__ */ y({
2
+ import { defineComponent as v, ref as w, toRef as t, computed as r, watch as q } from "vue";
3
+ import { useModifiers as b } from "../../../utils/create-modifiers.js";
4
+ import { toCssSize as x, createCssSizeVariables as S } from "../../../utils/common.js";
5
+ import { useMergedAttrs as O } from "../../../utils/attrs.js";
6
+ import { usePlacement as g } from "../../../hooks/use-placement.js";
7
+ import _ from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
8
+ const P = /* @__PURE__ */ v({
9
+ inheritAttrs: !1,
8
10
  __name: "NmorphDropdown",
9
11
  props: {
10
12
  open: { type: Boolean, required: !0 },
@@ -27,48 +29,51 @@ const B = /* @__PURE__ */ y({
27
29
  design: { type: null, required: !1, default: "nmorph" }
28
30
  },
29
31
  emits: ["on-outside-click", "on-escape-keydown"],
30
- setup(u, { expose: p, emit: f }) {
31
- p();
32
- const e = u, r = f, l = v(null), { placementCoords: o, placementReady: d, adjustPlacement: a } = S({
32
+ setup(f, { expose: m, emit: c }) {
33
+ m();
34
+ const e = f, o = c, l = w(null), { placementCoords: i, placementReady: a, adjustPlacement: d } = g({
33
35
  initialPlacement: t(e, "placement"),
34
36
  contentDOMElement: l,
35
37
  relativeElement: t(e, "relativeElement"),
36
38
  yOffset: t(e, "yOffset"),
37
39
  xOffset: t(e, "xOffset"),
38
40
  enabled: t(e, "open")
39
- }), m = i(
40
- () => q({
41
+ }), n = r(
42
+ () => b({
41
43
  "nmorph-dropdown": [!e.open && "closed", e.hideShadow && "hide-shadow", e.design]
42
44
  })
43
- ), n = i(
44
- () => e.fillWidth && e.relativeElement ? `${e.relativeElement.clientWidth}px` : b(e.width)
45
- ), c = i(() => ({
46
- "--nmorph-private-dropdown-width": n.value,
47
- ...x({
45
+ ), s = r(
46
+ () => e.fillWidth && e.relativeElement ? `${e.relativeElement.clientWidth}px` : x(e.width)
47
+ ), u = r(() => ({
48
+ "--nmorph-private-dropdown-width": s.value,
49
+ ...S({
48
50
  "--nmorph-private-dropdown-min-width": e.minWidth === void 0 ? "auto" : e.minWidth,
49
51
  "--nmorph-private-dropdown-max-width": e.maxWidth === void 0 ? "none" : e.maxWidth
50
52
  }),
51
- left: o.value.x,
52
- top: o.value.y,
53
- visibility: e.open && d.value ? "visible" : "hidden"
54
- }));
55
- w(
53
+ left: i.value.x,
54
+ top: i.value.y,
55
+ visibility: e.open && a.value ? "visible" : "hidden"
56
+ })), h = O(
57
+ r(() => [n.value, e.contentClass]),
58
+ u
59
+ );
60
+ q(
56
61
  () => e.open,
57
- (h) => {
58
- h && a();
62
+ (y) => {
63
+ y && d();
59
64
  },
60
65
  { flush: "post" }
61
66
  );
62
- const s = { props: e, emit: r, dropdownDOMRef: l, placementCoords: o, placementReady: d, adjustPlacement: a, modifiers: m, width: n, dropdownStyle: c, outsideClickHandler: () => {
63
- r("on-outside-click");
67
+ const p = { props: e, emit: o, dropdownDOMRef: l, placementCoords: i, placementReady: a, adjustPlacement: d, modifiers: n, width: s, dropdownStyle: u, rootAttrs: h, outsideClickHandler: () => {
68
+ o("on-outside-click");
64
69
  }, escapeHandler: () => {
65
- r("on-escape-keydown");
70
+ o("on-escape-keydown");
66
71
  }, get NmorphOverlay() {
67
- return O;
72
+ return _;
68
73
  } };
69
- return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
74
+ return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
70
75
  }
71
76
  });
72
77
  export {
73
- B as default
78
+ P as default
74
79
  };
@@ -1,59 +1,54 @@
1
1
  import './NmorphOverlay.css';
2
- import d from "./NmorphOverlay.vue2.js";
3
- import { openBlock as l, createElementBlock as p, withModifiers as e, normalizeStyle as i, normalizeClass as s, createElementVNode as n, renderSlot as a, createBlock as m, Teleport as c } from "vue";
2
+ import p from "./NmorphOverlay.vue2.js";
3
+ import { openBlock as l, createElementBlock as d, mergeProps as i, withModifiers as e, createElementVNode as t, renderSlot as s, createBlock as a, Teleport as c } from "vue";
4
4
  /* empty css */
5
- import f from "../../../_virtual/_plugin-vue_export-helper.js";
6
- const v = ["tabindex"], y = ["tabindex"];
7
- function k(t, r, _, o, h, x) {
8
- return o.renderInline ? (l(), p(
5
+ import m from "../../../_virtual/_plugin-vue_export-helper.js";
6
+ const f = ["tabindex"], k = ["tabindex"];
7
+ function v(n, r, _, o, h, y) {
8
+ return o.renderInline ? (l(), d(
9
9
  "div",
10
- {
11
- key: 0,
12
- class: s(o.modifiers),
13
- style: i({ "--nmorph-private-overlay-z-index": o.zIndex }),
10
+ i({ key: 0 }, o.rootAttrs, {
14
11
  onClick: e(o.clickHandler, ["stop"])
15
- },
12
+ }),
16
13
  [
17
- n("div", {
14
+ t("div", {
18
15
  ref: "contentRef",
19
16
  class: "nmorph-overlay__slot",
20
17
  tabindex: o.props.trapFocus ? -1 : void 0,
21
18
  onClick: r[0] || (r[0] = e(() => {
22
19
  }, ["stop"]))
23
20
  }, [
24
- a(t.$slots, "default")
25
- ], 8, v)
21
+ s(n.$slots, "default")
22
+ ], 8, f)
26
23
  ],
27
- 6
28
- /* CLASS, STYLE */
29
- )) : (l(), m(c, {
24
+ 16
25
+ /* FULL_PROPS */
26
+ )) : (l(), a(c, {
30
27
  key: 1,
31
28
  to: o.props.teleportTo
32
29
  }, [
33
- n(
30
+ t(
34
31
  "div",
35
- {
36
- class: s(o.modifiers),
37
- style: i({ "--nmorph-private-overlay-z-index": o.zIndex }),
32
+ i(o.rootAttrs, {
38
33
  onClick: e(o.clickHandler, ["stop"])
39
- },
34
+ }),
40
35
  [
41
- n("div", {
36
+ t("div", {
42
37
  ref: "contentRef",
43
38
  class: "nmorph-overlay__slot",
44
39
  tabindex: o.props.trapFocus ? -1 : void 0,
45
40
  onClick: r[1] || (r[1] = e(() => {
46
41
  }, ["stop"]))
47
42
  }, [
48
- a(t.$slots, "default")
49
- ], 8, y)
43
+ s(n.$slots, "default")
44
+ ], 8, k)
50
45
  ],
51
- 6
52
- /* CLASS, STYLE */
46
+ 16
47
+ /* FULL_PROPS */
53
48
  )
54
49
  ], 8, ["to"]));
55
50
  }
56
- const I = /* @__PURE__ */ f(d, [["render", k], ["__file", "/home/runner/work/nmorph/nmorph/library/src/components/others/nmorph-overlay/NmorphOverlay.vue"]]);
51
+ const N = /* @__PURE__ */ m(p, [["render", v], ["__file", "/home/runner/work/nmorph/nmorph/library/src/components/others/nmorph-overlay/NmorphOverlay.vue"]]);
57
52
  export {
58
- I as default
53
+ N as default
59
54
  };
@@ -1,8 +1,10 @@
1
1
  import './NmorphOverlay.css';
2
- import { defineComponent as _, computed as i, ref as q, watch as g, onBeforeUnmount as B, nextTick as A } from "vue";
3
- import { useModifiers as F } from "../../../utils/create-modifiers.js";
4
- import { useZIndex as I } from "../../../hooks/use-z-index.js";
5
- const L = /* @__PURE__ */ _({
2
+ import { defineComponent as A, computed as s, ref as g, watch as B, onBeforeUnmount as F, nextTick as I } from "vue";
3
+ import { useModifiers as S } from "../../../utils/create-modifiers.js";
4
+ import { useMergedAttrs as T } from "../../../utils/attrs.js";
5
+ import { useZIndex as z } from "../../../hooks/use-z-index.js";
6
+ const j = /* @__PURE__ */ A({
7
+ inheritAttrs: !1,
6
8
  __name: "NmorphOverlay",
7
9
  props: {
8
10
  show: { type: Boolean, required: !0 },
@@ -15,65 +17,65 @@ const L = /* @__PURE__ */ _({
15
17
  restoreFocus: { type: Boolean, required: !1, default: !0 }
16
18
  },
17
19
  emits: ["on-outside-click", "on-escape-keydown"],
18
- setup(b, { expose: v, emit: h }) {
19
- v();
20
- const t = b, E = I(
21
- i(() => t.show),
20
+ setup(E, { expose: w, emit: k }) {
21
+ w();
22
+ const t = E, d = z(
23
+ s(() => t.show),
22
24
  () => t.zIndex
23
- ), w = i(
24
- () => F({
25
+ ), c = s(
26
+ () => S({
25
27
  "nmorph-overlay": [t.show && "show", t.transparent && "transparent"]
26
28
  })
27
- ), k = i(() => t.disabledTeleport || !t.show || typeof document > "u"), x = () => {
28
- s("on-outside-click");
29
- }, s = h, n = q(null);
30
- let o = null;
31
- const d = [
29
+ ), x = s(() => t.disabledTeleport || !t.show || typeof document > "u"), f = s(() => ({ "--nmorph-private-overlay-z-index": d.value })), _ = T(c, f), q = () => {
30
+ l("on-outside-click");
31
+ }, l = k, o = g(null);
32
+ let n = null;
33
+ const p = [
32
34
  "a[href]",
33
35
  "button:not([disabled])",
34
36
  "textarea:not([disabled])",
35
37
  "input:not([disabled])",
36
38
  "select:not([disabled])",
37
39
  '[tabindex]:not([tabindex="-1"])'
38
- ].join(","), u = () => n.value ? Array.from(n.value.querySelectorAll(d)).filter(
40
+ ].join(","), u = () => o.value ? Array.from(o.value.querySelectorAll(p)).filter(
39
41
  (e) => e.getAttribute("aria-hidden") !== "true"
40
- ) : [], c = async () => {
42
+ ) : [], m = async () => {
41
43
  if (!t.trapFocus) return;
42
- await A(), (u()[0] || n.value)?.focus();
43
- }, l = (e) => {
44
+ await I(), (u()[0] || o.value)?.focus();
45
+ }, a = (e) => {
44
46
  if (!t.show) return;
45
47
  if (e.key === "Escape" && t.closeOnEscape) {
46
- e.preventDefault(), s("on-escape-keydown");
48
+ e.preventDefault(), l("on-escape-keydown");
47
49
  return;
48
50
  }
49
51
  if (e.key !== "Tab" || !t.trapFocus) return;
50
52
  const r = u();
51
53
  if (!r.length) {
52
- e.preventDefault(), n.value?.focus();
54
+ e.preventDefault(), o.value?.focus();
53
55
  return;
54
56
  }
55
- const m = r[0], y = r[r.length - 1];
56
- e.shiftKey && document.activeElement === m ? (e.preventDefault(), y.focus()) : !e.shiftKey && document.activeElement === y && (e.preventDefault(), m.focus());
57
- }, f = () => {
58
- typeof document > "u" || document.addEventListener("keydown", l);
59
- }, a = () => {
60
- typeof document > "u" || document.removeEventListener("keydown", l);
57
+ const b = r[0], h = r[r.length - 1];
58
+ e.shiftKey && document.activeElement === b ? (e.preventDefault(), h.focus()) : !e.shiftKey && document.activeElement === h && (e.preventDefault(), b.focus());
59
+ }, y = () => {
60
+ typeof document > "u" || document.addEventListener("keydown", a);
61
+ }, i = () => {
62
+ typeof document > "u" || document.removeEventListener("keydown", a);
61
63
  };
62
- g(
64
+ B(
63
65
  () => t.show,
64
66
  (e) => {
65
- typeof document > "u" || (e ? (o = document.activeElement, f(), c()) : (a(), t.restoreFocus && o?.focus?.(), o = null));
67
+ typeof document > "u" || (e ? (n = document.activeElement, y(), m()) : (i(), t.restoreFocus && n?.focus?.(), n = null));
66
68
  },
67
69
  { immediate: !0, flush: "post" }
68
- ), B(a);
69
- const p = { props: t, zIndex: E, modifiers: w, renderInline: k, clickHandler: x, emit: s, contentRef: n, get previousActiveElement() {
70
- return o;
70
+ ), F(i);
71
+ const v = { props: t, zIndex: d, modifiers: c, renderInline: x, overlayStyle: f, rootAttrs: _, clickHandler: q, emit: l, contentRef: o, get previousActiveElement() {
72
+ return n;
71
73
  }, set previousActiveElement(e) {
72
- o = e;
73
- }, focusableSelector: d, getFocusableElements: u, focusContent: c, keydownHandler: l, addKeydownListener: f, removeKeydownListener: a };
74
- return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
74
+ n = e;
75
+ }, focusableSelector: p, getFocusableElements: u, focusContent: m, keydownHandler: a, addKeydownListener: y, removeKeydownListener: i };
76
+ return Object.defineProperty(v, "__isScriptSetup", { enumerable: !1, value: !0 }), v;
75
77
  }
76
78
  });
77
79
  export {
78
- L as default
80
+ j as default
79
81
  };
@@ -1,54 +1,51 @@
1
1
  import './NmorphNotificationProvider.css';
2
2
  import h from "./NmorphNotificationProvider.vue2.js";
3
- import { openBlock as e, createBlock as d, Teleport as _, createElementVNode as n, normalizeStyle as l, 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";
3
+ import { openBlock as e, createBlock as a, Teleport as _, createElementVNode as n, normalizeProps as v, guardReactiveProps as u, createElementBlock as t, Fragment as d, renderList as s, TransitionGroup as b, normalizeClass as c, withCtx as f, normalizeStyle as p, createVNode as y, toDisplayString as k, createCommentVNode as m } from "vue";
4
4
  /* empty css */
5
- import y from "../../../_virtual/_plugin-vue_export-helper.js";
6
- const k = ["title"], N = {
5
+ import N from "../../../_virtual/_plugin-vue_export-helper.js";
6
+ const g = ["title"], D = {
7
7
  key: 0,
8
8
  class: "nmorph-notification-provider__duration-value"
9
9
  };
10
- function g(D, a, w, r, I, x) {
11
- return e(), d(_, {
10
+ function w(C, l, I, r, P, V) {
11
+ return e(), a(_, {
12
12
  to: r.props.teleportTo,
13
13
  disabled: r.teleportDisabled
14
14
  }, [
15
15
  n(
16
16
  "div",
17
- {
18
- class: "nmorph-notification-provider",
19
- style: l({ zIndex: r.zIndex })
20
- },
17
+ v(u(r.rootAttrs)),
21
18
  [
22
- (e(!0), i(
23
- s,
19
+ (e(!0), t(
20
+ d,
24
21
  null,
25
- c(r.notificationGroups, (t) => (e(), d(v, {
26
- key: t.placement,
22
+ s(r.notificationGroups, (i) => (e(), a(b, {
23
+ key: i.placement,
27
24
  appear: "",
28
25
  name: "nmorph-notification",
29
26
  tag: "div",
30
- class: p(`nmorph-notification-provider__list nmorph-notification-provider__list--${t.placement}`)
27
+ class: c(`nmorph-notification-provider__list nmorph-notification-provider__list--${i.placement}`)
31
28
  }, {
32
- default: u(() => [
33
- (e(!0), i(
34
- s,
29
+ default: f(() => [
30
+ (e(!0), t(
31
+ d,
35
32
  null,
36
- c(t.notifications, (o) => (e(), i(
33
+ s(i.notifications, (o) => (e(), t(
37
34
  "div",
38
35
  {
39
36
  key: o.id,
40
- style: l(r.getNotificationStyle(o)),
41
- class: p([
37
+ style: p(r.getNotificationStyle(o)),
38
+ class: c([
42
39
  "nmorph-notification-provider__notification",
43
40
  r.hasDurationIndicator(o) && "nmorph-notification-provider__notification--with-duration",
44
41
  r.closingIds.includes(o.id) && "nmorph-notification-provider__notification--closing"
45
42
  ])
46
43
  },
47
44
  [
48
- b(r.NmorphAlert, {
45
+ y(r.NmorphAlert, {
49
46
  id: o.id,
50
47
  class: "nmorph-notification-provider__alert",
51
- style: l({ width: o.width }),
48
+ style: p({ width: o.width }),
52
49
  type: o.type,
53
50
  closable: o.closable,
54
51
  title: o.title,
@@ -61,13 +58,13 @@ function g(D, a, w, r, I, x) {
61
58
  "background-color": o.backgroundColor,
62
59
  onClose: () => r.closeHandler(o.id)
63
60
  }, 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", {
61
+ r.hasDurationIndicator(o) ? (e(), t("div", {
65
62
  key: `${o.id}-${r.getNotificationDuration(o)}`,
66
63
  class: "nmorph-notification-provider__duration",
67
64
  title: r.hasDurationValue(o) ? r.getNotificationDurationLabel(o) : void 0,
68
65
  "aria-hidden": "true"
69
66
  }, [
70
- a[0] || (a[0] = n(
67
+ l[0] || (l[0] = n(
71
68
  "span",
72
69
  { class: "nmorph-notification-provider__duration-track" },
73
70
  [
@@ -76,14 +73,14 @@ function g(D, a, w, r, I, x) {
76
73
  -1
77
74
  /* CACHED */
78
75
  )),
79
- r.hasDurationValue(o) ? (e(), i(
76
+ r.hasDurationValue(o) ? (e(), t(
80
77
  "span",
81
- N,
82
- f(r.getNotificationDurationLabel(o)),
78
+ D,
79
+ k(r.getNotificationDurationLabel(o)),
83
80
  1
84
81
  /* TEXT */
85
82
  )) : m("v-if", !0)
86
- ], 8, k)) : m("v-if", !0)
83
+ ], 8, g)) : m("v-if", !0)
87
84
  ],
88
85
  6
89
86
  /* CLASS, STYLE */
@@ -99,12 +96,12 @@ function g(D, a, w, r, I, x) {
99
96
  /* KEYED_FRAGMENT */
100
97
  ))
101
98
  ],
102
- 4
103
- /* STYLE */
99
+ 16
100
+ /* FULL_PROPS */
104
101
  )
105
102
  ], 8, ["to", "disabled"]);
106
103
  }
107
- const L = /* @__PURE__ */ y(h, [["render", g], ["__file", "/home/runner/work/nmorph/nmorph/library/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue"]]);
104
+ const S = /* @__PURE__ */ N(h, [["render", w], ["__file", "/home/runner/work/nmorph/nmorph/library/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue"]]);
108
105
  export {
109
- L as default
106
+ S as default
110
107
  };
@@ -1,8 +1,10 @@
1
1
  import './NmorphNotificationProvider.css';
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({
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,31 +14,31 @@ 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(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();
17
+ setup(V, { expose: Z }) {
18
+ Z();
19
+ const T = (e) => typeof e.id == "string" && e.id.length > 0, c = s([]), o = s([]), n = s([]), d = s(Date.now()), f = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
18
20
  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) => {
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, $ = (e) => e.showDurationValue !== !1, q = (e) => {
20
22
  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
+ return !t || !r ? t : Math.max(t - (d.value - r), 0);
24
+ }, z = (e) => e < 1e3 ? `${Math.ceil(e)}ms` : `${Math.ceil(e / 1e3)}s`, C = (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 = d.get(e);
26
- r && clearTimeout(r), d.delete(e), m.delete(e), t || v.delete(e);
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
30
  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
+ }, g = (e, t = !0) => {
32
+ o.value.includes(e) || (h(e, !0), t && !c.value.includes(e) && (c.value = [...c.value, e]), o.value = [...o.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), d.set(
35
+ m.get(e.id) !== t && (h(e.id), t && (d.value = Date.now(), v.set(e.id, d.value), f.set(
34
36
  e.id,
35
- setTimeout(() => D(e.id), t)
37
+ setTimeout(() => g(e.id), t)
36
38
  ), m.set(e.id, t)));
37
- }, a = P, g = s(!1), x = K("nmorph"), I = s(x?.zIndex.current.value ?? 1e3), N = s(!1), _ = () => {
39
+ }, a = V, D = s(!1), x = Q("nmorph"), I = s(x?.zIndex.current.value ?? 1e3), N = s(!1), A = () => {
38
40
  a.zIndex !== void 0 || N.value || (I.value = x?.zIndex.next() ?? I.value + 1, N.value = !0);
39
- }, C = f(
41
+ }, G = l(
40
42
  () => w.map((e) => {
41
43
  const t = n.value.filter(
42
44
  (u) => (u.placement ?? a.placement) === e
@@ -46,49 +48,49 @@ const j = 500, L = 250, re = /* @__PURE__ */ H({
46
48
  notifications: t.slice(r)
47
49
  };
48
50
  })
49
- ), O = f(
51
+ ), O = l(
50
52
  () => n.value.some(
51
53
  (e) => R(e) && !o.value.includes(e.id)
52
54
  )
53
- ), b = f(() => n.value.length > 0), B = f(
54
- () => b.value || a.notifications.some(
55
- (e) => y(e) && !l.value.includes(e.id)
55
+ ), _ = l(() => n.value.length > 0), S = l(
56
+ () => _.value || a.notifications.some(
57
+ (e) => T(e) && !c.value.includes(e.id)
56
58
  )
57
- ), F = f(() => a.zIndex ?? I.value), G = f(() => !g.value || a.disabledTeleport), A = () => {
59
+ ), B = l(() => a.zIndex ?? I.value), H = l(() => !D.value || a.disabledTeleport), j = l(() => ({ zIndex: B.value })), K = Y("nmorph-notification-provider", j), b = () => {
58
60
  i && (clearInterval(i), i = void 0);
59
61
  };
60
- T(
62
+ y(
61
63
  () => a.notifications,
62
64
  () => {
63
- B.value && _();
65
+ S.value && A();
64
66
  },
65
67
  { deep: !0, immediate: !0, flush: "sync" }
66
- ), T(
67
- b,
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
- ), T(
78
+ ), y(
77
79
  O,
78
80
  (e) => {
79
81
  if (!e) {
80
- A();
82
+ b();
81
83
  return;
82
84
  }
83
- i || (c.value = Date.now(), i = setInterval(() => {
84
- c.value = Date.now();
85
- }, L));
85
+ i || (d.value = Date.now(), i = setInterval(() => {
86
+ d.value = Date.now();
87
+ }, U));
86
88
  },
87
89
  { immediate: !0 }
88
- ), T(
90
+ ), y(
89
91
  () => a.notifications,
90
92
  (e) => {
91
- const t = e.filter(y).filter((r) => !l.value.includes(r.id));
93
+ const t = e.filter(T).filter((r) => !c.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) => D(r.id, !1));
103
+ ).forEach((r) => g(r.id, !1));
102
104
  },
103
105
  { deep: !0, immediate: !0 }
104
- ), J(() => {
105
- g.value = !0;
106
- }), Q(() => {
107
- d.forEach((e) => clearTimeout(e)), d.clear(), m.clear(), v.clear(), A();
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 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() {
111
+ const L = { ANIMATION_DURATION: P, DURATION_TICK_INTERVAL: U, hasNotificationId: T, removedIds: c, closingIds: o, renderedNotifications: n, durationTick: d, 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: 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;
115
+ }, placementList: w, getNotificationDuration: p, hasDurationIndicator: R, hasDurationValue: $, getNotificationRemainingDuration: q, formatNotificationDuration: z, getNotificationDurationLabel: C, getNotificationStyle: F, clearDurationTimer: h, removeRenderedNotification: k, closeHandler: g, scheduleDurationTimer: E, props: a, 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(S, "__isScriptSetup", { enumerable: !1, value: !0 }), S;
118
+ return Object.defineProperty(L, "__isScriptSetup", { enumerable: !1, value: !0 }), L;
117
119
  }
118
120
  });
119
121
  export {
120
- re as default
122
+ ie as default
121
123
  };