@nmorph/nmorph-ui-kit 2.2.33 → 2.2.35

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 (36) hide show
  1. package/dist/assets/icons/pin.svg.js +21 -0
  2. package/dist/components/basic/nmorph-icon/NmorphIcons.js +551 -0
  3. package/dist/components/basic/nmorph-link/NmorphLink.vue.js +33 -21
  4. package/dist/components/basic/nmorph-link/NmorphLink.vue2.js +21 -16
  5. package/dist/components/data/nmorph-avatar/NmorphAvatar.vue.js +22 -28
  6. package/dist/components/data/nmorph-badge/NmorphBadge.css +1 -1
  7. package/dist/components/data/nmorph-empty/NmorphEmpty.css +1 -1
  8. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.css +1 -1
  9. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +20 -17
  10. package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +63 -54
  11. package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue.js +34 -30
  12. package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +94 -62
  13. package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +52 -52
  14. package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +24 -21
  15. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.css +1 -1
  16. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +40 -31
  17. package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +45 -41
  18. package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue.js +20 -25
  19. package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue2.js +25 -21
  20. package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.js +11 -10
  21. package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue2.js +10 -9
  22. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.css +1 -1
  23. package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +13 -12
  24. package/dist/hooks/use-common-styles.js +2 -1
  25. package/dist/icons.js +209 -207
  26. package/dist/index.es.js +331 -329
  27. package/dist/index.umd.js +31 -30
  28. package/dist/package.json.js +1 -1
  29. package/dist/src/components/basic/nmorph-icon/NmorphIcons.d.ts +1 -0
  30. package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +2 -0
  31. package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +2 -2
  32. package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +0 -1
  33. package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +2 -0
  34. package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +2 -0
  35. package/dist/style.css +1 -1
  36. package/package.json +1 -1
@@ -1,94 +1,126 @@
1
1
  import './NmorphFileUpload.css';
