@nmorph/nmorph-ui-kit 2.2.15 → 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.
Files changed (65) hide show
  1. package/README.md +0 -8
  2. package/dist/components/basic/nmorph-button/NmorphButton.css +1 -1
  3. package/dist/components/basic/nmorph-button/NmorphButton.vue.js +12 -12
  4. package/dist/components/basic/nmorph-button/NmorphButton.vue2.js +17 -14
  5. package/dist/components/data/nmorph-badge/NmorphBadge.css +1 -1
  6. package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +1 -1
  7. package/dist/components/data/nmorph-calendar/utils.js +65 -52
  8. package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +39 -37
  9. package/dist/components/data/nmorph-table/NmorphTable.css +1 -1
  10. package/dist/components/data/nmorph-table/NmorphTable.vue.js +228 -225
  11. package/dist/components/data/nmorph-table/NmorphTable.vue2.js +57 -43
  12. package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue.js +47 -47
  13. package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue2.js +28 -25
  14. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.css +1 -1
  15. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +102 -92
  16. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +67 -44
  17. package/dist/components/form/nmorph-date-picker/NmorphDatePicker.css +1 -1
  18. package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +45 -33
  19. package/dist/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue2.js +1 -1
  20. package/dist/components/form/nmorph-form/use-form-item-input.js +7 -8
  21. package/dist/components/form/nmorph-select/NmorphSelect.css +1 -1
  22. package/dist/components/form/nmorph-select/NmorphSelect.vue.js +135 -125
  23. package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +76 -65
  24. package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.js +15 -12
  25. package/dist/components/form/nmorph-switch/NmorphSwitch.vue.js +15 -14
  26. package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +22 -21
  27. package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +16 -16
  28. package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.css +1 -0
  29. package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.js +51 -0
  30. package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue2.js +72 -0
  31. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.css +1 -1
  32. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue.js +23 -23
  33. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +31 -25
  34. package/dist/components/others/nmorph-overlay/NmorphOverlay.vue.js +42 -18
  35. package/dist/components/others/nmorph-overlay/NmorphOverlay.vue2.js +66 -19
  36. package/dist/hooks/use-common-styles.js +42 -33
  37. package/dist/hooks/use-virtual-list.js +65 -37
  38. package/dist/icons.d.ts +2 -0
  39. package/dist/icons.js +539 -0
  40. package/dist/index.es.js +656 -653
  41. package/dist/index.umd.js +63 -65
  42. package/dist/nuxt.mjs +10 -5
  43. package/dist/outside-hooks/use-nmorph-theme.js +97 -98
  44. package/dist/package.json.js +1 -1
  45. package/dist/plugin.js +43 -43
  46. package/dist/src/components/data/nmorph-calendar/types.d.ts +8 -1
  47. package/dist/src/components/data/nmorph-calendar/utils.d.ts +2 -1
  48. package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +2 -0
  49. package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +2 -0
  50. package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +2 -0
  51. package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +13 -1
  52. package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +2 -0
  53. package/dist/src/components/form/nmorph-text-input/NmorphTextInput.vue.d.ts +2 -0
  54. package/dist/src/components/navigation/index.d.ts +1 -0
  55. package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +64 -0
  56. package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +10 -0
  57. package/dist/src/components/others/nmorph-overlay/NmorphOverlay.vue.d.ts +12 -1
  58. package/dist/src/hooks/use-virtual-list.d.ts +3 -0
  59. package/dist/src/icons.d.ts +3 -0
  60. package/dist/src/styles.d.ts +2 -0
  61. package/dist/style.css +1 -1
  62. package/dist/styles.d.ts +2 -0
  63. package/dist/styles.js +7 -0
  64. package/dist/utils/theme-style.js +27 -38
  65. package/package.json +11 -1
@@ -1,17 +1,17 @@
1
1
  import './NmorphSelect.css';
