@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.
- package/dist/assets/icons/pin.svg.js +21 -0
- package/dist/components/basic/nmorph-icon/NmorphIcons.js +551 -0
- package/dist/components/basic/nmorph-link/NmorphLink.vue.js +33 -21
- package/dist/components/basic/nmorph-link/NmorphLink.vue2.js +21 -16
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue.js +22 -28
- package/dist/components/data/nmorph-badge/NmorphBadge.css +1 -1
- package/dist/components/data/nmorph-empty/NmorphEmpty.css +1 -1
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.css +1 -1
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +20 -17
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +63 -54
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue.js +34 -30
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +94 -62
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +52 -52
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +24 -21
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.css +1 -1
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +40 -31
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +45 -41
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue.js +20 -25
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue2.js +25 -21
- package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.js +11 -10
- package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue2.js +10 -9
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.css +1 -1
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +13 -12
- package/dist/hooks/use-common-styles.js +2 -1
- package/dist/icons.js +209 -207
- package/dist/index.es.js +331 -329
- package/dist/index.umd.js +31 -30
- package/dist/package.json.js +1 -1
- package/dist/src/components/basic/nmorph-icon/NmorphIcons.d.ts +1 -0
- package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +2 -0
- package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +2 -2
- package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +0 -1
- package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +2 -0
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +2 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,94 +1,126 @@
|
|
|
1
1
|
import './NmorphFileUpload.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { useI18n as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
const
|
|
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: () => [
|
|
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(
|
|
27
|
-
const { t:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
const
|
|
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
|
-
},
|
|
35
|
-
|
|
36
|
-
},
|
|
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(
|
|
39
|
-
o.has(t) ||
|
|
71
|
+
Array.from(l).forEach((t) => {
|
|
72
|
+
o.has(t) || c(t);
|
|
40
73
|
});
|
|
41
|
-
},
|
|
74
|
+
}, h = (e) => {
|
|
42
75
|
const o = [...e];
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
if (
|
|
48
|
-
const o = e.target, t = Array.from(o.files || []),
|
|
49
|
-
t.forEach((
|
|
50
|
-
|
|
51
|
-
|
|
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
|
|
56
|
-
|
|
57
|
-
}),
|
|
58
|
-
},
|
|
59
|
-
if (
|
|
60
|
-
const o =
|
|
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 =
|
|
63
|
-
|
|
94
|
+
const t = a.value[o];
|
|
95
|
+
c(t.previewUrl), m(), h(a.value.filter((r, s) => s !== o));
|
|
64
96
|
}
|
|
65
97
|
};
|
|
66
|
-
|
|
67
|
-
() =>
|
|
98
|
+
E(
|
|
99
|
+
() => n.modelValue,
|
|
68
100
|
(e) => {
|
|
69
101
|
const o = [...e];
|
|
70
|
-
|
|
102
|
+
N(o), a.value = o, o.length === 0 && m();
|
|
71
103
|
},
|
|
72
104
|
{ deep: !0 }
|
|
73
|
-
),
|
|
74
|
-
Array.from(
|
|
75
|
-
}),
|
|
76
|
-
const
|
|
77
|
-
() =>
|
|
78
|
-
"nmorph-file-upload": [`${
|
|
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
|
-
),
|
|
81
|
-
return
|
|
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
|
|
115
|
+
return Q;
|
|
84
116
|
}, get NmorphImagePreview() {
|
|
85
|
-
return
|
|
117
|
+
return J;
|
|
86
118
|
}, get NmorphIconCross() {
|
|
87
|
-
return
|
|
119
|
+
return oe;
|
|
88
120
|
} };
|
|
89
|
-
return Object.defineProperty(
|
|
121
|
+
return Object.defineProperty(x, "__isScriptSetup", { enumerable: !1, value: !0 }), x;
|
|
90
122
|
}
|
|
91
123
|
});
|
|
92
124
|
export {
|
|
93
|
-
|
|
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
|
|
3
|
-
import { NmorphComponentHeight as
|
|
4
|
-
import { useModifiers as
|
|
5
|
-
import { useI18n as
|
|
6
|
-
import { useFormItemInput as
|
|
7
|
-
import { useVirtualList as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
const
|
|
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:
|
|
44
|
-
() =>
|
|
45
|
-
), m = P,
|
|
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
|
|
48
|
-
const n =
|
|
49
|
-
if (
|
|
50
|
-
n ?
|
|
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",
|
|
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
|
-
() =>
|
|
60
|
-
nmorph: [
|
|
59
|
+
() => ve({
|
|
60
|
+
nmorph: [de[t.height]],
|
|
61
61
|
"nmorph-select": [
|
|
62
|
-
`${
|
|
63
|
-
`${
|
|
64
|
-
`${
|
|
62
|
+
`${t.disabled && "disabled"}`,
|
|
63
|
+
`${t.modelValue ? "on" : "off"}`,
|
|
64
|
+
`${t.loading && "loading"}`,
|
|
65
65
|
`${r.value && !v.value && "open"}`,
|
|
66
|
-
`${
|
|
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
|
-
...
|
|
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
|
-
() =>
|
|
88
|
+
() => t.loading,
|
|
89
89
|
(e) => {
|
|
90
90
|
e && (r.value = !1);
|
|
91
91
|
}
|
|
92
92
|
);
|
|
93
|
-
const i = 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
|
-
})[
|
|
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:
|
|
100
|
-
overscan:
|
|
101
|
-
dynamic:
|
|
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(
|
|
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(
|
|
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
|
|
122
|
-
const n = o.value.indexOf(
|
|
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
|
|
128
|
+
await R(), O(), document.addEventListener("click", q);
|
|
129
129
|
}), ie(() => {
|
|
130
130
|
document.removeEventListener("click", q);
|
|
131
131
|
});
|
|
132
|
-
const le = a(() => typeof
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
() => h.value ? `${
|
|
136
|
-
),
|
|
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
|
|
154
|
+
return ye;
|
|
155
155
|
}, get NmorphIcon() {
|
|
156
|
-
return
|
|
156
|
+
return ge;
|
|
157
157
|
}, get NmorphSelectOption() {
|
|
158
|
-
return
|
|
158
|
+
return he;
|
|
159
159
|
}, get NmorphDropdown() {
|
|
160
|
-
return
|
|
160
|
+
return me;
|
|
161
161
|
}, get NmorphIconLoader() {
|
|
162
|
-
return
|
|
162
|
+
return be;
|
|
163
163
|
}, get NmorphIconChevronDown() {
|
|
164
|
-
return
|
|
164
|
+
return He;
|
|
165
165
|
} };
|
|
166
|
-
return Object.defineProperty(
|
|
166
|
+
return Object.defineProperty(L, "__isScriptSetup", { enumerable: !1, value: !0 }), L;
|
|
167
167
|
}
|
|
168
168
|
});
|
|
169
169
|
export {
|
|
170
|
-
|
|
170
|
+
ke as default
|
|
171
171
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import './NmorphSelectOption.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { NmorphComponentHeight as
|
|
4
|
-
import { useModifiers as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
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
|
|
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(
|
|
24
|
-
|
|
25
|
-
const r =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
`${
|
|
36
|
+
`${u.value && "checked"}`,
|
|
34
37
|
`${e.focused && "focused"}`
|
|
35
38
|
]
|
|
36
39
|
})
|
|
37
|
-
),
|
|
40
|
+
), m = t(() => ({
|
|
38
41
|
...e.hoverBackground !== void 0 && { "--hover-bg": e.hoverBackground },
|
|
39
42
|
...e.hoverColor !== void 0 && { "--hover-color": e.hoverColor }
|
|
40
|
-
})),
|
|
41
|
-
return
|
|
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
|
|
46
|
+
return q;
|
|
44
47
|
} };
|
|
45
|
-
return Object.defineProperty(
|
|
48
|
+
return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
|
|
46
49
|
}
|
|
47
50
|
});
|
|
48
51
|
export {
|
|
49
|
-
|
|
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{
|
|
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}
|