@nmorph/nmorph-ui-kit 3.0.6 → 3.0.7
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/hand.svg.js +2 -2
- package/dist/components/data/nmorph-calendar/NmorphCalendar.vue.js +34 -36
- package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +80 -78
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +60 -60
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +118 -94
- package/dist/components/data/nmorph-media-tile/NmorphMediaTile.vue2.js +49 -39
- package/dist/components/data/nmorph-pagination/NmorphPagination.css +1 -1
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue.js +5 -5
- package/dist/components/data/nmorph-pagination/NmorphPagination.vue2.js +80 -56
- package/dist/components/data/nmorph-table/NmorphTable.css +1 -1
- package/dist/components/data/nmorph-table/NmorphTable.vue.js +6 -6
- package/dist/components/data/nmorph-table/NmorphTable.vue2.js +41 -38
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue.js +8 -8
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +64 -24
- package/dist/index.umd.js +22 -22
- package/dist/package.json.js +1 -1
- package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +3 -0
- package/dist/src/components/data/nmorph-pagination/types.d.ts +3 -0
- package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +2 -20
- package/dist/src/components/data/nmorph-table/types.d.ts +11 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-table{--nmorph-private-table-border-color: var(--nmorph-info-text-color);--nmorph-private-table-cell-height: auto;--nmorph-private-table-row-hover-background: var(--nmorph-info-color)}.nmorph-table .nmorph-table__header th{border-bottom:0}.nmorph-table .nmorph-table__button-wrapper{display:flex;align-items:center;margin-left:var(--indentation-03)}.nmorph-table table{width:calc(100% - 2px);margin-left:1px;border-collapse:collapse;border-spacing:0}.nmorph-table .nmorph-table__table-data{padding:var(--indentation-03) 0;border-bottom:1px solid var(--nmorph-private-table-border-color)}.nmorph-table .nmorph-table__table-data--bordered{border:1px solid var(--nmorph-private-table-border-color)}.nmorph-table .nmorph-table__cell{padding:0 var(--indentation-03)}.nmorph-table .nmorph-table__cell-content{display:flex;align-items:center}.nmorph-table .nmorph-table__cell--data{height:var(--nmorph-private-table-cell-height)}.nmorph-table .nmorph-table__body{position:relative}.nmorph-table .nmorph-table__body--virtual{overflow-x:hidden}.nmorph-table .nmorph-table__body--virtual .nmorph-table__table-data{height:var(--nmorph-private-table-virtual-row-height);padding-top:0;padding-bottom:0}.nmorph-table .nmorph-table__body--virtual.nmorph-table__body--dynamic .nmorph-table__table-data{height:auto}.nmorph-table .nmorph-table__virtual-spacer{position:relative;min-width:100%}.nmorph-table .nmorph-table__virtual-content{position:absolute;top:0;right:0;left:0}.nmorph-table .nmorph-table__table-data-row--row-hover:hover,.nmorph-table .nmorph-table__table-data-row--active{background:var(--nmorph-private-table-row-hover-background)}.nmorph-table--nmorph{overflow:hidden;background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-outset);--nmorph-private-table-border-color: transparent}.nmorph-table--nmorph .nmorph-table__button-wrapper{padding:var(--indentation-02)}.nmorph-table--nmorph .nmorph-table__table-row{background:var(--nmorph-main-color);box-shadow:var(--nmorph-shadow-inset)}.nmorph-table--plain{overflow:hidden;background:var(--nmorph-main-color);border:var(--nmorph-plain-border);border-radius:var(--default-border-radius)}
|
|
1
|
+
.nmorph-table{--nmorph-private-table-border-color: var(--nmorph-info-text-color);--nmorph-private-table-cell-height: auto;--nmorph-private-table-row-hover-background: var(--nmorph-info-color)}.nmorph-table .nmorph-table__header th{border-bottom:0}.nmorph-table .nmorph-table__button-wrapper{display:flex;align-items:center;margin-left:var(--indentation-03)}.nmorph-table table{width:calc(100% - 2px);margin-left:1px;table-layout:fixed;border-collapse:collapse;border-spacing:0}.nmorph-table .nmorph-table__table-data{padding:var(--indentation-03) 0;border-bottom:1px solid var(--nmorph-private-table-border-color)}.nmorph-table .nmorph-table__table-data--bordered{border:1px solid var(--nmorph-private-table-border-color)}.nmorph-table .nmorph-table__cell{padding:0 var(--indentation-03)}.nmorph-table .nmorph-table__cell-content{display:flex;align-items:center}.nmorph-table .nmorph-table__cell--data{height:var(--nmorph-private-table-cell-height)}.nmorph-table .nmorph-table__body{position:relative}.nmorph-table .nmorph-table__body--virtual{overflow-x:hidden}.nmorph-table .nmorph-table__body--virtual .nmorph-table__table-data{height:var(--nmorph-private-table-virtual-row-height);padding-top:0;padding-bottom:0}.nmorph-table .nmorph-table__body--virtual.nmorph-table__body--dynamic .nmorph-table__table-data{height:auto}.nmorph-table .nmorph-table__virtual-spacer{position:relative;min-width:100%}.nmorph-table .nmorph-table__virtual-content{position:absolute;top:0;right:0;left:0}.nmorph-table .nmorph-table__table-data-row--row-hover:hover,.nmorph-table .nmorph-table__table-data-row--active{background:var(--nmorph-private-table-row-hover-background)}.nmorph-table--nmorph{overflow:hidden;background:var(--nmorph-main-color);border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-outset);--nmorph-private-table-border-color: transparent}.nmorph-table--nmorph .nmorph-table__button-wrapper{padding:var(--indentation-02)}.nmorph-table--nmorph .nmorph-table__table-row{background:var(--nmorph-main-color);box-shadow:var(--nmorph-shadow-inset)}.nmorph-table--plain{overflow:hidden;background:var(--nmorph-main-color);border:var(--nmorph-plain-border);border-radius:var(--default-border-radius)}.nmorph-table--plain.nmorph-table--bordered{border:1px solid var(--nmorph-private-table-border-color)}.nmorph-table--plain.nmorph-table--bordered table{width:100%;margin-left:0}.nmorph-table--plain.nmorph-table--bordered .nmorph-table__table-data--bordered{border:0;border-right:1px solid var(--nmorph-private-table-border-color);border-bottom:1px solid var(--nmorph-private-table-border-color)}.nmorph-table--plain.nmorph-table--bordered .nmorph-table__table-data--bordered:last-child{border-right:0}.nmorph-table--plain.nmorph-table--bordered .nmorph-table__body:not(.nmorph-table__body--virtual) .nmorph-table__table-data-row:last-child .nmorph-table__table-data--bordered{border-bottom:0}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './NmorphTable.css';
|
|
2
2
|
import h from "./NmorphTable.vue2.js";
|
|
3
|
-
import { openBlock as r, createElementBlock as t, normalizeStyle as n, normalizeClass as _, createElementVNode as o, renderSlot as
|
|
3
|
+
import { openBlock as r, createElementBlock as t, normalizeStyle as n, normalizeClass as _, createElementVNode as o, renderSlot as m, Fragment as d, renderList as i, toDisplayString as s, createBlock as p, createCommentVNode as y } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import v from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
6
|
const w = { class: "nmorph-table__wrapper" }, f = {
|
|
@@ -20,7 +20,7 @@ function H(c, N, W, e, C, I) {
|
|
|
20
20
|
[
|
|
21
21
|
o("div", w, [
|
|
22
22
|
o("div", f, [
|
|
23
|
-
|
|
23
|
+
m(c.$slots, "default")
|
|
24
24
|
]),
|
|
25
25
|
o("table", k, [
|
|
26
26
|
o("colgroup", null, [
|
|
@@ -45,7 +45,7 @@ function H(c, N, W, e, C, I) {
|
|
|
45
45
|
"th",
|
|
46
46
|
{
|
|
47
47
|
key: b,
|
|
48
|
-
class: _(["nmorph-table__table-data", { "nmorph-table__table-data--bordered": e.
|
|
48
|
+
class: _(["nmorph-table__table-data", { "nmorph-table__table-data--bordered": e.bordered }])
|
|
49
49
|
},
|
|
50
50
|
[
|
|
51
51
|
o("div", x, [
|
|
@@ -63,7 +63,7 @@ function H(c, N, W, e, C, I) {
|
|
|
63
63
|
1
|
|
64
64
|
/* TEXT */
|
|
65
65
|
),
|
|
66
|
-
e.sortData && e.sortData[l.prop] ? (r(),
|
|
66
|
+
e.sortData && e.sortData[l.prop] ? (r(), p(e.NmorphSortButton, {
|
|
67
67
|
key: 0,
|
|
68
68
|
class: "nmorph-table__button-wrapper",
|
|
69
69
|
value: e.sortData[l.prop],
|
|
@@ -154,7 +154,7 @@ function H(c, N, W, e, C, I) {
|
|
|
154
154
|
"td",
|
|
155
155
|
{
|
|
156
156
|
key: a.prop,
|
|
157
|
-
class: _([{ "nmorph-table__table-data--bordered": e.
|
|
157
|
+
class: _([{ "nmorph-table__table-data--bordered": e.bordered }, "nmorph-table__table-data"])
|
|
158
158
|
},
|
|
159
159
|
[
|
|
160
160
|
o("div", {
|
|
@@ -222,7 +222,7 @@ function H(c, N, W, e, C, I) {
|
|
|
222
222
|
"td",
|
|
223
223
|
{
|
|
224
224
|
key: a.prop,
|
|
225
|
-
class: _([{ "nmorph-table__table-data--bordered": e.
|
|
225
|
+
class: _([{ "nmorph-table__table-data--bordered": e.bordered }, "nmorph-table__table-data"])
|
|
226
226
|
},
|
|
227
227
|
[
|
|
228
228
|
o("div", {
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import './NmorphTable.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { generateUUID as
|
|
5
|
-
import { useVirtualList as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
2
|
+
import { defineComponent as P, computed as l, ref as n, provide as _, watch as z, nextTick as K } from "vue";
|
|
3
|
+
import { useModifiers as Q } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { generateUUID as Y, toCssSize as $, createCssSizeVariables as F, createCssVariables as G, resolveDomElement as J } from "../../../utils/common.js";
|
|
5
|
+
import { useVirtualList as X } from "../../../hooks/use-virtual-list.js";
|
|
6
|
+
import Z from "./inner-components/nmorph-sort-button/NmorphSortButton.vue.js";
|
|
7
|
+
const ie = /* @__PURE__ */ P({
|
|
8
8
|
__name: "NmorphTable",
|
|
9
9
|
props: {
|
|
10
10
|
data: { type: Array, required: !1, default: () => [] },
|
|
11
11
|
rowHover: { type: Boolean, required: !1, default: !0 },
|
|
12
|
-
bordered: { type: Boolean, required: !1, default: !1 },
|
|
13
12
|
sort: { type: Object, required: !1, default: void 0 },
|
|
14
|
-
design: { type: null, required: !1, default: "nmorph" },
|
|
15
13
|
virtual: { type: Boolean, required: !1, default: !1 },
|
|
16
14
|
virtualHeight: { type: [Number, String], required: !1, default: "320px" },
|
|
17
15
|
virtualOverscan: { type: Number, required: !1, default: 5 },
|
|
@@ -19,22 +17,27 @@ const oe = /* @__PURE__ */ j({
|
|
|
19
17
|
virtualDynamicHeight: { type: Boolean, required: !1, default: !1 },
|
|
20
18
|
borderColor: { type: String, required: !1, default: void 0 },
|
|
21
19
|
cellHeight: { type: [Number, String], required: !1, default: void 0 },
|
|
22
|
-
rowHoverBackground: { type: String, required: !1, default: void 0 }
|
|
20
|
+
rowHoverBackground: { type: String, required: !1, default: void 0 },
|
|
21
|
+
design: { type: null, required: !1, default: "nmorph" },
|
|
22
|
+
bordered: { type: Boolean, required: !1, skipCheck: !0 }
|
|
23
23
|
},
|
|
24
|
-
setup(
|
|
25
|
-
|
|
26
|
-
const t =
|
|
27
|
-
() =>
|
|
28
|
-
"nmorph-table":
|
|
24
|
+
setup(B, { expose: T }) {
|
|
25
|
+
T();
|
|
26
|
+
const t = B, w = l(() => t.design === "plain" && t.bordered === !0), I = l(
|
|
27
|
+
() => Q({
|
|
28
|
+
"nmorph-table": {
|
|
29
|
+
[t.design]: !0,
|
|
30
|
+
bordered: w.value
|
|
31
|
+
}
|
|
29
32
|
})
|
|
30
|
-
), o = n([...t.data]), u = l(() => t.virtual),
|
|
33
|
+
), o = n([...t.data]), u = l(() => t.virtual), H = l(() => t.virtualRowHeight), S = l(() => t.virtualOverscan), C = l(() => t.virtualDynamicHeight), r = X(o, {
|
|
31
34
|
enabled: u,
|
|
32
|
-
itemHeight:
|
|
33
|
-
overscan:
|
|
34
|
-
dynamic:
|
|
35
|
-
}),
|
|
35
|
+
itemHeight: H,
|
|
36
|
+
overscan: S,
|
|
37
|
+
dynamic: C
|
|
38
|
+
}), x = l(
|
|
36
39
|
() => u.value ? r.virtualItems.value : o.value.map((e, a) => ({ item: e, index: a }))
|
|
37
|
-
),
|
|
40
|
+
), D = l(() => x.value.map((e) => e.item)), s = n(-1), p = n(0), d = n(t.sort), W = (e, a) => {
|
|
38
41
|
d.value && (d.value[a] = e, o.value.sort((g, y) => {
|
|
39
42
|
const b = String(g[a]).toLowerCase(), i = String(y[a]).toLowerCase();
|
|
40
43
|
if (!d.value)
|
|
@@ -43,15 +46,15 @@ const oe = /* @__PURE__ */ j({
|
|
|
43
46
|
return f === "ascending" ? b.localeCompare(i) : f === "descending" ? i.localeCompare(b) : 0;
|
|
44
47
|
}));
|
|
45
48
|
}, h = n(null), c = n([]);
|
|
46
|
-
|
|
47
|
-
const
|
|
49
|
+
_("table-data", { rows: D, columns: c });
|
|
50
|
+
const R = l(() => {
|
|
48
51
|
const e = c.value.map((i) => i.width).filter((i) => !!i), a = e.length, g = e.reduce((i, f) => (i += Number(f), i), 0), y = c.value.length - a;
|
|
49
52
|
return h.value?.clientWidth ? (h.value?.clientWidth - g) / y : 0;
|
|
50
|
-
}),
|
|
51
|
-
|
|
53
|
+
}), N = (e) => e || R.value, m = n(0);
|
|
54
|
+
z(
|
|
52
55
|
() => t.data,
|
|
53
56
|
async () => {
|
|
54
|
-
m.value = m.value + 1, o.value = [...t.data], c.value = [], await
|
|
57
|
+
m.value = m.value + 1, o.value = [...t.data], c.value = [], await K();
|
|
55
58
|
const e = r.containerRef.value;
|
|
56
59
|
e && (e.scrollTop = Math.min(
|
|
57
60
|
p.value,
|
|
@@ -62,38 +65,38 @@ const oe = /* @__PURE__ */ j({
|
|
|
62
65
|
immediate: !0
|
|
63
66
|
}
|
|
64
67
|
);
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
const q = l(() =>
|
|
68
|
-
...
|
|
68
|
+
const O = (e) => typeof e == "object" ? "" : e, k = Y();
|
|
69
|
+
_("table-identifier", k);
|
|
70
|
+
const q = l(() => $(t.virtualHeight)), A = l(() => ({
|
|
71
|
+
...G({
|
|
69
72
|
"--nmorph-private-table-border-color": t.borderColor,
|
|
70
73
|
"--nmorph-private-table-row-hover-background": t.rowHoverBackground
|
|
71
74
|
}),
|
|
72
|
-
|
|
75
|
+
...F({
|
|
73
76
|
"--nmorph-private-table-cell-height": t.cellHeight
|
|
74
77
|
})
|
|
75
|
-
})),
|
|
78
|
+
})), E = l(() => ({
|
|
76
79
|
"--nmorph-private-table-virtual-row-height": `${t.virtualRowHeight}px`,
|
|
77
80
|
height: u.value ? q.value : void 0,
|
|
78
81
|
overflowY: u.value ? "auto" : void 0
|
|
79
|
-
})),
|
|
80
|
-
r.measureElement(a,
|
|
81
|
-
},
|
|
82
|
+
})), L = r.spacerStyle, U = r.contentStyle, V = (e, a) => {
|
|
83
|
+
r.measureElement(a, J(e));
|
|
84
|
+
}, j = () => {
|
|
82
85
|
r.scrollHandler(), p.value = r.containerRef.value?.scrollTop || 0;
|
|
83
86
|
}, v = (e) => {
|
|
84
87
|
if (!o.value.length) return;
|
|
85
88
|
const a = s.value < 0 ? 0 : Math.min(Math.max(s.value + e, 0), o.value.length - 1);
|
|
86
89
|
s.value = a, r.scrollToIndex(a);
|
|
87
|
-
},
|
|
90
|
+
}, M = { props: t, bordered: w, modifiers: I, rows: o, virtualEnabled: u, virtualRowHeight: H, virtualOverscan: S, virtualDynamicHeight: C, virtualList: r, renderedRows: x, tableRows: D, activeRowIndex: s, lastScrollTop: p, sortData: d, onSort: W, nmorphDOMTable: h, columns: c, defaultColWidth: R, getWidth: N, key: m, tableData: O, tableIdentifier: k, virtualHeight: q, tableStyle: A, tableBodyStyle: E, virtualSpacerStyle: L, virtualContentStyle: U, setVirtualRowRef: V, scrollHandler: j, moveActiveRow: v, tableKeydownHandler: (e) => {
|
|
88
91
|
u.value && (e.key === "ArrowDown" ? (e.preventDefault(), v(1)) : e.key === "ArrowUp" ? (e.preventDefault(), v(-1)) : e.key === "Home" ? (e.preventDefault(), s.value = 0, r.scrollToIndex(0)) : e.key === "End" ? (e.preventDefault(), s.value = o.value.length - 1, r.scrollToIndex(o.value.length - 1)) : e.key === "PageDown" ? (e.preventDefault(), v(
|
|
89
92
|
Math.max(Math.floor((r.viewportHeight.value || t.virtualRowHeight) / t.virtualRowHeight), 1)
|
|
90
93
|
)) : e.key === "PageUp" && (e.preventDefault(), v(
|
|
91
94
|
-Math.max(Math.floor((r.viewportHeight.value || t.virtualRowHeight) / t.virtualRowHeight), 1)
|
|
92
95
|
)));
|
|
93
|
-
}, NmorphSortButton:
|
|
94
|
-
return Object.defineProperty(
|
|
96
|
+
}, NmorphSortButton: Z };
|
|
97
|
+
return Object.defineProperty(M, "__isScriptSetup", { enumerable: !1, value: !0 }), M;
|
|
95
98
|
}
|
|
96
99
|
});
|
|
97
100
|
export {
|
|
98
|
-
|
|
101
|
+
ie as default
|
|
99
102
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './NmorphDrawer.css';
|
|
2
2
|
import c from "./NmorphDrawer.vue2.js";
|
|
3
|
-
import { openBlock as e, createBlock as p, withCtx as
|
|
3
|
+
import { openBlock as e, createBlock as p, withCtx as i, createElementVNode as l, normalizeStyle as m, normalizeClass as n, createElementBlock as a, renderSlot as t, toDisplayString as _, createVNode as d, createCommentVNode as s } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import h from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
6
|
const f = ["aria-label"], w = {
|
|
@@ -12,7 +12,7 @@ const f = ["aria-label"], w = {
|
|
|
12
12
|
};
|
|
13
13
|
function v(r, C, N, o, z, O) {
|
|
14
14
|
return e(), p(o.NmorphOverlay, {
|
|
15
|
-
show: o.
|
|
15
|
+
show: o.isVisible,
|
|
16
16
|
"z-index": o.props.zIndex,
|
|
17
17
|
"teleport-to": o.props.teleportTo,
|
|
18
18
|
"disabled-teleport": o.props.disabledTeleport,
|
|
@@ -21,9 +21,9 @@ function v(r, C, N, o, z, O) {
|
|
|
21
21
|
onOnOutsideClick: o.overlayClickHandler,
|
|
22
22
|
onOnEscapeKeydown: o.closeHandler
|
|
23
23
|
}, {
|
|
24
|
-
default:
|
|
24
|
+
default: i(() => [
|
|
25
25
|
l("aside", {
|
|
26
|
-
class:
|
|
26
|
+
class: n(o.modifiers),
|
|
27
27
|
style: m(o.drawerStyle),
|
|
28
28
|
role: "dialog",
|
|
29
29
|
"aria-modal": "true",
|
|
@@ -45,9 +45,9 @@ function v(r, C, N, o, z, O) {
|
|
|
45
45
|
"aria-label": o.props.title ? `Close ${o.props.title}` : "Close drawer",
|
|
46
46
|
onClick: o.closeHandler
|
|
47
47
|
}, [
|
|
48
|
-
|
|
49
|
-
default:
|
|
50
|
-
|
|
48
|
+
d(o.NmorphIcon, null, {
|
|
49
|
+
default: i(() => [
|
|
50
|
+
d(o.NmorphIconCross)
|
|
51
51
|
]),
|
|
52
52
|
_: 1
|
|
53
53
|
/* STABLE */
|
|
@@ -58,7 +58,7 @@ function v(r, C, N, o, z, O) {
|
|
|
58
58
|
l(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
|
-
class:
|
|
61
|
+
class: n(["nmorph-drawer__content", o.props.contentClass])
|
|
62
62
|
},
|
|
63
63
|
[
|
|
64
64
|
t(r.$slots, "default")
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import './NmorphDrawer.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { createCssSizeVariables as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
2
|
+
import { defineComponent as C, useSlots as N, ref as y, computed as i, watch as S, onBeforeUnmount as b, nextTick as B } from "vue";
|
|
3
|
+
import { useModifiers as A } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { createCssSizeVariables as F } from "../../../utils/common.js";
|
|
5
|
+
import V from "../../others/nmorph-overlay/NmorphOverlay.vue.js";
|
|
6
|
+
import x from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
7
|
+
import z from "../../../assets/icons/cross.svg.js";
|
|
8
|
+
const v = 220, M = /* @__PURE__ */ C({
|
|
9
9
|
__name: "NmorphDrawer",
|
|
10
10
|
props: {
|
|
11
11
|
modelValue: { type: Boolean, required: !1, default: !1 },
|
|
@@ -21,30 +21,70 @@ const w = /* @__PURE__ */ m({
|
|
|
21
21
|
contentClass: { type: String, required: !1, default: "" }
|
|
22
22
|
},
|
|
23
23
|
emits: ["on-close", "update:model-value"],
|
|
24
|
-
setup(
|
|
25
|
-
|
|
26
|
-
const e =
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
setup(h, { expose: w, emit: q }) {
|
|
25
|
+
w();
|
|
26
|
+
const e = h, u = q, m = N(), n = y(e.modelValue), o = y(e.modelValue);
|
|
27
|
+
let r = null, t = null;
|
|
28
|
+
const g = i(
|
|
29
|
+
() => A({
|
|
30
|
+
"nmorph-drawer": [e.placement, o.value && "open"]
|
|
29
31
|
})
|
|
30
|
-
),
|
|
31
|
-
() =>
|
|
32
|
+
), O = i(
|
|
33
|
+
() => F({
|
|
32
34
|
"--nmorph-private-drawer-size": e.size
|
|
33
35
|
})
|
|
34
|
-
),
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
e.closeOnOverlay &&
|
|
38
|
-
},
|
|
39
|
-
|
|
36
|
+
), d = () => {
|
|
37
|
+
u("on-close"), u("update:model-value", !1);
|
|
38
|
+
}, T = () => {
|
|
39
|
+
e.closeOnOverlay && d();
|
|
40
|
+
}, _ = i(() => !!(m.header || e.title || e.showClose)), a = () => {
|
|
41
|
+
r === null || typeof window > "u" || (cancelAnimationFrame(r), r = null);
|
|
42
|
+
}, s = () => {
|
|
43
|
+
t !== null && (clearTimeout(t), t = null);
|
|
44
|
+
}, p = async () => {
|
|
45
|
+
if (s(), n.value = !0, typeof window > "u") {
|
|
46
|
+
o.value = !0;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
await B(), a(), r = requestAnimationFrame(() => {
|
|
50
|
+
o.value = !0, r = null;
|
|
51
|
+
});
|
|
52
|
+
}, f = () => {
|
|
53
|
+
a(), o.value = !1, n.value && (s(), t = setTimeout(() => {
|
|
54
|
+
n.value = !1, t = null;
|
|
55
|
+
}, v));
|
|
56
|
+
};
|
|
57
|
+
S(
|
|
58
|
+
() => e.modelValue,
|
|
59
|
+
(l) => {
|
|
60
|
+
if (l) {
|
|
61
|
+
p();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
f();
|
|
65
|
+
},
|
|
66
|
+
{ immediate: !0 }
|
|
67
|
+
), b(() => {
|
|
68
|
+
a(), s();
|
|
69
|
+
});
|
|
70
|
+
const c = { props: e, emit: u, slots: m, drawerTransitionDuration: v, isVisible: n, isOpen: o, get openAnimationFrame() {
|
|
71
|
+
return r;
|
|
72
|
+
}, set openAnimationFrame(l) {
|
|
73
|
+
r = l;
|
|
74
|
+
}, get closeTimeout() {
|
|
75
|
+
return t;
|
|
76
|
+
}, set closeTimeout(l) {
|
|
77
|
+
t = l;
|
|
78
|
+
}, modifiers: g, drawerStyle: O, closeHandler: d, overlayClickHandler: T, hasHeader: _, clearOpenAnimationFrame: a, clearCloseTimeout: s, openDrawer: p, closeDrawer: f, get NmorphIcon() {
|
|
79
|
+
return x;
|
|
40
80
|
}, get NmorphIconCross() {
|
|
41
|
-
return
|
|
81
|
+
return z;
|
|
42
82
|
}, get NmorphOverlay() {
|
|
43
|
-
return
|
|
83
|
+
return V;
|
|
44
84
|
} };
|
|
45
|
-
return Object.defineProperty(
|
|
85
|
+
return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
|
|
46
86
|
}
|
|
47
87
|
});
|
|
48
88
|
export {
|
|
49
|
-
|
|
89
|
+
M as default
|
|
50
90
|
};
|