2
- import { defineComponent as V, computed as N, ref as g, watch as B, onBeforeUnmount as T } from "vue";
3
- import { useModifiers as q } from "../../../utils/create-modifiers.js";
4
- import { useI18n as S } from "vue-i18n";
5
- import j from "../../../assets/icons/doc.svg.js";
6
- import k from "../../data/nmorph-image-preview/NmorphImagePreview.vue.js";
7
- import C from "../../basic/nmorph-icon/NmorphIcon.vue.js";
8
- import L from "../../basic/nmorph-button/NmorphButton.vue.js";
9
- import { NmorphImageResolution as O, NmorphAudioResolution as E, NmorphVideoResolution as M, NmorphArchiveResolution as D } from "./types.js";
10
- import W from "../../../assets/icons/audio.svg.js";
11
- import $ from "../../../assets/icons/video.svg.js";
12
- import z from "../../../assets/icons/archive.svg.js";
13
- import G from "../../../assets/icons/cross.svg.js";
14
- import H from "../../../assets/icons/image.svg.js";
15
- const se = /* @__PURE__ */ V({
2
+ import { defineComponent as M, computed as y, ref as F, watch as E, onBeforeUnmount as W } from "vue";
3
+ import { useModifiers as $ } from "../../../utils/create-modifiers.js";
4
+ import { useI18n as D } from "vue-i18n";
5
+ import { resolution as T, NmorphImageResolution as A, NmorphAudioResolution as K, NmorphVideoResolution as z, NmorphArchiveResolution as G } from "./types.js";
6
+ import H from "../../../assets/icons/doc.svg.js";
7
+ import J from "../../data/nmorph-image-preview/NmorphImagePreview.vue.js";
8
+ import Q from "../../basic/nmorph-icon/NmorphIcon.vue.js";
9
+ import X from "../../basic/nmorph-button/NmorphButton.vue.js";
10
+ import Y from "../../../assets/icons/audio.svg.js";
11
+ import Z from "../../../assets/icons/video.svg.js";
12
+ import ee from "../../../assets/icons/archive.svg.js";
13
+ import oe from "../../../assets/icons/cross.svg.js";
14
+ import te from "../../../assets/icons/image.svg.js";
15
+ const ye = /* @__PURE__ */ M({
16
16
  __name: "NmorphFileUpload",
17
17
  props: {
18
18
  modelValue: { type: Array, required: !1, default: () => [] },
19
19
  disabled: { type: Boolean, required: !1, default: !1 },
20
20
  multiple: { type: Boolean, required: !1, default: !1 },
21
- allowedTypes: { type: Array, required: !1, default: () => ["jpg", "jpeg", "png"] },
21
+ allowedTypes: { type: Array, required: !1, default: () => [] },
22
22
  photoWithPreview: { type: Boolean, required: !1, default: !0 },
23
23
  buttonText: { type: String, required: !1, default: "" }
24
24
  },
25
25
  emits: ["update:model-value", "on-unsupported-file-type-error"],
26
- setup(I, { expose: b, emit: w }) {
27
- const { t: f } = S(), r = I, m = w, x = N(() => r.buttonText ? r.buttonText : f("selectFile")), d = (e) => e.split("/")[1], R = (e) => {
28
- const o = d(e);
29
- let t = j;
30
- return o in O && (t = H), o in E && (t = W), o in M && (t = $), o in D && (t = z), t;
31
- }, s = g(null), n = g([...r.modelValue]), i = /* @__PURE__ */ new Set(), a = () => {
32
- const e = s.value;
26
+ setup(R, { expose: U, emit: _ }) {
27
+ const { t: w } = D(), n = R, d = _, B = y(() => n.buttonText ? n.buttonText : w("selectFile")), g = Object.entries(T), v = {
28
+ "svg-xml": "svg",
29
+ "audio-ogg": "ogg",
30
+ "wideo-ogg": "ogg"
31
+ }, C = (e) => e.split("/")[1]?.toLowerCase() || "", f = (e) => {
32
+ const o = e.split(".").pop()?.toLowerCase();
33
+ return o && o !== e.toLowerCase() ? o : "";
34
+ }, I = (e) => g.find(([, o]) => o.toLowerCase() === e.toLowerCase())?.[0] || "", u = (e) => Array.from(
35
+ new Set(
36
+ [
37
+ e.type.toLowerCase(),
38
+ I(e.type),
39
+ f(e.name),
40
+ C(e.type)
41
+ ].filter(Boolean).map((o) => o.toLowerCase())
42
+ )
43
+ ), i = (e, o) => Object.prototype.hasOwnProperty.call(o, e), P = (e) => {
44
+ const o = u(e);
45
+ return e.type.toLowerCase().startsWith("image/") || o.some((t) => i(t, A));
46
+ }, L = (e) => {
47
+ if (n.allowedTypes.length === 0) return !0;
48
+ const o = u(e);
49
+ return n.allowedTypes.some((t) => o.includes(String(t).toLowerCase()));
50
+ }, S = y(() => {
51
+ if (n.allowedTypes.length !== 0)
52
+ return Array.from(
53
+ new Set(
54
+ n.allowedTypes.flatMap((e) => {
55
+ const o = String(e).toLowerCase(), t = T[o], r = v[o] || o;
56
+ return o.includes("/") ? o : t ? [`.${r}`, t] : `.${r}`;
57
+ })
58
+ )
59
+ ).join(",");
60
+ }), V = (e) => {
61
+ const o = u(e);
62
+ let t = H;
63
+ return (e.type.toLowerCase().startsWith("image/") || o.some((r) => i(r, A))) && (t = te), (e.type.toLowerCase().startsWith("audio/") || o.some((r) => i(r, K))) && (t = Y), (e.type.toLowerCase().startsWith("video/") || o.some((r) => i(r, z))) && (t = Z), o.some((r) => i(r, G)) && (t = ee), t;
64
+ }, p = F(null), a = F([...n.modelValue]), l = /* @__PURE__ */ new Set(), m = () => {
65
+ const e = p.value;
33
66
  e && (e.value = "");
34
- }, u = (e) => {
35
- i.has(e) && (URL.revokeObjectURL(e), i.delete(e));
36
- }, h = (e) => {
67
+ }, c = (e) => {
68
+ l.has(e) && (URL.revokeObjectURL(e), l.delete(e));
69
+ }, N = (e) => {
37
70
  const o = new Set(e.map((t) => t.previewUrl));
38
- Array.from(i).forEach((t) => {
39
- o.has(t) || u(t);
71
+ Array.from(l).forEach((t) => {
72
+ o.has(t) || c(t);
40
73
  });
41
- }, c = (e) => {
74
+ }, h = (e) => {
42
75
  const o = [...e];
43
- n.value = o, m("update:model-value", o);
44
- }, U = () => {
45
- r.disabled || !s.value || s.value.click();
46
- }, _ = (e) => {
47
- if (r.disabled) return;
48
- const o = e.target, t = Array.from(o.files || []), p = [];
49
- t.forEach((l) => {
50
- const P = d(l.type);
51
- if (!r.allowedTypes.includes(P)) {
52
- m("on-unsupported-file-type-error", l.type);
76
+ a.value = o, d("update:model-value", o);
77
+ }, O = () => {
78
+ n.disabled || !p.value || p.value.click();
79
+ }, j = (e) => {
80
+ if (n.disabled) return;
81
+ const o = e.target, t = Array.from(o.files || []), r = [];
82
+ t.forEach((s) => {
83
+ if (!L(s)) {
84
+ d("on-unsupported-file-type-error", s.type || f(s.name) || s.name);
53
85
  return;
54
86
  }
55
- const y = URL.createObjectURL(l);
56
- i.add(y), p.push({ data: l, previewUrl: y });
57
- }), a(), p.length > 0 && c([...n.value, ...p]);
58
- }, A = (e) => {
59
- if (r.disabled) return;
60
- const o = n.value.findIndex((t) => t.data.name === e);
87
+ const b = URL.createObjectURL(s);
88
+ l.add(b), r.push({ data: s, previewUrl: b });
89
+ }), m(), r.length > 0 && h([...a.value, ...r]);
90
+ }, k = (e) => {
91
+ if (n.disabled) return;
92
+ const o = a.value.findIndex((t) => t.data.name === e);
61
93
  if (o !== -1) {
62
- const t = n.value[o];
63
- u(t.previewUrl), a(), c(n.value.filter((p, l) => l !== o));
94
+ const t = a.value[o];
95
+ c(t.previewUrl), m(), h(a.value.filter((r, s) => s !== o));
64
96
  }
65
97
  };
66
- B(
67
- () => r.modelValue,
98
+ E(
99
+ () => n.modelValue,
68
100
  (e) => {
69
101
  const o = [...e];
70
- h(o), n.value = o, o.length === 0 && a();
102
+ N(o), a.value = o, o.length === 0 && m();
71
103
  },
72
104
  { deep: !0 }
73
- ), T(() => {
74
- Array.from(i).forEach((e) => u(e));
75
- }), b({ inputDOMRef: s });
76
- const F = N(
77
- () => q({
78
- "nmorph-file-upload": [`${r.disabled && "disabled"}`]
105
+ ), W(() => {
106
+ Array.from(l).forEach((e) => c(e));
107
+ }), U({ inputDOMRef: p });
108
+ const q = y(
109
+ () => $({
110
+ "nmorph-file-upload": [`${n.disabled && "disabled"}`]
79
111
  })
80
- ), v = { t: f, props: r, emit: m, computedButtonText: x, getPlainType: d, typeFileIconMap: R, inputDOMRef: s, files: n, createdPreviewUrls: i, resetInputValue: a, revokePreviewUrl: u, revokeRemovedPreviewUrls: h, filesChanged: c, openFileSelector: U, handleFileUpload: _, removeFile: A, modifiers: F, get NmorphButton() {
81
- return L;
112
+ ), x = { t: w, props: n, emit: d, computedButtonText: B, knownResolutionEntries: g, extensionByResolution: v, getPlainType: C, getFileExtension: f, getKnownResolutionByMime: I, getFileTypeCandidates: u, isKnownFileType: i, isImageFile: P, isFileAllowed: L, inputAccept: S, typeFileIconMap: V, inputDOMRef: p, files: a, createdPreviewUrls: l, resetInputValue: m, revokePreviewUrl: c, revokeRemovedPreviewUrls: N, filesChanged: h, openFileSelector: O, handleFileUpload: j, removeFile: k, modifiers: q, get NmorphButton() {
113
+ return X;
82
114
  }, get NmorphIcon() {
83
- return C;
115
+ return Q;
84
116
  }, get NmorphImagePreview() {
85
- return k;
117
+ return J;
86
118
  }, get NmorphIconCross() {
87
- return G;
119
+ return oe;
88
120
  } };
89
- return Object.defineProperty(v, "__isScriptSetup", { enumerable: !1, value: !0 }), v;
121
+ return Object.defineProperty(x, "__isScriptSetup", { enumerable: !1, value: !0 }), x;
90
122
  }
91
123
  });
92
124
  export {
93
- se as default
125
+ ye as default
94
126
  };
@@ -1,17 +1,17 @@
1
1
  import './NmorphSelect.css';
2
- import { defineComponent as ue, computed as a, ref as d, watch as f, nextTick as L, onMounted as oe, onUnmounted as ie, provide as R } from "vue";
3
- import { NmorphComponentHeight as se } from "../../../types/index.js";
4
- import { useModifiers as de } from "../../../utils/create-modifiers.js";
5
- import { useI18n as ve } from "vue-i18n";
6
- import { useFormItemInput as ce } from "../nmorph-form/use-form-item-input.js";
7
- import { useVirtualList as fe } from "../../../hooks/use-virtual-list.js";
8
- import pe from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
9
- import me from "./components/nmorph-select-option/NmorphSelectOption.vue.js";
10
- import he from "../../basic/nmorph-icon/NmorphIcon.vue.js";
11
- import ge from "../../data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js";
12
- import ye from "../../../assets/icons/chevron-down.svg.js";
13
- import He from "../../../assets/icons/loader.svg.js";
14
- const Pe = /* @__PURE__ */ ue({
2
+ import { defineComponent as ue, computed as a, ref as d, watch as f, nextTick as R, onMounted as oe, onUnmounted as ie, provide as M, toRef as se } from "vue";
3
+ import { NmorphComponentHeight as de } from "../../../types/index.js";
4
+ import { useModifiers as ve } from "../../../utils/create-modifiers.js";
5
+ import { useI18n as ce } from "vue-i18n";
6
+ import { useFormItemInput as fe } from "../nmorph-form/use-form-item-input.js";
7
+ import { useVirtualList as pe } from "../../../hooks/use-virtual-list.js";
8
+ import me from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
9
+ import he from "./components/nmorph-select-option/NmorphSelectOption.vue.js";
10
+ import ge from "../../basic/nmorph-icon/NmorphIcon.vue.js";
11
+ import ye from "../../data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js";
12
+ import He from "../../../assets/icons/chevron-down.svg.js";
13
+ import be from "../../../assets/icons/loader.svg.js";
14
+ const ke = /* @__PURE__ */ ue({
15
15
  __name: "NmorphSelect",
16
16
  props: {
17
17
  noElementPlaceholder: { type: String, required: !1, default: "" },
@@ -40,37 +40,37 @@ const Pe = /* @__PURE__ */ ue({
40
40
  emits: ["update:model-value"],
41
41
  setup(T, { expose: C, emit: P }) {
42
42
  C();
43
- const { t: M } = ve(), l = T, $ = a(
44
- () => l.noElementPlaceholder ? l.noElementPlaceholder : M("noElementPlaceholder")
45
- ), 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 } = ce(l), H = (e) => {
43
+ const { t: $ } = ce(), t = T, D = a(
44
+ () => t.noElementPlaceholder ? t.noElementPlaceholder : $("noElementPlaceholder")
45
+ ), m = P, l = d(t.modelValue), r = d(t.open), v = a(() => t.disabled || t.loading), h = a(() => t.optionsWidth === "auto"), g = d(!0), { id: y, name: k, autocomplete: W, tabindex: U } = fe(t), H = (e) => {
46
46
  if (!v.value) {
47
- 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)) {
48
- const n = t.value.includes(e), w = t.value.length === 1 && n;
49
- if (l.valueRequired && w) return;
50
- n ? t.value = t.value.filter((ne) => ne !== e) : t.value = [...t.value, e];
47
+ if (r.value = !1, typeof l.value == "string" && (!t.valueRequired && l.value === e ? l.value = "" : l.value = e, m("update:model-value", l.value)), Array.isArray(l.value)) {
48
+ const n = l.value.includes(e), w = l.value.length === 1 && n;
49
+ if (t.valueRequired && w) return;
50
+ n ? l.value = l.value.filter((ne) => ne !== e) : l.value = [...l.value, e];
51
51
  }
52
- m("update:model-value", t.value);
52
+ m("update:model-value", l.value);
53
53
  }
54
54
  }, p = d(!1), z = () => {
55
55
  p.value = !0;
56
56
  }, F = () => {
57
57
  p.value = !1;
58
58
  }, j = a(
59
- () => de({
60
- nmorph: [se[l.height]],
59
+ () => ve({
60
+ nmorph: [de[t.height]],
61
61
  "nmorph-select": [
62
- `${l.disabled && "disabled"}`,
63
- `${l.modelValue ? "on" : "off"}`,
64
- `${l.loading && "loading"}`,
62
+ `${t.disabled && "disabled"}`,
63
+ `${t.modelValue ? "on" : "off"}`,
64
+ `${t.loading && "loading"}`,
65
65
  `${r.value && !v.value && "open"}`,
66
- `${l.fill && "fill"}`,
66
+ `${t.fill && "fill"}`,
67
67
  `${h.value && "options-auto-width"}`,
68
68
  `${g.value ? "selected-line-outset" : "selected-line-inset"}`,
69
69
  `${p.value && "focus"}`
70
70
  ]
71
71
  })
72
72
  ), b = (e) => typeof e == "number" ? `${e}px` : e, Y = a(() => ({
73
- ...l.width !== void 0 && { "--base-width": b(l.width) }
73
+ ...t.width !== void 0 && { "--base-width": b(t.width) }
74
74
  })), G = () => {
75
75
  v.value || (r.value = !r.value);
76
76
  };
@@ -85,29 +85,29 @@ const Pe = /* @__PURE__ */ ue({
85
85
  r.value = !1;
86
86
  };
87
87
  f(
88
- () => l.loading,
88
+ () => t.loading,
89
89
  (e) => {
90
90
  e && (r.value = !1);
91
91
  }
92
92
  );
93
- const i = a(() => l.options.length > 0 ? l.options : l.optionsMap), x = d(null), I = d([]), N = a(() => l.options), c = a(() => l.virtual && N.value.length > 0), D = a(() => ({
93
+ const i = a(() => t.options.length > 0 ? t.options : t.optionsMap), x = d(null), I = d([]), N = a(() => t.options), c = a(() => t.virtual && N.value.length > 0), A = a(() => ({
94
94
  basic: 30,
95
95
  thick: 38,
96
96
  thin: 22
97
- })[l.height || "basic"]), A = a(() => l.virtualItemHeight || D.value), E = a(() => l.virtualOverscan), V = a(() => l.virtualDynamicHeight), s = fe(N, {
97
+ })[t.height || "basic"]), E = a(() => t.virtualItemHeight || A.value), V = a(() => t.virtualOverscan), _ = a(() => t.virtualDynamicHeight), s = pe(N, {
98
98
  enabled: c,
99
- itemHeight: A,
100
- overscan: E,
101
- dynamic: V
99
+ itemHeight: E,
100
+ overscan: V,
101
+ dynamic: _
102
102
  }), J = a(() => s.virtualItems.value), K = a(() => ({
103
103
  height: `${s.totalHeight.value}px`
104
104
  })), Q = a(() => ({
105
105
  transform: `translateY(${s.offsetTop.value}px)`
106
- })), X = a(() => b(l.virtualMaxHeight)), O = () => {
106
+ })), X = a(() => b(t.virtualMaxHeight)), O = () => {
107
107
  i.value.length > 0 || !x.value || (I.value = Array.from(x.value.querySelectorAll(".nmorph-select-option")).map((e) => e.getAttribute("value")).filter((e) => !!e));
108
108
  }, o = a(
109
109
  () => i.value.length > 0 ? i.value.map((e) => e.value) : I.value
110
- ), Z = a(() => c.value ? Array.isArray(t.value) ? t.value : t.value ? [t.value] : [] : o.value), u = d(0), S = a(() => o.value[u.value] || ""), ee = a(() => `${y.value}-listbox`), te = (e) => `${y.value}-option-${e.replace(/\s+/g, "-")}`;
110
+ ), Z = a(() => c.value ? Array.isArray(l.value) ? l.value : l.value ? [l.value] : [] : o.value), u = d(0), S = a(() => o.value[u.value] || ""), ee = a(() => `${y.value}-listbox`), te = (e) => `${y.value}-option-${e.replace(/\s+/g, "-")}`;
111
111
  f(u, (e) => {
112
112
  r.value && c.value && s.scrollToIndex(e);
113
113
  }), f(
@@ -118,22 +118,22 @@ const Pe = /* @__PURE__ */ ue({
118
118
  { immediate: !0 }
119
119
  ), f(r, async (e) => {
120
120
  if (e) {
121
- if (await L(), O(), typeof t.value == "string") {
122
- const n = o.value.indexOf(t.value);
121
+ if (await R(), O(), typeof l.value == "string") {
122
+ const n = o.value.indexOf(l.value);
123
123
  n !== -1 && (u.value = n);
124
124
  }
125
125
  s.refresh(), c.value && s.scrollToIndex(u.value);
126
126
  }
127
127
  }), oe(async () => {
128
- await L(), O(), document.addEventListener("click", q);
128
+ await R(), O(), document.addEventListener("click", q);
129
129
  }), ie(() => {
130
130
  document.removeEventListener("click", q);
131
131
  });
132
- const le = 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), ae = 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 }]);
133
- R("select-selected-value", t), R("select-change-selected-value", H);
134
- const _ = d(null), re = a(
135
- () => h.value ? `${_.value?.clientWidth || 0}px` : void 0
136
- ), 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, getCssSize: b, styles: Y, clickHandler: G, closeHandler: q, optionsMap: i, optionsDOMRef: x, slotDomOptions: I, renderedOptions: N, virtualEnabled: c, defaultOptionHeight: D, virtualItemHeight: A, virtualOverscan: E, virtualDynamicHeight: V, virtualList: s, virtualOptions: J, virtualSpacerStyle: K, virtualContentStyle: Q, virtualMaxHeight: X, refreshDomOptions: O, domOptions: o, nativeOptions: Z, currentIndex: u, currentFocusedEl: S, listboxId: ee, getOptionId: te, selectedValueTitle: le, tags: ae, nmorphSelectDOMRef: _, optionsMinWidth: re, spaceHandler: () => {
132
+ const le = a(() => typeof l.value == "string" ? l.value === "" ? D.value : i.value.find((e) => e.value === l.value)?.label : i.value.find((e) => e.value === l.value)?.label), ae = a(() => i.value.length > 0 ? i.value.filter((n) => l.value.includes(n.value)).map((n) => ({ text: n.label, value: n.value })) : Array.isArray(l.value) ? l.value.map((n) => ({ text: n, value: n })) : [{ text: l.value, value: l.value }]);
133
+ M("select-selected-value", l), M("select-change-selected-value", H), M("select-height", se(t, "height"));
134
+ const B = d(null), re = a(
135
+ () => h.value ? `${B.value?.clientWidth || 0}px` : void 0
136
+ ), L = { t: $, props: t, computedNoElementPlaceholder: D, emit: m, initialValue: l, 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, getCssSize: b, styles: Y, clickHandler: G, closeHandler: q, optionsMap: i, optionsDOMRef: x, slotDomOptions: I, renderedOptions: N, virtualEnabled: c, defaultOptionHeight: A, virtualItemHeight: E, virtualOverscan: V, virtualDynamicHeight: _, virtualList: s, virtualOptions: J, virtualSpacerStyle: K, virtualContentStyle: Q, virtualMaxHeight: X, refreshDomOptions: O, domOptions: o, nativeOptions: Z, currentIndex: u, currentFocusedEl: S, listboxId: ee, getOptionId: te, selectedValueTitle: le, tags: ae, nmorphSelectDOMRef: B, optionsMinWidth: re, spaceHandler: () => {
137
137
  v.value || (r.value = !r.value);
138
138
  }, arrowDownHandler: () => {
139
139
  v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value + 1) % o.value.length);
@@ -151,21 +151,21 @@ const Pe = /* @__PURE__ */ ue({
151
151
  }, endHandler: () => {
152
152
  u.value = Math.max(o.value.length - 1, 0);
153
153
  }, get NmorphTagItem() {
154
- return ge;
154
+ return ye;
155
155
  }, get NmorphIcon() {
156
- return he;
156
+ return ge;
157
157
  }, get NmorphSelectOption() {
158
- return me;
158
+ return he;
159
159
  }, get NmorphDropdown() {
160
- return pe;
160
+ return me;
161
161
  }, get NmorphIconLoader() {
162
- return He;
162
+ return be;
163
163
  }, get NmorphIconChevronDown() {
164
- return ye;
164
+ return He;
165
165
  } };
166
- return Object.defineProperty(B, "__isScriptSetup", { enumerable: !1, value: !0 }), B;
166
+ return Object.defineProperty(L, "__isScriptSetup", { enumerable: !1, value: !0 }), L;
167
167
  }
168
168
  });
169
169
  export {
170
- Pe as default
170
+ ke as default
171
171
  };
@@ -1,10 +1,10 @@
1
1
  import './NmorphSelectOption.css';
2
- import { defineComponent as h, inject as i, computed as o } from "vue";
3
- import { NmorphComponentHeight as v } from "../../../../../types/index.js";
4
- import { useModifiers as g } from "../../../../../utils/create-modifiers.js";
5
- import y from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
6
- import S from "../../../../../assets/icons/success.svg.js";
7
- const C = /* @__PURE__ */ h({
2
+ import { defineComponent as g, inject as l, computed as t } from "vue";
3
+ import { NmorphComponentHeight as y } from "../../../../../types/index.js";
4
+ import { useModifiers as S } from "../../../../../utils/create-modifiers.js";
5
+ import b from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
6
+ import q from "../../../../../assets/icons/success.svg.js";
7
+ const I = /* @__PURE__ */ g({
8
8
  __name: "NmorphSelectOption",
9
9
  props: {
10
10
  value: { type: String, required: !0 },
@@ -15,36 +15,39 @@ const C = /* @__PURE__ */ h({
15
15
  id: { type: String, required: !1 },
16
16
  name: { type: String, required: !1 },
17
17
  autocomplete: { type: String, required: !1 },
18
- height: { type: null, required: !1, default: "basic" },
18
+ height: { type: null, required: !1 },
19
19
  disabled: { type: Boolean, required: !1, default: !1 },
20
20
  tabindex: { type: Number, required: !1 }
21
21
  },
22
22
  emits: ["change-value"],
23
- setup(n, { expose: s, emit: c }) {
24
- s();
25
- const r = i("select-selected-value"), t = i("select-change-selected-value"), e = n, l = c, d = () => {
26
- e.disabled || (l("change-value", e.value), t && t(e.value));
27
- }, a = o(() => typeof r?.value == "string" ? r.value === e.value : Array.isArray(r?.value) ? r.value.some((m) => m === e.value) : !1), p = o(
28
- () => g({
29
- nmorph: [v[e.height]],
23
+ setup(c, { expose: d, emit: p }) {
24
+ d();
25
+ const r = l("select-selected-value"), o = l("select-change-selected-value"), a = l(
26
+ "select-height",
27
+ void 0
28
+ ), e = c, i = p, f = () => {
29
+ e.disabled || (i("change-value", e.value), o && o(e.value));
30
+ }, u = t(() => typeof r?.value == "string" ? r.value === e.value : Array.isArray(r?.value) ? r.value.some((v) => v === e.value) : !1), s = t(() => e.height || a?.value || "basic"), h = t(
31
+ () => S({
32
+ nmorph: [y[s.value]],
30
33
  "nmorph-select-option": [
31
34
  `${e.disabled && "disabled"}`,
32
35
  `${e.label && "with-label"}`,
33
- `${a.value && "checked"}`,
36
+ `${u.value && "checked"}`,
34
37
  `${e.focused && "focused"}`
35
38
  ]
36
39
  })
37
- ), f = o(() => ({
40
+ ), m = t(() => ({
38
41
  ...e.hoverBackground !== void 0 && { "--hover-bg": e.hoverBackground },
39
42
  ...e.hoverColor !== void 0 && { "--hover-color": e.hoverColor }
40
- })), u = { selectSelectedValue: r, selectChangeSelectedValue: t, props: e, emit: l, clickHandler: d, checked: a, modifiers: p, styles: f, get NmorphIcon() {
41
- return y;
43
+ })), n = { selectSelectedValue: r, selectChangeSelectedValue: o, selectHeight: a, props: e, emit: i, clickHandler: f, checked: u, height: s, modifiers: h, styles: m, get NmorphIcon() {
44
+ return b;
42
45
  }, get NmorphIconSuccess() {
43
- return S;
46
+ return q;
44
47
  } };
45
- return Object.defineProperty(u, "__isScriptSetup", { enumerable: !1, value: !0 }), u;
48
+ return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
46
49
  }
47
50
  });
48
51
  export {
49
- C as default
52
+ I as default
50
53
  };
@@ -1 +1 @@
1
- .nmorph-time-picker{--width: 160px;position:relative;width:var(--width);height:var(--height)}.nmorph-time-picker .nmorph-time-picker__input{display:flex;align-items:center;height:100%;padding:0 var(--default-indentation-input);overflow:hidden;background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-outset);cursor:pointer}.nmorph-time-picker .nmorph-time-picker__native{position:absolute;width:0;height:0;padding:0;border:0;opacity:0;pointer-events:none}.nmorph-time-picker .nmorph-time-picker__clock-icon{flex:0 0 auto;margin-right:6px}.nmorph-time-picker .nmorph-time-picker__selected-value{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.nmorph-time-picker .nmorph-time-picker__clear{display:inline-flex;flex:0 0 auto;justify-content:center;align-items:center;width:18px;height:18px;padding:0;color:var(--nmorph-text-color);background:transparent;border:0;cursor:pointer}.nmorph-time-picker .nmorph-time-picker__panel{display:grid;grid-template-columns:minmax(48px,1fr) auto minmax(48px,1fr);gap:4px;padding:8px}.nmorph-time-picker .nmorph-time-picker__panel--with-seconds{grid-template-columns:minmax(48px,1fr) auto minmax(48px,1fr) auto minmax(48px,1fr)}.nmorph-time-picker .nmorph-time-picker__column{display:grid;max-height:220px;overflow-y:auto}.nmorph-time-picker .nmorph-time-picker__separator{display:flex;justify-content:center;align-items:center;color:var(--nmorph-semi-contrast-text-color);font-weight:700}.nmorph-time-picker .nmorph-time-picker__option{min-height:28px;padding:0 8px;color:var(--nmorph-text-color);background:transparent;border:0;border-radius:4px;cursor:pointer}.nmorph-time-picker .nmorph-time-picker__option:hover,.nmorph-time-picker .nmorph-time-picker__option--active{color:var(--nmorph-focus-text-color);background:var(--nmorph-accent-color)}.nmorph-time-picker .nmorph-time-picker__option:disabled{cursor:not-allowed;opacity:.35}.nmorph-time-picker.nmorph-time-picker--open .nmorph-time-picker__input{box-shadow:var(--nmorph-shadow-inset)}.nmorph-time-picker.nmorph-time-picker--focus{outline:2px solid var(--nmorph-accent-color)}.nmorph-time-picker.nmorph-time-picker--placeholder .nmorph-time-picker__selected-value{color:var(--nmorph-placeholder-text-color)}.nmorph-time-picker.nmorph-time-picker--disabled{cursor:not-allowed;opacity:.6}.nmorph-time-picker.nmorph-time-picker--disabled .nmorph-time-picker__input{pointer-events:none}
1
+ .nmorph-time-picker{--width: 160px;position:relative;width:var(--width);height:var(--height)}.nmorph-time-picker .nmorph-time-picker__input{display:flex;align-items:center;height:100%;padding:0 var(--default-indentation-input);overflow:hidden;background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-outset);cursor:pointer}.nmorph-time-picker .nmorph-time-picker__native{position:absolute;width:0;height:0;padding:0;border:0;opacity:0;pointer-events:none}.nmorph-time-picker .nmorph-time-picker__clock-icon{flex:0 0 auto;margin-right:6px}.nmorph-time-picker .nmorph-time-picker__selected-value{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.nmorph-time-picker .nmorph-time-picker__clear{display:inline-flex;flex:0 0 auto;justify-content:center;align-items:center;width:18px;height:18px;padding:0;color:var(--nmorph-text-color);background:transparent;border:0;cursor:pointer}.nmorph-time-picker .nmorph-time-picker__panel{display:grid;grid-template-columns:minmax(48px,1fr) auto minmax(48px,1fr);gap:4px;padding:8px}.nmorph-time-picker .nmorph-time-picker__panel--with-seconds{grid-template-columns:minmax(48px,1fr) auto minmax(48px,1fr) auto minmax(48px,1fr)}.nmorph-time-picker .nmorph-time-picker__column{display:grid;max-height:220px;overflow-y:auto}.nmorph-time-picker .nmorph-time-picker__separator{display:flex;justify-content:center;align-items:center;color:var(--nmorph-semi-contrast-text-color);font-weight:700}.nmorph-time-picker .nmorph-time-picker__option{padding:0 8px;color:var(--nmorph-text-color);background:transparent;border:0;border-radius:4px;cursor:pointer}.nmorph-time-picker .nmorph-time-picker__option:hover,.nmorph-time-picker .nmorph-time-picker__option--active{color:var(--nmorph-focus-text-color);background:var(--nmorph-accent-color)}.nmorph-time-picker .nmorph-time-picker__option:disabled{cursor:not-allowed;opacity:.35}.nmorph-time-picker.nmorph-time-picker--open .nmorph-time-picker__input{box-shadow:var(--nmorph-shadow-inset)}.nmorph-time-picker.nmorph-time-picker--focus{outline:2px solid var(--nmorph-accent-color)}.nmorph-time-picker.nmorph-time-picker--placeholder .nmorph-time-picker__selected-value{color:var(--nmorph-placeholder-text-color)}.nmorph-time-picker.nmorph-time-picker--disabled{cursor:not-allowed;opacity:.6}.nmorph-time-picker.nmorph-time-picker--disabled .nmorph-time-picker__input{pointer-events:none}