@nextrap/nte-nav 1.1.16 → 1.1.17
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
|
@@ -25,6 +25,7 @@ export declare class NteNavBrandRelocator extends NteNavBrandRelocator_base {
|
|
|
25
25
|
private accessor done;
|
|
26
26
|
private onScroll;
|
|
27
27
|
private onanimationEnd;
|
|
28
|
+
private get brandElement();
|
|
28
29
|
render(): import('lit-html').TemplateResult<1>;
|
|
29
30
|
update(changedProperties: Map<string, any>): void;
|
|
30
31
|
firstUpdated(): Promise<void>;
|
package/index.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { waitForDomContentLoaded as q, isBiggerThanBreakpoint as
|
|
1
|
+
import { waitForDomContentLoaded as q, isBiggerThanBreakpoint as mt, Debouncer as ie, SlotTool as Tt } 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
|
|
3
|
+
import { html as z, unsafeCSS as H, LitElement as j } from "lit";
|
|
4
|
+
import { customElement as J, property as N, state as zt } from "lit/decorators.js";
|
|
5
|
+
import { createRef as wt, ref as yt } from "lit/directives/ref.js";
|
|
6
6
|
import { EventBindingsMixin as ae, LoggingMixin as oe, Listen as ne } from "@trunkjs/browser-utils";
|
|
7
7
|
import { styleMap as se } from "lit/directives/style-map.js";
|
|
8
8
|
import "@nextrap/nte-burger";
|
|
9
9
|
const le = ":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 de = Object.create, tt = Object.defineProperty, ce = Object.getOwnPropertyDescriptor, Ct = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t),
|
|
10
|
+
var de = Object.create, tt = Object.defineProperty, ce = Object.getOwnPropertyDescriptor, Ct = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), P = (t) => {
|
|
11
11
|
throw TypeError(t);
|
|
12
|
-
}, he = (t, e, r) => e in t ? tt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, St = (t, e) => tt(t, "name", { value: e, configurable: !0 }), pe = (t) => [, , , de((t == null ? void 0 : t[Ct("metadata")]) ?? null)], Pt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"],
|
|
12
|
+
}, he = (t, e, r) => e in t ? tt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, St = (t, e) => tt(t, "name", { value: e, configurable: !0 }), pe = (t) => [, , , de((t == null ? void 0 : t[Ct("metadata")]) ?? null)], Pt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Y = (t) => t !== void 0 && typeof t != "function" ? P("Function expected") : t, ve = (t, e, r, n, a) => ({ kind: Pt[t], name: e, metadata: n, addInitializer: (o) => r._ ? P("Already initialized") : a.push(Y(o || null)) }), ue = (t, e) => he(e, Ct("metadata"), t[3]), y = (t, e, r, n) => {
|
|
13
13
|
for (var a = 0, o = t[e >> 1], h = o && o.length; a < h; a++) e & 1 ? o[a].call(r) : n = o[a].call(r, n);
|
|
14
14
|
return n;
|
|
15
|
-
},
|
|
16
|
-
var h, s, b, p, f, i = e & 7, g = !!(e & 8), d = !!(e & 16), _ = i > 3 ? t.length + 1 : i ? g ? 1 : 2 : 0, k = Pt[i + 5],
|
|
15
|
+
}, M = (t, e, r, n, a, o) => {
|
|
16
|
+
var h, s, b, p, f, i = e & 7, g = !!(e & 8), d = !!(e & 16), _ = i > 3 ? t.length + 1 : i ? g ? 1 : 2 : 0, k = Pt[i + 5], E = i > 3 && (t[_ - 1] = []), W = t[_] || (t[_] = []), c = i && (!d && !g && (a = a.prototype), i < 5 && (i > 3 || !d) && ce(i < 4 ? a : { get [r]() {
|
|
17
17
|
return $t(this, o);
|
|
18
18
|
}, set [r](l) {
|
|
19
19
|
return xt(this, o, l);
|
|
20
20
|
} }, r));
|
|
21
21
|
i ? d && i < 4 && St(o, (i > 2 ? "set " : i > 1 ? "get " : "") + r) : St(a, r);
|
|
22
|
-
for (var
|
|
23
|
-
p = ve(i, r, b = {}, t[3], W), i && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => _e(a, l) : (l) => r in l }, i ^ 3 && (f.get = d ? (l) => (i ^ 1 ? $t : fe)(l, a, i ^ 4 ? o : c.get) : (l) => l[r]), i > 2 && (f.set = d ? (l,
|
|
22
|
+
for (var m = n.length - 1; m >= 0; m--)
|
|
23
|
+
p = ve(i, r, b = {}, t[3], W), i && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => _e(a, l) : (l) => r in l }, i ^ 3 && (f.get = d ? (l) => (i ^ 1 ? $t : fe)(l, a, i ^ 4 ? o : c.get) : (l) => l[r]), i > 2 && (f.set = d ? (l, w) => xt(l, a, w, i ^ 4 ? o : c.set) : (l, w) => l[r] = w)), s = (0, n[m])(i ? i < 4 ? d ? o : c[k] : i > 4 ? void 0 : { get: c.get, set: c.set } : a, p), b._ = 1, i ^ 4 || s === void 0 ? Y(s) && (i > 4 ? E.unshift(s) : i ? d ? o = s : c[k] = s : a = s) : typeof s != "object" || s === null ? P("Object expected") : (Y(h = s.get) && (c.get = h), Y(h = s.set) && (c.set = h), Y(h = s.init) && E.unshift(h));
|
|
24
24
|
return i || ue(t, a), c && tt(a, r, c), d ? i ^ 4 ? o : c : a;
|
|
25
|
-
}, et = (t, e, r) => e.has(t) ||
|
|
25
|
+
}, et = (t, e, r) => e.has(t) || P("Cannot " + r), _e = (t, e) => Object(e) !== e ? P('Cannot use the "in" operator on this value') : t.has(e), $t = (t, e, r) => (et(t, e, "read from private field"), r ? r.call(t) : e.get(t)), B = (t, e, r) => e.has(t) ? P("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), xt = (t, e, r, n) => (et(t, e, "write to private field"), n ? n.call(t, r) : e.set(t, r), r), fe = (t, e, r) => (et(t, e, "access private method"), r), Mt, Lt, It, Rt, Wt, K, Bt, v, rt, it, at, ot, nt;
|
|
26
26
|
Bt = [J("nte-nav")];
|
|
27
|
-
class $ extends (K = j,
|
|
27
|
+
class $ extends (K = j, Wt = [N({ type: String, reflect: !0 })], Rt = [N({ type: String, reflect: !0 })], It = [N({ type: String, reflect: !0, attribute: "transfer-to" })], Lt = [N({ type: String, reflect: !1, attribute: "data-group-name" })], Mt = [zt()], K) {
|
|
28
28
|
constructor() {
|
|
29
|
-
super(),
|
|
29
|
+
super(), B(this, rt, y(v, 8, this, "slave")), y(v, 11, this), B(this, it, y(v, 12, this, "99999px")), y(v, 15, this), B(this, at, y(v, 16, this, "")), y(v, 19, this), B(this, ot, y(v, 20, this, "")), y(v, 23, this), B(this, nt, y(v, 24, this, !1)), y(v, 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, Rt = [O({ type: String, reflect: !0 })], Wt = [O({ type:
|
|
|
36
36
|
return e ? e.querySelector("nte-nav") : null;
|
|
37
37
|
}
|
|
38
38
|
render() {
|
|
39
|
-
return
|
|
39
|
+
return z` <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, Rt = [O({ type: String, reflect: !0 })], Wt = [O({ type:
|
|
|
50
50
|
}}
|
|
51
51
|
>
|
|
52
52
|
<!-- fallback icon -->
|
|
53
|
-
${this._isTransferred ?
|
|
53
|
+
${this._isTransferred ? z`<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}"
|
|
@@ -89,8 +89,8 @@ class $ extends (K = j, Rt = [O({ type: String, reflect: !0 })], Wt = [O({ 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 !== "" && (mt(this.breakpoint) || (this._isTransferred = !0), window.addEventListener("breakpoint-changed", (e) => {
|
|
93
|
+
mt(this.breakpoint) ? this._isTransferred = !1 : this._isTransferred = !0;
|
|
94
94
|
})));
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -100,35 +100,35 @@ it = /* @__PURE__ */ new WeakMap();
|
|
|
100
100
|
at = /* @__PURE__ */ new WeakMap();
|
|
101
101
|
ot = /* @__PURE__ */ new WeakMap();
|
|
102
102
|
nt = /* @__PURE__ */ new WeakMap();
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
$ =
|
|
103
|
+
M(v, 4, "mode", Wt, $, rt);
|
|
104
|
+
M(v, 4, "breakpoint", Rt, $, it);
|
|
105
|
+
M(v, 4, "transferTo", It, $, at);
|
|
106
|
+
M(v, 4, "dataGroupName", Lt, $, ot);
|
|
107
|
+
M(v, 4, "_isTransferred", Mt, $, nt);
|
|
108
|
+
$ = M(v, 0, "NteNav", Bt, $);
|
|
109
109
|
$.styles = [H(le)];
|
|
110
110
|
y(v, 1, $);
|
|
111
111
|
const ge = "*,*: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 be = Object.create, st = Object.defineProperty,
|
|
112
|
+
var be = Object.create, st = Object.defineProperty, me = Object.getOwnPropertyDescriptor, Dt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), L = (t) => {
|
|
113
113
|
throw TypeError(t);
|
|
114
|
-
},
|
|
114
|
+
}, we = (t, e, r) => e in t ? st(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, kt = (t, e) => st(t, "name", { value: e, configurable: !0 }), ye = (t) => [, , , be((t == null ? void 0 : t[Dt("metadata")]) ?? null)], Yt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], A = (t) => t !== void 0 && typeof t != "function" ? L("Function expected") : t, Se = (t, e, r, n, a) => ({ kind: Yt[t], name: e, metadata: n, addInitializer: (o) => r._ ? L("Already initialized") : a.push(A(o || null)) }), $e = (t, e) => we(e, Dt("metadata"), t[3]), Q = (t, e, r, n) => {
|
|
115
115
|
for (var a = 0, o = t[e >> 1], h = o && o.length; a < h; a++) e & 1 ? o[a].call(r) : n = o[a].call(r, n);
|
|
116
116
|
return n;
|
|
117
117
|
}, At = (t, e, r, n, a, o) => {
|
|
118
|
-
var h, s, b, 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],
|
|
119
|
-
return
|
|
118
|
+
var h, s, b, 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] = []), W = t[_] || (t[_] = []), c = i && (!d && !g && (a = a.prototype), i < 5 && (i > 3 || !d) && me(i < 4 ? a : { get [r]() {
|
|
119
|
+
return Et(this, o);
|
|
120
120
|
}, set [r](l) {
|
|
121
|
-
return
|
|
121
|
+
return Nt(this, o, l);
|
|
122
122
|
} }, r));
|
|
123
123
|
i ? d && i < 4 && kt(o, (i > 2 ? "set " : i > 1 ? "get " : "") + r) : kt(a, r);
|
|
124
|
-
for (var
|
|
125
|
-
p = Se(i, r, b = {}, t[3], W), i && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => xe(a, l) : (l) => r in l }, i ^ 3 && (f.get = d ? (l) => (i ^ 1 ?
|
|
124
|
+
for (var m = n.length - 1; m >= 0; m--)
|
|
125
|
+
p = Se(i, r, b = {}, t[3], W), i && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => xe(a, l) : (l) => r in l }, i ^ 3 && (f.get = d ? (l) => (i ^ 1 ? Et : Ee)(l, a, i ^ 4 ? o : c.get) : (l) => l[r]), i > 2 && (f.set = d ? (l, w) => Nt(l, a, w, i ^ 4 ? o : c.set) : (l, w) => l[r] = w)), s = (0, n[m])(i ? i < 4 ? d ? o : c[k] : i > 4 ? void 0 : { get: c.get, set: c.set } : a, p), b._ = 1, i ^ 4 || s === void 0 ? A(s) && (i > 4 ? E.unshift(s) : i ? d ? o = s : c[k] = s : a = s) : typeof s != "object" || s === null ? L("Object expected") : (A(h = s.get) && (c.get = h), A(h = s.set) && (c.set = h), A(h = s.init) && E.unshift(h));
|
|
126
126
|
return i || $e(t, a), c && st(a, r, c), d ? i ^ 4 ? o : c : a;
|
|
127
|
-
}, lt = (t, e, r) => e.has(t) ||
|
|
127
|
+
}, lt = (t, e, r) => e.has(t) || L("Cannot " + r), xe = (t, e) => Object(e) !== e ? L('Cannot use the "in" operator on this value') : t.has(e), Et = (t, e, r) => (lt(t, e, "read from private field"), r ? r.call(t) : e.get(t)), ke = (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), Nt = (t, e, r, n) => (lt(t, e, "write to private field"), n ? n.call(t, r) : e.set(t, r), r), Ee = (t, e, r) => (lt(t, e, "access private method"), r), Ft, V, Ut, C, dt;
|
|
128
128
|
Ut = [J("nte-navbar")];
|
|
129
|
-
class U extends (V = j, Ft = [
|
|
129
|
+
class U extends (V = j, Ft = [N({ type: Number, attribute: "scroll-threshold", reflect: !0 })], V) {
|
|
130
130
|
constructor() {
|
|
131
|
-
super(), this.navbarRef =
|
|
131
|
+
super(), this.navbarRef = wt(), this.spacerRef = wt(), ke(this, dt, Q(C, 8, this, 0)), Q(C, 11, this), this._lastScrollY = window.scrollY, this._scrollUpPixels = 0, this._debouncer = void 0, this._debouncer = new ie(100, 300), document.addEventListener(
|
|
132
132
|
"scroll",
|
|
133
133
|
async () => {
|
|
134
134
|
this.updateScrollState();
|
|
@@ -154,7 +154,7 @@ class U extends (V = j, Ft = [O({ type: Number, attribute: "scroll-threshold", r
|
|
|
154
154
|
Tt.observeEmptySlots(this);
|
|
155
155
|
}
|
|
156
156
|
render() {
|
|
157
|
-
return
|
|
157
|
+
return z`
|
|
158
158
|
<div id="wrapper" part="wrapper">
|
|
159
159
|
<div id="spacer" part="spacer" ${yt(this.spacerRef)}></div>
|
|
160
160
|
<div id="navbar" part="navbar" ${yt(this.navbarRef)}>
|
|
@@ -169,19 +169,19 @@ class U extends (V = j, Ft = [O({ type: Number, attribute: "scroll-threshold", r
|
|
|
169
169
|
`;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
|
|
172
|
+
C = ye(V);
|
|
173
173
|
dt = /* @__PURE__ */ new WeakMap();
|
|
174
|
-
At(
|
|
175
|
-
U = At(
|
|
174
|
+
At(C, 4, "scrollThreshold", Ft, U, dt);
|
|
175
|
+
U = At(C, 0, "NteNavbar", Ut, U);
|
|
176
176
|
U.styles = [H(ge)];
|
|
177
|
-
Q(
|
|
178
|
-
const
|
|
179
|
-
var
|
|
177
|
+
Q(C, 1, U);
|
|
178
|
+
const Ne = "*,*: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 Oe = Object.create, ct = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, Gt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), qt = (t) => {
|
|
180
180
|
throw TypeError(t);
|
|
181
|
-
}, ze = (t, e, r) => e in t ? ct(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Ce = (t, e) => ct(t, "name", { value: e, configurable: !0 }), Pe = (t) => [, , ,
|
|
181
|
+
}, ze = (t, e, r) => e in t ? ct(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Ce = (t, e) => ct(t, "name", { value: e, configurable: !0 }), Pe = (t) => [, , , Oe((t == null ? void 0 : t[Gt("metadata")]) ?? null)], Me = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Ht = (t) => t !== void 0 && typeof t != "function" ? qt("Function expected") : t, Le = (t, e, r, n, a) => ({ kind: Me[t], name: e, metadata: n, addInitializer: (o) => r._ ? qt("Already initialized") : a.push(Ht(o || null)) }), Ie = (t, e) => ze(e, Gt("metadata"), t[3]), Re = (t, e, r, n) => {
|
|
182
182
|
for (var a = 0, o = t[e >> 1], h = o && o.length; a < h; a++) o[a].call(r);
|
|
183
183
|
return n;
|
|
184
|
-
},
|
|
184
|
+
}, We = (t, e, r, n, a, o) => {
|
|
185
185
|
var h, s, b, p = e & 7, f = !1, i = 0, g = t[i] || (t[i] = []), d = p && (a = a.prototype, p < 5 && (p > 3 || !f) && Te(a, r));
|
|
186
186
|
Ce(a, r);
|
|
187
187
|
for (var _ = n.length - 1; _ >= 0; _--)
|
|
@@ -207,7 +207,7 @@ const bt = class bt extends (Jt = j) {
|
|
|
207
207
|
Tt.observeEmptySlots(this), this.updateScrollState();
|
|
208
208
|
}
|
|
209
209
|
render() {
|
|
210
|
-
return
|
|
210
|
+
return z`
|
|
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
|
-
bt.styles = [H(
|
|
224
|
+
bt.styles = [H(Ne)];
|
|
225
225
|
let G = bt;
|
|
226
226
|
ht = Pe(Jt);
|
|
227
|
-
G =
|
|
228
|
-
|
|
229
|
-
const Be = ":host{display:
|
|
230
|
-
var De = Object.create, pt = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, Kt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t),
|
|
227
|
+
G = We(ht, 0, "NteNavbarLine", jt, G);
|
|
228
|
+
Re(ht, 1, G);
|
|
229
|
+
const Be = ":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;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 De = Object.create, pt = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, Kt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), I = (t) => {
|
|
231
231
|
throw TypeError(t);
|
|
232
|
-
}, Ae = (t, e, r) => e in t ? pt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r,
|
|
232
|
+
}, Ae = (t, e, r) => e in t ? pt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Ot = (t, e) => pt(t, "name", { value: e, configurable: !0 }), Fe = (t) => [, , , De((t == null ? void 0 : t[Kt("metadata")]) ?? null)], Qt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], F = (t) => t !== void 0 && typeof t != "function" ? I("Function expected") : t, Ue = (t, e, r, n, a) => ({ kind: Qt[t], name: e, metadata: n, addInitializer: (o) => r._ ? I("Already initialized") : a.push(F(o || null)) }), Ge = (t, e) => Ae(e, Kt("metadata"), t[3]), S = (t, e, r, n) => {
|
|
233
233
|
for (var a = 0, o = t[e >> 1], h = o && o.length; a < h; a++) e & 1 ? o[a].call(r) : n = o[a].call(r, n);
|
|
234
234
|
return n;
|
|
235
|
-
},
|
|
236
|
-
var h, s, b, p, f, i = e & 7, g = !!(e & 8), d = !!(e & 16), _ = i > 3 ? t.length + 1 : i ? g ? 1 : 2 : 0, k = Qt[i + 5],
|
|
237
|
-
return
|
|
235
|
+
}, R = (t, e, r, n, a, o) => {
|
|
236
|
+
var h, s, b, p, f, i = e & 7, g = !!(e & 8), d = !!(e & 16), _ = i > 3 ? t.length + 1 : i ? g ? 1 : 2 : 0, k = Qt[i + 5], E = i > 3 && (t[_ - 1] = []), W = t[_] || (t[_] = []), c = i && (!d && !g && (a = a.prototype), i < 5 && (i > 3 || !d) && Ye(i < 4 ? a : { get [r]() {
|
|
237
|
+
return T(this, o);
|
|
238
238
|
}, set [r](l) {
|
|
239
239
|
return X(this, o, l);
|
|
240
240
|
} }, r));
|
|
241
|
-
i ? d && i < 4 &&
|
|
242
|
-
for (var
|
|
243
|
-
p = Ue(i, r, b = {}, t[3], W), i && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => qe(a, l) : (l) => r in l }, i ^ 3 && (f.get = d ? (l) => (i ^ 1 ?
|
|
241
|
+
i ? d && i < 4 && Ot(o, (i > 2 ? "set " : i > 1 ? "get " : "") + r) : Ot(a, r);
|
|
242
|
+
for (var m = n.length - 1; m >= 0; m--)
|
|
243
|
+
p = Ue(i, r, b = {}, t[3], W), i && (p.static = g, p.private = d, f = p.access = { has: d ? (l) => qe(a, l) : (l) => r in l }, i ^ 3 && (f.get = d ? (l) => (i ^ 1 ? T : He)(l, a, i ^ 4 ? o : c.get) : (l) => l[r]), i > 2 && (f.set = d ? (l, w) => X(l, a, w, i ^ 4 ? o : c.set) : (l, w) => l[r] = w)), s = (0, n[m])(i ? i < 4 ? d ? o : c[k] : i > 4 ? void 0 : { get: c.get, set: c.set } : a, p), b._ = 1, i ^ 4 || s === void 0 ? F(s) && (i > 4 ? E.unshift(s) : i ? d ? o = s : c[k] = s : a = s) : typeof s != "object" || s === null ? I("Object expected") : (F(h = s.get) && (c.get = h), F(h = s.set) && (c.set = h), F(h = s.init) && E.unshift(h));
|
|
244
244
|
return i || Ge(t, a), c && pt(a, r, c), d ? i ^ 4 ? o : c : a;
|
|
245
|
-
}, vt = (t, e, r) => e.has(t) ||
|
|
245
|
+
}, vt = (t, e, r) => e.has(t) || I("Cannot " + r), qe = (t, e) => Object(e) !== e ? I('Cannot use the "in" operator on this value') : t.has(e), T = (t, e, r) => (vt(t, e, "read from private field"), r ? r.call(t) : e.get(t)), D = (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), X = (t, e, r, n) => (vt(t, e, "write to private field"), n ? n.call(t, r) : e.set(t, r), r), He = (t, e, r) => (vt(t, e, "access private method"), r), Vt, Xt, Zt, te, ee, Z, re, u, ut, _t, ft, gt, O;
|
|
246
246
|
re = [J("nte-nav-brand-relocator")];
|
|
247
|
-
class x extends (Z = ae(oe(j)), ee = [
|
|
247
|
+
class x extends (Z = ae(oe(j)), ee = [N({ type: String, reflect: !0 })], te = [N({ type: Boolean, reflect: !0 })], Zt = [N({ type: String, reflect: !0 })], Xt = [zt()], Vt = [ne("scroll", { target: "window", options: { passive: !0 } })], Z) {
|
|
248
248
|
constructor() {
|
|
249
|
-
super(...arguments), S(u, 5, this),
|
|
249
|
+
super(...arguments), S(u, 5, this), D(this, ut, S(u, 8, this, ".brand-image")), S(u, 11, this), D(this, _t, S(u, 12, this, null)), S(u, 15, this), D(this, ft, S(u, 16, this, "auto")), S(u, 19, this), D(this, gt, S(u, 20, this, !1)), S(u, 23, this), D(this, O, null);
|
|
250
250
|
}
|
|
251
251
|
onScroll() {
|
|
252
252
|
if (this.mode !== "auto") {
|
|
@@ -257,26 +257,30 @@ class x extends (Z = ae(oe(j)), ee = [O({ type: String, reflect: !0 })], te = [O
|
|
|
257
257
|
e !== this.active && (this.active = e);
|
|
258
258
|
}
|
|
259
259
|
onanimationEnd() {
|
|
260
|
-
this.log("Animation ended - finalizing state"), this.active || (
|
|
260
|
+
this.log("Animation ended - finalizing state"), this.active || (this.brandElement.style.visibility = "visible", this.done = !0);
|
|
261
|
+
}
|
|
262
|
+
get brandElement() {
|
|
263
|
+
return T(this, O) || (X(this, O, document.querySelector(this.brandSelector)), T(this, O) || this.warn(`Brand element not found using selector: ${this.brandSelector}`)), T(this, O);
|
|
261
264
|
}
|
|
262
265
|
render() {
|
|
263
|
-
|
|
264
|
-
|
|
266
|
+
const e = this.brandElement.getBoundingClientRect(), r = e.width / e.height;
|
|
267
|
+
this.style.setProperty("--auto-aspect-ratio", r.toString());
|
|
268
|
+
const n = this.getBoundingClientRect();
|
|
265
269
|
if (!e)
|
|
266
|
-
return
|
|
267
|
-
const
|
|
270
|
+
return z`<div>No brand element found</div>`;
|
|
271
|
+
const a = {
|
|
268
272
|
"--orig-top": e.top + "px",
|
|
269
273
|
"--orig-left": e.left + "px",
|
|
270
274
|
"--orig-width": e.width + "px",
|
|
271
275
|
"--orig-height": e.height + "px",
|
|
272
|
-
"--self-top":
|
|
273
|
-
"--self-left":
|
|
274
|
-
"--self-width":
|
|
275
|
-
"--self-height":
|
|
276
|
+
"--self-top": n.top + "px",
|
|
277
|
+
"--self-left": n.left + "px",
|
|
278
|
+
"--self-width": n.width + "px",
|
|
279
|
+
"--self-height": n.height + "px"
|
|
276
280
|
};
|
|
277
|
-
return
|
|
281
|
+
return z`<div
|
|
278
282
|
class="wrapper ${this.active ? "" : "inactive"} ${this.done ? "done" : ""}"
|
|
279
|
-
style=${se(
|
|
283
|
+
style=${se(a)}
|
|
280
284
|
@transitionend=${() => this.onanimationEnd()}
|
|
281
285
|
>
|
|
282
286
|
<slot></slot>
|
|
@@ -284,11 +288,11 @@ class x extends (Z = ae(oe(j)), ee = [O({ type: String, reflect: !0 })], te = [O
|
|
|
284
288
|
}
|
|
285
289
|
update(e) {
|
|
286
290
|
var r;
|
|
287
|
-
e.has("active") && this.active === !0 && ((r =
|
|
291
|
+
e.has("active") && this.active === !0 && ((r = T(this, O)) == null || r.style.setProperty("visibility", "hidden"), this.done = !1), super.update(e);
|
|
288
292
|
}
|
|
289
293
|
async firstUpdated() {
|
|
290
294
|
await q();
|
|
291
|
-
const e =
|
|
295
|
+
const e = this.brandElement;
|
|
292
296
|
if (!e) {
|
|
293
297
|
this.warn(`Brand element not found using selector: ${this.brandSelector}`);
|
|
294
298
|
return;
|
|
@@ -302,13 +306,13 @@ ut = /* @__PURE__ */ new WeakMap();
|
|
|
302
306
|
_t = /* @__PURE__ */ new WeakMap();
|
|
303
307
|
ft = /* @__PURE__ */ new WeakMap();
|
|
304
308
|
gt = /* @__PURE__ */ new WeakMap();
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
x =
|
|
309
|
+
O = /* @__PURE__ */ new WeakMap();
|
|
310
|
+
R(u, 4, "brandSelector", ee, x, ut);
|
|
311
|
+
R(u, 4, "active", te, x, _t);
|
|
312
|
+
R(u, 4, "mode", Zt, x, ft);
|
|
313
|
+
R(u, 4, "done", Xt, x, gt);
|
|
314
|
+
R(u, 1, "onScroll", Vt, x);
|
|
315
|
+
x = R(u, 0, "NteNavBrandRelocator", re, x);
|
|
312
316
|
x.styles = [H(Be)];
|
|
313
317
|
S(u, 1, x);
|
|
314
318
|
console.log("Loading nte-nav...");
|