2
- import { defineComponent as le, computed as a, ref as s, watch as f, nextTick as E, onMounted as ae, onUnmounted as re, provide as L } from "vue";
3
- import { NmorphComponentHeight as ne } from "../../../types/index.js";
4
- import { useModifiers as ue } from "../../../utils/create-modifiers.js";
5
- import { useI18n as oe } from "vue-i18n";
6
- import { useFormItemInput as ie } from "../nmorph-form/use-form-item-input.js";
7
- import { useVirtualList as se } from "../../../hooks/use-virtual-list.js";
8
- import de from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
9
- import ve from "./components/nmorph-select-option/NmorphSelectOption.vue.js";
10
- import ce from "../../basic/nmorph-icon/NmorphIcon.vue.js";
11
- import fe from "../../data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js";
12
- import pe from "../../../assets/icons/chevron-down.svg.js";
13
- import me from "../../../assets/icons/loader.svg.js";
14
- const _e = /* @__PURE__ */ le({
2
+ import { defineComponent as ne, computed as a, ref as d, watch as f, nextTick as L, onMounted as ue, onUnmounted as oe, provide as R } from "vue";
3
+ import { NmorphComponentHeight as ie } from "../../../types/index.js";
4
+ import { useModifiers as se } from "../../../utils/create-modifiers.js";
5
+ import { useI18n as de } from "vue-i18n";
6
+ import { useFormItemInput as ve } from "../nmorph-form/use-form-item-input.js";
7
+ import { useVirtualList as ce } from "../../../hooks/use-virtual-list.js";
8
+ import fe from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
9
+ import pe from "./components/nmorph-select-option/NmorphSelectOption.vue.js";
10
+ import me from "../../basic/nmorph-icon/NmorphIcon.vue.js";
11
+ import he from "../../data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js";
12
+ import ge from "../../../assets/icons/chevron-down.svg.js";
13
+ import ye from "../../../assets/icons/loader.svg.js";
14
+ const Ce = /* @__PURE__ */ ne({
15
15
  __name: "NmorphSelect",
16
16
  props: {
17
17
  noElementPlaceholder: { type: String, required: !1, default: "" },
@@ -28,6 +28,7 @@ const _e = /* @__PURE__ */ le({
28
28
  virtualItemHeight: { type: Number, required: !1, default: 0 },
29
29
  virtualMaxHeight: { type: [Number, String], required: !1, default: 240 },
30
30
  virtualOverscan: { type: Number, required: !1, default: 5 },
31
+ virtualDynamicHeight: { type: Boolean, required: !1, default: !1 },
31
32
  id: { type: String, required: !1 },
32
33
  name: { type: String, required: !1 },
33
34
  autocomplete: { type: String, required: !1 },
@@ -36,39 +37,39 @@ const _e = /* @__PURE__ */ le({
36
37
  tabindex: { type: Number, required: !1 }
37
38
  },
38
39
  emits: ["update:model-value"],
39
- setup(V, { expose: B, emit: T }) {
40
- B();
41
- const { t: O } = oe(), l = V, S = a(
42
- () => l.noElementPlaceholder ? l.noElementPlaceholder : O("noElementPlaceholder")
43
- ), m = T, t = s(l.modelValue), r = s(l.open), d = a(() => l.disabled || l.loading), h = a(() => l.optionsWidth === "auto"), g = s(!0), { id: C, name: P, autocomplete: k, tabindex: R } = ie(l), y = (e) => {
44
- if (!d.value) {
40
+ setup(T, { expose: C, emit: P }) {
41
+ C();
42
+ const { t: M } = de(), l = T, $ = a(
43
+ () => l.noElementPlaceholder ? l.noElementPlaceholder : M("noElementPlaceholder")
44
+ ), m = P, t = d(l.modelValue), r = d(l.open), v = a(() => l.disabled || l.loading), h = a(() => l.optionsWidth === "auto"), g = d(!0), { id: y, name: k, autocomplete: W, tabindex: U } = ve(l), H = (e) => {
45
+ if (!v.value) {
45
46
  if (r.value = !1, typeof t.value == "string" && (!l.valueRequired && t.value === e ? t.value = "" : t.value = e, m("update:model-value", t.value)), Array.isArray(t.value)) {
46
- const n = t.value.includes(e), ee = t.value.length === 1 && n;
47
- if (l.valueRequired && ee) return;
48
- n ? t.value = t.value.filter((te) => te !== e) : t.value = [...t.value, e];
47
+ const n = t.value.includes(e), S = t.value.length === 1 && n;
48
+ if (l.valueRequired && S) return;
49
+ n ? t.value = t.value.filter((re) => re !== e) : t.value = [...t.value, e];
49
50
  }
50
51
  m("update:model-value", t.value);
51
52
  }
52
- }, p = s(!1), W = () => {
53
+ }, p = d(!1), z = () => {
53
54
  p.value = !0;
54
- }, U = () => {
55
+ }, F = () => {
55
56
  p.value = !1;
56
- }, z = a(
57
- () => ue({
58
- nmorph: [ne[l.height]],
57
+ }, j = a(
58
+ () => se({
59
+ nmorph: [ie[l.height]],
59
60
  "nmorph-select": [
60
61
  `${l.disabled && "disabled"}`,
61
62
  `${l.modelValue ? "on" : "off"}`,
62
63
  `${l.loading && "loading"}`,
63
- `${r.value && !d.value && "open"}`,
64
+ `${r.value && !v.value && "open"}`,
64
65
  `${l.fill && "fill"}`,
65
66
  `${h.value && "options-auto-width"}`,
66
67
  `${g.value ? "selected-line-outset" : "selected-line-inset"}`,
67
68
  `${p.value && "focus"}`
68
69
  ]
69
70
  })
70
- ), F = () => {
71
- d.value || (r.value = !r.value);
71
+ ), Y = () => {
72
+ v.value || (r.value = !r.value);
72
73
  };
73
74
  f(
74
75
  r,
@@ -86,25 +87,26 @@ const _e = /* @__PURE__ */ le({
86
87
  e && (r.value = !1);
87
88
  }
88
89
  );
89
- const i = a(() => l.options.length > 0 ? l.options : l.optionsMap), q = s(null), H = s([]), x = a(() => l.options), c = a(() => l.virtual && x.value.length > 0), M = a(() => ({
90
+ const i = a(() => l.options.length > 0 ? l.options : l.optionsMap), q = d(null), x = d([]), I = a(() => l.options), c = a(() => l.virtual && I.value.length > 0), w = a(() => ({
90
91
  basic: 30,
91
92
  thick: 38,
92
93
  thin: 22
93
- })[l.height || "basic"]), w = a(() => l.virtualItemHeight || M.value), A = a(() => l.virtualOverscan), v = se(x, {
94
+ })[l.height || "basic"]), D = a(() => l.virtualItemHeight || w.value), A = a(() => l.virtualOverscan), E = a(() => l.virtualDynamicHeight), s = ce(I, {
94
95
  enabled: c,
95
- itemHeight: w,
96
- overscan: A
97
- }), j = a(() => v.virtualItems.value), Y = a(() => ({
98
- height: `${v.totalHeight.value}px`
99
- })), G = a(() => ({
100
- transform: `translateY(${v.offsetTop.value}px)`
101
- })), $ = (e) => typeof e == "number" ? `${e}px` : e, J = a(() => $(l.virtualMaxHeight)), I = () => {
102
- i.value.length > 0 || !q.value || (H.value = Array.from(q.value.querySelectorAll(".nmorph-select-option")).map((e) => e.getAttribute("value")).filter((e) => !!e));
96
+ itemHeight: D,
97
+ overscan: A,
98
+ dynamic: E
99
+ }), G = a(() => s.virtualItems.value), J = a(() => ({
100
+ height: `${s.totalHeight.value}px`
101
+ })), K = a(() => ({
102
+ transform: `translateY(${s.offsetTop.value}px)`
103
+ })), V = (e) => typeof e == "number" ? `${e}px` : e, Q = a(() => V(l.virtualMaxHeight)), O = () => {
104
+ i.value.length > 0 || !q.value || (x.value = Array.from(q.value.querySelectorAll(".nmorph-select-option")).map((e) => e.getAttribute("value")).filter((e) => !!e));
103
105
  }, o = a(
104
- () => i.value.length > 0 ? i.value.map((e) => e.value) : H.value
105
- ), K = a(() => c.value ? Array.isArray(t.value) ? t.value : t.value ? [t.value] : [] : o.value), u = s(0), N = a(() => o.value[u.value] || "");
106
+ () => i.value.length > 0 ? i.value.map((e) => e.value) : x.value
107
+ ), X = a(() => c.value ? Array.isArray(t.value) ? t.value : t.value ? [t.value] : [] : o.value), u = d(0), N = a(() => o.value[u.value] || ""), Z = a(() => `${y.value}-listbox`), ee = (e) => `${y.value}-option-${e.replace(/\s+/g, "-")}`;
106
108
  f(u, (e) => {
107
- r.value && c.value && v.scrollToIndex(e);
109
+ r.value && c.value && s.scrollToIndex(e);
108
110
  }), f(
109
111
  o,
110
112
  (e) => {
@@ -113,45 +115,54 @@ const _e = /* @__PURE__ */ le({
113
115
  { immediate: !0 }
114
116
  ), f(r, async (e) => {
115
117
  if (e) {
116
- if (await E(), I(), typeof t.value == "string") {
118
+ if (await L(), O(), typeof t.value == "string") {
117
119
  const n = o.value.indexOf(t.value);
118
120
  n !== -1 && (u.value = n);
119
121
  }
120
- v.refresh(), c.value && v.scrollToIndex(u.value);
122
+ s.refresh(), c.value && s.scrollToIndex(u.value);
121
123
  }
122
- }), ae(async () => {
123
- await E(), I(), document.addEventListener("click", b);
124
- }), re(() => {
124
+ }), ue(async () => {
125
+ await L(), O(), document.addEventListener("click", b);
126
+ }), oe(() => {
125
127
  document.removeEventListener("click", b);
126
128
  });
127
- const Q = a(() => typeof t.value == "string" ? t.value === "" ? S.value : i.value.find((e) => e.value === t.value)?.label : i.value.find((e) => e.value === t.value)?.label), X = a(() => i.value.length > 0 ? i.value.filter((n) => t.value.includes(n.value)).map((n) => ({ text: n.label, value: n.value })) : Array.isArray(t.value) ? t.value.map((n) => ({ text: n, value: n })) : [{ text: t.value, value: t.value }]);
128
- L("select-selected-value", t), L("select-change-selected-value", y);
129
- const D = s(null), Z = a(
130
- () => h.value ? `${D.value?.clientWidth || 0}px` : void 0
131
- ), _ = { t: O, props: l, computedNoElementPlaceholder: S, emit: m, initialValue: t, open: r, disabledInput: d, autoOptionsWidth: h, selectedLineOutset: g, id: C, name: P, autocomplete: k, tabindex: R, changeHandler: y, focus: p, focusHandler: W, blurHandler: U, modifiers: z, clickHandler: F, closeHandler: b, optionsMap: i, optionsDOMRef: q, slotDomOptions: H, renderedOptions: x, virtualEnabled: c, defaultOptionHeight: M, virtualItemHeight: w, virtualOverscan: A, virtualList: v, virtualOptions: j, virtualSpacerStyle: Y, virtualContentStyle: G, getCssSize: $, virtualMaxHeight: J, refreshDomOptions: I, domOptions: o, nativeOptions: K, currentIndex: u, currentFocusedEl: N, selectedValueTitle: Q, tags: X, nmorphSelectDOMRef: D, optionsMinWidth: Z, spaceHandler: () => {
132
- d.value || (r.value = !r.value);
129
+ const te = a(() => typeof t.value == "string" ? t.value === "" ? $.value : i.value.find((e) => e.value === t.value)?.label : i.value.find((e) => e.value === t.value)?.label), le = a(() => i.value.length > 0 ? i.value.filter((n) => t.value.includes(n.value)).map((n) => ({ text: n.label, value: n.value })) : Array.isArray(t.value) ? t.value.map((n) => ({ text: n, value: n })) : [{ text: t.value, value: t.value }]);
130
+ R("select-selected-value", t), R("select-change-selected-value", H);
131
+ const _ = d(null), ae = a(
132
+ () => h.value ? `${_.value?.clientWidth || 0}px` : void 0
133
+ ), B = { t: M, props: l, computedNoElementPlaceholder: $, emit: m, initialValue: t, open: r, disabledInput: v, autoOptionsWidth: h, selectedLineOutset: g, id: y, name: k, autocomplete: W, tabindex: U, changeHandler: H, focus: p, focusHandler: z, blurHandler: F, modifiers: j, clickHandler: Y, closeHandler: b, optionsMap: i, optionsDOMRef: q, slotDomOptions: x, renderedOptions: I, virtualEnabled: c, defaultOptionHeight: w, virtualItemHeight: D, virtualOverscan: A, virtualDynamicHeight: E, virtualList: s, virtualOptions: G, virtualSpacerStyle: J, virtualContentStyle: K, getCssSize: V, virtualMaxHeight: Q, refreshDomOptions: O, domOptions: o, nativeOptions: X, currentIndex: u, currentFocusedEl: N, listboxId: Z, getOptionId: ee, selectedValueTitle: te, tags: le, nmorphSelectDOMRef: _, optionsMinWidth: ae, spaceHandler: () => {
134
+ v.value || (r.value = !r.value);
133
135
  }, arrowDownHandler: () => {
134
- d.value || o.value.length !== 0 && (u.value = (u.value + 1) % o.value.length);
136
+ v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value + 1) % o.value.length);
135
137
  }, arrowUpHandler: () => {
136
- d.value || o.value.length !== 0 && (u.value = (u.value - 1 + o.value.length) % o.value.length);
138
+ v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value - 1 + o.value.length) % o.value.length);
137
139
  }, enterHandler: () => {
138
- r.value && N.value && y(N.value);
140
+ r.value && N.value && H(N.value);
141
+ }, setVirtualOptionRef: (e, n) => {
142
+ const S = e instanceof Element ? e : e?.$el;
143
+ s.measureElement(n, S);
144
+ }, escapeHandler: () => {
145
+ r.value = !1;
146
+ }, homeHandler: () => {
147
+ u.value = 0;
148
+ }, endHandler: () => {
149
+ u.value = Math.max(o.value.length - 1, 0);
139
150
  }, get NmorphTagItem() {
140
- return fe;
151
+ return he;
141
152
  }, get NmorphIcon() {
142
- return ce;
153
+ return me;
143
154
  }, get NmorphSelectOption() {
144
- return ve;
155
+ return pe;
145
156
  }, get NmorphDropdown() {
146
- return de;
157
+ return fe;
147
158
  }, get NmorphIconLoader() {
148
- return me;
159
+ return ye;
149
160
  }, get NmorphIconChevronDown() {
150
- return pe;
161
+ return ge;
151
162
  } };
152
- return Object.defineProperty(_, "__isScriptSetup", { enumerable: !1, value: !0 }), _;
163
+ return Object.defineProperty(B, "__isScriptSetup", { enumerable: !1, value: !0 }), B;
153
164
  }
154
165
  });
155
166
  export {
156
- _e as default
167
+ Ce as default
157
168
  };
@@ -1,38 +1,41 @@
1
1
  import './NmorphSelectOption.css';
2
- import c from "./NmorphSelectOption.vue2.js";
3
- import { openBlock as o, createElementBlock as n, normalizeClass as l, createElementVNode as r, toDisplayString as s, renderSlot as i, createBlock as a, withCtx as m, createVNode as p, createCommentVNode as d } from "vue";
2
+ import t from "./NmorphSelectOption.vue2.js";
3
+ import { openBlock as o, createElementBlock as l, normalizeClass as n, createElementVNode as r, toDisplayString as a, renderSlot as i, createBlock as s, withCtx as d, createVNode as p, createCommentVNode as m } from "vue";
4
4
  /* empty css */
5
5
  import _ from "../../../../../_virtual/_plugin-vue_export-helper.js";
6
- const h = ["value"], f = { class: "nmorph-select-option__content" };
7
- function k(t, u, v, e, N, S) {
8
- return o(), n("div", {
9
- class: l(e.modifiers),
6
+ const h = ["value", "aria-selected", "aria-disabled"], f = { class: "nmorph-select-option__content" };
7
+ function k(c, v, N, e, b, u) {
8
+ return o(), l("div", {
9
+ class: n(e.modifiers),
10
10
  value: e.props.value,
11
+ role: "option",
12
+ "aria-selected": e.checked,
13
+ "aria-disabled": e.props.disabled,
11
14
  onClick: e.clickHandler
12
15
  }, [
13
16
  r("div", f, [
14
17
  r(
15
18
  "span",
16
19
  null,
17
- s(e.props.label),
20
+ a(e.props.label),
18
21
  1
19
22
  /* TEXT */
20
23
  ),
21
- i(t.$slots, "default")
24
+ i(c.$slots, "default")
22
25
  ]),
23
- e.checked ? (o(), a(e.NmorphIcon, {
26
+ e.checked ? (o(), s(e.NmorphIcon, {
24
27
  key: 0,
25
28
  class: "nmorph-select-option__checked"
26
29
  }, {
27
- default: m(() => [
30
+ default: d(() => [
28
31
  p(e.NmorphIconSuccess)
29
32
  ]),
30
33
  _: 1
31
34
  /* STABLE */
32
- })) : d("v-if", !0)
35
+ })) : m("v-if", !0)
33
36
  ], 10, h);
34
37
  }
35
- const B = /* @__PURE__ */ _(c, [["render", k], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue"]]);
38
+ const B = /* @__PURE__ */ _(t, [["render", k], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue"]]);
36
39
  export {
37
40
  B as default
38
41
  };
@@ -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,23 +1,23 @@
1
- import p from "./NmorphTextInput.vue2.js";
2
- import { openBlock as o, createElementBlock as t, normalizeStyle as c, normalizeClass as s, createElementVNode as r, renderSlot as m, createCommentVNode as l, mergeProps as h, withKeys as _, createBlock as i, withCtx as a, createVNode as f, resolveDynamicComponent as y } from "vue";
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 _, withKeys as f, createBlock as a, withCtx as d, createVNode as y, resolveDynamicComponent as b } from "vue";
3
3
  import u from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const b = { class: "nmorph-text-input__input-side" }, x = {
4
+ const x = { class: "nmorph-text-input__input-side" }, v = {
5
5
  key: 0,
6
6
  class: "nmorph-text-input__prepend-icon"
7
- }, v = ["id", "name", "autocomplete", "tabindex", "type", "placeholder", "disabled", "value"];
8
- function k(d, n, B, e, N, C) {
9
- return o(), t(
7
+ }, k = ["id", "name", "autocomplete", "tabindex", "type", "placeholder", "disabled", "value"];
8
+ function w(p, o, B, e, N, C) {
9
+ return n(), r(
10
10
  "div",
11
11
  {
12
- class: s(e.modifiers),
13
- style: c(e.styles)
12
+ class: c(e.modifiers),
13
+ style: m(e.styles)
14
14
  },
15
15
  [
16
- r("div", b, [
17
- e.slots["prepend-icon"] ? (o(), t("div", x, [
18
- m(d.$slots, "prepend-icon")
16
+ i("div", x, [
17
+ e.slots["prepend-icon"] ? (n(), r("div", v, [
18
+ h(p.$slots, "prepend-icon")
19
19
  ])) : l("v-if", !0),
20
- r("input", h({
20
+ i("input", _({
21
21
  id: e.id,
22
22
  ref: "inputDOMRef",
23
23
  name: e.name,
@@ -32,9 +32,10 @@ function k(d, n, B, e, N, C) {
32
32
  onInput: e.handleInput,
33
33
  onFocus: e.handleFocus,
34
34
  onBlur: e.handleBlur,
35
- onKeyup: n[0] || (n[0] = _((I) => e.emit("on-enter"), ["enter"]))
36
- }), null, 16, v),
37
- e.props.typePassword || e.props.clearable ? (o(), i(e.NmorphButton, {
35
+ onKeydown: o[0] || (o[0] = (t) => e.emit("keydown", t)),
36
+ onKeyup: o[1] || (o[1] = f((t) => e.emit("on-enter"), ["enter"]))
37
+ }), null, 16, k),
38
+ e.props.typePassword || e.props.clearable ? (n(), a(e.NmorphButton, {
38
39
  key: 1,
39
40
  disabled: e.props.disabled,
40
41
  class: "nmorph-text-input__password-btn",
@@ -43,10 +44,10 @@ function k(d, n, B, e, N, C) {
43
44
  height: e.props.height,
44
45
  onClick: e.actionButtonClickHandler
45
46
  }, {
46
- default: a(() => [
47
- f(e.NmorphIcon, null, {
48
- default: a(() => [
49
- (o(), i(y(e.actionIcon)))
47
+ default: d(() => [
48
+ y(e.NmorphIcon, null, {
49
+ default: d(() => [
50
+ (n(), a(b(e.actionIcon)))
50
51
  ]),
51
52
  _: 1
52
53
  /* STABLE */
@@ -61,7 +62,7 @@ function k(d, n, B, e, N, C) {
61
62
  /* CLASS, STYLE */
62
63
  );
63
64
  }
64
- const z = /* @__PURE__ */ u(p, [["render", k], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-text-input/NmorphTextInput.vue"]]);
65
+ const K = /* @__PURE__ */ u(s, [["render", w], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-text-input/NmorphTextInput.vue"]]);
65
66
  export {
66
- z as default
67
+ K as default
67
68
  };
@@ -1,13 +1,13 @@
1
- import { defineComponent as E, useSlots as O, computed as n, ref as l } from "vue";
2
- import { NmorphComponentHeight as $ } from "../../../types/index.js";
3
- import { useModifiers as j } from "../../../utils/create-modifiers.js";
4
- import { useFormItemInput as k } from "../nmorph-form/use-form-item-input.js";
1
+ import { defineComponent as C, useSlots as E, computed as n, ref as l } from "vue";
2
+ import { NmorphComponentHeight as O } from "../../../types/index.js";
3
+ import { useModifiers as $ } from "../../../utils/create-modifiers.js";
4
+ import { useFormItemInput as j } from "../nmorph-form/use-form-item-input.js";
5
5
  import F from "../../../assets/icons/eye-blocked.svg.js";
6
6
  import H from "../../../assets/icons/eye.svg.js";
7
7
  import M from "../../basic/nmorph-button/NmorphButton.vue.js";
8
8
  import A from "../../basic/nmorph-icon/NmorphIcon.vue.js";
9
9
  import D from "../../../assets/icons/error.svg.js";
10
- const U = /* @__PURE__ */ E({
10
+ const U = /* @__PURE__ */ C({
11
11
  __name: "NmorphTextInput",
12
12
  props: {
13
13
  placeholder: { type: String, required: !1, default: "" },
@@ -23,24 +23,24 @@ const U = /* @__PURE__ */ E({
23
23
  disabled: { type: Boolean, required: !1, default: !1 },
24
24
  tabindex: { type: Number, required: !1 }
25
25
  },
26
- emits: ["update:model-value", "focus", "blur", "on-enter"],
26
+ emits: ["update:model-value", "focus", "blur", "on-enter", "keydown"],
27
27
  setup(f, { expose: m, emit: h }) {
28
- const s = O(), e = f, { id: y, name: b, autocomplete: v, tabindex: g } = k(e), q = n(
29
- () => j({
30
- nmorph: [$[e.height], `${a.value && "focused"}`],
28
+ const s = E(), e = f, { id: y, name: b, autocomplete: v, tabindex: g } = j(e), q = n(
29
+ () => $({
30
+ nmorph: [O[e.height], `${a.value && "focused"}`],
31
31
  "nmorph-text-input": [
32
32
  `${e.typePassword && "password"}`,
33
33
  `${(e.typePassword || e.clearable) && "with-action"}`
34
34
  ]
35
35
  })
36
- ), x = (P) => {
37
- const C = P.target;
38
- r("update:model-value", C.value);
39
- }, t = l(!1), I = () => {
36
+ ), w = (P) => {
37
+ const k = P.target;
38
+ r("update:model-value", k.value);
39
+ }, t = l(!1), x = () => {
40
40
  e.clearable ? r("update:model-value", "") : t.value = !t.value;
41
- }, N = n(() => e.typePassword && !t.value && !e.clearable ? "password" : "text"), a = l(!1), _ = () => {
41
+ }, I = n(() => e.typePassword && !t.value && !e.clearable ? "password" : "text"), a = l(!1), N = () => {
42
42
  r("focus"), a.value = !0;
43
- }, w = () => {
43
+ }, _ = () => {
44
44
  r("blur"), a.value = !1;
45
45
  }, o = l(null), u = () => {
46
46
  o.value?.focus();
@@ -50,7 +50,7 @@ const U = /* @__PURE__ */ E({
50
50
  o.value?.select();
51
51
  };
52
52
  m({ inputDOMRef: o, focus: u, blur: p, select: i });
53
- const r = h, S = n(() => e.clearable ? D : t.value ? F : H), d = n(() => e.indentation || (s["prepend-icon"] ? "28px" : "8px")), B = n(() => ({ "--nmorph-text-input-indentation": d.value })), c = { slots: s, props: e, id: y, name: b, autocomplete: v, tabindex: g, modifiers: q, handleInput: x, showPassword: t, actionButtonClickHandler: I, type: N, focused: a, handleFocus: _, handleBlur: w, inputDOMRef: o, focus: u, blur: p, select: i, emit: r, actionIcon: S, indentation: d, styles: B, get NmorphIcon() {
53
+ const r = h, S = n(() => e.clearable ? D : t.value ? F : H), d = n(() => e.indentation || (s["prepend-icon"] ? "28px" : "8px")), B = n(() => ({ "--nmorph-text-input-indentation": d.value })), c = { slots: s, props: e, id: y, name: b, autocomplete: v, tabindex: g, modifiers: q, handleInput: w, showPassword: t, actionButtonClickHandler: x, type: I, focused: a, handleFocus: N, handleBlur: _, inputDOMRef: o, focus: u, blur: p, select: i, emit: r, actionIcon: S, indentation: d, styles: B, get NmorphIcon() {
54
54
  return A;
55
55
  }, get NmorphButton() {
56
56
  return M;
@@ -0,0 +1 @@
1
+ .nmorph-context-menu{display:inline-block;max-width:100%}
@@ -0,0 +1,51 @@
1
+ import './NmorphContextMenu.css';
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
+ /* empty css */
5
+ import d from "../../../_virtual/_plugin-vue_export-helper.js";
6
+ function m(o, p, f, e, s, h) {
7
+ return n(), t(
8
+ "div",
9
+ {
10
+ ref: "triggerDOMRef",
11
+ class: "nmorph-context-menu",
12
+ onClick: e.clickHandler,
13
+ onContextmenu: e.contextMenuHandler,
14
+ onKeydown: e.keydownHandler
15
+ },
16
+ [
17
+ r(o.$slots, "default"),
18
+ e.relativeElement ? (n(), i(e.NmorphDropdown, {
19
+ key: 0,
20
+ open: e.isOpen,
21
+ "relative-element": e.relativeElement,
22
+ placement: e.props.placement,
23
+ width: e.props.width,
24
+ "min-width": e.props.minWidth,
25
+ "max-width": e.props.maxWidth,
26
+ "x-offset": e.props.xOffset,
27
+ "y-offset": e.props.yOffset,
28
+ "fill-width": e.props.fillWidth,
29
+ "z-index": e.props.zIndex,
30
+ "close-on-escape": e.props.closeOnEscape,
31
+ "trap-focus": e.props.trapFocus,
32
+ role: e.props.role,
33
+ "aria-label": e.props.ariaLabel,
34
+ onOnOutsideClick: e.outsideClickHandler,
35
+ onOnEscapeKeydown: e.escapeHandler
36
+ }, {
37
+ default: a(() => [
38
+ r(o.$slots, "menu", { close: e.close })
39
+ ]),
40
+ _: 3
41
+ /* FORWARDED */
42
+ }, 8, ["open", "relative-element", "placement", "width", "min-width", "max-width", "x-offset", "y-offset", "fill-width", "z-index", "close-on-escape", "trap-focus", "role", "aria-label"])) : c("v-if", !0)
43
+ ],
44
+ 544
45
+ /* NEED_HYDRATION, NEED_PATCH */
46
+ );
47
+ }
48
+ const v = /* @__PURE__ */ d(l, [["render", m], ["__file", "/builds/ketjo/nmorph/library/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue"]]);
49
+ export {
50
+ v as default
51
+ };
@@ -0,0 +1,72 @@
1
+ import './NmorphContextMenu.css';
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
+ __name: "NmorphContextMenu",
6
+ props: {
7
+ modelValue: { type: [Boolean, null], required: !1, default: null },
8
+ trigger: { type: String, required: !1, default: "contextmenu" },
9
+ placement: { type: null, required: !1, default: "bottom-start" },
10
+ width: { type: [Number, String], required: !1, default: 160 },
11
+ minWidth: { type: [Number, String], required: !1, default: void 0 },
12
+ maxWidth: { type: [Number, String], required: !1, default: void 0 },
13
+ xOffset: { type: Number, required: !1, default: 0 },
14
+ yOffset: { type: Number, required: !1, default: 0 },
15
+ fillWidth: { type: Boolean, required: !1, default: !1 },
16
+ zIndex: { type: Number, required: !1, default: void 0 },
17
+ closeOnEscape: { type: Boolean, required: !1, default: !0 },
18
+ trapFocus: { type: Boolean, required: !1, default: !1 },
19
+ disabled: { type: Boolean, required: !1, default: !1 },
20
+ role: { type: String, required: !1, default: "menu" },
21
+ ariaLabel: { type: String, required: !1, default: "" }
22
+ },
23
+ emits: ["update:model-value", "open", "close", "on-outside-click", "on-escape-keydown"],
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,
28
+ (e) => {
29
+ typeof e == "boolean" && (n.value = e);
30
+ }
31
+ );
32
+ const p = (e, l) => ({
33
+ clientWidth: 0,
34
+ getBoundingClientRect: () => ({
35
+ x: e,
36
+ y: l,
37
+ width: 0,
38
+ height: 0,
39
+ top: l,
40
+ left: e,
41
+ right: e,
42
+ bottom: l,
43
+ toJSON: () => ({})
44
+ })
45
+ }), u = (e) => {
46
+ const l = c.value;
47
+ n.value = e, o("update:model-value", e), l && !e && o("close");
48
+ }, a = () => {
49
+ u(!1);
50
+ }, i = (e, l, r) => {
51
+ f.value = p(e, l), u(!0), o("open", r);
52
+ }, h = (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();
62
+ }, _ = () => {
63
+ o("on-escape-keydown"), a();
64
+ };
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 };
67
+ return Object.defineProperty(m, "__isScriptSetup", { enumerable: !1, value: !0 }), m;
68
+ }
69
+ });
70
+ export {
71
+ H as default
72
+ };
@@ -1 +1 @@
1
- .nmorph-dropdown{position:fixed;width:var(--nmorph-dropdown-width);min-width:var(--nmorph-dropdown-min-width);max-width:var(--nmorph-dropdown-max-width);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}.nmorph-dropdown--closed{z-index:-1000;opacity:0}
1
+ .nmorph-dropdown{position:fixed;width:var(--nmorph-dropdown-width);min-width:var(--nmorph-dropdown-min-width);max-width:var(--nmorph-dropdown-max-width);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-outset)}.nmorph-dropdown--closed{z-index:-1000;opacity:0}