@nextrap/nte-nav 1.1.29 → 1.2.0
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 +4 -0
- package/index.js +80 -74
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { waitForDomContentLoaded as
|
|
1
|
+
import { waitForDomContentLoaded as H, isBiggerThanBreakpoint as ne, Debouncer as oe, SlotTool as Tt } from "@nextrap/nt-framework";
|
|
2
2
|
import "@nextrap/nte-offcanvas";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { sleep as q, EventBindingsMixin as se, LoggingMixin as le, Listen as de, waitForLoad as ce, create_element as he } from "@trunkjs/browser-utils";
|
|
4
|
+
import { html as Y, unsafeCSS as j, LitElement as J } from "lit";
|
|
5
|
+
import { customElement as K, property as z, state as Q } from "lit/decorators.js";
|
|
6
|
+
import { createRef as St, ref as $t } from "lit/directives/ref.js";
|
|
7
7
|
import { styleMap as pe } from "lit/directives/style-map.js";
|
|
8
8
|
import "@nextrap/nte-burger";
|
|
9
9
|
const ve = ":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);--submenu-hover-text-color: var(--nt-primary);--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 ue = Object.create, it = Object.defineProperty, fe = Object.getOwnPropertyDescriptor,
|
|
10
|
+
var ue = Object.create, it = Object.defineProperty, fe = Object.getOwnPropertyDescriptor, Pt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), M = (t) => {
|
|
11
11
|
throw TypeError(t);
|
|
12
|
-
}, _e = (t, e, i) => e in t ? it(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i,
|
|
12
|
+
}, _e = (t, e, i) => e in t ? it(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, xt = (t, e) => it(t, "name", { value: e, configurable: !0 }), ge = (t) => [, , , ue((t == null ? void 0 : t[Pt("metadata")]) ?? null)], Mt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], A = (t) => t !== void 0 && typeof t != "function" ? M("Function expected") : t, be = (t, e, i, o, a) => ({ kind: Mt[t], name: e, metadata: o, addInitializer: (n) => i._ ? M("Already initialized") : a.push(A(n || null)) }), me = (t, e) => _e(e, Pt("metadata"), t[3]), S = (t, e, i, o) => {
|
|
13
13
|
for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) e & 1 ? n[a].call(i) : o = n[a].call(i, o);
|
|
14
14
|
return o;
|
|
15
15
|
}, W = (t, e, i, o, a, n) => {
|
|
16
|
-
var h, s, m, p, _, r = e & 7, g = !!(e & 8), d = !!(e & 16), f = r > 3 ? t.length + 1 : r ? g ? 1 : 2 : 0, k =
|
|
17
|
-
return
|
|
16
|
+
var h, s, m, p, _, r = e & 7, g = !!(e & 8), d = !!(e & 16), f = r > 3 ? t.length + 1 : r ? g ? 1 : 2 : 0, k = Mt[r + 5], E = r > 3 && (t[f - 1] = []), I = t[f] || (t[f] = []), c = r && (!d && !g && (a = a.prototype), r < 5 && (r > 3 || !d) && fe(r < 4 ? a : { get [i]() {
|
|
17
|
+
return kt(this, n);
|
|
18
18
|
}, set [i](l) {
|
|
19
|
-
return
|
|
19
|
+
return Et(this, n, l);
|
|
20
20
|
} }, i));
|
|
21
|
-
r ? d && r < 4 &&
|
|
21
|
+
r ? d && r < 4 && xt(n, (r > 2 ? "set " : r > 1 ? "get " : "") + i) : xt(a, i);
|
|
22
22
|
for (var w = o.length - 1; w >= 0; w--)
|
|
23
|
-
p = be(r, i, m = {}, t[3], I), r && (p.static = g, p.private = d, _ = p.access = { has: d ? (l) => we(a, l) : (l) => i in l }, r ^ 3 && (_.get = d ? (l) => (r ^ 1 ?
|
|
23
|
+
p = be(r, i, m = {}, t[3], I), r && (p.static = g, p.private = d, _ = p.access = { has: d ? (l) => we(a, l) : (l) => i in l }, r ^ 3 && (_.get = d ? (l) => (r ^ 1 ? kt : ye)(l, a, r ^ 4 ? n : c.get) : (l) => l[i]), r > 2 && (_.set = d ? (l, y) => Et(l, a, y, r ^ 4 ? n : c.set) : (l, y) => l[i] = y)), s = (0, o[w])(r ? r < 4 ? d ? n : c[k] : r > 4 ? void 0 : { get: c.get, set: c.set } : a, p), m._ = 1, r ^ 4 || s === void 0 ? A(s) && (r > 4 ? E.unshift(s) : r ? d ? n = s : c[k] = s : a = s) : typeof s != "object" || s === null ? M("Object expected") : (A(h = s.get) && (c.get = h), A(h = s.set) && (c.set = h), A(h = s.init) && E.unshift(h));
|
|
24
24
|
return r || me(t, a), c && it(a, i, c), d ? r ^ 4 ? n : c : a;
|
|
25
|
-
}, rt = (t, e, i) => e.has(t) || M("Cannot " + i), we = (t, e) => Object(e) !== e ? M('Cannot use the "in" operator on this value') : t.has(e),
|
|
26
|
-
|
|
27
|
-
class x extends (V =
|
|
25
|
+
}, rt = (t, e, i) => e.has(t) || M("Cannot " + i), we = (t, e) => Object(e) !== e ? M('Cannot use the "in" operator on this value') : t.has(e), kt = (t, e, i) => (rt(t, e, "read from private field"), i ? i.call(t) : e.get(t)), R = (t, e, i) => e.has(t) ? M("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), Et = (t, e, i, o) => (rt(t, e, "write to private field"), o ? o.call(t, i) : e.set(t, i), i), ye = (t, e, i) => (rt(t, e, "access private method"), i), Wt, Lt, Bt, It, Rt, V, At, u, at, nt, ot, st, lt;
|
|
26
|
+
At = [K("nte-nav")];
|
|
27
|
+
class x extends (V = J, Rt = [z({ type: String, reflect: !0 })], It = [z({ type: String, reflect: !0 })], Bt = [z({ type: String, reflect: !0, attribute: "transfer-to" })], Lt = [z({ type: String, reflect: !1, attribute: "data-group-name" })], Wt = [Q()], V) {
|
|
28
28
|
constructor() {
|
|
29
29
|
super(), R(this, at, S(u, 8, this, "slave")), S(u, 11, this), R(this, nt, S(u, 12, this, "99999px")), S(u, 15, this), R(this, ot, S(u, 16, this, "")), S(u, 19, this), R(this, st, S(u, 20, this, "")), S(u, 23, this), R(this, lt, S(u, 24, this, !1)), S(u, 27, this);
|
|
30
30
|
}
|
|
@@ -89,9 +89,15 @@ class x extends (V = j, At = [z({ type: String, reflect: !0 })], Rt = [z({ type:
|
|
|
89
89
|
!i.contains("nav-vertical") && !i.contains("nav-horizontal") && i.add(this.closest("nte-offcanvas") === null ? "nav-horizontal" : "nav-vertical");
|
|
90
90
|
}
|
|
91
91
|
async connectedCallback() {
|
|
92
|
-
await
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
await H(), super.connectedCallback();
|
|
93
|
+
const e = () => {
|
|
94
|
+
if (this.transferTo === "") {
|
|
95
|
+
this._isTransferred = !1;
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this.breakpoint !== "" && (ne(this.breakpoint) ? this._isTransferred = !1 : this._isTransferred = !0);
|
|
99
|
+
};
|
|
100
|
+
this.mode !== "slave" && this.breakpoint !== "" && (e(), window.addEventListener("breakpoint-changed", e), (async () => (await q(1e3), e()))());
|
|
95
101
|
}
|
|
96
102
|
}
|
|
97
103
|
u = ge(V);
|
|
@@ -100,35 +106,35 @@ nt = /* @__PURE__ */ new WeakMap();
|
|
|
100
106
|
ot = /* @__PURE__ */ new WeakMap();
|
|
101
107
|
st = /* @__PURE__ */ new WeakMap();
|
|
102
108
|
lt = /* @__PURE__ */ new WeakMap();
|
|
103
|
-
W(u, 4, "mode",
|
|
104
|
-
W(u, 4, "breakpoint",
|
|
105
|
-
W(u, 4, "transferTo",
|
|
106
|
-
W(u, 4, "dataGroupName",
|
|
107
|
-
W(u, 4, "_isTransferred",
|
|
108
|
-
x = W(u, 0, "NteNav",
|
|
109
|
-
x.styles = [
|
|
109
|
+
W(u, 4, "mode", Rt, x, at);
|
|
110
|
+
W(u, 4, "breakpoint", It, x, nt);
|
|
111
|
+
W(u, 4, "transferTo", Bt, x, ot);
|
|
112
|
+
W(u, 4, "dataGroupName", Lt, x, st);
|
|
113
|
+
W(u, 4, "_isTransferred", Wt, x, lt);
|
|
114
|
+
x = W(u, 0, "NteNav", At, x);
|
|
115
|
+
x.styles = [j(ve)];
|
|
110
116
|
S(u, 1, x);
|
|
111
117
|
const Se = "*,*: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 $e = Object.create, dt = Object.defineProperty, xe = Object.getOwnPropertyDescriptor,
|
|
118
|
+
var $e = Object.create, dt = Object.defineProperty, xe = Object.getOwnPropertyDescriptor, Dt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), L = (t) => {
|
|
113
119
|
throw TypeError(t);
|
|
114
|
-
}, ke = (t, e, i) => e in t ? dt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i,
|
|
120
|
+
}, ke = (t, e, i) => e in t ? dt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, zt = (t, e) => dt(t, "name", { value: e, configurable: !0 }), Ee = (t) => [, , , $e((t == null ? void 0 : t[Dt("metadata")]) ?? null)], Ft = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], D = (t) => t !== void 0 && typeof t != "function" ? L("Function expected") : t, ze = (t, e, i, o, a) => ({ kind: Ft[t], name: e, metadata: o, addInitializer: (n) => i._ ? L("Already initialized") : a.push(D(n || null)) }), Ce = (t, e) => ke(e, Dt("metadata"), t[3]), X = (t, e, i, o) => {
|
|
115
121
|
for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) e & 1 ? n[a].call(i) : o = n[a].call(i, o);
|
|
116
122
|
return o;
|
|
117
|
-
},
|
|
118
|
-
var h, s, m, p, _, r = e & 7, g = !!(e & 8), d = !!(e & 16), f = r > 3 ? t.length + 1 : r ? g ? 1 : 2 : 0, k =
|
|
119
|
-
return
|
|
123
|
+
}, Yt = (t, e, i, o, a, n) => {
|
|
124
|
+
var h, s, m, p, _, r = e & 7, g = !!(e & 8), d = !!(e & 16), f = r > 3 ? t.length + 1 : r ? g ? 1 : 2 : 0, k = Ft[r + 5], E = r > 3 && (t[f - 1] = []), I = t[f] || (t[f] = []), c = r && (!d && !g && (a = a.prototype), r < 5 && (r > 3 || !d) && xe(r < 4 ? a : { get [i]() {
|
|
125
|
+
return Ct(this, n);
|
|
120
126
|
}, set [i](l) {
|
|
121
|
-
return
|
|
127
|
+
return Ot(this, n, l);
|
|
122
128
|
} }, i));
|
|
123
|
-
r ? d && r < 4 &&
|
|
129
|
+
r ? d && r < 4 && zt(n, (r > 2 ? "set " : r > 1 ? "get " : "") + i) : zt(a, i);
|
|
124
130
|
for (var w = o.length - 1; w >= 0; w--)
|
|
125
|
-
p = ze(r, i, m = {}, t[3], I), r && (p.static = g, p.private = d, _ = p.access = { has: d ? (l) => Oe(a, l) : (l) => i in l }, r ^ 3 && (_.get = d ? (l) => (r ^ 1 ?
|
|
131
|
+
p = ze(r, i, m = {}, t[3], I), r && (p.static = g, p.private = d, _ = p.access = { has: d ? (l) => Oe(a, l) : (l) => i in l }, r ^ 3 && (_.get = d ? (l) => (r ^ 1 ? Ct : Te)(l, a, r ^ 4 ? n : c.get) : (l) => l[i]), r > 2 && (_.set = d ? (l, y) => Ot(l, a, y, r ^ 4 ? n : c.set) : (l, y) => l[i] = y)), s = (0, o[w])(r ? r < 4 ? d ? n : c[k] : r > 4 ? void 0 : { get: c.get, set: c.set } : a, p), m._ = 1, r ^ 4 || s === void 0 ? D(s) && (r > 4 ? E.unshift(s) : r ? d ? n = s : c[k] = s : a = s) : typeof s != "object" || s === null ? L("Object expected") : (D(h = s.get) && (c.get = h), D(h = s.set) && (c.set = h), D(h = s.init) && E.unshift(h));
|
|
126
132
|
return r || Ce(t, a), c && dt(a, i, c), d ? r ^ 4 ? n : c : a;
|
|
127
|
-
}, ct = (t, e, i) => e.has(t) || L("Cannot " + i), Oe = (t, e) => Object(e) !== e ? L('Cannot use the "in" operator on this value') : t.has(e),
|
|
128
|
-
|
|
129
|
-
class G extends (Z =
|
|
133
|
+
}, ct = (t, e, i) => e.has(t) || L("Cannot " + i), Oe = (t, e) => Object(e) !== e ? L('Cannot use the "in" operator on this value') : t.has(e), Ct = (t, e, i) => (ct(t, e, "read from private field"), i ? i.call(t) : e.get(t)), Ne = (t, e, i) => e.has(t) ? L("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), Ot = (t, e, i, o) => (ct(t, e, "write to private field"), o ? o.call(t, i) : e.set(t, i), i), Te = (t, e, i) => (ct(t, e, "access private method"), i), Gt, Z, Ut, P, ht;
|
|
134
|
+
Ut = [K("nte-navbar")];
|
|
135
|
+
class G extends (Z = J, Gt = [z({ type: Number, attribute: "scroll-threshold", reflect: !0 })], Z) {
|
|
130
136
|
constructor() {
|
|
131
|
-
super(), this.navbarRef =
|
|
137
|
+
super(), this.navbarRef = St(), this.spacerRef = St(), Ne(this, ht, X(P, 8, this, 0)), X(P, 11, this), this._lastScrollY = window.scrollY, this._scrollUpPixels = 0, this._debouncer = void 0, this._debouncer = new oe(100, 300), document.addEventListener(
|
|
132
138
|
"scroll",
|
|
133
139
|
async () => {
|
|
134
140
|
this.updateScrollState();
|
|
@@ -144,20 +150,20 @@ class G extends (Z = j, Ut = [z({ type: Number, attribute: "scroll-threshold", r
|
|
|
144
150
|
e > 1 ? this.classList.add("is-scrolled") : this.classList.remove("is-scrolled"), e < this._lastScrollY ? (this._scrollUpPixels += this._lastScrollY - e, this._scrollUpPixels > 10 && e < this.scrollThreshold && this.classList.add("is-scrolling-up")) : (this._scrollUpPixels = 0, this.classList.remove("is-scrolling-up")), e > this.scrollThreshold ? this.classList.add("is-below-threshold") : this.classList.remove("is-below-threshold"), this._lastScrollY = e;
|
|
145
151
|
}
|
|
146
152
|
async connectedCallback() {
|
|
147
|
-
this.updateScrollState(), await
|
|
153
|
+
this.updateScrollState(), await H(), super.connectedCallback();
|
|
148
154
|
}
|
|
149
155
|
// Adjust the spacer height on every render
|
|
150
156
|
async updated(e) {
|
|
151
|
-
await
|
|
157
|
+
await H(), super.updated(e);
|
|
152
158
|
}
|
|
153
159
|
firstUpdated(e) {
|
|
154
|
-
|
|
160
|
+
Tt.observeEmptySlots(this);
|
|
155
161
|
}
|
|
156
162
|
render() {
|
|
157
163
|
return Y`
|
|
158
164
|
<div id="wrapper" part="wrapper">
|
|
159
|
-
<div id="spacer" part="spacer" ${
|
|
160
|
-
<div id="navbar" part="navbar" ${
|
|
165
|
+
<div id="spacer" part="spacer" ${$t(this.spacerRef)}></div>
|
|
166
|
+
<div id="navbar" part="navbar" ${$t(this.navbarRef)}>
|
|
161
167
|
<div id="brand" part="brand">
|
|
162
168
|
<slot name="brand"></slot>
|
|
163
169
|
</div>
|
|
@@ -171,25 +177,25 @@ class G extends (Z = j, Ut = [z({ type: Number, attribute: "scroll-threshold", r
|
|
|
171
177
|
}
|
|
172
178
|
P = Ee(Z);
|
|
173
179
|
ht = /* @__PURE__ */ new WeakMap();
|
|
174
|
-
|
|
175
|
-
G =
|
|
176
|
-
G.styles = [
|
|
180
|
+
Yt(P, 4, "scrollThreshold", Gt, G, ht);
|
|
181
|
+
G = Yt(P, 0, "NteNavbar", Ut, G);
|
|
182
|
+
G.styles = [j(Se)];
|
|
177
183
|
X(P, 1, G);
|
|
178
184
|
const Pe = "*,*: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 Me = Object.create, pt = Object.defineProperty, We = Object.getOwnPropertyDescriptor,
|
|
185
|
+
var Me = Object.create, pt = Object.defineProperty, We = Object.getOwnPropertyDescriptor, qt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), Ht = (t) => {
|
|
180
186
|
throw TypeError(t);
|
|
181
|
-
}, Le = (t, e, i) => e in t ? pt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, Be = (t, e) => pt(t, "name", { value: e, configurable: !0 }), Ie = (t) => [, , , Me((t == null ? void 0 : t[
|
|
187
|
+
}, Le = (t, e, i) => e in t ? pt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, Be = (t, e) => pt(t, "name", { value: e, configurable: !0 }), Ie = (t) => [, , , Me((t == null ? void 0 : t[qt("metadata")]) ?? null)], Re = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], jt = (t) => t !== void 0 && typeof t != "function" ? Ht("Function expected") : t, Ae = (t, e, i, o, a) => ({ kind: Re[t], name: e, metadata: o, addInitializer: (n) => i._ ? Ht("Already initialized") : a.push(jt(n || null)) }), De = (t, e) => Le(e, qt("metadata"), t[3]), Fe = (t, e, i, o) => {
|
|
182
188
|
for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) n[a].call(i);
|
|
183
189
|
return o;
|
|
184
190
|
}, Ye = (t, e, i, o, a, n) => {
|
|
185
191
|
var h, s, m, p = e & 7, _ = !1, r = 0, g = t[r] || (t[r] = []), d = p && (a = a.prototype, p < 5 && (p > 3 || !_) && We(a, i));
|
|
186
192
|
Be(a, i);
|
|
187
193
|
for (var f = o.length - 1; f >= 0; f--)
|
|
188
|
-
m = Ae(p, i, s = {}, t[3], g), h = (0, o[f])(a, m), s._ = 1,
|
|
194
|
+
m = Ae(p, i, s = {}, t[3], g), h = (0, o[f])(a, m), s._ = 1, jt(h) && (a = h);
|
|
189
195
|
return De(t, a), d && pt(a, i, d), _ ? p ^ 4 ? n : d : a;
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
const yt = class yt extends (
|
|
196
|
+
}, Jt, vt, Kt;
|
|
197
|
+
Jt = [K("nte-navbar-line")];
|
|
198
|
+
const yt = class yt extends (Kt = J) {
|
|
193
199
|
constructor() {
|
|
194
200
|
super(...arguments), this._isScrolled = !1;
|
|
195
201
|
}
|
|
@@ -204,7 +210,7 @@ const yt = class yt extends (Qt = j) {
|
|
|
204
210
|
super.connectedCallback(), window.addEventListener("scroll", () => this.updateScrollState(), { passive: !0 });
|
|
205
211
|
}
|
|
206
212
|
async firstUpdated(e) {
|
|
207
|
-
|
|
213
|
+
Tt.observeEmptySlots(this), this.updateScrollState();
|
|
208
214
|
}
|
|
209
215
|
render() {
|
|
210
216
|
return Y`
|
|
@@ -221,30 +227,30 @@ const yt = class yt extends (Qt = j) {
|
|
|
221
227
|
`;
|
|
222
228
|
}
|
|
223
229
|
};
|
|
224
|
-
yt.styles = [
|
|
230
|
+
yt.styles = [j(Pe)];
|
|
225
231
|
let U = yt;
|
|
226
|
-
vt = Ie(
|
|
227
|
-
U = Ye(vt, 0, "NteNavbarLine",
|
|
232
|
+
vt = Ie(Kt);
|
|
233
|
+
U = Ye(vt, 0, "NteNavbarLine", Jt, U);
|
|
228
234
|
Fe(vt, 1, U);
|
|
229
235
|
const Ge = ":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 Ue = Object.create, ut = Object.defineProperty, qe = Object.getOwnPropertyDescriptor,
|
|
236
|
+
var Ue = Object.create, ut = Object.defineProperty, qe = Object.getOwnPropertyDescriptor, Qt = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), B = (t) => {
|
|
231
237
|
throw TypeError(t);
|
|
232
|
-
}, He = (t, e, i) => e in t ? ut(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i,
|
|
238
|
+
}, He = (t, e, i) => e in t ? ut(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, Nt = (t, e) => ut(t, "name", { value: e, configurable: !0 }), je = (t) => [, , , Ue((t == null ? void 0 : t[Qt("metadata")]) ?? null)], Vt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], F = (t) => t !== void 0 && typeof t != "function" ? B("Function expected") : t, Je = (t, e, i, o, a) => ({ kind: Vt[t], name: e, metadata: o, addInitializer: (n) => i._ ? B("Already initialized") : a.push(F(n || null)) }), Ke = (t, e) => He(e, Qt("metadata"), t[3]), b = (t, e, i, o) => {
|
|
233
239
|
for (var a = 0, n = t[e >> 1], h = n && n.length; a < h; a++) e & 1 ? n[a].call(i) : o = n[a].call(i, o);
|
|
234
240
|
return o;
|
|
235
241
|
}, O = (t, e, i, o, a, n) => {
|
|
236
|
-
var h, s, m, p, _, r = e & 7, g = !!(e & 8), d = !!(e & 16), f = r > 3 ? t.length + 1 : r ? g ? 1 : 2 : 0, k =
|
|
242
|
+
var h, s, m, p, _, r = e & 7, g = !!(e & 8), d = !!(e & 16), f = r > 3 ? t.length + 1 : r ? g ? 1 : 2 : 0, k = Vt[r + 5], E = r > 3 && (t[f - 1] = []), I = t[f] || (t[f] = []), c = r && (!d && !g && (a = a.prototype), r < 5 && (r > 3 || !d) && qe(r < 4 ? a : { get [i]() {
|
|
237
243
|
return T(this, n);
|
|
238
244
|
}, set [i](l) {
|
|
239
245
|
return tt(this, n, l);
|
|
240
246
|
} }, i));
|
|
241
|
-
r ? d && r < 4 &&
|
|
247
|
+
r ? d && r < 4 && Nt(n, (r > 2 ? "set " : r > 1 ? "get " : "") + i) : Nt(a, i);
|
|
242
248
|
for (var w = o.length - 1; w >= 0; w--)
|
|
243
249
|
p = Je(r, i, m = {}, t[3], I), r && (p.static = g, p.private = d, _ = p.access = { has: d ? (l) => Qe(a, l) : (l) => i in l }, r ^ 3 && (_.get = d ? (l) => (r ^ 1 ? T : Ve)(l, a, r ^ 4 ? n : c.get) : (l) => l[i]), r > 2 && (_.set = d ? (l, y) => tt(l, a, y, r ^ 4 ? n : c.set) : (l, y) => l[i] = y)), s = (0, o[w])(r ? r < 4 ? d ? n : c[k] : r > 4 ? void 0 : { get: c.get, set: c.set } : a, p), m._ = 1, r ^ 4 || s === void 0 ? F(s) && (r > 4 ? E.unshift(s) : r ? d ? n = s : c[k] = s : a = s) : typeof s != "object" || s === null ? B("Object expected") : (F(h = s.get) && (c.get = h), F(h = s.set) && (c.set = h), F(h = s.init) && E.unshift(h));
|
|
244
250
|
return r || Ke(t, a), c && ut(a, i, c), d ? r ^ 4 ? n : c : a;
|
|
245
|
-
}, ft = (t, e, i) => e.has(t) || B("Cannot " + i), Qe = (t, e) => Object(e) !== e ? B('Cannot use the "in" operator on this value') : t.has(e), T = (t, e, i) => (ft(t, e, "read from private field"), i ? i.call(t) : e.get(t)), N = (t, e, i) => e.has(t) ? B("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), tt = (t, e, i, o) => (ft(t, e, "write to private field"), o ? o.call(t, i) : e.set(t, i), i), Ve = (t, e, i) => (ft(t, e, "access private method"), i), Zt, te, ee, ie, re,
|
|
246
|
-
|
|
247
|
-
class $ extends (et = se(le(
|
|
251
|
+
}, ft = (t, e, i) => e.has(t) || B("Cannot " + i), Qe = (t, e) => Object(e) !== e ? B('Cannot use the "in" operator on this value') : t.has(e), T = (t, e, i) => (ft(t, e, "read from private field"), i ? i.call(t) : e.get(t)), N = (t, e, i) => e.has(t) ? B("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), tt = (t, e, i, o) => (ft(t, e, "write to private field"), o ? o.call(t, i) : e.set(t, i), i), Ve = (t, e, i) => (ft(t, e, "access private method"), i), Xt, Zt, te, ee, ie, re, et, ae, v, _t, gt, bt, mt, wt, C;
|
|
252
|
+
ae = [K("nte-nav-brand-relocator")];
|
|
253
|
+
class $ extends (et = se(le(J)), re = [z({ type: String, reflect: !0 })], ie = [z({ type: Boolean, reflect: !0 })], ee = [z({ type: String, reflect: !0 })], te = [Q()], Zt = [Q()], Xt = [de("scroll", { target: "window", options: { passive: !0 } })], et) {
|
|
248
254
|
constructor() {
|
|
249
255
|
super(...arguments), b(v, 5, this), N(this, _t, b(v, 8, this, ".brand-image")), b(v, 11, this), N(this, gt, b(v, 12, this, null)), b(v, 15, this), N(this, bt, b(v, 16, this, "auto")), b(v, 19, this), N(this, mt, b(v, 20, this, !1)), b(v, 23, this), N(this, wt, b(v, 24, this, !1)), b(v, 27, this), N(this, C, null);
|
|
250
256
|
}
|
|
@@ -298,15 +304,15 @@ class $ extends (et = se(le(j)), ae = [z({ type: String, reflect: !0 })], re = [
|
|
|
298
304
|
this.warn(`Brand element not found using selector: ${this.brandSelector}`);
|
|
299
305
|
return;
|
|
300
306
|
}
|
|
301
|
-
for (this.log("Waiting for Ghost element loading...", this.ghostElement), await ce(this.ghostElement), await
|
|
302
|
-
this.log("Waiting for Ghost element to have naturalWidth...", this.ghostElement), await
|
|
307
|
+
for (this.log("Waiting for Ghost element loading...", this.ghostElement), await ce(this.ghostElement), await q(10); !((i = this.ghostElement) != null && i.naturalWidth); )
|
|
308
|
+
this.log("Waiting for Ghost element to have naturalWidth...", this.ghostElement), await q(100);
|
|
303
309
|
for (; this.brandElement && !this.brandElement.getBoundingClientRect().width; )
|
|
304
|
-
this.log("Waiting for Brand element to have width...", this.brandElement), await
|
|
310
|
+
this.log("Waiting for Brand element to have width...", this.brandElement), await q(100);
|
|
305
311
|
const e = ((o = this.ghostElement) == null ? void 0 : o.naturalWidth) / ((a = this.ghostElement) == null ? void 0 : a.naturalHeight);
|
|
306
312
|
this.log("Setting Aspect ratio:", e), this.style.setProperty("--auto-aspect-ratio", e.toString()), this.log("Brand element is now loaded:", this.brandElement), this.initialized = !0, this.onScroll();
|
|
307
313
|
}
|
|
308
314
|
async connectedCallback() {
|
|
309
|
-
if (await
|
|
315
|
+
if (await H(), this.ghostElement === null) {
|
|
310
316
|
const e = this.brandElement;
|
|
311
317
|
if (this.log("first connectedCallback() on Brand element:", e), !e) {
|
|
312
318
|
this.warn(`Brand element not found using selector: ${this.brandSelector}`);
|
|
@@ -327,14 +333,14 @@ bt = /* @__PURE__ */ new WeakMap();
|
|
|
327
333
|
mt = /* @__PURE__ */ new WeakMap();
|
|
328
334
|
wt = /* @__PURE__ */ new WeakMap();
|
|
329
335
|
C = /* @__PURE__ */ new WeakMap();
|
|
330
|
-
O(v, 4, "brandSelector",
|
|
331
|
-
O(v, 4, "active",
|
|
332
|
-
O(v, 4, "mode",
|
|
333
|
-
O(v, 4, "done",
|
|
334
|
-
O(v, 4, "initialized",
|
|
335
|
-
O(v, 1, "onScroll",
|
|
336
|
-
$ = O(v, 0, "NteNavBrandRelocator",
|
|
337
|
-
$.styles = [
|
|
336
|
+
O(v, 4, "brandSelector", re, $, _t);
|
|
337
|
+
O(v, 4, "active", ie, $, gt);
|
|
338
|
+
O(v, 4, "mode", ee, $, bt);
|
|
339
|
+
O(v, 4, "done", te, $, mt);
|
|
340
|
+
O(v, 4, "initialized", Zt, $, wt);
|
|
341
|
+
O(v, 1, "onScroll", Xt, $);
|
|
342
|
+
$ = O(v, 0, "NteNavBrandRelocator", ae, $);
|
|
343
|
+
$.styles = [j(Ge)];
|
|
338
344
|
b(v, 1, $);
|
|
339
345
|
console.log("Loading nte-nav...");
|
|
340
346
|
export {
|