@nmorph/nmorph-ui-kit 2.2.16 → 2.2.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.
@@ -1 +1 @@
1
- .nmorph-badge{position:relative;display:inline-block;height:fit-content;--dot-size: 4px}.nmorph-badge .nmorph-badge__container{position:absolute;display:inline-flex;justify-content:center;align-items:center;background:var(--nmorph-badge-color);border-radius:var(--default-border-radius);opacity:1}.nmorph-badge.nmorph-badge--tag{position:static;display:inline-flex}.nmorph-badge .nmorph-badge__container--tag{position:static}.nmorph-badge .nmorph-badge__content{padding:2px 4px;color:var(--nmorph-light-shade-color);font-size:var(--font-size-base);line-height:var(--line-height-regular)}.nmorph-badge.nmorph-badge--tiny .nmorph-badge__content{font-size:var(--font-size-tiny)}.nmorph-badge.nmorph-badge--extra-small .nmorph-badge__content{font-size:var(--font-size-extra-small)}.nmorph-badge .nmorph-badge__container--hidden{opacity:0}.nmorph-badge .nmorph-badge__dot{width:var(--dot-size);height:var(--dot-size);border-radius:var(--border-radius-circular)}
1
+ .nmorph-badge{position:relative;display:inline-block;height:fit-content;--dot-size: 4px}.nmorph-badge .nmorph-badge__container{position:absolute;display:inline-flex;justify-content:center;align-items:center;background:var(--nmorph-badge-color);border-radius:var(--default-border-radius);opacity:1}.nmorph-badge.nmorph-badge--tag{position:static;display:inline-flex}.nmorph-badge .nmorph-badge__container--tag{position:static}.nmorph-badge .nmorph-badge__content{box-sizing:border-box;display:inline-flex;justify-content:center;align-items:center;min-width:calc(1em * var(--line-height-regular) + 4px);padding:2px 4px;color:var(--nmorph-light-shade-color);font-size:var(--font-size-base);line-height:var(--line-height-regular);text-align:center}.nmorph-badge.nmorph-badge--tiny .nmorph-badge__content{font-size:var(--font-size-tiny)}.nmorph-badge.nmorph-badge--extra-small .nmorph-badge__content{font-size:var(--font-size-extra-small)}.nmorph-badge .nmorph-badge__container--hidden{opacity:0}.nmorph-badge .nmorph-badge__dot{width:var(--dot-size);height:var(--dot-size);border-radius:var(--border-radius-circular)}
@@ -1,15 +1,14 @@
1
- import { inject as i, computed as e } from "vue";
2
- import { generateUUID as r } from "../../../utils/common.js";
3
- const d = "nmorph-form-item-input-data", p = (t) => {
4
- const o = i(d, void 0), a = r(), n = e(() => t.id || o?.id.value || a), m = e(() => t.name || o?.name.value || n.value), c = e(() => t.autocomplete || o?.autocomplete.value || void 0), u = e(() => t.tabindex ?? 0);
1
+ import { inject as d, useId as i, computed as e } from "vue";
2
+ const l = "nmorph-form-item-input-data", I = (t) => {
3
+ const o = d(l, void 0), a = `nmorph-${i()}`, n = e(() => t.id || o?.id.value || a), m = e(() => t.name || o?.name.value || n.value), u = e(() => t.autocomplete || o?.autocomplete.value || void 0), c = e(() => t.tabindex ?? 0);
5
4
  return {
6
5
  id: n,
7
6
  name: m,
8
- autocomplete: c,
9
- tabindex: u
7
+ autocomplete: u,
8
+ tabindex: c
10
9
  };
11
10
  };
12
11
  export {
13
- d as nmorphFormItemInputDataKey,
14
- p as useFormItemInput
12
+ l as nmorphFormItemInputDataKey,
13
+ I as useFormItemInput
15
14
  };
@@ -1,44 +1,45 @@
1
1
  import './NmorphSwitch.css';
2
2
  import l from "./NmorphSwitch.vue2.js";
3
- import { openBlock as r, createElementBlock as t, normalizeClass as a, createElementVNode as e, renderSlot as i, createBlock as c, withCtx as d, createVNode as s } from "vue";
3
+ import { openBlock as r, createElementBlock as t, normalizeClass as a, createElementVNode as n, renderSlot as i, createBlock as c, withCtx as d, createVNode as s } from "vue";
4
4
  /* empty css */
5
- import m from "../../../_virtual/_plugin-vue_export-helper.js";
6
- const h = ["id", "name", "value", "disabled", "tabindex"], f = { class: "nmorph-switch-thumb" };
7
- function b(n, p, _, o, k, u) {
5
+ import h from "../../../_virtual/_plugin-vue_export-helper.js";
6
+ const m = ["id", "name", "value", "checked", "disabled", "tabindex"], f = { class: "nmorph-switch-thumb" };
7
+ function p(e, b, _, o, k, u) {
8
8
  return r(), t(
9
9
  "div",
10
10
  {
11
11
  class: a(o.modifiers)
12
12
  },
13
13
  [
14
- e("div", {
14
+ n("div", {
15
15
  class: "nmorph-switch__content",
16
16
  onClick: o.changeHandler
17
17
  }, [
18
- e("input", {
18
+ n("input", {
19
19
  id: o.id,
20
20
  ref: "inputDOMRef",
21
21
  name: o.name,
22
22
  type: "checkbox",
23
- value: o.initialValue,
23
+ value: o.props.activeValue,
24
+ checked: o.initialValue,
24
25
  disabled: o.props.disabled,
25
26
  tabindex: o.tabindex,
26
27
  class: "nmorph-native-input",
27
28
  onFocus: o.focusHandler,
28
29
  onBlur: o.blurHandler
29
- }, null, 40, h),
30
- e(
30
+ }, null, 40, m),
31
+ n(
31
32
  "div",
32
33
  {
33
34
  class: a(["nmorph-switch__bg-content", { "nmorph-switch__bg-content--enable": o.initialValue }])
34
35
  },
35
36
  [
36
- o.initialValue ? i(n.$slots, "bg-on", { key: 0 }) : i(n.$slots, "bg-off", { key: 1 })
37
+ o.initialValue ? i(e.$slots, "bg-on", { key: 0 }) : i(e.$slots, "bg-off", { key: 1 })
37
38
  ],
38
39
  2
39
40
  /* CLASS */
40
41
  ),
41
- e("div", f, [
42
+ n("div", f, [
42
43
  o.props.loading ? (r(), c(o.NmorphIcon, {
43
44
  key: 0,
44
45
  width: "14px",
@@ -49,7 +50,7 @@ function b(n, p, _, o, k, u) {
49
50
  ]),
50
51
  _: 1
51
52
  /* STABLE */
52
- })) : o.initialValue ? i(n.$slots, "thumb-on", { key: 1 }) : i(n.$slots, "thumb-off", { key: 2 })
53
+ })) : o.initialValue ? i(e.$slots, "thumb-on", { key: 1 }) : i(e.$slots, "thumb-off", { key: 2 })
53
54
  ])
54
55
  ])
55
56
  ],
@@ -57,7 +58,7 @@ function b(n, p, _, o, k, u) {
57
58
  /* CLASS */
58
59
  );
59
60
  }
60
- const x = /* @__PURE__ */ m(l, [["render", b], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-switch/NmorphSwitch.vue"]]);
61
+ const V = /* @__PURE__ */ h(l, [["render", p], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-switch/NmorphSwitch.vue"]]);
61
62
  export {
62
- x as default
63
+ V as default
63
64
  };
@@ -1,14 +1,15 @@
1
1
  import './NmorphContextMenu.css';
2
- import t from "./NmorphContextMenu.vue2.js";
3
- import { openBlock as n, createElementBlock as l, renderSlot as r, createBlock as i, withCtx as a, createCommentVNode as c } from "vue";
2
+ import l from "./NmorphContextMenu.vue2.js";
3
+ import { openBlock as n, createElementBlock as t, renderSlot as r, createBlock as i, withCtx as a, createCommentVNode as c } from "vue";
4
4
  /* empty css */
5
- import p from "../../../_virtual/_plugin-vue_export-helper.js";
6
- function d(o, m, f, e, s, h) {
7
- return n(), l(
5
+ import d from "../../../_virtual/_plugin-vue_export-helper.js";
6
+ function m(o, p, f, e, s, h) {
7
+ return n(), t(
8
8
  "div",
9
9
  {
10
10
  ref: "triggerDOMRef",
11
11
  class: "nmorph-context-menu",
12
+ onClick: e.clickHandler,
12
13
  onContextmenu: e.contextMenuHandler,
13
14
  onKeydown: e.keydownHandler
14
15
  },
@@ -44,7 +45,7 @@ function d(o, m, f, e, s, h) {
44
45
  /* NEED_HYDRATION, NEED_PATCH */
45
46
  );
46
47
  }
47
- const v = /* @__PURE__ */ p(t, [["render", d], ["__file", "/builds/ketjo/nmorph/library/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue"]]);
48
+ const v = /* @__PURE__ */ d(l, [["render", m], ["__file", "/builds/ketjo/nmorph/library/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue"]]);
48
49
  export {
49
50
  v as default
50
51
  };
@@ -1,10 +1,11 @@
1
1
  import './NmorphContextMenu.css';
2
- import { defineComponent as O, ref as i, computed as S, watch as k } from "vue";
3
- import w from "../nmorph-dropdown/NmorphDropdown.vue.js";
4
- const C = /* @__PURE__ */ O({
2
+ import { defineComponent as N, ref as d, computed as O, watch as w } from "vue";
3
+ import x from "../nmorph-dropdown/NmorphDropdown.vue.js";
4
+ const H = /* @__PURE__ */ N({
5
5
  __name: "NmorphContextMenu",
6
6
  props: {
7
- modelValue: { type: Boolean, required: !1 },
7
+ modelValue: { type: [Boolean, null], required: !1, default: null },
8
+ trigger: { type: String, required: !1, default: "contextmenu" },
8
9
  placement: { type: null, required: !1, default: "bottom-start" },
9
10
  width: { type: [Number, String], required: !1, default: 160 },
10
11
  minWidth: { type: [Number, String], required: !1, default: void 0 },
@@ -20,50 +21,52 @@ const C = /* @__PURE__ */ O({
20
21
  ariaLabel: { type: String, required: !1, default: "" }
21
22
  },
22
23
  emits: ["update:model-value", "open", "close", "on-outside-click", "on-escape-keydown"],
23
- setup(y, { expose: b, emit: g }) {
24
- const l = y, o = g, s = i(null), f = i(null), n = i(!!l.modelValue), p = S(() => typeof l.modelValue == "boolean" ? l.modelValue : n.value);
25
- k(
26
- () => l.modelValue,
24
+ setup(g, { expose: y, emit: b }) {
25
+ const t = g, o = b, s = d(null), f = d(null), n = d(!!t.modelValue), c = O(() => typeof t.modelValue == "boolean" ? t.modelValue : n.value);
26
+ w(
27
+ () => t.modelValue,
27
28
  (e) => {
28
29
  typeof e == "boolean" && (n.value = e);
29
30
  }
30
31
  );
31
- const c = (e, t) => ({
32
+ const p = (e, l) => ({
32
33
  clientWidth: 0,
33
34
  getBoundingClientRect: () => ({
34
35
  x: e,
35
- y: t,
36
+ y: l,
36
37
  width: 0,
37
38
  height: 0,
38
- top: t,
39
+ top: l,
39
40
  left: e,
40
41
  right: e,
41
- bottom: t,
42
+ bottom: l,
42
43
  toJSON: () => ({})
43
44
  })
44
45
  }), u = (e) => {
45
- const t = p.value;
46
- n.value = e, o("update:model-value", e), t && !e && o("close");
47
- }, r = () => {
46
+ const l = c.value;
47
+ n.value = e, o("update:model-value", e), l && !e && o("close");
48
+ }, a = () => {
48
49
  u(!1);
49
- }, d = (e, t, a) => {
50
- f.value = c(e, t), u(!0), o("open", a);
51
- }, q = (e) => {
52
- l.disabled || (e.preventDefault(), d(e.clientX, e.clientY, e));
50
+ }, i = (e, l, r) => {
51
+ f.value = p(e, l), u(!0), o("open", r);
53
52
  }, h = (e) => {
54
- if (l.disabled || e.key !== "ContextMenu" && !(e.shiftKey && e.key === "F10")) return;
55
- const a = (e.target instanceof HTMLElement ? e.target : s.value)?.getBoundingClientRect();
56
- a && (e.preventDefault(), d(a.left, a.bottom, e));
53
+ t.disabled || t.trigger !== "contextmenu" && t.trigger !== "both" || (e.preventDefault(), i(e.clientX, e.clientY, e));
54
+ }, q = (e) => {
55
+ t.disabled || t.trigger !== "click" && t.trigger !== "both" || e.button !== 0 || i(e.clientX, e.clientY, e);
56
+ }, k = (e) => {
57
+ if (t.disabled || e.key !== "ContextMenu" && !(e.shiftKey && e.key === "F10")) return;
58
+ const r = (e.target instanceof HTMLElement ? e.target : s.value)?.getBoundingClientRect();
59
+ r && (e.preventDefault(), i(r.left, r.bottom, e));
60
+ }, S = () => {
61
+ o("on-outside-click"), a();
57
62
  }, _ = () => {
58
- o("on-outside-click"), r();
59
- }, N = () => {
60
- o("on-escape-keydown"), r();
63
+ o("on-escape-keydown"), a();
61
64
  };
62
- b({ close: r });
63
- const m = { props: l, emit: o, triggerDOMRef: s, relativeElement: f, openState: n, isOpen: p, createPointElement: c, setOpen: u, close: r, openAt: d, contextMenuHandler: q, keydownHandler: h, outsideClickHandler: _, escapeHandler: N, NmorphDropdown: w };
65
+ y({ close: a });
66
+ const m = { props: t, emit: o, triggerDOMRef: s, relativeElement: f, openState: n, isOpen: c, createPointElement: p, setOpen: u, close: a, openAt: i, contextMenuHandler: h, clickHandler: q, keydownHandler: k, outsideClickHandler: S, escapeHandler: _, NmorphDropdown: x };
64
67
  return Object.defineProperty(m, "__isScriptSetup", { enumerable: !1, value: !0 }), m;
65
68
  }
66
69
  });
67
70
  export {
68
- C as default
71
+ H as default
69
72
  };