@nmorph/nmorph-ui-kit 2.2.22 → 2.2.24
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/components/basic/nmorph-scroll/NmorphScroll.vue2.js +2 -2
- package/dist/components/data/nmorph-badge/NmorphBadge.css +1 -1
- package/dist/components/data/nmorph-badge/NmorphBadge.vue.js +65 -20
- package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +42 -23
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.css +1 -1
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.css +1 -1
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue.js +12 -12
- package/dist/components/feedback/nmorph-dialog/NmorphDialog.vue2.js +36 -32
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.css +1 -1
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +25 -22
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +70 -62
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +19 -17
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue.js +8 -7
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +13 -12
- package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue2.js +20 -20
- package/dist/index.umd.js +14 -14
- package/dist/package.json.js +1 -1
- package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +6 -0
- package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +2 -0
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +2 -0
- package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +1 -1
- package/dist/src/outside-hooks/use-nmorph-notification.d.ts +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -16,8 +16,8 @@ const k = /* @__PURE__ */ C({
|
|
|
16
16
|
updateOnlyOnScrollEnd: { type: Boolean, required: !1, default: !1 },
|
|
17
17
|
yBarWidthInPx: { type: Number, required: !1, default: 6 },
|
|
18
18
|
xBarWidthInPx: { type: Number, required: !1, default: 6 },
|
|
19
|
-
xGapInPx: { type: Number, required: !1, default:
|
|
20
|
-
yGapInPx: { type: Number, required: !1, default:
|
|
19
|
+
xGapInPx: { type: Number, required: !1, default: 0 },
|
|
20
|
+
yGapInPx: { type: Number, required: !1, default: 0 }
|
|
21
21
|
},
|
|
22
22
|
emits: ["on-scroll", "update:model-value", "on-scroll-end"],
|
|
23
23
|
setup(b, { expose: H, emit: q }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-badge{position:relative;display:inline-block;height:fit-content;--dot-size: 4px}.nmorph-badge .nmorph-badge__container{position:absolute;display:inline-flex;justify-content:center;align-items:center;background:var(--nmorph-badge-color);border-radius:var(--default-border-radius);opacity:1}.nmorph-badge.nmorph-badge--tag{position:static;display:inline-flex}.nmorph-badge .nmorph-badge__container--tag{position:static}.nmorph-badge .nmorph-badge__content{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;min-width:calc(1em * var(--line-height-regular) + 4px);padding:2px 4px;color:var(--nmorph-light-shade-color);font-size:var(--font-size-base);line-height:var(--line-height-regular);text-align:center}.nmorph-badge.nmorph-badge--tiny .nmorph-badge__content{font-size:var(--font-size-tiny)}.nmorph-badge.nmorph-badge--extra-small .nmorph-badge__content{font-size:var(--font-size-extra-small)}.nmorph-badge .nmorph-badge__container--hidden{opacity:0}.nmorph-badge .nmorph-badge__dot{width:var(--dot-size);height:var(--dot-size);border-radius:var(--border-radius-circular)}
|
|
1
|
+
.nmorph-badge{position:relative;display:inline-block;height:fit-content;--dot-size: 4px;--nmorph-badge-ribbon-height: 24px;--nmorph-badge-ribbon-corner-size: 62px;--nmorph-badge-ribbon-width: 116px;--nmorph-badge-ribbon-offset-x: 0px;--nmorph-badge-ribbon-offset-y: 0px}.nmorph-badge .nmorph-badge__container{position:absolute;display:inline-flex;justify-content:center;align-items:center;background:var(--nmorph-badge-color);border-radius:var(--default-border-radius);opacity:1}.nmorph-badge.nmorph-badge--tag{position:static;display:inline-flex}.nmorph-badge .nmorph-badge__container--tag{position:static}.nmorph-badge .nmorph-badge__content{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;min-width:calc(1em * var(--line-height-regular) + 4px);padding:2px 4px;color:var(--nmorph-light-shade-color);font-size:var(--font-size-base);line-height:var(--line-height-regular);text-align:center}.nmorph-badge.nmorph-badge--tiny .nmorph-badge__content{font-size:var(--font-size-tiny)}.nmorph-badge.nmorph-badge--extra-small .nmorph-badge__content{font-size:var(--font-size-extra-small)}.nmorph-badge .nmorph-badge__container--hidden{opacity:0}.nmorph-badge .nmorph-badge__ribbon-frame{position:absolute;inset:0;overflow:hidden;border-radius:var(--default-border-radius);pointer-events:none}.nmorph-badge .nmorph-badge__ribbon-corner{position:absolute;width:var(--nmorph-badge-ribbon-corner-size);height:var(--nmorph-badge-ribbon-corner-size)}.nmorph-badge .nmorph-badge__container--ribbon{top:50%;left:50%;width:var(--nmorph-badge-ribbon-width);height:var(--nmorph-badge-ribbon-height);border-radius:0;box-shadow:var(--nmorph-shadow-outset)}.nmorph-badge .nmorph-badge__container--ribbon .nmorph-badge__content{width:100%;min-width:0;padding:0 var(--indentation-03);overflow:hidden;font-weight:600;font-size:var(--font-size-extra-small);white-space:nowrap;text-overflow:ellipsis;transform:translateY(-1px)}.nmorph-badge .nmorph-badge__ribbon-corner--top-left{top:var(--nmorph-badge-ribbon-offset-y);left:var(--nmorph-badge-ribbon-offset-x)}.nmorph-badge .nmorph-badge__ribbon-corner--top-left .nmorph-badge__container--ribbon{transform:translate(-50%,-50%) rotate(-45deg)}.nmorph-badge .nmorph-badge__ribbon-corner--top-right{top:var(--nmorph-badge-ribbon-offset-y);right:var(--nmorph-badge-ribbon-offset-x)}.nmorph-badge .nmorph-badge__ribbon-corner--top-right .nmorph-badge__container--ribbon{transform:translate(-50%,-50%) rotate(45deg)}.nmorph-badge .nmorph-badge__ribbon-corner--bottom-left{bottom:var(--nmorph-badge-ribbon-offset-y);left:var(--nmorph-badge-ribbon-offset-x)}.nmorph-badge .nmorph-badge__ribbon-corner--bottom-left .nmorph-badge__container--ribbon{transform:translate(-50%,-50%) rotate(45deg)}.nmorph-badge .nmorph-badge__ribbon-corner--bottom-right{right:var(--nmorph-badge-ribbon-offset-x);bottom:var(--nmorph-badge-ribbon-offset-y)}.nmorph-badge .nmorph-badge__ribbon-corner--bottom-right .nmorph-badge__container--ribbon{transform:translate(-50%,-50%) rotate(-45deg)}.nmorph-badge .nmorph-badge__dot{width:var(--dot-size);height:var(--dot-size);border-radius:var(--border-radius-circular)}.nmorph-badge.nmorph-badge--tiny{--nmorph-badge-ribbon-height: 18px;--nmorph-badge-ribbon-corner-size: 50px;--nmorph-badge-ribbon-width: 92px}.nmorph-badge.nmorph-badge--extra-small{--nmorph-badge-ribbon-height: 20px;--nmorph-badge-ribbon-corner-size: 56px;--nmorph-badge-ribbon-width: 104px}
|
|
@@ -1,41 +1,86 @@
|
|
|
1
1
|
import './NmorphBadge.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as o, createElementBlock as a, normalizeStyle as
|
|
2
|
+
import y from "./NmorphBadge.vue2.js";
|
|
3
|
+
import { openBlock as o, createElementBlock as a, normalizeStyle as l, normalizeClass as i, renderSlot as s, createCommentVNode as d, createElementVNode as n, createTextVNode as t, toDisplayString as c, Fragment as m } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import f from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const _ = { class: "nmorph-badge__content" }, b = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "nmorph-badge__dot"
|
|
9
|
-
},
|
|
9
|
+
}, g = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "nmorph-badge__content"
|
|
12
12
|
};
|
|
13
|
-
function
|
|
13
|
+
function h(r, p, v, e, k, V) {
|
|
14
14
|
return !e.props.disabled && (!e.props.isTag || e.shouldShowBadge) ? (o(), a(
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
17
17
|
key: 0,
|
|
18
|
-
class:
|
|
19
|
-
style:
|
|
18
|
+
class: i(e.modifiers),
|
|
19
|
+
style: l(e.styles)
|
|
20
20
|
},
|
|
21
21
|
[
|
|
22
|
-
e.props.isTag ?
|
|
23
|
-
e.shouldShowBadge ? (o(), a(
|
|
22
|
+
e.props.isTag ? d("v-if", !0) : s(r.$slots, "default", { key: 0 }),
|
|
23
|
+
e.shouldShowBadge && e.isRibbon ? (o(), a(
|
|
24
24
|
"div",
|
|
25
25
|
{
|
|
26
26
|
key: 1,
|
|
27
|
+
class: "nmorph-badge__ribbon-frame",
|
|
28
|
+
style: l(e.ribbonFrameStyle)
|
|
29
|
+
},
|
|
30
|
+
[
|
|
31
|
+
n(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
class: i(e.ribbonCornerModifiers)
|
|
35
|
+
},
|
|
36
|
+
[
|
|
37
|
+
n(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
ref: "badge",
|
|
41
|
+
class: i(e.containerModifiers),
|
|
42
|
+
style: l(e.containerStyle)
|
|
43
|
+
},
|
|
44
|
+
[
|
|
45
|
+
n("div", _, [
|
|
46
|
+
s(r.$slots, "value", {
|
|
47
|
+
value: e.props.value,
|
|
48
|
+
displayValue: e.displayValue
|
|
49
|
+
}, () => [
|
|
50
|
+
t(
|
|
51
|
+
c(e.displayValue),
|
|
52
|
+
1
|
|
53
|
+
/* TEXT */
|
|
54
|
+
)
|
|
55
|
+
])
|
|
56
|
+
])
|
|
57
|
+
],
|
|
58
|
+
6
|
|
59
|
+
/* CLASS, STYLE */
|
|
60
|
+
)
|
|
61
|
+
],
|
|
62
|
+
2
|
|
63
|
+
/* CLASS */
|
|
64
|
+
)
|
|
65
|
+
],
|
|
66
|
+
4
|
|
67
|
+
/* STYLE */
|
|
68
|
+
)) : e.shouldShowBadge ? (o(), a(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
key: 2,
|
|
27
72
|
ref: "badge",
|
|
28
|
-
class:
|
|
29
|
-
style:
|
|
73
|
+
class: i(e.containerModifiers),
|
|
74
|
+
style: l(e.containerStyle)
|
|
30
75
|
},
|
|
31
76
|
[
|
|
32
|
-
e.
|
|
77
|
+
e.isDotType ? (o(), a("div", b)) : (o(), a("div", g, [
|
|
33
78
|
e.props.isTag ? (o(), a(
|
|
34
|
-
|
|
79
|
+
m,
|
|
35
80
|
{ key: 0 },
|
|
36
81
|
[
|
|
37
82
|
t(
|
|
38
|
-
|
|
83
|
+
c(e.displayValue),
|
|
39
84
|
1
|
|
40
85
|
/* TEXT */
|
|
41
86
|
)
|
|
@@ -48,7 +93,7 @@ function _(r, g, h, e, k, v) {
|
|
|
48
93
|
displayValue: e.displayValue
|
|
49
94
|
}, () => [
|
|
50
95
|
t(
|
|
51
|
-
|
|
96
|
+
c(e.displayValue),
|
|
52
97
|
1
|
|
53
98
|
/* TEXT */
|
|
54
99
|
)
|
|
@@ -57,13 +102,13 @@ function _(r, g, h, e, k, v) {
|
|
|
57
102
|
],
|
|
58
103
|
6
|
|
59
104
|
/* CLASS, STYLE */
|
|
60
|
-
)) :
|
|
105
|
+
)) : d("v-if", !0)
|
|
61
106
|
],
|
|
62
107
|
6
|
|
63
108
|
/* CLASS, STYLE */
|
|
64
|
-
)) : e.props.isTag ?
|
|
109
|
+
)) : e.props.isTag ? d("v-if", !0) : s(r.$slots, "default", { key: 1 });
|
|
65
110
|
}
|
|
66
|
-
const
|
|
111
|
+
const w = /* @__PURE__ */ f(y, [["render", h], ["__file", "/builds/ketjo/nmorph/library/src/components/data/nmorph-badge/NmorphBadge.vue"]]);
|
|
67
112
|
export {
|
|
68
|
-
|
|
113
|
+
w as default
|
|
69
114
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import './NmorphBadge.css';
|
|
2
|
-
import { defineComponent as
|
|
2
|
+
import { defineComponent as T, computed as r, ref as l, onMounted as N, watch as C, nextTick as B } from "vue";
|
|
3
3
|
import { useModifiers as f } from "../../../utils/create-modifiers.js";
|
|
4
|
-
const
|
|
4
|
+
const H = /* @__PURE__ */ T({
|
|
5
5
|
__name: "NmorphBadge",
|
|
6
6
|
props: {
|
|
7
7
|
value: { type: [Number, String], required: !1, default: void 0 },
|
|
8
8
|
max: { type: Number, required: !1, default: 99 },
|
|
9
|
+
type: { type: String, required: !1, default: "default" },
|
|
10
|
+
ribbonCorner: { type: String, required: !1, default: "top-right" },
|
|
9
11
|
isDot: { type: Boolean, required: !1, default: !1 },
|
|
10
12
|
isTag: { type: Boolean, required: !1, default: !1 },
|
|
11
13
|
hidden: { type: Boolean, required: !1, default: !1 },
|
|
@@ -17,39 +19,56 @@ const B = /* @__PURE__ */ z({
|
|
|
17
19
|
disabled: { type: Boolean, required: !1, default: !1 },
|
|
18
20
|
dotSize: { type: [Number, String], required: !1, default: void 0 }
|
|
19
21
|
},
|
|
20
|
-
setup(
|
|
21
|
-
|
|
22
|
-
const e =
|
|
22
|
+
setup(v, { expose: m }) {
|
|
23
|
+
m();
|
|
24
|
+
const e = v, o = r(() => e.isDot ? "dot" : e.type), b = r(() => o.value === "dot"), t = r(() => o.value === "ribbon" && !e.isTag), g = r(
|
|
23
25
|
() => f({
|
|
24
|
-
"nmorph-badge": [
|
|
26
|
+
"nmorph-badge": [
|
|
27
|
+
`${e.hidden && "hidden"}`,
|
|
28
|
+
`${e.isTag && "tag"}`,
|
|
29
|
+
`${t.value && "ribbon"}`,
|
|
30
|
+
`${t.value && `ribbon-${e.ribbonCorner}`}`,
|
|
31
|
+
e.size
|
|
32
|
+
]
|
|
25
33
|
})
|
|
26
|
-
),
|
|
34
|
+
), y = r(
|
|
27
35
|
() => f({
|
|
28
|
-
"nmorph-badge__container": [
|
|
36
|
+
"nmorph-badge__container": [
|
|
37
|
+
`${e.hidden && "hidden"}`,
|
|
38
|
+
`${e.isTag && "tag"}`,
|
|
39
|
+
`${t.value && "ribbon"}`,
|
|
40
|
+
`${t.value && `ribbon-${e.ribbonCorner}`}`
|
|
41
|
+
]
|
|
29
42
|
})
|
|
30
|
-
),
|
|
31
|
-
|
|
43
|
+
), x = r(
|
|
44
|
+
() => f({
|
|
45
|
+
"nmorph-badge__ribbon-corner": [`${e.ribbonCorner}`]
|
|
46
|
+
})
|
|
47
|
+
), h = r(() => typeof Number(e.value) == "number" && Number(e.value) > e.max ? `${e.max}+` : e.value), z = r(() => b.value || e.value !== void 0), i = r(() => {
|
|
48
|
+
const a = `${(s?.value / 2 + e.offsetX) * -1}px`, _ = `${(d?.value / 2 + e.offsetY) * -1}px`;
|
|
32
49
|
return {
|
|
33
50
|
x: a,
|
|
34
|
-
y:
|
|
51
|
+
y: _
|
|
35
52
|
};
|
|
36
|
-
}),
|
|
53
|
+
}), S = r(() => e.isTag || t.value ? {
|
|
37
54
|
zIndex: e.zIndex
|
|
38
55
|
} : {
|
|
39
|
-
right:
|
|
40
|
-
top:
|
|
56
|
+
right: i.value.x,
|
|
57
|
+
top: i.value.y,
|
|
41
58
|
zIndex: e.zIndex
|
|
42
|
-
}),
|
|
59
|
+
}), p = (a) => typeof a == "number" ? `${a}px` : a, n = l(null), s = l(0), d = l(0), $ = r(() => ({
|
|
43
60
|
"--nmorph-badge-color": e.color,
|
|
44
|
-
...e.dotSize !== void 0 && { "--dot-size":
|
|
45
|
-
})),
|
|
46
|
-
await
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
...e.dotSize !== void 0 && { "--dot-size": p(e.dotSize) }
|
|
62
|
+
})), u = async () => {
|
|
63
|
+
await B(), !(!n.value || e.isTag || t.value) && (s.value = n.value.clientWidth, d.value = n.value.clientHeight);
|
|
64
|
+
}, q = r(() => ({
|
|
65
|
+
zIndex: e.zIndex
|
|
66
|
+
}));
|
|
67
|
+
N(u), C(() => [e.value, e.max, o.value, e.ribbonCorner, e.isTag, e.size], u);
|
|
68
|
+
const c = { props: e, resolvedType: o, isDotType: b, isRibbon: t, modifiers: g, containerModifiers: y, ribbonCornerModifiers: x, displayValue: h, shouldShowBadge: z, appliedOffset: i, containerStyle: S, getCssSize: p, badge: n, badgeWidth: s, badgeHeight: d, styles: $, updateBadgeSize: u, ribbonFrameStyle: q };
|
|
69
|
+
return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
|
|
51
70
|
}
|
|
52
71
|
});
|
|
53
72
|
export {
|
|
54
|
-
|
|
73
|
+
H as default
|
|
55
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-image-preview{--width: 50px;--height: 50px;width:var(--width);height:var(--height);overflow:hidden}.nmorph-image-preview .nmorph-image-preview__trigger{position:relative;width:100%;height:100%;cursor:pointer}.nmorph-image-preview .nmorph-image-preview__trigger:hover{filter:brightness(.8)}.nmorph-image-preview .nmorph-image-preview__trigger .nmorph-image{width:100%;height:100%}.nmorph-image-preview__portal{display:contents}.nmorph-image-preview__portal .nmorph-image-preview__content{position:absolute;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:
|
|
1
|
+
.nmorph-image-preview{--width: 50px;--height: 50px;width:var(--width);height:var(--height);overflow:hidden}.nmorph-image-preview .nmorph-image-preview__trigger{position:relative;width:100%;height:100%;cursor:pointer}.nmorph-image-preview .nmorph-image-preview__trigger:hover{filter:brightness(.8)}.nmorph-image-preview .nmorph-image-preview__trigger .nmorph-image{width:100%;height:100%}.nmorph-image-preview__portal{display:contents}.nmorph-image-preview__portal .nmorph-image-preview__content{--nmorph-image-preview-content-width: min( calc(100vw - 96px) , 960px);--nmorph-image-preview-content-height: min( calc(100vh - 180px) , 720px);position:absolute;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:var(--nmorph-image-preview-content-width);height:var(--nmorph-image-preview-content-height);transform:translate(-50%,-50%);transition:var(--transition-04) opacity ease-in-out;pointer-events:none}.nmorph-image-preview__portal .nmorph-image-preview__content .nmorph-image{width:100%;height:100%;pointer-events:none}.nmorph-image-preview__portal .nmorph-image-preview__content .nmorph-image img{display:block;width:auto;max-width:100%;height:auto;max-height:100%;object-fit:contain;pointer-events:auto}.nmorph-image-preview__portal .nmorph-image-preview__actions{position:absolute;bottom:-50px;left:50%;z-index:2;display:flex;height:0;transform:translate(-50%);transition:ease-in-out bottom var(--transition-03)}.nmorph-image-preview__portal .nmorph-image-preview__action-element{margin-right:var(--indentation-03)}.nmorph-image-preview__portal .nmorph-button__content{box-shadow:none}.nmorph-image-preview__portal .nmorph-image-preview__left,.nmorph-image-preview__portal .nmorph-image-preview__right{z-index:2}.nmorph-image-preview__portal .nmorph-image-preview__left{position:absolute;top:50%;left:-100%;transform:rotate(90deg) translate(-50%);transition:ease-in-out left var(--transition-03)}.nmorph-image-preview__portal .nmorph-image-preview__right{position:absolute;top:50%;right:-100%;transform:rotate(270deg) translate(50%);transition:ease-in-out right var(--transition-03)}.nmorph-image-preview__portal.nmorph-image-preview--opened .nmorph-image-preview__actions{bottom:50px}.nmorph-image-preview__portal.nmorph-image-preview--opened{--nmorph-image-preview-btn-margin: 20px}.nmorph-image-preview__portal.nmorph-image-preview--opened .nmorph-image-preview__left{left:var(--nmorph-image-preview-btn-margin)}.nmorph-image-preview__portal.nmorph-image-preview--opened .nmorph-image-preview__right{right:var(--nmorph-image-preview-btn-margin)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-dialog{position:absolute;top:50%;left:50%;width:var(--width);padding:var(--indentation-04);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);transform:translate(-50%,-50%)}.nmorph-dialog .nmorph-dialog__header{display:flex;justify-content:space-between;align-items:center;font-weight:600;font-size:var(--font-size-large);line-height:var(--line-height-loose)}.nmorph-dialog .nmorph-dialog__close-icon{cursor:pointer}.nmorph-dialog
|
|
1
|
+
.nmorph-dialog{position:absolute;top:50%;left:50%;display:flex;flex-direction:column;box-sizing:border-box;width:var(--width);max-width:var(--nmorph-dialog-max-width, calc(100vw - 32px) );max-height:var(--nmorph-dialog-max-height, var(--nmorph-dialog-default-max-height));padding:var(--indentation-04);background:var(--nmorph-main-color);border-radius:var(--default-border-radius);transform:translate(-50%,-50%);--width: var(--nmorph-dialog-width);--nmorph-dialog-default-max-height: calc(100vh - 32px) }@supports (height: 100dvh){.nmorph-dialog{--nmorph-dialog-default-max-height: calc(100dvh - 32px) }}.nmorph-dialog .nmorph-dialog__header{display:flex;flex:0 0 auto;justify-content:space-between;align-items:center;font-weight:600;font-size:var(--font-size-large);line-height:var(--line-height-loose)}.nmorph-dialog .nmorph-dialog__close-icon{flex:0 0 auto;cursor:pointer}.nmorph-dialog .nmorph-dialog__content{min-height:0;overflow-y:auto}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import './NmorphDialog.css';
|
|
2
2
|
import s from "./NmorphDialog.vue2.js";
|
|
3
|
-
import { openBlock as
|
|
3
|
+
import { openBlock as r, createBlock as c, withCtx as a, createElementVNode as e, normalizeStyle as d, normalizeClass as t, renderSlot as i, toDisplayString as m, createElementBlock as _, createVNode as n, createCommentVNode as p } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import h from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
6
|
const f = ["aria-label"], g = { class: "nmorph-dialog__header" }, v = { class: "nmorph-dialog__title" }, k = { class: "nmorph-dialog__content" };
|
|
7
|
-
function y(
|
|
8
|
-
return
|
|
7
|
+
function y(l, N, C, o, O, b) {
|
|
8
|
+
return r(), c(o.NmorphOverlay, {
|
|
9
9
|
show: o.isVisible,
|
|
10
10
|
"z-index": o.props.zIndex,
|
|
11
11
|
"close-on-escape": o.props.closeOnEscape,
|
|
@@ -13,16 +13,16 @@ function y(r, N, w, o, C, O) {
|
|
|
13
13
|
onOnOutsideClick: o.clickOnOverlay,
|
|
14
14
|
onOnEscapeKeydown: o.closeHandler
|
|
15
15
|
}, {
|
|
16
|
-
default:
|
|
16
|
+
default: a(() => [
|
|
17
17
|
e("div", {
|
|
18
18
|
class: t(o.modifiers),
|
|
19
|
-
style: d(
|
|
19
|
+
style: d(o.dialogStyle),
|
|
20
20
|
role: "dialog",
|
|
21
21
|
"aria-modal": "true",
|
|
22
22
|
"aria-label": o.props.title || void 0
|
|
23
23
|
}, [
|
|
24
24
|
e("div", g, [
|
|
25
|
-
|
|
25
|
+
i(l.$slots, "header", {}, () => [
|
|
26
26
|
e(
|
|
27
27
|
"div",
|
|
28
28
|
v,
|
|
@@ -30,23 +30,23 @@ function y(r, N, w, o, C, O) {
|
|
|
30
30
|
1
|
|
31
31
|
/* TEXT */
|
|
32
32
|
),
|
|
33
|
-
o.props.showClose ? (
|
|
33
|
+
o.props.showClose ? (r(), _("div", {
|
|
34
34
|
key: 0,
|
|
35
35
|
class: "nmorph-dialog__close-icon",
|
|
36
36
|
onClick: o.closeHandler
|
|
37
37
|
}, [
|
|
38
38
|
n(o.NmorphIcon, null, {
|
|
39
|
-
default:
|
|
39
|
+
default: a(() => [
|
|
40
40
|
n(o.NmorphIconCross)
|
|
41
41
|
]),
|
|
42
42
|
_: 1
|
|
43
43
|
/* STABLE */
|
|
44
44
|
})
|
|
45
|
-
])) :
|
|
45
|
+
])) : p("v-if", !0)
|
|
46
46
|
])
|
|
47
47
|
]),
|
|
48
48
|
e("div", k, [
|
|
49
|
-
|
|
49
|
+
i(l.$slots, "default")
|
|
50
50
|
])
|
|
51
51
|
], 14, f)
|
|
52
52
|
]),
|
|
@@ -54,7 +54,7 @@ function y(r, N, w, o, C, O) {
|
|
|
54
54
|
/* FORWARDED */
|
|
55
55
|
}, 8, ["show", "z-index", "close-on-escape"]);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
57
|
+
const S = /* @__PURE__ */ h(s, [["render", y], ["__file", "/builds/ketjo/nmorph/library/src/components/feedback/nmorph-dialog/NmorphDialog.vue"]]);
|
|
58
58
|
export {
|
|
59
|
-
|
|
59
|
+
S as default
|
|
60
60
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import './NmorphDialog.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
2
|
+
import { defineComponent as c, computed as s, ref as y, watch as h } from "vue";
|
|
3
|
+
import { useModifiers as g } from "../../../utils/create-modifiers.js";
|
|
4
4
|
import v from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const C = /* @__PURE__ */
|
|
5
|
+
import O from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
|
|
6
|
+
import T from "../../../assets/icons/cross.svg.js";
|
|
7
|
+
const C = /* @__PURE__ */ c({
|
|
8
8
|
__name: "NmorphDialog",
|
|
9
9
|
props: {
|
|
10
10
|
modelValue: { type: Boolean, required: !1, default: !1 },
|
|
11
11
|
title: { type: String, required: !1, default: "" },
|
|
12
12
|
width: { type: String, required: !1, default: "330px" },
|
|
13
|
+
maxHeight: { type: String, required: !1, default: void 0 },
|
|
13
14
|
openDelay: { type: Number, required: !1, default: 0 },
|
|
14
15
|
closeDelay: { type: Number, required: !1, default: 0 },
|
|
15
16
|
closeOnClickModal: { type: Boolean, required: !1, default: !0 },
|
|
@@ -19,49 +20,52 @@ const C = /* @__PURE__ */ f({
|
|
|
19
20
|
closeOnEscape: { type: Boolean, required: !1, default: !0 }
|
|
20
21
|
},
|
|
21
22
|
emits: ["on-close", "update:model-value"],
|
|
22
|
-
setup(
|
|
23
|
-
|
|
24
|
-
const e =
|
|
25
|
-
() =>
|
|
23
|
+
setup(n, { expose: m, emit: d }) {
|
|
24
|
+
m();
|
|
25
|
+
const e = n, r = d, p = s(
|
|
26
|
+
() => g({
|
|
26
27
|
"nmorph-dialog": []
|
|
27
28
|
})
|
|
28
|
-
),
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
), f = s(() => ({
|
|
30
|
+
"--nmorph-dialog-width": e.width,
|
|
31
|
+
...e.maxHeight && { "--nmorph-dialog-max-height": e.maxHeight }
|
|
32
|
+
})), a = y(e.modelValue);
|
|
33
|
+
let o = null, l = null;
|
|
34
|
+
h(
|
|
31
35
|
() => e.modelValue,
|
|
32
|
-
(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}, e.openDelay)) : (
|
|
36
|
-
|
|
36
|
+
(t) => {
|
|
37
|
+
t ? (l && clearTimeout(l), o = setTimeout(() => {
|
|
38
|
+
a.value = !0;
|
|
39
|
+
}, e.openDelay)) : (o && clearTimeout(o), l = setTimeout(() => {
|
|
40
|
+
a.value = !1;
|
|
37
41
|
}, e.closeDelay));
|
|
38
42
|
},
|
|
39
43
|
{ immediate: !0 }
|
|
40
44
|
);
|
|
41
|
-
const
|
|
42
|
-
r("on-close"),
|
|
43
|
-
const
|
|
45
|
+
const i = () => {
|
|
46
|
+
r("on-close"), o && clearTimeout(o);
|
|
47
|
+
const t = () => {
|
|
44
48
|
r("update:model-value", !1);
|
|
45
49
|
};
|
|
46
|
-
e.closeDelay <= 0 ?
|
|
47
|
-
},
|
|
48
|
-
return
|
|
49
|
-
}, set openTimeout(
|
|
50
|
-
|
|
50
|
+
e.closeDelay <= 0 ? t() : l = setTimeout(t, e.closeDelay);
|
|
51
|
+
}, u = { props: e, emit: r, modifiers: p, dialogStyle: f, isVisible: a, get openTimeout() {
|
|
52
|
+
return o;
|
|
53
|
+
}, set openTimeout(t) {
|
|
54
|
+
o = t;
|
|
51
55
|
}, get closeTimeout() {
|
|
52
56
|
return l;
|
|
53
|
-
}, set closeTimeout(
|
|
54
|
-
l =
|
|
55
|
-
}, closeHandler:
|
|
56
|
-
e.closeOnOverlay &&
|
|
57
|
+
}, set closeTimeout(t) {
|
|
58
|
+
l = t;
|
|
59
|
+
}, closeHandler: i, clickOnOverlay: () => {
|
|
60
|
+
e.closeOnOverlay && i();
|
|
57
61
|
}, get NmorphOverlay() {
|
|
58
|
-
return
|
|
62
|
+
return O;
|
|
59
63
|
}, get NmorphIcon() {
|
|
60
64
|
return v;
|
|
61
65
|
}, get NmorphIconCross() {
|
|
62
|
-
return
|
|
66
|
+
return T;
|
|
63
67
|
} };
|
|
64
|
-
return Object.defineProperty(
|
|
68
|
+
return Object.defineProperty(u, "__isScriptSetup", { enumerable: !1, value: !0 }), u;
|
|
65
69
|
}
|
|
66
70
|
});
|
|
67
71
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-autocomplete .nmorph-
|
|
1
|
+
.nmorph-autocomplete .nmorph-autocomplete__input-content{position:relative}.nmorph-autocomplete.nmorph-autocomplete--open .nmorph-autocomplete__input-content{z-index:var(--nmorph-autocomplete-input-z-index)}.nmorph-autocomplete__list{padding:var(--indentation-01) 0}.nmorph-autocomplete__list-item{box-sizing:border-box;padding:var(--indentation-00) var(--default-indentation-input);cursor:pointer}.nmorph-autocomplete__loading{display:flex;justify-content:center;align-items:center;height:100px}.nmorph-autocomplete__list-item:hover,.nmorph-autocomplete__list-item--focused{color:var(--nmorph-white-color);background:var(--nmorph-accent-color)}.nmorph-autocomplete__list--virtual{overflow-y:auto}.nmorph-autocomplete__list--virtual .nmorph-autocomplete__list-item{height:var(--autocomplete-virtual-item-height);overflow:hidden}.nmorph-autocomplete__list--dynamic .nmorph-autocomplete__list-item{height:auto}.nmorph-autocomplete__virtual-spacer{position:relative}.nmorph-autocomplete__virtual-content{position:absolute;top:0;right:0;left:0}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './NmorphAutocomplete.css';
|
|
2
2
|
import v from "./NmorphAutocomplete.vue2.js";
|
|
3
|
-
import { openBlock as l, createElementBlock as t, normalizeClass as
|
|
3
|
+
import { openBlock as l, createElementBlock as t, normalizeStyle as n, normalizeClass as a, createElementVNode as i, createVNode as c, createBlock as y, withCtx as p, renderSlot as m, Fragment as _, renderList as h, createTextVNode as f, toDisplayString as u, createCommentVNode as x } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import k from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
6
|
const b = { class: "nmorph-autocomplete__input-content" }, g = {
|
|
@@ -10,19 +10,20 @@ const b = { class: "nmorph-autocomplete__input-content" }, g = {
|
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "nmorph-autocomplete__loading"
|
|
12
12
|
}, N = ["id"], C = ["id", "aria-selected", "onClick"], I = ["id"], O = ["id", "aria-selected", "onClick"];
|
|
13
|
-
function V(
|
|
13
|
+
function V(d, s, w, e, S, A) {
|
|
14
14
|
return l(), t(
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
17
|
-
class:
|
|
17
|
+
class: a(e.modifiers),
|
|
18
|
+
style: n(e.styles)
|
|
18
19
|
},
|
|
19
20
|
[
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
i("div", b, [
|
|
22
|
+
i(
|
|
22
23
|
"div",
|
|
23
24
|
g,
|
|
24
25
|
[
|
|
25
|
-
|
|
26
|
+
c(e.NmorphTextInput, {
|
|
26
27
|
id: e.props.id,
|
|
27
28
|
name: e.props.name,
|
|
28
29
|
autocomplete: e.props.autocomplete,
|
|
@@ -46,17 +47,19 @@ function V(a, s, S, e, z, A) {
|
|
|
46
47
|
open: e.open,
|
|
47
48
|
"relative-element": e.nmorphAutocompleteDOMRef,
|
|
48
49
|
"y-offset": 1,
|
|
49
|
-
"z-index": e.
|
|
50
|
+
"z-index": e.dropdownZIndex,
|
|
51
|
+
"restore-focus": !1,
|
|
52
|
+
"content-class": "nmorph-autocomplete__dropdown",
|
|
50
53
|
"aria-label": e.props.name || e.props.id || "autocomplete",
|
|
51
54
|
onOnOutsideClick: e.closeHandler,
|
|
52
55
|
onOnEscapeKeydown: e.closeHandler
|
|
53
56
|
}, {
|
|
54
57
|
default: p(() => [
|
|
55
58
|
e.loader ? (l(), t("div", H, [
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
m(d.$slots, "loader", {}, () => [
|
|
60
|
+
c(e.NmorphIcon, { size: "large" }, {
|
|
58
61
|
default: p(() => [
|
|
59
|
-
|
|
62
|
+
c(e.NmorphIconLoader)
|
|
60
63
|
]),
|
|
61
64
|
_: 1
|
|
62
65
|
/* STABLE */
|
|
@@ -66,23 +69,23 @@ function V(a, s, S, e, z, A) {
|
|
|
66
69
|
key: 1,
|
|
67
70
|
id: e.listboxId,
|
|
68
71
|
ref: e.virtualList.containerRef,
|
|
69
|
-
class:
|
|
70
|
-
style:
|
|
72
|
+
class: a(["nmorph-autocomplete__list nmorph-autocomplete__list--virtual", { "nmorph-autocomplete__list--dynamic": e.virtualDynamicHeight }]),
|
|
73
|
+
style: n({ "--autocomplete-virtual-item-height": `${e.virtualItemHeight}px`, maxHeight: e.virtualMaxHeight }),
|
|
71
74
|
role: "listbox",
|
|
72
75
|
onScroll: s[0] || (s[0] = (...o) => e.virtualList.scrollHandler && e.virtualList.scrollHandler(...o))
|
|
73
76
|
}, [
|
|
74
|
-
|
|
77
|
+
i(
|
|
75
78
|
"div",
|
|
76
79
|
{
|
|
77
80
|
class: "nmorph-autocomplete__virtual-spacer",
|
|
78
|
-
style:
|
|
81
|
+
style: n(e.virtualSpacerStyle)
|
|
79
82
|
},
|
|
80
83
|
[
|
|
81
|
-
|
|
84
|
+
i(
|
|
82
85
|
"div",
|
|
83
86
|
{
|
|
84
87
|
class: "nmorph-autocomplete__virtual-content",
|
|
85
|
-
style:
|
|
88
|
+
style: n(e.virtualContentStyle)
|
|
86
89
|
},
|
|
87
90
|
[
|
|
88
91
|
(l(!0), t(
|
|
@@ -93,12 +96,12 @@ function V(a, s, S, e, z, A) {
|
|
|
93
96
|
ref_for: !0,
|
|
94
97
|
ref: (r) => e.setVirtualItemRef(r, o.index),
|
|
95
98
|
key: o.index,
|
|
96
|
-
class:
|
|
99
|
+
class: a(["nmorph-autocomplete__list-item", { "nmorph-autocomplete__list-item--focused": o.index === e.currentIndex }]),
|
|
97
100
|
role: "option",
|
|
98
101
|
"aria-selected": o.index === e.currentIndex,
|
|
99
102
|
onClick: () => e.clickHandler(o.item)
|
|
100
103
|
}, [
|
|
101
|
-
|
|
104
|
+
m(d.$slots, "default", {
|
|
102
105
|
scope: o.item
|
|
103
106
|
}, () => [
|
|
104
107
|
f(
|
|
@@ -131,12 +134,12 @@ function V(a, s, S, e, z, A) {
|
|
|
131
134
|
h(e.filteredList, (o, r) => (l(), t("div", {
|
|
132
135
|
id: e.getOptionId(r),
|
|
133
136
|
key: r,
|
|
134
|
-
class:
|
|
137
|
+
class: a(["nmorph-autocomplete__list-item", { "nmorph-autocomplete__list-item--focused": r === e.currentIndex }]),
|
|
135
138
|
role: "option",
|
|
136
139
|
"aria-selected": r === e.currentIndex,
|
|
137
140
|
onClick: () => e.clickHandler(o)
|
|
138
141
|
}, [
|
|
139
|
-
|
|
142
|
+
m(d.$slots, "default", { scope: o }, () => [
|
|
140
143
|
f(
|
|
141
144
|
u(o.value),
|
|
142
145
|
1
|
|
@@ -153,8 +156,8 @@ function V(a, s, S, e, z, A) {
|
|
|
153
156
|
/* FORWARDED */
|
|
154
157
|
}, 8, ["open", "relative-element", "z-index", "aria-label"])) : x("v-if", !0)
|
|
155
158
|
],
|
|
156
|
-
|
|
157
|
-
/* CLASS */
|
|
159
|
+
6
|
|
160
|
+
/* CLASS, STYLE */
|
|
158
161
|
);
|
|
159
162
|
}
|
|
160
163
|
const M = /* @__PURE__ */ k(v, [["render", V], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue"]]);
|