@nmorph/nmorph-ui-kit 2.2.15 → 2.2.16
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/README.md +0 -8
- package/dist/components/basic/nmorph-button/NmorphButton.css +1 -1
- package/dist/components/basic/nmorph-button/NmorphButton.vue.js +12 -12
- package/dist/components/basic/nmorph-button/NmorphButton.vue2.js +17 -14
- package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +1 -1
- package/dist/components/data/nmorph-calendar/utils.js +65 -52
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +39 -37
- package/dist/components/data/nmorph-table/NmorphTable.css +1 -1
- package/dist/components/data/nmorph-table/NmorphTable.vue.js +228 -225
- package/dist/components/data/nmorph-table/NmorphTable.vue2.js +57 -43
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue.js +47 -47
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue2.js +28 -25
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.css +1 -1
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +102 -92
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +67 -44
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.css +1 -1
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +45 -33
- package/dist/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue2.js +1 -1
- package/dist/components/form/nmorph-select/NmorphSelect.css +1 -1
- package/dist/components/form/nmorph-select/NmorphSelect.vue.js +135 -125
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +76 -65
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.js +15 -12
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +22 -21
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +16 -16
- package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.css +1 -0
- package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.js +50 -0
- package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue2.js +69 -0
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.css +1 -1
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue.js +23 -23
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +31 -25
- package/dist/components/others/nmorph-overlay/NmorphOverlay.vue.js +42 -18
- package/dist/components/others/nmorph-overlay/NmorphOverlay.vue2.js +66 -19
- package/dist/hooks/use-common-styles.js +42 -33
- package/dist/hooks/use-virtual-list.js +65 -37
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +539 -0
- package/dist/index.es.js +656 -653
- package/dist/index.umd.js +62 -64
- package/dist/nuxt.mjs +3 -3
- package/dist/package.json.js +1 -1
- package/dist/src/components/data/nmorph-calendar/types.d.ts +8 -1
- package/dist/src/components/data/nmorph-calendar/utils.d.ts +2 -1
- package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +2 -0
- package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +2 -0
- package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +2 -0
- package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +13 -1
- package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +2 -0
- package/dist/src/components/form/nmorph-text-input/NmorphTextInput.vue.d.ts +2 -0
- package/dist/src/components/navigation/index.d.ts +1 -0
- package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +60 -0
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +10 -0
- package/dist/src/components/others/nmorph-overlay/NmorphOverlay.vue.d.ts +12 -1
- package/dist/src/hooks/use-virtual-list.d.ts +3 -0
- package/dist/src/icons.d.ts +3 -0
- package/dist/src/styles.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/styles.d.ts +2 -0
- package/dist/styles.js +7 -0
- package/dist/utils/theme-style.js +27 -38
- package/package.json +11 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import './NmorphSelect.css';
|
|
2
|
-
import { defineComponent 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 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(
|
|
40
|
-
|
|
41
|
-
const { t:
|
|
42
|
-
() => l.noElementPlaceholder ? l.noElementPlaceholder :
|
|
43
|
-
), m =
|
|
44
|
-
if (!
|
|
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),
|
|
47
|
-
if (l.valueRequired &&
|
|
48
|
-
n ? t.value = t.value.filter((
|
|
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 =
|
|
53
|
+
}, p = d(!1), z = () => {
|
|
53
54
|
p.value = !0;
|
|
54
|
-
},
|
|
55
|
+
}, F = () => {
|
|
55
56
|
p.value = !1;
|
|
56
|
-
},
|
|
57
|
-
() =>
|
|
58
|
-
nmorph: [
|
|
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 && !
|
|
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
|
-
),
|
|
71
|
-
|
|
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 =
|
|
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"]),
|
|
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:
|
|
96
|
-
overscan: A
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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) :
|
|
105
|
-
),
|
|
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 &&
|
|
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
|
|
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
|
-
|
|
122
|
+
s.refresh(), c.value && s.scrollToIndex(u.value);
|
|
121
123
|
}
|
|
122
|
-
}),
|
|
123
|
-
await
|
|
124
|
-
}),
|
|
124
|
+
}), ue(async () => {
|
|
125
|
+
await L(), O(), document.addEventListener("click", b);
|
|
126
|
+
}), oe(() => {
|
|
125
127
|
document.removeEventListener("click", b);
|
|
126
128
|
});
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
() => h.value ? `${
|
|
131
|
-
),
|
|
132
|
-
|
|
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
|
-
|
|
136
|
+
v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value + 1) % o.value.length);
|
|
135
137
|
}, arrowUpHandler: () => {
|
|
136
|
-
|
|
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 &&
|
|
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
|
|
151
|
+
return he;
|
|
141
152
|
}, get NmorphIcon() {
|
|
142
|
-
return
|
|
153
|
+
return me;
|
|
143
154
|
}, get NmorphSelectOption() {
|
|
144
|
-
return
|
|
155
|
+
return pe;
|
|
145
156
|
}, get NmorphDropdown() {
|
|
146
|
-
return
|
|
157
|
+
return fe;
|
|
147
158
|
}, get NmorphIconLoader() {
|
|
148
|
-
return
|
|
159
|
+
return ye;
|
|
149
160
|
}, get NmorphIconChevronDown() {
|
|
150
|
-
return
|
|
161
|
+
return ge;
|
|
151
162
|
} };
|
|
152
|
-
return Object.defineProperty(
|
|
163
|
+
return Object.defineProperty(B, "__isScriptSetup", { enumerable: !1, value: !0 }), B;
|
|
153
164
|
}
|
|
154
165
|
});
|
|
155
166
|
export {
|
|
156
|
-
|
|
167
|
+
Ce as default
|
|
157
168
|
};
|
package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.js
CHANGED
|
@@ -1,38 +1,41 @@
|
|
|
1
1
|
import './NmorphSelectOption.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as o, createElementBlock as
|
|
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(
|
|
8
|
-
return o(),
|
|
9
|
-
class:
|
|
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
|
-
|
|
20
|
+
a(e.props.label),
|
|
18
21
|
1
|
|
19
22
|
/* TEXT */
|
|
20
23
|
),
|
|
21
|
-
i(
|
|
24
|
+
i(c.$slots, "default")
|
|
22
25
|
]),
|
|
23
|
-
e.checked ? (o(),
|
|
26
|
+
e.checked ? (o(), s(e.NmorphIcon, {
|
|
24
27
|
key: 0,
|
|
25
28
|
class: "nmorph-select-option__checked"
|
|
26
29
|
}, {
|
|
27
|
-
default:
|
|
30
|
+
default: d(() => [
|
|
28
31
|
p(e.NmorphIconSuccess)
|
|
29
32
|
]),
|
|
30
33
|
_: 1
|
|
31
34
|
/* STABLE */
|
|
32
|
-
})) :
|
|
35
|
+
})) : m("v-if", !0)
|
|
33
36
|
], 10, h);
|
|
34
37
|
}
|
|
35
|
-
const B = /* @__PURE__ */ _(
|
|
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,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { openBlock as
|
|
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
|
|
4
|
+
const x = { class: "nmorph-text-input__input-side" }, v = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "nmorph-text-input__prepend-icon"
|
|
7
|
-
},
|
|
8
|
-
function
|
|
9
|
-
return
|
|
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:
|
|
13
|
-
style:
|
|
12
|
+
class: c(e.modifiers),
|
|
13
|
+
style: m(e.styles)
|
|
14
14
|
},
|
|
15
15
|
[
|
|
16
|
-
|
|
17
|
-
e.slots["prepend-icon"] ? (
|
|
18
|
-
|
|
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
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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:
|
|
47
|
-
|
|
48
|
-
default:
|
|
49
|
-
(
|
|
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
|
|
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
|
-
|
|
67
|
+
K as default
|
|
67
68
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { NmorphComponentHeight as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { useFormItemInput as
|
|
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__ */
|
|
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 =
|
|
29
|
-
() =>
|
|
30
|
-
nmorph: [
|
|
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
|
-
),
|
|
37
|
-
const
|
|
38
|
-
r("update:model-value",
|
|
39
|
-
}, t = l(!1),
|
|
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
|
-
},
|
|
41
|
+
}, I = n(() => e.typePassword && !t.value && !e.clearable ? "password" : "text"), a = l(!1), N = () => {
|
|
42
42
|
r("focus"), a.value = !0;
|
|
43
|
-
},
|
|
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:
|
|
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,50 @@
|
|
|
1
|
+
import './NmorphContextMenu.css';
|
|
2
|
+
import t from "./NmorphContextMenu.vue2.js";
|
|
3
|
+
import { openBlock as n, createElementBlock as l, renderSlot as r, createBlock as i, withCtx as a, createCommentVNode as c } from "vue";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import p from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
function d(o, m, f, e, s, h) {
|
|
7
|
+
return n(), l(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
ref: "triggerDOMRef",
|
|
11
|
+
class: "nmorph-context-menu",
|
|
12
|
+
onContextmenu: e.contextMenuHandler,
|
|
13
|
+
onKeydown: e.keydownHandler
|
|
14
|
+
},
|
|
15
|
+
[
|
|
16
|
+
r(o.$slots, "default"),
|
|
17
|
+
e.relativeElement ? (n(), i(e.NmorphDropdown, {
|
|
18
|
+
key: 0,
|
|
19
|
+
open: e.isOpen,
|
|
20
|
+
"relative-element": e.relativeElement,
|
|
21
|
+
placement: e.props.placement,
|
|
22
|
+
width: e.props.width,
|
|
23
|
+
"min-width": e.props.minWidth,
|
|
24
|
+
"max-width": e.props.maxWidth,
|
|
25
|
+
"x-offset": e.props.xOffset,
|
|
26
|
+
"y-offset": e.props.yOffset,
|
|
27
|
+
"fill-width": e.props.fillWidth,
|
|
28
|
+
"z-index": e.props.zIndex,
|
|
29
|
+
"close-on-escape": e.props.closeOnEscape,
|
|
30
|
+
"trap-focus": e.props.trapFocus,
|
|
31
|
+
role: e.props.role,
|
|
32
|
+
"aria-label": e.props.ariaLabel,
|
|
33
|
+
onOnOutsideClick: e.outsideClickHandler,
|
|
34
|
+
onOnEscapeKeydown: e.escapeHandler
|
|
35
|
+
}, {
|
|
36
|
+
default: a(() => [
|
|
37
|
+
r(o.$slots, "menu", { close: e.close })
|
|
38
|
+
]),
|
|
39
|
+
_: 3
|
|
40
|
+
/* FORWARDED */
|
|
41
|
+
}, 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)
|
|
42
|
+
],
|
|
43
|
+
544
|
|
44
|
+
/* NEED_HYDRATION, NEED_PATCH */
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
const v = /* @__PURE__ */ p(t, [["render", d], ["__file", "/builds/ketjo/nmorph/library/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue"]]);
|
|
48
|
+
export {
|
|
49
|
+
v as default
|
|
50
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import './NmorphContextMenu.css';
|
|
2
|
+
import { defineComponent as O, ref as i, computed as S, watch as k } from "vue";
|
|
3
|
+
import w from "../nmorph-dropdown/NmorphDropdown.vue.js";
|
|
4
|
+
const C = /* @__PURE__ */ O({
|
|
5
|
+
__name: "NmorphContextMenu",
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: { type: Boolean, required: !1 },
|
|
8
|
+
placement: { type: null, required: !1, default: "bottom-start" },
|
|
9
|
+
width: { type: [Number, String], required: !1, default: 160 },
|
|
10
|
+
minWidth: { type: [Number, String], required: !1, default: void 0 },
|
|
11
|
+
maxWidth: { type: [Number, String], required: !1, default: void 0 },
|
|
12
|
+
xOffset: { type: Number, required: !1, default: 0 },
|
|
13
|
+
yOffset: { type: Number, required: !1, default: 0 },
|
|
14
|
+
fillWidth: { type: Boolean, required: !1, default: !1 },
|
|
15
|
+
zIndex: { type: Number, required: !1, default: void 0 },
|
|
16
|
+
closeOnEscape: { type: Boolean, required: !1, default: !0 },
|
|
17
|
+
trapFocus: { type: Boolean, required: !1, default: !1 },
|
|
18
|
+
disabled: { type: Boolean, required: !1, default: !1 },
|
|
19
|
+
role: { type: String, required: !1, default: "menu" },
|
|
20
|
+
ariaLabel: { type: String, required: !1, default: "" }
|
|
21
|
+
},
|
|
22
|
+
emits: ["update:model-value", "open", "close", "on-outside-click", "on-escape-keydown"],
|
|
23
|
+
setup(y, { expose: b, emit: g }) {
|
|
24
|
+
const l = y, o = g, s = i(null), f = i(null), n = i(!!l.modelValue), p = S(() => typeof l.modelValue == "boolean" ? l.modelValue : n.value);
|
|
25
|
+
k(
|
|
26
|
+
() => l.modelValue,
|
|
27
|
+
(e) => {
|
|
28
|
+
typeof e == "boolean" && (n.value = e);
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
const c = (e, t) => ({
|
|
32
|
+
clientWidth: 0,
|
|
33
|
+
getBoundingClientRect: () => ({
|
|
34
|
+
x: e,
|
|
35
|
+
y: t,
|
|
36
|
+
width: 0,
|
|
37
|
+
height: 0,
|
|
38
|
+
top: t,
|
|
39
|
+
left: e,
|
|
40
|
+
right: e,
|
|
41
|
+
bottom: t,
|
|
42
|
+
toJSON: () => ({})
|
|
43
|
+
})
|
|
44
|
+
}), u = (e) => {
|
|
45
|
+
const t = p.value;
|
|
46
|
+
n.value = e, o("update:model-value", e), t && !e && o("close");
|
|
47
|
+
}, r = () => {
|
|
48
|
+
u(!1);
|
|
49
|
+
}, d = (e, t, a) => {
|
|
50
|
+
f.value = c(e, t), u(!0), o("open", a);
|
|
51
|
+
}, q = (e) => {
|
|
52
|
+
l.disabled || (e.preventDefault(), d(e.clientX, e.clientY, e));
|
|
53
|
+
}, h = (e) => {
|
|
54
|
+
if (l.disabled || e.key !== "ContextMenu" && !(e.shiftKey && e.key === "F10")) return;
|
|
55
|
+
const a = (e.target instanceof HTMLElement ? e.target : s.value)?.getBoundingClientRect();
|
|
56
|
+
a && (e.preventDefault(), d(a.left, a.bottom, e));
|
|
57
|
+
}, _ = () => {
|
|
58
|
+
o("on-outside-click"), r();
|
|
59
|
+
}, N = () => {
|
|
60
|
+
o("on-escape-keydown"), r();
|
|
61
|
+
};
|
|
62
|
+
b({ close: r });
|
|
63
|
+
const m = { props: l, emit: o, triggerDOMRef: s, relativeElement: f, openState: n, isOpen: p, createPointElement: c, setOpen: u, close: r, openAt: d, contextMenuHandler: q, keydownHandler: h, outsideClickHandler: _, escapeHandler: N, NmorphDropdown: w };
|
|
64
|
+
return Object.defineProperty(m, "__isScriptSetup", { enumerable: !1, value: !0 }), m;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export {
|
|
68
|
+
C as default
|
|
69
|
+
};
|
|
@@ -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(--
|
|
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}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import './NmorphDropdown.css';
|
|
2
2
|
import n from "./NmorphDropdown.vue2.js";
|
|
3
|
-
import { openBlock as r, createBlock as
|
|
3
|
+
import { openBlock as r, createBlock as a, withCtx as l, createElementBlock as p, normalizeStyle as s, normalizeClass as i, renderSlot as c, createCommentVNode as d } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const m = ["role", "aria-label"];
|
|
7
|
+
function f(e, _, h, o, w, k) {
|
|
8
|
+
return r(), a(o.NmorphOverlay, {
|
|
8
9
|
show: o.props.open,
|
|
9
10
|
transparent: "",
|
|
10
11
|
"z-index": o.props.zIndex,
|
|
11
|
-
|
|
12
|
+
"close-on-escape": o.props.closeOnEscape,
|
|
13
|
+
"trap-focus": o.props.trapFocus,
|
|
14
|
+
onOnOutsideClick: o.outsideClickHandler,
|
|
15
|
+
onOnEscapeKeydown: o.escapeHandler
|
|
12
16
|
}, {
|
|
13
|
-
default:
|
|
14
|
-
o.props.open ? (r(),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
],
|
|
25
|
-
6
|
|
26
|
-
/* CLASS, STYLE */
|
|
27
|
-
)) : m("v-if", !0)
|
|
17
|
+
default: l(() => [
|
|
18
|
+
o.props.open ? (r(), p("div", {
|
|
19
|
+
key: 0,
|
|
20
|
+
ref: "dropdownDOMRef",
|
|
21
|
+
class: i(o.modifiers),
|
|
22
|
+
style: s(o.dropdownStyle),
|
|
23
|
+
role: o.props.role || void 0,
|
|
24
|
+
"aria-label": o.props.ariaLabel || void 0
|
|
25
|
+
}, [
|
|
26
|
+
c(e.$slots, "default")
|
|
27
|
+
], 14, m)) : d("v-if", !0)
|
|
28
28
|
]),
|
|
29
29
|
_: 3
|
|
30
30
|
/* FORWARDED */
|
|
31
|
-
}, 8, ["show", "z-index"]);
|
|
31
|
+
}, 8, ["show", "z-index", "close-on-escape", "trap-focus"]);
|
|
32
32
|
}
|
|
33
|
-
const
|
|
33
|
+
const b = /* @__PURE__ */ t(n, [["render", f], ["__file", "/builds/ketjo/nmorph/library/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue"]]);
|
|
34
34
|
export {
|
|
35
|
-
|
|
35
|
+
b as default
|
|
36
36
|
};
|