@nmorph/nmorph-ui-kit 2.2.10 → 2.2.13
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 +11 -7
- package/dist/components/basic/nmorph-icon/NmorphIcon.css +1 -1
- package/dist/components/basic/nmorph-icon/NmorphIcon.vue2.js +11 -11
- package/dist/components/data/nmorph-avatar/NmorphAvatar.css +1 -0
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue.js +74 -46
- package/dist/components/data/nmorph-avatar/NmorphAvatar.vue2.js +26 -21
- package/dist/components/data/nmorph-carousel/NmorphCarousel.vue2.js +4 -4
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +77 -38
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +31 -30
- package/dist/components/data/nmorph-pagination/NmorphPagination.css +1 -1
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue.js +36 -30
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +48 -41
- package/dist/components/data/nmorph-table/NmorphTable.css +1 -1
- package/dist/components/data/nmorph-table/NmorphTable.vue.js +228 -103
- package/dist/components/data/nmorph-table/NmorphTable.vue2.js +49 -30
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.css +1 -1
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +91 -35
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +48 -35
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.css +1 -1
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue.js +15 -13
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +8 -8
- package/dist/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue2.js +22 -14
- package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +11 -10
- package/dist/components/form/nmorph-radio/NmorphRadio.css +1 -1
- package/dist/components/form/nmorph-radio/NmorphRadio.vue.js +22 -20
- package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +7 -7
- package/dist/components/form/nmorph-radio-group/NmorphRadioGroup.vue2.js +14 -14
- package/dist/components/form/nmorph-select/NmorphSelect.css +1 -1
- package/dist/components/form/nmorph-select/NmorphSelect.vue.js +115 -58
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +104 -75
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +12 -10
- package/dist/components/navigation/nmorph-backtop/NmorphBacktop.vue.js +7 -7
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue.js +29 -42
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +39 -20
- package/dist/components/others/nmorph-overlay/NmorphOverlay.vue.js +29 -24
- package/dist/components/others/nmorph-overlay/NmorphOverlay.vue2.js +17 -15
- package/dist/hooks/use-common-styles.js +23 -20
- package/dist/hooks/use-placement.js +76 -44
- package/dist/hooks/use-virtual-list.js +46 -0
- package/dist/index.es.js +698 -694
- package/dist/index.umd.js +46 -38
- package/dist/nuxt.mjs +21 -8
- package/dist/outside-hooks/use-nmorph-browser.js +9 -9
- package/dist/outside-hooks/use-nmorph-theme.js +133 -87
- package/dist/package.json.js +1 -1
- package/dist/plugin.js +34 -29
- package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-image/NmorphImage.vue.d.ts +3 -3
- package/dist/src/components/data/nmorph-image-preview/NmorphImagePreview.vue.d.ts +14 -2
- package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +3 -0
- package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +9 -0
- package/dist/src/components/data/nmorph-table/types.d.ts +2 -2
- package/dist/src/components/feedback/nmorph-tooltip/NmorphTooltip.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +11 -0
- package/dist/src/components/form/nmorph-checkbox/NmorphCheckbox.vue.d.ts +1 -0
- package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +4 -3
- package/dist/src/components/form/nmorph-radio/NmorphRadio.vue.d.ts +1 -0
- package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +4 -3
- package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +8 -0
- package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +1 -0
- package/dist/src/components/form/nmorph-select/types.d.ts +1 -0
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +3 -1
- package/dist/src/components/others/nmorph-overlay/NmorphOverlay.vue.d.ts +4 -0
- package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +1 -1
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/use-common-styles.d.ts +1 -0
- package/dist/src/hooks/use-placement.d.ts +8 -4
- package/dist/src/hooks/use-virtual-list.d.ts +21 -0
- package/dist/src/outside-hooks/use-nmorph-notification.d.ts +2 -2
- package/dist/src/outside-hooks/use-nmorph-theme.d.ts +1 -0
- package/dist/src/plugin.d.ts +2 -0
- package/dist/src/types/index.d.ts +12 -3
- package/dist/style.css +1 -1
- package/dist/types/index.js +14 -8
- package/package.json +1 -1
|
@@ -1,16 +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
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
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({
|
|
14
15
|
__name: "NmorphSelect",
|
|
15
16
|
props: {
|
|
16
17
|
noElementPlaceholder: { type: String, required: !1, default: "" },
|
|
@@ -23,6 +24,10 @@ const ye = /* @__PURE__ */ U({
|
|
|
23
24
|
fill: { type: Boolean, required: !1, default: !1 },
|
|
24
25
|
optionsWidth: { type: String, required: !1, default: "truncate" },
|
|
25
26
|
zIndex: { type: Number, required: !1 },
|
|
27
|
+
virtual: { type: Boolean, required: !1, default: !1 },
|
|
28
|
+
virtualItemHeight: { type: Number, required: !1, default: 0 },
|
|
29
|
+
virtualMaxHeight: { type: [Number, String], required: !1, default: 240 },
|
|
30
|
+
virtualOverscan: { type: Number, required: !1, default: 5 },
|
|
26
31
|
id: { type: String, required: !1 },
|
|
27
32
|
name: { type: String, required: !1 },
|
|
28
33
|
autocomplete: { type: String, required: !1 },
|
|
@@ -31,98 +36,122 @@ const ye = /* @__PURE__ */ U({
|
|
|
31
36
|
tabindex: { type: Number, required: !1 }
|
|
32
37
|
},
|
|
33
38
|
emits: ["update:model-value"],
|
|
34
|
-
setup(
|
|
35
|
-
|
|
36
|
-
const { t:
|
|
37
|
-
() =>
|
|
38
|
-
),
|
|
39
|
-
if (!
|
|
40
|
-
if (r.value = !1, typeof
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
|
|
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) {
|
|
45
|
+
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];
|
|
44
49
|
}
|
|
45
|
-
|
|
50
|
+
m("update:model-value", t.value);
|
|
46
51
|
}
|
|
47
|
-
}, p =
|
|
52
|
+
}, p = s(!1), W = () => {
|
|
48
53
|
p.value = !0;
|
|
49
|
-
},
|
|
54
|
+
}, U = () => {
|
|
50
55
|
p.value = !1;
|
|
51
|
-
},
|
|
52
|
-
() =>
|
|
53
|
-
nmorph: [
|
|
56
|
+
}, z = a(
|
|
57
|
+
() => ue({
|
|
58
|
+
nmorph: [ne[l.height]],
|
|
54
59
|
"nmorph-select": [
|
|
55
|
-
`${
|
|
56
|
-
`${
|
|
57
|
-
`${
|
|
58
|
-
`${r.value && !
|
|
59
|
-
`${
|
|
60
|
-
`${
|
|
61
|
-
`${
|
|
60
|
+
`${l.disabled && "disabled"}`,
|
|
61
|
+
`${l.modelValue ? "on" : "off"}`,
|
|
62
|
+
`${l.loading && "loading"}`,
|
|
63
|
+
`${r.value && !d.value && "open"}`,
|
|
64
|
+
`${l.fill && "fill"}`,
|
|
65
|
+
`${h.value && "options-auto-width"}`,
|
|
66
|
+
`${g.value ? "selected-line-outset" : "selected-line-inset"}`,
|
|
62
67
|
`${p.value && "focus"}`
|
|
63
68
|
]
|
|
64
69
|
})
|
|
65
|
-
),
|
|
66
|
-
|
|
70
|
+
), F = () => {
|
|
71
|
+
d.value || (r.value = !r.value);
|
|
67
72
|
};
|
|
68
|
-
|
|
73
|
+
f(
|
|
69
74
|
r,
|
|
70
|
-
(
|
|
71
|
-
|
|
75
|
+
(e) => {
|
|
76
|
+
e && (g.value = !1);
|
|
72
77
|
},
|
|
73
78
|
{ immediate: !0 }
|
|
74
79
|
);
|
|
75
|
-
const
|
|
80
|
+
const b = () => {
|
|
76
81
|
r.value = !1;
|
|
77
82
|
};
|
|
78
|
-
|
|
79
|
-
() =>
|
|
80
|
-
(
|
|
81
|
-
|
|
83
|
+
f(
|
|
84
|
+
() => l.loading,
|
|
85
|
+
(e) => {
|
|
86
|
+
e && (r.value = !1);
|
|
82
87
|
}
|
|
83
88
|
);
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
+
basic: 30,
|
|
91
|
+
thick: 38,
|
|
92
|
+
thin: 22
|
|
93
|
+
})[l.height || "basic"]), w = a(() => l.virtualItemHeight || M.value), A = a(() => l.virtualOverscan), v = se(x, {
|
|
94
|
+
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));
|
|
103
|
+
}, 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
|
+
f(u, (e) => {
|
|
107
|
+
r.value && c.value && v.scrollToIndex(e);
|
|
108
|
+
}), f(
|
|
109
|
+
o,
|
|
110
|
+
(e) => {
|
|
111
|
+
u.value >= e.length && (u.value = Math.max(e.length - 1, 0));
|
|
112
|
+
},
|
|
113
|
+
{ immediate: !0 }
|
|
114
|
+
), f(r, async (e) => {
|
|
115
|
+
if (e) {
|
|
116
|
+
if (await E(), I(), typeof t.value == "string") {
|
|
117
|
+
const n = o.value.indexOf(t.value);
|
|
118
|
+
n !== -1 && (u.value = n);
|
|
119
|
+
}
|
|
120
|
+
v.refresh(), c.value && v.scrollToIndex(u.value);
|
|
121
|
+
}
|
|
122
|
+
}), ae(async () => {
|
|
123
|
+
await E(), I(), document.addEventListener("click", b);
|
|
124
|
+
}), re(() => {
|
|
125
|
+
document.removeEventListener("click", b);
|
|
97
126
|
});
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
() =>
|
|
102
|
-
),
|
|
103
|
-
|
|
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);
|
|
104
133
|
}, arrowDownHandler: () => {
|
|
105
|
-
|
|
134
|
+
d.value || o.value.length !== 0 && (u.value = (u.value + 1) % o.value.length);
|
|
106
135
|
}, arrowUpHandler: () => {
|
|
107
|
-
|
|
136
|
+
d.value || o.value.length !== 0 && (u.value = (u.value - 1 + o.value.length) % o.value.length);
|
|
108
137
|
}, enterHandler: () => {
|
|
109
|
-
r.value &&
|
|
138
|
+
r.value && N.value && y(N.value);
|
|
110
139
|
}, get NmorphTagItem() {
|
|
111
|
-
return
|
|
140
|
+
return fe;
|
|
112
141
|
}, get NmorphIcon() {
|
|
113
|
-
return
|
|
142
|
+
return ce;
|
|
114
143
|
}, get NmorphSelectOption() {
|
|
115
|
-
return
|
|
144
|
+
return ve;
|
|
116
145
|
}, get NmorphDropdown() {
|
|
117
|
-
return
|
|
146
|
+
return de;
|
|
118
147
|
}, get NmorphIconLoader() {
|
|
119
|
-
return
|
|
148
|
+
return me;
|
|
120
149
|
}, get NmorphIconChevronDown() {
|
|
121
|
-
return
|
|
150
|
+
return pe;
|
|
122
151
|
} };
|
|
123
|
-
return Object.defineProperty(
|
|
152
|
+
return Object.defineProperty(_, "__isScriptSetup", { enumerable: !1, value: !0 }), _;
|
|
124
153
|
}
|
|
125
154
|
});
|
|
126
155
|
export {
|
|
127
|
-
|
|
156
|
+
_e as default
|
|
128
157
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import './NmorphSelectOption.css';
|
|
2
|
-
import { defineComponent as
|
|
2
|
+
import { defineComponent as m, inject as u, computed as s } from "vue";
|
|
3
3
|
import { NmorphComponentHeight as h } from "../../../../../types/index.js";
|
|
4
4
|
import { useModifiers as g } from "../../../../../utils/create-modifiers.js";
|
|
5
5
|
import v from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
6
|
-
import
|
|
7
|
-
const I = /* @__PURE__ */
|
|
6
|
+
import y from "../../../../../assets/icons/success.svg.js";
|
|
7
|
+
const I = /* @__PURE__ */ m({
|
|
8
8
|
__name: "NmorphSelectOption",
|
|
9
9
|
props: {
|
|
10
10
|
value: { type: String, required: !0 },
|
|
11
11
|
label: { type: String, required: !0, default: "" },
|
|
12
|
+
focused: { type: Boolean, required: !1, default: !1 },
|
|
12
13
|
id: { type: String, required: !1 },
|
|
13
14
|
name: { type: String, required: !1 },
|
|
14
15
|
autocomplete: { type: String, required: !1 },
|
|
@@ -17,23 +18,24 @@ const I = /* @__PURE__ */ f({
|
|
|
17
18
|
tabindex: { type: Number, required: !1 }
|
|
18
19
|
},
|
|
19
20
|
emits: ["change-value"],
|
|
20
|
-
setup(
|
|
21
|
-
|
|
22
|
-
const t =
|
|
21
|
+
setup(i, { expose: n, emit: c }) {
|
|
22
|
+
n();
|
|
23
|
+
const t = u("select-selected-value"), r = u("select-change-selected-value"), e = i, l = c, d = () => {
|
|
23
24
|
e.disabled || (l("change-value", e.value), r && r(e.value));
|
|
24
|
-
}, a =
|
|
25
|
+
}, a = s(() => typeof t?.value == "string" ? t.value === e.value : Array.isArray(t?.value) ? t.value.some((f) => f === e.value) : !1), p = s(
|
|
25
26
|
() => g({
|
|
26
27
|
nmorph: [h[e.height]],
|
|
27
28
|
"nmorph-select-option": [
|
|
28
29
|
`${e.disabled && "disabled"}`,
|
|
29
30
|
`${e.label && "with-label"}`,
|
|
30
|
-
`${a.value && "checked"}
|
|
31
|
+
`${a.value && "checked"}`,
|
|
32
|
+
`${e.focused && "focused"}`
|
|
31
33
|
]
|
|
32
34
|
})
|
|
33
|
-
), o = { selectSelectedValue: t, selectChangeSelectedValue: r, props: e, emit: l, clickHandler:
|
|
35
|
+
), o = { selectSelectedValue: t, selectChangeSelectedValue: r, props: e, emit: l, clickHandler: d, checked: a, modifiers: p, get NmorphIcon() {
|
|
34
36
|
return v;
|
|
35
37
|
}, get NmorphIconSuccess() {
|
|
36
|
-
return
|
|
38
|
+
return y;
|
|
37
39
|
} };
|
|
38
40
|
return Object.defineProperty(o, "__isScriptSetup", { enumerable: !1, value: !0 }), o;
|
|
39
41
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import './NmorphBacktop.css';
|
|
2
2
|
import p from "./NmorphBacktop.vue2.js";
|
|
3
|
-
import { openBlock as
|
|
3
|
+
import { openBlock as a, createElementBlock as l, normalizeStyle as c, createElementVNode as t, normalizeClass as i, withModifiers as m, renderSlot as s, createVNode as r, withCtx as e } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import d from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
6
|
function h(n, f, _, o, k, b) {
|
|
7
|
-
return
|
|
7
|
+
return a(), l(
|
|
8
8
|
"div",
|
|
9
9
|
{
|
|
10
|
-
style:
|
|
10
|
+
style: c({ "--nmorph-backtop-right": `${o.props.right}px`, "--nmorph-backtop-bottom": `${o.props.bottom}px` })
|
|
11
11
|
},
|
|
12
12
|
[
|
|
13
13
|
t(
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
16
|
ref: "selfDOMEl",
|
|
17
|
-
class:
|
|
17
|
+
class: i(o.modifiers)
|
|
18
18
|
},
|
|
19
19
|
[
|
|
20
20
|
t("div", {
|
|
@@ -27,7 +27,7 @@ function h(n, f, _, o, k, b) {
|
|
|
27
27
|
default: e(() => [
|
|
28
28
|
r(o.NmorphIcon, {
|
|
29
29
|
class: "nmorph-backtop__up-icon",
|
|
30
|
-
color: o.props.design === "nmorph" ? void 0 : "var(--nmorph-
|
|
30
|
+
color: o.props.design === "nmorph" ? void 0 : "var(--nmorph-contrast-text-color)"
|
|
31
31
|
}, {
|
|
32
32
|
default: e(() => [
|
|
33
33
|
r(o.NmorphIconChevronDown)
|
|
@@ -50,7 +50,7 @@ function h(n, f, _, o, k, b) {
|
|
|
50
50
|
/* STYLE */
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const g = /* @__PURE__ */ d(p, [["render", h], ["__file", "/builds/ketjo/nmorph/library/src/components/navigation/nmorph-backtop/NmorphBacktop.vue"]]);
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
g as default
|
|
56
56
|
};
|
|
@@ -1,49 +1,36 @@
|
|
|
1
1
|
import './NmorphDropdown.css';
|
|
2
2
|
import n from "./NmorphDropdown.vue2.js";
|
|
3
|
-
import { openBlock as
|
|
3
|
+
import { openBlock as r, createBlock as t, withCtx as d, createElementBlock as i, normalizeStyle as p, normalizeClass as l, renderSlot as a, createCommentVNode as m } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import s from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
-
function c(e,
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
l(e.$slots, "default")
|
|
33
|
-
],
|
|
34
|
-
6
|
|
35
|
-
/* CLASS, STYLE */
|
|
36
|
-
)
|
|
37
|
-
]),
|
|
38
|
-
_: 3
|
|
39
|
-
/* FORWARDED */
|
|
40
|
-
}, 8, ["show", "z-index"])
|
|
41
|
-
],
|
|
42
|
-
4
|
|
43
|
-
/* STYLE */
|
|
44
|
-
);
|
|
6
|
+
function c(e, f, _, o, h, w) {
|
|
7
|
+
return r(), t(o.NmorphOverlay, {
|
|
8
|
+
show: o.props.open,
|
|
9
|
+
transparent: "",
|
|
10
|
+
"z-index": o.props.zIndex,
|
|
11
|
+
onOnOutsideClick: o.outsideClickHandler
|
|
12
|
+
}, {
|
|
13
|
+
default: d(() => [
|
|
14
|
+
o.props.open ? (r(), i(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
key: 0,
|
|
18
|
+
ref: "dropdownDOMRef",
|
|
19
|
+
class: l(o.modifiers),
|
|
20
|
+
style: p(o.dropdownStyle)
|
|
21
|
+
},
|
|
22
|
+
[
|
|
23
|
+
a(e.$slots, "default")
|
|
24
|
+
],
|
|
25
|
+
6
|
|
26
|
+
/* CLASS, STYLE */
|
|
27
|
+
)) : m("v-if", !0)
|
|
28
|
+
]),
|
|
29
|
+
_: 3
|
|
30
|
+
/* FORWARDED */
|
|
31
|
+
}, 8, ["show", "z-index"]);
|
|
45
32
|
}
|
|
46
|
-
const
|
|
33
|
+
const z = /* @__PURE__ */ s(n, [["render", c], ["__file", "/builds/ketjo/nmorph/library/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue"]]);
|
|
47
34
|
export {
|
|
48
|
-
|
|
35
|
+
z as default
|
|
49
36
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import './NmorphDropdown.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { usePlacement as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
2
|
+
import { defineComponent as w, ref as b, toRef as r, computed as i, watch as v } from "vue";
|
|
3
|
+
import { useModifiers as x } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { usePlacement as O } from "../../../hooks/use-placement.js";
|
|
5
|
+
import q from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
|
|
6
|
+
const g = /* @__PURE__ */ w({
|
|
7
7
|
__name: "NmorphDropdown",
|
|
8
8
|
props: {
|
|
9
9
|
open: { type: Boolean, required: !0 },
|
|
10
10
|
relativeElement: { type: null, required: !0 },
|
|
11
|
+
placement: { type: null, required: !1, default: "bottom" },
|
|
11
12
|
width: { type: [Number, String], required: !1, default: 160 },
|
|
12
13
|
minWidth: { type: [Number, String], required: !1 },
|
|
13
14
|
maxWidth: { type: [Number, String], required: !1 },
|
|
@@ -17,26 +18,44 @@ const w = /* @__PURE__ */ a({
|
|
|
17
18
|
zIndex: { type: Number, required: !1 }
|
|
18
19
|
},
|
|
19
20
|
emits: ["on-outside-click"],
|
|
20
|
-
setup(
|
|
21
|
-
|
|
22
|
-
const e =
|
|
23
|
-
initialPlacement: "
|
|
24
|
-
contentDOMElement:
|
|
25
|
-
relativeElement: e
|
|
26
|
-
yOffset: e
|
|
27
|
-
xOffset: e
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
setup(u, { expose: f, emit: c }) {
|
|
22
|
+
f();
|
|
23
|
+
const e = u, l = c, d = b(null), { placementCoords: n, placementReady: p, adjustPlacement: m } = O({
|
|
24
|
+
initialPlacement: r(e, "placement"),
|
|
25
|
+
contentDOMElement: d,
|
|
26
|
+
relativeElement: r(e, "relativeElement"),
|
|
27
|
+
yOffset: r(e, "yOffset"),
|
|
28
|
+
xOffset: r(e, "xOffset"),
|
|
29
|
+
enabled: r(e, "open")
|
|
30
|
+
}), h = i(
|
|
31
|
+
() => x({
|
|
30
32
|
"nmorph-dropdown": [`${!e.open && "closed"}`]
|
|
31
33
|
})
|
|
32
|
-
),
|
|
33
|
-
|
|
34
|
+
), o = (t) => typeof t == "number" ? `${t}px` : t, s = i(
|
|
35
|
+
() => e.fillWidth && e.relativeElement ? `${e.relativeElement.clientWidth}px` : o(e.width)
|
|
36
|
+
), y = i(() => ({
|
|
37
|
+
"--nmorph-dropdown-width": s.value,
|
|
38
|
+
"--nmorph-dropdown-min-width": o(e.minWidth) || "auto",
|
|
39
|
+
"--nmorph-dropdown-max-width": o(e.maxWidth) || "none",
|
|
40
|
+
left: n.value.x,
|
|
41
|
+
top: n.value.y,
|
|
42
|
+
visibility: e.open && p.value ? "visible" : "hidden"
|
|
43
|
+
}));
|
|
44
|
+
v(
|
|
45
|
+
() => e.open,
|
|
46
|
+
(t) => {
|
|
47
|
+
t && m();
|
|
48
|
+
},
|
|
49
|
+
{ flush: "post" }
|
|
50
|
+
);
|
|
51
|
+
const a = { props: e, emit: l, dropdownDOMRef: d, placementCoords: n, placementReady: p, adjustPlacement: m, modifiers: h, getCssSize: o, width: s, dropdownStyle: y, outsideClickHandler: () => {
|
|
52
|
+
l("on-outside-click");
|
|
34
53
|
}, get NmorphOverlay() {
|
|
35
|
-
return
|
|
54
|
+
return q;
|
|
36
55
|
} };
|
|
37
|
-
return Object.defineProperty(
|
|
56
|
+
return Object.defineProperty(a, "__isScriptSetup", { enumerable: !1, value: !0 }), a;
|
|
38
57
|
}
|
|
39
58
|
});
|
|
40
59
|
export {
|
|
41
|
-
|
|
60
|
+
g as default
|
|
42
61
|
};
|
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
import './NmorphOverlay.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as n,
|
|
2
|
+
import s from "./NmorphOverlay.vue2.js";
|
|
3
|
+
import { openBlock as i, createBlock as n, Teleport as p, createElementVNode as e, withModifiers as l, normalizeStyle as a, normalizeClass as d, renderSlot as m } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import c from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
-
function
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
6
|
+
function f(t, r, _, o, h, v) {
|
|
7
|
+
return i(), n(p, {
|
|
8
|
+
to: o.props.teleportTo,
|
|
9
|
+
disabled: o.props.disabledTeleport || !o.props.show
|
|
10
|
+
}, [
|
|
11
|
+
e(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
class: d(o.modifiers),
|
|
15
|
+
style: a({ "--nmorph-overlay-z-index": o.zIndex }),
|
|
16
|
+
onClick: l(o.clickHandler, ["stop"])
|
|
17
|
+
},
|
|
18
|
+
[
|
|
19
|
+
e("div", {
|
|
20
|
+
class: "nmorph-overlay__slot",
|
|
21
|
+
onClick: r[0] || (r[0] = l(() => {
|
|
22
|
+
}, ["stop"]))
|
|
23
|
+
}, [
|
|
24
|
+
m(t.$slots, "default")
|
|
25
|
+
])
|
|
26
|
+
],
|
|
27
|
+
6
|
|
28
|
+
/* CLASS, STYLE */
|
|
29
|
+
)
|
|
30
|
+
], 8, ["to", "disabled"]);
|
|
26
31
|
}
|
|
27
|
-
const
|
|
32
|
+
const z = /* @__PURE__ */ c(s, [["render", f], ["__file", "/builds/ketjo/nmorph/library/src/components/others/nmorph-overlay/NmorphOverlay.vue"]]);
|
|
28
33
|
export {
|
|
29
|
-
|
|
34
|
+
z as default
|
|
30
35
|
};
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
import './NmorphOverlay.css';
|
|
2
|
-
import { defineComponent as d, computed as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { useZIndex as
|
|
5
|
-
const
|
|
2
|
+
import { defineComponent as d, computed as o } from "vue";
|
|
3
|
+
import { useModifiers as u } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { useZIndex as f } from "../../../hooks/use-z-index.js";
|
|
5
|
+
const y = /* @__PURE__ */ d({
|
|
6
6
|
__name: "NmorphOverlay",
|
|
7
7
|
props: {
|
|
8
8
|
show: { type: Boolean, required: !0 },
|
|
9
9
|
transparent: { type: Boolean, required: !1, default: !1 },
|
|
10
|
-
zIndex: { type: Number, required: !1 }
|
|
10
|
+
zIndex: { type: Number, required: !1 },
|
|
11
|
+
teleportTo: { type: null, required: !1, default: "body" },
|
|
12
|
+
disabledTeleport: { type: Boolean, required: !1, default: !1 }
|
|
11
13
|
},
|
|
12
14
|
emits: ["on-outside-click"],
|
|
13
|
-
setup(
|
|
14
|
-
|
|
15
|
-
const e =
|
|
16
|
-
|
|
15
|
+
setup(s, { expose: n, emit: a }) {
|
|
16
|
+
n();
|
|
17
|
+
const e = s, l = f(
|
|
18
|
+
o(() => e.show),
|
|
17
19
|
() => e.zIndex
|
|
18
|
-
),
|
|
19
|
-
() =>
|
|
20
|
+
), p = o(
|
|
21
|
+
() => u({
|
|
20
22
|
"nmorph-overlay": [`${e.show && "show"}`, `${e.transparent && "transparent"}`]
|
|
21
23
|
})
|
|
22
|
-
),
|
|
24
|
+
), i = () => {
|
|
23
25
|
r("on-outside-click");
|
|
24
|
-
}, r =
|
|
25
|
-
return Object.defineProperty(
|
|
26
|
+
}, r = a, t = { props: e, zIndex: l, modifiers: p, clickHandler: i, emit: r };
|
|
27
|
+
return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
|
|
26
28
|
}
|
|
27
29
|
});
|
|
28
30
|
export {
|
|
29
|
-
|
|
31
|
+
y as default
|
|
30
32
|
};
|