@nextrap/nte-nav 1.1.17 → 1.1.18
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/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
declare const NteNavBrandRelocator_base: (abstract new (...a: any[]) => {
|
|
3
|
-
"__#
|
|
3
|
+
"__#2347@#ac"?: AbortController;
|
|
4
4
|
connectedCallback(): void;
|
|
5
5
|
disconnectedCallback(): void;
|
|
6
|
-
"__#
|
|
6
|
+
"__#2347@#bindEventListeners"(): void;
|
|
7
7
|
}) & (abstract new (...args: any[]) => {
|
|
8
|
-
"__#
|
|
9
|
-
"__#
|
|
8
|
+
"__#2348@#debugCached": boolean | null;
|
|
9
|
+
"__#2348@#myElementId": number;
|
|
10
10
|
invalidateDebugCache(): void;
|
|
11
|
-
"__#
|
|
11
|
+
"__#2348@#myLoggerInstance": import('@trunkjs/browser-utils').Logger | null;
|
|
12
12
|
readonly _debug: boolean;
|
|
13
13
|
getLogger(instanceId?: string): import('@trunkjs/browser-utils').Logger;
|
|
14
14
|
log(...args: any[]): void;
|
|
@@ -23,11 +23,13 @@ export declare class NteNavBrandRelocator extends NteNavBrandRelocator_base {
|
|
|
23
23
|
accessor active: boolean | null;
|
|
24
24
|
accessor mode: string;
|
|
25
25
|
private accessor done;
|
|
26
|
+
private accessor initialized;
|
|
26
27
|
private onScroll;
|
|
27
28
|
private onanimationEnd;
|
|
28
29
|
private get brandElement();
|
|
29
30
|
render(): import('lit-html').TemplateResult<1>;
|
|
30
31
|
update(changedProperties: Map<string, any>): void;
|
|
31
32
|
firstUpdated(): Promise<void>;
|
|
33
|
+
connectedCallback(): Promise<void>;
|
|
32
34
|
}
|
|
33
35
|
export {};
|
package/index.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { waitForDomContentLoaded as q, isBiggerThanBreakpoint as
|
|
1
|
+
import { waitForDomContentLoaded as q, isBiggerThanBreakpoint as yt, Debouncer as ne, SlotTool as Ct, waitForLoad as oe } from "@nextrap/nt-framework";
|
|
2
2
|
import "@nextrap/nte-offcanvas";
|
|
3
|
-
import { html as
|
|
4
|
-
import { customElement as J, property as
|
|
5
|
-
import { createRef as
|
|
6
|
-
import { EventBindingsMixin as
|
|
7
|
-
import { styleMap as
|
|
3
|
+
import { html as P, unsafeCSS as H, LitElement as j } from "lit";
|
|
4
|
+
import { customElement as J, property as z, state as K } from "lit/decorators.js";
|
|
5
|
+
import { createRef as St, ref as $t } from "lit/directives/ref.js";
|
|
6
|
+
import { EventBindingsMixin as se, LoggingMixin as le, Listen as de } from "@trunkjs/browser-utils";
|
|
7
|
+
import { styleMap as ce } from "lit/directives/style-map.js";
|
|
8
8
|
import "@nextrap/nte-burger";
|
|
9
|
-
const
|
|
10
|
-
var
|
|
9
|
+
const he = ":host{--container-width: var(--nt-container-width);--text-color: var(--nt-text);--hover-color: var(--nt-primary);--hover-text-color: var(--nt-text-on-primary);--transition: .2s ease-in-out;--submenu-bg: var(--nt-light);--submenu-text-color: var(--nt-text);--justify-content: center;--sidemenu-bg: var(--nt-primary-subtle);--justify-sidebar-burger: flex-end;--height: auto;--default-alpha: .7;height:var(--height);display:block}nav{height:100%}#main{height:100%}#burger-wrapper{padding:15px}#text{padding-right:10px}#burger-default{cursor:pointer}#burger-default slot::slotted(span){color:rgb(from var(--text-color) r g b/var(--default-alpha));transition:color var(--transition)}#burger-default nte-burger{--color: rgb(from var(--text-color) r g b / var(--default-alpha))}#burger-default:hover slot::slotted(span){color:rgb(from var(--text-color) r g b/1)}#burger-default:hover nte-burger{--color: rgb(from var(--text-color) r g b / 1)}";
|
|
10
|
+
var pe = Object.create, et = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, Pt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), L = (t) => {
|
|
11
11
|
throw TypeError(t);
|
|
12
|
-
},
|
|
13
|
-
for (var a = 0,
|
|
14
|
-
return
|
|
15
|
-
},
|
|
16
|
-
var h, s,
|
|
17
|
-
return
|
|
12
|
+
}, ue = (t, e, r) => e in t ? et(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, xt = (t, e) => et(t, "name", { value: e, configurable: !0 }), _e = (t) => [, , , pe((t == null ? void 0 : t[Pt("metadata")]) ?? null)], Mt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], F = (t) => t !== void 0 && typeof t != "function" ? L("Function expected") : t, fe = (t, e, r, o, a) => ({ kind: Mt[t], name: e, metadata: o, addInitializer: (n) => r._ ? L("Already initialized") : a.push(F(n || null)) }), ge = (t, e) => ue(e, Pt("metadata"), t[3]), S = (t, e, r, o) => {
|
|
13
|
+
for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) e & 1 ? n[a].call(r) : o = n[a].call(r, o);
|
|
14
|
+
return o;
|
|
15
|
+
}, W = (t, e, r, o, a, n) => {
|
|
16
|
+
var h, s, m, p, f, i = e & 7, g = !!(e & 8), d = !!(e & 16), _ = i > 3 ? t.length + 1 : i ? g ? 1 : 2 : 0, k = Mt[i + 5], E = i > 3 && (t[_ - 1] = []), R = t[_] || (t[_] = []), c = i && (!d && !g && (a = a.prototype), i < 5 && (i > 3 || !d) && ve(i < 4 ? a : { get [r]() {
|
|
17
|
+
return kt(this, n);
|
|
18
18
|
}, set [r](l) {
|
|
19
|
-
return
|
|
19
|
+
return Et(this, n, l);
|
|
20
20
|
} }, r));
|
|
21
|
-
i ? d && i < 4 &&
|
|
22
|
-
for (var
|
|
23
|
-
p =
|
|
24
|
-
return i ||
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
class
|
|
21
|
+
i ? d && i < 4 && xt(n, (i > 2 ? "set " : i > 1 ? "get " : "") + r) : xt(a, r);
|
|
22
|
+
for (var w = o.length - 1; w >= 0; w--)
|
|
23
|
+
p = fe(i, r, m = {}, t[3], R), i && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => be(a, l) : (l) => r in l }, i ^ 3 && (f.get = d ? (l) => (i ^ 1 ? kt : me)(l, a, i ^ 4 ? n : c.get) : (l) => l[r]), i > 2 && (f.set = d ? (l, y) => Et(l, a, y, i ^ 4 ? n : c.set) : (l, y) => l[r] = y)), s = (0, o[w])(i ? i < 4 ? d ? n : c[k] : i > 4 ? void 0 : { get: c.get, set: c.set } : a, p), m._ = 1, i ^ 4 || s === void 0 ? F(s) && (i > 4 ? E.unshift(s) : i ? d ? n = s : c[k] = s : a = s) : typeof s != "object" || s === null ? L("Object expected") : (F(h = s.get) && (c.get = h), F(h = s.set) && (c.set = h), F(h = s.init) && E.unshift(h));
|
|
24
|
+
return i || ge(t, a), c && et(a, r, c), d ? i ^ 4 ? n : c : a;
|
|
25
|
+
}, rt = (t, e, r) => e.has(t) || L("Cannot " + r), be = (t, e) => Object(e) !== e ? L('Cannot use the "in" operator on this value') : t.has(e), kt = (t, e, r) => (rt(t, e, "read from private field"), r ? r.call(t) : e.get(t)), D = (t, e, r) => e.has(t) ? L("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), Et = (t, e, r, o) => (rt(t, e, "write to private field"), o ? o.call(t, r) : e.set(t, r), r), me = (t, e, r) => (rt(t, e, "access private method"), r), Lt, Wt, It, Bt, Rt, Q, Dt, u, it, at, nt, ot, st;
|
|
26
|
+
Dt = [J("nte-nav")];
|
|
27
|
+
class x extends (Q = j, Rt = [z({ type: String, reflect: !0 })], Bt = [z({ type: String, reflect: !0 })], It = [z({ type: String, reflect: !0, attribute: "transfer-to" })], Wt = [z({ type: String, reflect: !1, attribute: "data-group-name" })], Lt = [K()], Q) {
|
|
28
28
|
constructor() {
|
|
29
|
-
super(),
|
|
29
|
+
super(), D(this, it, S(u, 8, this, "slave")), S(u, 11, this), D(this, at, S(u, 12, this, "99999px")), S(u, 15, this), D(this, nt, S(u, 16, this, "")), S(u, 19, this), D(this, ot, S(u, 20, this, "")), S(u, 23, this), D(this, st, S(u, 24, this, !1)), S(u, 27, this);
|
|
30
30
|
}
|
|
31
31
|
getOffcanvas() {
|
|
32
32
|
return this.transferTo ? document.querySelector(this.transferTo) : null;
|
|
@@ -36,7 +36,7 @@ class $ extends (K = j, Wt = [N({ type: String, reflect: !0 })], Rt = [N({ type:
|
|
|
36
36
|
return e ? e.querySelector("nte-nav") : null;
|
|
37
37
|
}
|
|
38
38
|
render() {
|
|
39
|
-
return
|
|
39
|
+
return P` <nav>
|
|
40
40
|
<div id="burger-wrapper" ?hidden=${!this._isTransferred}>
|
|
41
41
|
<slot
|
|
42
42
|
name="burger"
|
|
@@ -50,7 +50,7 @@ class $ extends (K = j, Wt = [N({ type: String, reflect: !0 })], Rt = [N({ type:
|
|
|
50
50
|
}}
|
|
51
51
|
>
|
|
52
52
|
<!-- fallback icon -->
|
|
53
|
-
${this._isTransferred ?
|
|
53
|
+
${this._isTransferred ? P`<div id="burger-default" style="display:flex; align-items: center; justify-content: center;">
|
|
54
54
|
<div id="text"><slot name="menu-text"></slot></div>
|
|
55
55
|
<nte-burger
|
|
56
56
|
data-group-name="${this.dataGroupName}"
|
|
@@ -71,17 +71,17 @@ class $ extends (K = j, Wt = [N({ type: String, reflect: !0 })], Rt = [N({ type:
|
|
|
71
71
|
const r = (a = this.shadowRoot) == null ? void 0 : a.querySelector("#main-slot");
|
|
72
72
|
if (r === null)
|
|
73
73
|
return;
|
|
74
|
-
Array.from(r.assignedElements({ flatten: !0 })).forEach((
|
|
75
|
-
|
|
74
|
+
Array.from(r.assignedElements({ flatten: !0 })).forEach((n) => {
|
|
75
|
+
n instanceof HTMLElement && e.appendChild(n);
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
updated(e) {
|
|
79
|
-
var r,
|
|
79
|
+
var r, o;
|
|
80
80
|
super.updated(e), this._isTransferred ? this.transferToElement(
|
|
81
81
|
this.getOffcanvasNav() ?? (() => {
|
|
82
82
|
throw new Error("No offcanvas nav found");
|
|
83
83
|
})()
|
|
84
|
-
) : ((r = this.getOffcanvasNav()) == null || r.transferToElement(this), (
|
|
84
|
+
) : ((r = this.getOffcanvasNav()) == null || r.transferToElement(this), (o = this.getOffcanvas()) == null || o.close());
|
|
85
85
|
}
|
|
86
86
|
firstUpdated(e) {
|
|
87
87
|
super.firstUpdated(e);
|
|
@@ -89,46 +89,46 @@ class $ extends (K = j, Wt = [N({ type: String, reflect: !0 })], Rt = [N({ type:
|
|
|
89
89
|
!r.contains("nav-vertical") && !r.contains("nav-horizontal") && r.add(this.closest("nte-offcanvas") === null ? "nav-horizontal" : "nav-vertical");
|
|
90
90
|
}
|
|
91
91
|
async connectedCallback() {
|
|
92
|
-
await q(), super.connectedCallback(), this.mode !== "slave" && this.transferTo !== "" && (this._isTransferred = !1, this.breakpoint !== "" && (
|
|
93
|
-
|
|
92
|
+
await q(), super.connectedCallback(), this.mode !== "slave" && this.transferTo !== "" && (this._isTransferred = !1, this.breakpoint !== "" && (yt(this.breakpoint) || (this._isTransferred = !0), window.addEventListener("breakpoint-changed", (e) => {
|
|
93
|
+
yt(this.breakpoint) ? this._isTransferred = !1 : this._isTransferred = !0;
|
|
94
94
|
})));
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
rt = /* @__PURE__ */ new WeakMap();
|
|
97
|
+
u = _e(Q);
|
|
99
98
|
it = /* @__PURE__ */ new WeakMap();
|
|
100
99
|
at = /* @__PURE__ */ new WeakMap();
|
|
101
|
-
ot = /* @__PURE__ */ new WeakMap();
|
|
102
100
|
nt = /* @__PURE__ */ new WeakMap();
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
101
|
+
ot = /* @__PURE__ */ new WeakMap();
|
|
102
|
+
st = /* @__PURE__ */ new WeakMap();
|
|
103
|
+
W(u, 4, "mode", Rt, x, it);
|
|
104
|
+
W(u, 4, "breakpoint", Bt, x, at);
|
|
105
|
+
W(u, 4, "transferTo", It, x, nt);
|
|
106
|
+
W(u, 4, "dataGroupName", Wt, x, ot);
|
|
107
|
+
W(u, 4, "_isTransferred", Lt, x, st);
|
|
108
|
+
x = W(u, 0, "NteNav", Dt, x);
|
|
109
|
+
x.styles = [H(he)];
|
|
110
|
+
S(u, 1, x);
|
|
111
|
+
const we = "*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{height:100%;width:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit;color:inherit;background:none;border:none;outline:none}a,i{color:inherit;text-decoration:none}ul,ol{list-style:none}table{border-collapse:collapse;border-spacing:0}slot{display:contents}:host{--bg: transparent;--spacer-bg: transparent;--container-width: var(--nt-container-width, 100%);--brand-height: 80px;--spacer-height: 80px;width:100vw;margin:0}:host(a){height:85px;width:auto}#wrapper{position:relative;left:0;top:0;right:0;width:100%}#spacer{position:relative;top:0;left:0;width:100%;transition:height .3s ease-in-out;height:var(--spacer-height);background-color:var(--spacer-bg)}#navbar{position:absolute;top:0;width:100vw;height:auto;background-color:var(--bg);z-index:1000}#main{width:100vw;display:block}";
|
|
112
|
+
var ye = Object.create, lt = Object.defineProperty, Se = Object.getOwnPropertyDescriptor, Ft = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), I = (t) => {
|
|
113
113
|
throw TypeError(t);
|
|
114
|
-
},
|
|
115
|
-
for (var a = 0,
|
|
116
|
-
return
|
|
117
|
-
}, At = (t, e, r,
|
|
118
|
-
var h, s,
|
|
119
|
-
return
|
|
114
|
+
}, $e = (t, e, r) => e in t ? lt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, zt = (t, e) => lt(t, "name", { value: e, configurable: !0 }), xe = (t) => [, , , ye((t == null ? void 0 : t[Ft("metadata")]) ?? null)], Yt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Y = (t) => t !== void 0 && typeof t != "function" ? I("Function expected") : t, ke = (t, e, r, o, a) => ({ kind: Yt[t], name: e, metadata: o, addInitializer: (n) => r._ ? I("Already initialized") : a.push(Y(n || null)) }), Ee = (t, e) => $e(e, Ft("metadata"), t[3]), V = (t, e, r, o) => {
|
|
115
|
+
for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) e & 1 ? n[a].call(r) : o = n[a].call(r, o);
|
|
116
|
+
return o;
|
|
117
|
+
}, At = (t, e, r, o, a, n) => {
|
|
118
|
+
var h, s, m, p, f, i = e & 7, g = !!(e & 8), d = !!(e & 16), _ = i > 3 ? t.length + 1 : i ? g ? 1 : 2 : 0, k = Yt[i + 5], E = i > 3 && (t[_ - 1] = []), R = t[_] || (t[_] = []), c = i && (!d && !g && (a = a.prototype), i < 5 && (i > 3 || !d) && Se(i < 4 ? a : { get [r]() {
|
|
119
|
+
return Nt(this, n);
|
|
120
120
|
}, set [r](l) {
|
|
121
|
-
return
|
|
121
|
+
return Ot(this, n, l);
|
|
122
122
|
} }, r));
|
|
123
|
-
i ? d && i < 4 &&
|
|
124
|
-
for (var
|
|
125
|
-
p =
|
|
126
|
-
return i ||
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
class U extends (
|
|
123
|
+
i ? d && i < 4 && zt(n, (i > 2 ? "set " : i > 1 ? "get " : "") + r) : zt(a, r);
|
|
124
|
+
for (var w = o.length - 1; w >= 0; w--)
|
|
125
|
+
p = ke(i, r, m = {}, t[3], R), i && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => ze(a, l) : (l) => r in l }, i ^ 3 && (f.get = d ? (l) => (i ^ 1 ? Nt : Oe)(l, a, i ^ 4 ? n : c.get) : (l) => l[r]), i > 2 && (f.set = d ? (l, y) => Ot(l, a, y, i ^ 4 ? n : c.set) : (l, y) => l[r] = y)), s = (0, o[w])(i ? i < 4 ? d ? n : c[k] : i > 4 ? void 0 : { get: c.get, set: c.set } : a, p), m._ = 1, i ^ 4 || s === void 0 ? Y(s) && (i > 4 ? E.unshift(s) : i ? d ? n = s : c[k] = s : a = s) : typeof s != "object" || s === null ? I("Object expected") : (Y(h = s.get) && (c.get = h), Y(h = s.set) && (c.set = h), Y(h = s.init) && E.unshift(h));
|
|
126
|
+
return i || Ee(t, a), c && lt(a, r, c), d ? i ^ 4 ? n : c : a;
|
|
127
|
+
}, dt = (t, e, r) => e.has(t) || I("Cannot " + r), ze = (t, e) => Object(e) !== e ? I('Cannot use the "in" operator on this value') : t.has(e), Nt = (t, e, r) => (dt(t, e, "read from private field"), r ? r.call(t) : e.get(t)), Ne = (t, e, r) => e.has(t) ? I("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), Ot = (t, e, r, o) => (dt(t, e, "write to private field"), o ? o.call(t, r) : e.set(t, r), r), Oe = (t, e, r) => (dt(t, e, "access private method"), r), Ut, X, Gt, M, ct;
|
|
128
|
+
Gt = [J("nte-navbar")];
|
|
129
|
+
class U extends (X = j, Ut = [z({ type: Number, attribute: "scroll-threshold", reflect: !0 })], X) {
|
|
130
130
|
constructor() {
|
|
131
|
-
super(), this.navbarRef =
|
|
131
|
+
super(), this.navbarRef = St(), this.spacerRef = St(), Ne(this, ct, V(M, 8, this, 0)), V(M, 11, this), this._lastScrollY = window.scrollY, this._scrollUpPixels = 0, this._debouncer = void 0, this._debouncer = new ne(100, 300), document.addEventListener(
|
|
132
132
|
"scroll",
|
|
133
133
|
async () => {
|
|
134
134
|
this.updateScrollState();
|
|
@@ -151,13 +151,13 @@ class U extends (V = j, Ft = [N({ type: Number, attribute: "scroll-threshold", r
|
|
|
151
151
|
await q(), super.updated(e);
|
|
152
152
|
}
|
|
153
153
|
firstUpdated(e) {
|
|
154
|
-
|
|
154
|
+
Ct.observeEmptySlots(this);
|
|
155
155
|
}
|
|
156
156
|
render() {
|
|
157
|
-
return
|
|
157
|
+
return P`
|
|
158
158
|
<div id="wrapper" part="wrapper">
|
|
159
|
-
<div id="spacer" part="spacer" ${
|
|
160
|
-
<div id="navbar" part="navbar" ${
|
|
159
|
+
<div id="spacer" part="spacer" ${$t(this.spacerRef)}></div>
|
|
160
|
+
<div id="navbar" part="navbar" ${$t(this.navbarRef)}>
|
|
161
161
|
<div id="brand" part="brand">
|
|
162
162
|
<slot name="brand"></slot>
|
|
163
163
|
</div>
|
|
@@ -169,27 +169,27 @@ class U extends (V = j, Ft = [N({ type: Number, attribute: "scroll-threshold", r
|
|
|
169
169
|
`;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
At(
|
|
175
|
-
U = At(
|
|
176
|
-
U.styles = [H(
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
var
|
|
172
|
+
M = xe(X);
|
|
173
|
+
ct = /* @__PURE__ */ new WeakMap();
|
|
174
|
+
At(M, 4, "scrollThreshold", Ut, U, ct);
|
|
175
|
+
U = At(M, 0, "NteNavbar", Gt, U);
|
|
176
|
+
U.styles = [H(we)];
|
|
177
|
+
V(M, 1, U);
|
|
178
|
+
const Te = "*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{height:100%;width:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit;color:inherit;background:none;border:none;outline:none}a,i{color:inherit;text-decoration:none}ul,ol{list-style:none}table{border-collapse:collapse;border-spacing:0}slot{display:contents}:host{--container-width: var(--nt-container-width, 100%);--background: transparent;--text-color: var(--nt-text);--height: auto;--brand-height: 80px;display:block;height:100%;width:100vw}:host(.hide-on-scroll){transition:max-height .3s ease-in-out;max-height:100px}:host(.hide-on-scroll.is-scrolled){max-height:0;overflow:hidden}#main{height:var(--height);transition:height .2s ease-in-out;overflow:visible;width:100%;display:flex;background:var(--background)}#container{width:var(--container-width);margin:0 auto;display:flex}#container #brand:has(slot[empty]){display:none}#container #brand{min-width:0;flex-shrink:1;width:auto;align-items:start;display:flex;height:100%;justify-items:center}#container #nav{display:flex;flex-grow:1;justify-content:end;align-items:center;gap:1rem}";
|
|
179
|
+
var Ce = Object.create, ht = Object.defineProperty, Pe = Object.getOwnPropertyDescriptor, qt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), Ht = (t) => {
|
|
180
180
|
throw TypeError(t);
|
|
181
|
-
},
|
|
182
|
-
for (var a = 0,
|
|
183
|
-
return
|
|
184
|
-
},
|
|
185
|
-
var h, s,
|
|
186
|
-
|
|
187
|
-
for (var _ =
|
|
188
|
-
|
|
189
|
-
return
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
const
|
|
181
|
+
}, Me = (t, e, r) => e in t ? ht(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Le = (t, e) => ht(t, "name", { value: e, configurable: !0 }), We = (t) => [, , , Ce((t == null ? void 0 : t[qt("metadata")]) ?? null)], Ie = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], jt = (t) => t !== void 0 && typeof t != "function" ? Ht("Function expected") : t, Be = (t, e, r, o, a) => ({ kind: Ie[t], name: e, metadata: o, addInitializer: (n) => r._ ? Ht("Already initialized") : a.push(jt(n || null)) }), Re = (t, e) => Me(e, qt("metadata"), t[3]), De = (t, e, r, o) => {
|
|
182
|
+
for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) n[a].call(r);
|
|
183
|
+
return o;
|
|
184
|
+
}, Fe = (t, e, r, o, a, n) => {
|
|
185
|
+
var h, s, m, p = e & 7, f = !1, i = 0, g = t[i] || (t[i] = []), d = p && (a = a.prototype, p < 5 && (p > 3 || !f) && Pe(a, r));
|
|
186
|
+
Le(a, r);
|
|
187
|
+
for (var _ = o.length - 1; _ >= 0; _--)
|
|
188
|
+
m = Be(p, r, s = {}, t[3], g), h = (0, o[_])(a, m), s._ = 1, jt(h) && (a = h);
|
|
189
|
+
return Re(t, a), d && ht(a, r, d), f ? p ^ 4 ? n : d : a;
|
|
190
|
+
}, Jt, pt, Kt;
|
|
191
|
+
Jt = [J("nte-navbar-line")];
|
|
192
|
+
const wt = class wt extends (Kt = j) {
|
|
193
193
|
constructor() {
|
|
194
194
|
super(...arguments), this._isScrolled = !1;
|
|
195
195
|
}
|
|
@@ -204,10 +204,10 @@ const bt = class bt extends (Jt = j) {
|
|
|
204
204
|
super.connectedCallback(), window.addEventListener("scroll", () => this.updateScrollState(), { passive: !0 });
|
|
205
205
|
}
|
|
206
206
|
async firstUpdated(e) {
|
|
207
|
-
|
|
207
|
+
Ct.observeEmptySlots(this), this.updateScrollState();
|
|
208
208
|
}
|
|
209
209
|
render() {
|
|
210
|
-
return
|
|
210
|
+
return P`
|
|
211
211
|
<div id="main" part="main">
|
|
212
212
|
<div id="container" part="container">
|
|
213
213
|
<div id="brand" part="brand">
|
|
@@ -221,32 +221,32 @@ const bt = class bt extends (Jt = j) {
|
|
|
221
221
|
`;
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
|
-
|
|
225
|
-
let G =
|
|
226
|
-
|
|
227
|
-
G =
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
var
|
|
224
|
+
wt.styles = [H(Te)];
|
|
225
|
+
let G = wt;
|
|
226
|
+
pt = We(Kt);
|
|
227
|
+
G = Fe(pt, 0, "NteNavbarLine", Jt, G);
|
|
228
|
+
De(pt, 1, G);
|
|
229
|
+
const Ye = ":host{display:block;--animation-duration: .3s;--auto-aspect-ratio: unset;aspect-ratio:var(--auto-aspect-ratio);height:auto;width:auto}.wrapper{--orig-top: 0;--orig-left: 0;--orig-width: 0;--orig-height: 0;--self-top: 0;--self-left: 0;--self-width: 100%;--self-height: 100%;display:inline-block;width:var(--self-width);height:var(--self-height);object-fit:contain;overflow:visible;position:fixed;opacity:0}.wrapper.initialized{opacity:1}.wrapper{top:var(--self-top);left:var(--self-left);transition:all var(--animation-duration) ease-in-out}.wrapper.inactive{z-index:99999;top:calc(var(--orig-top));left:calc(var(--orig-left));width:var(--orig-width);height:var(--orig-height)}.wrapper.inactive.done{z-index:inherit;visibility:hidden}.wrapper>slot{display:contents}.wrapper ::slotted(*){width:100%;height:100%;object-fit:contain;transition:all .3s ease-in-out}";
|
|
230
|
+
var Ae = Object.create, vt = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, Qt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), B = (t) => {
|
|
231
231
|
throw TypeError(t);
|
|
232
|
-
},
|
|
233
|
-
for (var a = 0,
|
|
234
|
-
return
|
|
235
|
-
},
|
|
236
|
-
var h, s,
|
|
237
|
-
return
|
|
232
|
+
}, Ge = (t, e, r) => e in t ? vt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Tt = (t, e) => vt(t, "name", { value: e, configurable: !0 }), qe = (t) => [, , , Ae((t == null ? void 0 : t[Qt("metadata")]) ?? null)], Vt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], A = (t) => t !== void 0 && typeof t != "function" ? B("Function expected") : t, He = (t, e, r, o, a) => ({ kind: Vt[t], name: e, metadata: o, addInitializer: (n) => r._ ? B("Already initialized") : a.push(A(n || null)) }), je = (t, e) => Ge(e, Qt("metadata"), t[3]), b = (t, e, r, o) => {
|
|
233
|
+
for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) e & 1 ? n[a].call(r) : o = n[a].call(r, o);
|
|
234
|
+
return o;
|
|
235
|
+
}, O = (t, e, r, o, a, n) => {
|
|
236
|
+
var h, s, m, p, f, i = e & 7, g = !!(e & 8), d = !!(e & 16), _ = i > 3 ? t.length + 1 : i ? g ? 1 : 2 : 0, k = Vt[i + 5], E = i > 3 && (t[_ - 1] = []), R = t[_] || (t[_] = []), c = i && (!d && !g && (a = a.prototype), i < 5 && (i > 3 || !d) && Ue(i < 4 ? a : { get [r]() {
|
|
237
|
+
return C(this, n);
|
|
238
238
|
}, set [r](l) {
|
|
239
|
-
return
|
|
239
|
+
return Z(this, n, l);
|
|
240
240
|
} }, r));
|
|
241
|
-
i ? d && i < 4 &&
|
|
242
|
-
for (var
|
|
243
|
-
p =
|
|
244
|
-
return i ||
|
|
245
|
-
},
|
|
246
|
-
|
|
247
|
-
class
|
|
241
|
+
i ? d && i < 4 && Tt(n, (i > 2 ? "set " : i > 1 ? "get " : "") + r) : Tt(a, r);
|
|
242
|
+
for (var w = o.length - 1; w >= 0; w--)
|
|
243
|
+
p = He(i, r, m = {}, t[3], R), i && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => Je(a, l) : (l) => r in l }, i ^ 3 && (f.get = d ? (l) => (i ^ 1 ? C : Ke)(l, a, i ^ 4 ? n : c.get) : (l) => l[r]), i > 2 && (f.set = d ? (l, y) => Z(l, a, y, i ^ 4 ? n : c.set) : (l, y) => l[r] = y)), s = (0, o[w])(i ? i < 4 ? d ? n : c[k] : i > 4 ? void 0 : { get: c.get, set: c.set } : a, p), m._ = 1, i ^ 4 || s === void 0 ? A(s) && (i > 4 ? E.unshift(s) : i ? d ? n = s : c[k] = s : a = s) : typeof s != "object" || s === null ? B("Object expected") : (A(h = s.get) && (c.get = h), A(h = s.set) && (c.set = h), A(h = s.init) && E.unshift(h));
|
|
244
|
+
return i || je(t, a), c && vt(a, r, c), d ? i ^ 4 ? n : c : a;
|
|
245
|
+
}, ut = (t, e, r) => e.has(t) || B("Cannot " + r), Je = (t, e) => Object(e) !== e ? B('Cannot use the "in" operator on this value') : t.has(e), C = (t, e, r) => (ut(t, e, "read from private field"), r ? r.call(t) : e.get(t)), T = (t, e, r) => e.has(t) ? B("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), Z = (t, e, r, o) => (ut(t, e, "write to private field"), o ? o.call(t, r) : e.set(t, r), r), Ke = (t, e, r) => (ut(t, e, "access private method"), r), Xt, Zt, te, ee, re, ie, tt, ae, v, _t, ft, gt, bt, mt, N;
|
|
246
|
+
ae = [J("nte-nav-brand-relocator")];
|
|
247
|
+
class $ extends (tt = se(le(j)), ie = [z({ type: String, reflect: !0 })], re = [z({ type: Boolean, reflect: !0 })], ee = [z({ type: String, reflect: !0 })], te = [K()], Zt = [K()], Xt = [de("scroll", { target: "window", options: { passive: !0 } })], tt) {
|
|
248
248
|
constructor() {
|
|
249
|
-
super(...arguments),
|
|
249
|
+
super(...arguments), b(v, 5, this), T(this, _t, b(v, 8, this, ".brand-image")), b(v, 11, this), T(this, ft, b(v, 12, this, null)), b(v, 15, this), T(this, gt, b(v, 16, this, "auto")), b(v, 19, this), T(this, bt, b(v, 20, this, !1)), b(v, 23, this), T(this, mt, b(v, 24, this, !1)), b(v, 27, this), T(this, N, null);
|
|
250
250
|
}
|
|
251
251
|
onScroll() {
|
|
252
252
|
if (this.mode !== "auto") {
|
|
@@ -260,27 +260,27 @@ class x extends (Z = ae(oe(j)), ee = [N({ type: String, reflect: !0 })], te = [N
|
|
|
260
260
|
this.log("Animation ended - finalizing state"), this.active || (this.brandElement.style.visibility = "visible", this.done = !0);
|
|
261
261
|
}
|
|
262
262
|
get brandElement() {
|
|
263
|
-
return
|
|
263
|
+
return C(this, N) || (Z(this, N, document.querySelector(this.brandSelector)), C(this, N) || this.warn(`Brand element not found using selector: ${this.brandSelector}`)), C(this, N);
|
|
264
264
|
}
|
|
265
265
|
render() {
|
|
266
266
|
const e = this.brandElement.getBoundingClientRect(), r = e.width / e.height;
|
|
267
267
|
this.style.setProperty("--auto-aspect-ratio", r.toString());
|
|
268
|
-
const
|
|
268
|
+
const o = this.getBoundingClientRect();
|
|
269
269
|
if (!e)
|
|
270
|
-
return
|
|
270
|
+
return P`<div>No brand element found</div>`;
|
|
271
271
|
const a = {
|
|
272
272
|
"--orig-top": e.top + "px",
|
|
273
273
|
"--orig-left": e.left + "px",
|
|
274
274
|
"--orig-width": e.width + "px",
|
|
275
275
|
"--orig-height": e.height + "px",
|
|
276
|
-
"--self-top":
|
|
277
|
-
"--self-left":
|
|
278
|
-
"--self-width":
|
|
279
|
-
"--self-height":
|
|
276
|
+
"--self-top": o.top + "px",
|
|
277
|
+
"--self-left": o.left + "px",
|
|
278
|
+
"--self-width": o.width + "px",
|
|
279
|
+
"--self-height": o.height + "px"
|
|
280
280
|
};
|
|
281
|
-
return
|
|
282
|
-
class="wrapper ${this.active ? "" : "inactive"} ${this.done ? "done" : ""}"
|
|
283
|
-
style=${
|
|
281
|
+
return P`<div
|
|
282
|
+
class="wrapper ${this.active ? "" : "inactive"} ${this.done ? "done" : ""} ${this.initialized ? "initialized" : ""}"
|
|
283
|
+
style=${ce(a)}
|
|
284
284
|
@transitionend=${() => this.onanimationEnd()}
|
|
285
285
|
>
|
|
286
286
|
<slot></slot>
|
|
@@ -288,36 +288,41 @@ class x extends (Z = ae(oe(j)), ee = [N({ type: String, reflect: !0 })], te = [N
|
|
|
288
288
|
}
|
|
289
289
|
update(e) {
|
|
290
290
|
var r;
|
|
291
|
-
e.has("active") && this.active === !0 && ((r =
|
|
291
|
+
e.has("active") && this.active === !0 && ((r = C(this, N)) == null || r.style.setProperty("visibility", "hidden"), this.done = !1), super.update(e);
|
|
292
292
|
}
|
|
293
293
|
async firstUpdated() {
|
|
294
|
+
this.log("Waiting for Brand element loading...", this.brandElement), await oe(this.brandElement), this.log("Brand element loaded:", this.brandElement), this.initialized = !0;
|
|
295
|
+
}
|
|
296
|
+
async connectedCallback() {
|
|
294
297
|
await q();
|
|
295
298
|
const e = this.brandElement;
|
|
296
|
-
if (!e) {
|
|
299
|
+
if (this.log("Brand element:", e), !e) {
|
|
297
300
|
this.warn(`Brand element not found using selector: ${this.brandSelector}`);
|
|
298
301
|
return;
|
|
299
302
|
}
|
|
300
303
|
const r = e.cloneNode(!0);
|
|
301
|
-
this.appendChild(r), this.onScroll();
|
|
304
|
+
this.appendChild(r), super.connectedCallback(), this.onScroll();
|
|
302
305
|
}
|
|
303
306
|
}
|
|
304
|
-
|
|
305
|
-
ut = /* @__PURE__ */ new WeakMap();
|
|
307
|
+
v = qe(tt);
|
|
306
308
|
_t = /* @__PURE__ */ new WeakMap();
|
|
307
309
|
ft = /* @__PURE__ */ new WeakMap();
|
|
308
310
|
gt = /* @__PURE__ */ new WeakMap();
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
311
|
+
bt = /* @__PURE__ */ new WeakMap();
|
|
312
|
+
mt = /* @__PURE__ */ new WeakMap();
|
|
313
|
+
N = /* @__PURE__ */ new WeakMap();
|
|
314
|
+
O(v, 4, "brandSelector", ie, $, _t);
|
|
315
|
+
O(v, 4, "active", re, $, ft);
|
|
316
|
+
O(v, 4, "mode", ee, $, gt);
|
|
317
|
+
O(v, 4, "done", te, $, bt);
|
|
318
|
+
O(v, 4, "initialized", Zt, $, mt);
|
|
319
|
+
O(v, 1, "onScroll", Xt, $);
|
|
320
|
+
$ = O(v, 0, "NteNavBrandRelocator", ae, $);
|
|
321
|
+
$.styles = [H(Ye)];
|
|
322
|
+
b(v, 1, $);
|
|
318
323
|
console.log("Loading nte-nav...");
|
|
319
324
|
export {
|
|
320
|
-
|
|
321
|
-
|
|
325
|
+
x as NteNav,
|
|
326
|
+
$ as NteNavBrandRelocator,
|
|
322
327
|
U as NteNavbar
|
|
323
328
|
};
|