@styleon/foundation 0.0.0-next.0 → 0.0.0-next.1
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/common/context/tab-context.d.ts +7 -0
- package/dist/common/context/tab-context.js +5 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +12 -4
- package/dist/node_modules/@lit/context/lib/context-request-event.js +13 -0
- package/dist/node_modules/@lit/context/lib/controllers/context-consumer.js +29 -0
- package/dist/node_modules/@lit/context/lib/controllers/context-provider.js +37 -0
- package/dist/node_modules/@lit/context/lib/create-context.js +11 -0
- package/dist/node_modules/@lit/context/lib/decorators/consume.js +22 -0
- package/dist/node_modules/@lit/context/lib/decorators/provide.js +46 -0
- package/dist/node_modules/@lit/context/lib/value-notifier.js +36 -0
- package/dist/node_modules/@lit/reactive-element/decorators/base.js +9 -0
- package/dist/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js +19 -0
- package/dist/node_modules/@lit/reactive-element/decorators/state.js +12 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/BehaviorSubject.js +29 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +80 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/Subject.js +109 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +96 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +104 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +6 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +15 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +6 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js +9 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +13 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +9 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +9 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +6 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +6 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +6 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +5 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +11 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +9 -0
- package/dist/node_modules/tslib/tslib.es6.js +54 -0
- package/dist/tab/tab.component.d.ts +16 -0
- package/dist/tab/tab.component.js +65 -0
- package/dist/tab-panel/tab-panel.component.d.ts +16 -0
- package/dist/tab-panel/tab-panel.component.js +70 -0
- package/dist/tabs/tabs.component.d.ts +15 -0
- package/dist/tabs/tabs.component.js +62 -0
- package/dist/tabs/tabs.service.d.ts +14 -0
- package/dist/tabs/tabs.service.js +16 -0
- package/package.json +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export * as FlashButton from './button/button.component';
|
|
2
2
|
export * as FlashModal from './modal/modal';
|
|
3
|
+
export * as FlashTabs from './tabs/tabs.component';
|
|
4
|
+
export * as FlashTab from './tab/tab.component';
|
|
5
|
+
export * as FlashTabPanel from './tab-panel/tab-panel.component';
|
|
6
|
+
export * as FlashTabService from './tabs/tabs.service';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as a from "./button/button.component.js";
|
|
2
|
+
import * as o from "./modal/modal.js";
|
|
3
|
+
import * as t from "./tabs/tabs.component.js";
|
|
4
|
+
import * as s from "./tab/tab.component.js";
|
|
5
|
+
import * as r from "./tab-panel/tab-panel.component.js";
|
|
6
|
+
import * as m from "./tabs/tabs.service.js";
|
|
3
7
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
a as FlashButton,
|
|
9
|
+
o as FlashModal,
|
|
10
|
+
s as FlashTab,
|
|
11
|
+
r as FlashTabPanel,
|
|
12
|
+
m as FlashTabService,
|
|
13
|
+
t as FlashTabs
|
|
6
14
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
let r = class extends Event {
|
|
7
|
+
constructor(t, e, s, c) {
|
|
8
|
+
super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.contextTarget = e, this.callback = s, this.subscribe = c ?? !1;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
r as ContextRequestEvent
|
|
13
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ContextRequestEvent as b } from "../context-request-event.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2021 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
class r {
|
|
8
|
+
constructor(e, t, h, c) {
|
|
9
|
+
if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (s, i) => {
|
|
10
|
+
this.unsubscribe && (this.unsubscribe !== i && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = s, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(s, i)), this.unsubscribe = i;
|
|
11
|
+
}, this.host = e, t.context !== void 0) {
|
|
12
|
+
const s = t;
|
|
13
|
+
this.context = s.context, this.callback = s.callback, this.subscribe = s.subscribe ?? !1;
|
|
14
|
+
} else this.context = t, this.callback = h, this.subscribe = c ?? !1;
|
|
15
|
+
this.host.addController(this);
|
|
16
|
+
}
|
|
17
|
+
hostConnected() {
|
|
18
|
+
this.dispatchRequest();
|
|
19
|
+
}
|
|
20
|
+
hostDisconnected() {
|
|
21
|
+
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
|
|
22
|
+
}
|
|
23
|
+
dispatchRequest() {
|
|
24
|
+
this.host.dispatchEvent(new b(this.context, this.host, this.t, this.subscribe));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
r as ContextConsumer
|
|
29
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ContextRequestEvent as d } from "../context-request-event.js";
|
|
2
|
+
import { ValueNotifier as x } from "../value-notifier.js";
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2021 Google LLC
|
|
6
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
class u extends Event {
|
|
9
|
+
constructor(o, e) {
|
|
10
|
+
super("context-provider", { bubbles: !0, composed: !0 }), this.context = o, this.contextTarget = e;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
class l extends x {
|
|
14
|
+
constructor(o, e, a) {
|
|
15
|
+
var i, r;
|
|
16
|
+
super(e.context !== void 0 ? e.initialValue : a), this.onContextRequest = (t) => {
|
|
17
|
+
if (t.context !== this.context) return;
|
|
18
|
+
const s = t.contextTarget ?? t.composedPath()[0];
|
|
19
|
+
s !== this.host && (t.stopPropagation(), this.addCallback(t.callback, s, t.subscribe));
|
|
20
|
+
}, this.onProviderRequest = (t) => {
|
|
21
|
+
if (t.context !== this.context || (t.contextTarget ?? t.composedPath()[0]) === this.host) return;
|
|
22
|
+
const s = /* @__PURE__ */ new Set();
|
|
23
|
+
for (const [n, { consumerHost: c }] of this.subscriptions) s.has(n) || (s.add(n), c.dispatchEvent(new d(this.context, c, n, !0)));
|
|
24
|
+
t.stopPropagation();
|
|
25
|
+
}, this.host = o, e.context !== void 0 ? this.context = e.context : this.context = e, this.attachListeners(), (r = (i = this.host).addController) == null || r.call(i, this);
|
|
26
|
+
}
|
|
27
|
+
attachListeners() {
|
|
28
|
+
this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
|
|
29
|
+
}
|
|
30
|
+
hostConnected() {
|
|
31
|
+
this.host.dispatchEvent(new u(this.context, this.host));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
l as ContextProvider,
|
|
36
|
+
u as ContextProviderEvent
|
|
37
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ContextConsumer as n } from "../controllers/context-consumer.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2022 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
function a({ context: e, subscribe: s }) {
|
|
8
|
+
return (i, c) => {
|
|
9
|
+
typeof c == "object" ? c.addInitializer(function() {
|
|
10
|
+
new n(this, { context: e, callback: (t) => {
|
|
11
|
+
i.set.call(this, t);
|
|
12
|
+
}, subscribe: s });
|
|
13
|
+
}) : i.constructor.addInitializer((t) => {
|
|
14
|
+
new n(t, { context: e, callback: (o) => {
|
|
15
|
+
t[c] = o;
|
|
16
|
+
}, subscribe: s });
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
a as consume
|
|
22
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ContextProvider as c } from "../controllers/context-provider.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2017 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
function l({ context: a }) {
|
|
8
|
+
return (r, o) => {
|
|
9
|
+
const s = /* @__PURE__ */ new WeakMap();
|
|
10
|
+
if (typeof o == "object") return o.addInitializer(function() {
|
|
11
|
+
s.set(this, new c(this, { context: a }));
|
|
12
|
+
}), { get() {
|
|
13
|
+
return r.get.call(this);
|
|
14
|
+
}, set(t) {
|
|
15
|
+
var e;
|
|
16
|
+
return (e = s.get(this)) == null || e.setValue(t), r.set.call(this, t);
|
|
17
|
+
}, init(t) {
|
|
18
|
+
var e;
|
|
19
|
+
return (e = s.get(this)) == null || e.setValue(t), t;
|
|
20
|
+
} };
|
|
21
|
+
{
|
|
22
|
+
r.constructor.addInitializer((i) => {
|
|
23
|
+
s.set(i, new c(i, { context: a }));
|
|
24
|
+
});
|
|
25
|
+
const t = Object.getOwnPropertyDescriptor(r, o);
|
|
26
|
+
let e;
|
|
27
|
+
if (t === void 0) {
|
|
28
|
+
const i = /* @__PURE__ */ new WeakMap();
|
|
29
|
+
e = { get() {
|
|
30
|
+
return i.get(this);
|
|
31
|
+
}, set(n) {
|
|
32
|
+
s.get(this).setValue(n), i.set(this, n);
|
|
33
|
+
}, configurable: !0, enumerable: !0 };
|
|
34
|
+
} else {
|
|
35
|
+
const i = t.set;
|
|
36
|
+
e = { ...t, set(n) {
|
|
37
|
+
s.get(this).setValue(n), i == null || i.call(this, n);
|
|
38
|
+
} };
|
|
39
|
+
}
|
|
40
|
+
return void Object.defineProperty(r, o, e);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
l as provide
|
|
46
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
class r {
|
|
7
|
+
get value() {
|
|
8
|
+
return this.o;
|
|
9
|
+
}
|
|
10
|
+
set value(s) {
|
|
11
|
+
this.setValue(s);
|
|
12
|
+
}
|
|
13
|
+
setValue(s, t = !1) {
|
|
14
|
+
const i = t || !Object.is(s, this.o);
|
|
15
|
+
this.o = s, i && this.updateObservers();
|
|
16
|
+
}
|
|
17
|
+
constructor(s) {
|
|
18
|
+
this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
|
|
19
|
+
for (const [t, { disposer: i }] of this.subscriptions) t(this.o, i);
|
|
20
|
+
}, s !== void 0 && (this.value = s);
|
|
21
|
+
}
|
|
22
|
+
addCallback(s, t, i) {
|
|
23
|
+
if (!i) return void s(this.value);
|
|
24
|
+
this.subscriptions.has(s) || this.subscriptions.set(s, { disposer: () => {
|
|
25
|
+
this.subscriptions.delete(s);
|
|
26
|
+
}, consumerHost: t });
|
|
27
|
+
const { disposer: e } = this.subscriptions.get(s);
|
|
28
|
+
s(this.value, e);
|
|
29
|
+
}
|
|
30
|
+
clearCallbacks() {
|
|
31
|
+
this.subscriptions.clear();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
r as ValueNotifier
|
|
36
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
const o = (r, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(r, t, e), e);
|
|
7
|
+
export {
|
|
8
|
+
o as desc
|
|
9
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { desc as a } from "./base.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2021 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
function d(t) {
|
|
8
|
+
return (c, i) => {
|
|
9
|
+
const { slot: r, selector: s } = t ?? {}, l = "slot" + (r ? `[name=${r}]` : ":not([name])");
|
|
10
|
+
return a(c, i, { get() {
|
|
11
|
+
var o;
|
|
12
|
+
const e = (o = this.renderRoot) == null ? void 0 : o.querySelector(l), n = (e == null ? void 0 : e.assignedElements(t)) ?? [];
|
|
13
|
+
return s === void 0 ? n : n.filter((m) => m.matches(s));
|
|
14
|
+
} });
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
d as queryAssignedElements
|
|
19
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { __extends as u } from "../../../../tslib/tslib.es6.js";
|
|
2
|
+
import { Subject as a } from "./Subject.js";
|
|
3
|
+
var c = function(o) {
|
|
4
|
+
u(e, o);
|
|
5
|
+
function e(t) {
|
|
6
|
+
var r = o.call(this) || this;
|
|
7
|
+
return r._value = t, r;
|
|
8
|
+
}
|
|
9
|
+
return Object.defineProperty(e.prototype, "value", {
|
|
10
|
+
get: function() {
|
|
11
|
+
return this.getValue();
|
|
12
|
+
},
|
|
13
|
+
enumerable: !1,
|
|
14
|
+
configurable: !0
|
|
15
|
+
}), e.prototype._subscribe = function(t) {
|
|
16
|
+
var r = o.prototype._subscribe.call(this, t);
|
|
17
|
+
return !r.closed && t.next(this._value), r;
|
|
18
|
+
}, e.prototype.getValue = function() {
|
|
19
|
+
var t = this, r = t.hasError, n = t.thrownError, i = t._value;
|
|
20
|
+
if (r)
|
|
21
|
+
throw n;
|
|
22
|
+
return this._throwIfClosed(), i;
|
|
23
|
+
}, e.prototype.next = function(t) {
|
|
24
|
+
o.prototype.next.call(this, this._value = t);
|
|
25
|
+
}, e;
|
|
26
|
+
}(a);
|
|
27
|
+
export {
|
|
28
|
+
c as BehaviorSubject
|
|
29
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { SafeSubscriber as f, Subscriber as p } from "./Subscriber.js";
|
|
2
|
+
import { isSubscription as m } from "./Subscription.js";
|
|
3
|
+
import { observable as h } from "./symbol/observable.js";
|
|
4
|
+
import { pipeFromArray as v } from "./util/pipe.js";
|
|
5
|
+
import { config as y } from "./config.js";
|
|
6
|
+
import { isFunction as b } from "./util/isFunction.js";
|
|
7
|
+
import { errorContext as l } from "./util/errorContext.js";
|
|
8
|
+
var E = function() {
|
|
9
|
+
function t(r) {
|
|
10
|
+
r && (this._subscribe = r);
|
|
11
|
+
}
|
|
12
|
+
return t.prototype.lift = function(r) {
|
|
13
|
+
var n = new t();
|
|
14
|
+
return n.source = this, n.operator = r, n;
|
|
15
|
+
}, t.prototype.subscribe = function(r, n, u) {
|
|
16
|
+
var i = this, o = S(r) ? r : new f(r, n, u);
|
|
17
|
+
return l(function() {
|
|
18
|
+
var e = i, c = e.operator, s = e.source;
|
|
19
|
+
o.add(c ? c.call(o, s) : s ? i._subscribe(o) : i._trySubscribe(o));
|
|
20
|
+
}), o;
|
|
21
|
+
}, t.prototype._trySubscribe = function(r) {
|
|
22
|
+
try {
|
|
23
|
+
return this._subscribe(r);
|
|
24
|
+
} catch (n) {
|
|
25
|
+
r.error(n);
|
|
26
|
+
}
|
|
27
|
+
}, t.prototype.forEach = function(r, n) {
|
|
28
|
+
var u = this;
|
|
29
|
+
return n = a(n), new n(function(i, o) {
|
|
30
|
+
var e = new f({
|
|
31
|
+
next: function(c) {
|
|
32
|
+
try {
|
|
33
|
+
r(c);
|
|
34
|
+
} catch (s) {
|
|
35
|
+
o(s), e.unsubscribe();
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
error: o,
|
|
39
|
+
complete: i
|
|
40
|
+
});
|
|
41
|
+
u.subscribe(e);
|
|
42
|
+
});
|
|
43
|
+
}, t.prototype._subscribe = function(r) {
|
|
44
|
+
var n;
|
|
45
|
+
return (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(r);
|
|
46
|
+
}, t.prototype[h] = function() {
|
|
47
|
+
return this;
|
|
48
|
+
}, t.prototype.pipe = function() {
|
|
49
|
+
for (var r = [], n = 0; n < arguments.length; n++)
|
|
50
|
+
r[n] = arguments[n];
|
|
51
|
+
return v(r)(this);
|
|
52
|
+
}, t.prototype.toPromise = function(r) {
|
|
53
|
+
var n = this;
|
|
54
|
+
return r = a(r), new r(function(u, i) {
|
|
55
|
+
var o;
|
|
56
|
+
n.subscribe(function(e) {
|
|
57
|
+
return o = e;
|
|
58
|
+
}, function(e) {
|
|
59
|
+
return i(e);
|
|
60
|
+
}, function() {
|
|
61
|
+
return u(o);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}, t.create = function(r) {
|
|
65
|
+
return new t(r);
|
|
66
|
+
}, t;
|
|
67
|
+
}();
|
|
68
|
+
function a(t) {
|
|
69
|
+
var r;
|
|
70
|
+
return (r = t ?? y.Promise) !== null && r !== void 0 ? r : Promise;
|
|
71
|
+
}
|
|
72
|
+
function _(t) {
|
|
73
|
+
return t && b(t.next) && b(t.error) && b(t.complete);
|
|
74
|
+
}
|
|
75
|
+
function S(t) {
|
|
76
|
+
return t && t instanceof p || _(t) && m(t);
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
E as Observable
|
|
80
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { __extends as c, __values as d } from "../../../../tslib/tslib.es6.js";
|
|
2
|
+
import { Observable as a } from "./Observable.js";
|
|
3
|
+
import { EMPTY_SUBSCRIPTION as h, Subscription as b } from "./Subscription.js";
|
|
4
|
+
import { ObjectUnsubscribedError as _ } from "./util/ObjectUnsubscribedError.js";
|
|
5
|
+
import { arrRemove as y } from "./util/arrRemove.js";
|
|
6
|
+
import { errorContext as l } from "./util/errorContext.js";
|
|
7
|
+
var S = function(s) {
|
|
8
|
+
c(o, s);
|
|
9
|
+
function o() {
|
|
10
|
+
var r = s.call(this) || this;
|
|
11
|
+
return r.closed = !1, r.currentObservers = null, r.observers = [], r.isStopped = !1, r.hasError = !1, r.thrownError = null, r;
|
|
12
|
+
}
|
|
13
|
+
return o.prototype.lift = function(r) {
|
|
14
|
+
var t = new p(this, this);
|
|
15
|
+
return t.operator = r, t;
|
|
16
|
+
}, o.prototype._throwIfClosed = function() {
|
|
17
|
+
if (this.closed)
|
|
18
|
+
throw new _();
|
|
19
|
+
}, o.prototype.next = function(r) {
|
|
20
|
+
var t = this;
|
|
21
|
+
l(function() {
|
|
22
|
+
var e, u;
|
|
23
|
+
if (t._throwIfClosed(), !t.isStopped) {
|
|
24
|
+
t.currentObservers || (t.currentObservers = Array.from(t.observers));
|
|
25
|
+
try {
|
|
26
|
+
for (var i = d(t.currentObservers), n = i.next(); !n.done; n = i.next()) {
|
|
27
|
+
var f = n.value;
|
|
28
|
+
f.next(r);
|
|
29
|
+
}
|
|
30
|
+
} catch (v) {
|
|
31
|
+
e = { error: v };
|
|
32
|
+
} finally {
|
|
33
|
+
try {
|
|
34
|
+
n && !n.done && (u = i.return) && u.call(i);
|
|
35
|
+
} finally {
|
|
36
|
+
if (e) throw e.error;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}, o.prototype.error = function(r) {
|
|
42
|
+
var t = this;
|
|
43
|
+
l(function() {
|
|
44
|
+
if (t._throwIfClosed(), !t.isStopped) {
|
|
45
|
+
t.hasError = t.isStopped = !0, t.thrownError = r;
|
|
46
|
+
for (var e = t.observers; e.length; )
|
|
47
|
+
e.shift().error(r);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}, o.prototype.complete = function() {
|
|
51
|
+
var r = this;
|
|
52
|
+
l(function() {
|
|
53
|
+
if (r._throwIfClosed(), !r.isStopped) {
|
|
54
|
+
r.isStopped = !0;
|
|
55
|
+
for (var t = r.observers; t.length; )
|
|
56
|
+
t.shift().complete();
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}, o.prototype.unsubscribe = function() {
|
|
60
|
+
this.isStopped = this.closed = !0, this.observers = this.currentObservers = null;
|
|
61
|
+
}, Object.defineProperty(o.prototype, "observed", {
|
|
62
|
+
get: function() {
|
|
63
|
+
var r;
|
|
64
|
+
return ((r = this.observers) === null || r === void 0 ? void 0 : r.length) > 0;
|
|
65
|
+
},
|
|
66
|
+
enumerable: !1,
|
|
67
|
+
configurable: !0
|
|
68
|
+
}), o.prototype._trySubscribe = function(r) {
|
|
69
|
+
return this._throwIfClosed(), s.prototype._trySubscribe.call(this, r);
|
|
70
|
+
}, o.prototype._subscribe = function(r) {
|
|
71
|
+
return this._throwIfClosed(), this._checkFinalizedStatuses(r), this._innerSubscribe(r);
|
|
72
|
+
}, o.prototype._innerSubscribe = function(r) {
|
|
73
|
+
var t = this, e = this, u = e.hasError, i = e.isStopped, n = e.observers;
|
|
74
|
+
return u || i ? h : (this.currentObservers = null, n.push(r), new b(function() {
|
|
75
|
+
t.currentObservers = null, y(n, r);
|
|
76
|
+
}));
|
|
77
|
+
}, o.prototype._checkFinalizedStatuses = function(r) {
|
|
78
|
+
var t = this, e = t.hasError, u = t.thrownError, i = t.isStopped;
|
|
79
|
+
e ? r.error(u) : i && r.complete();
|
|
80
|
+
}, o.prototype.asObservable = function() {
|
|
81
|
+
var r = new a();
|
|
82
|
+
return r.source = this, r;
|
|
83
|
+
}, o.create = function(r, t) {
|
|
84
|
+
return new p(r, t);
|
|
85
|
+
}, o;
|
|
86
|
+
}(a), p = function(s) {
|
|
87
|
+
c(o, s);
|
|
88
|
+
function o(r, t) {
|
|
89
|
+
var e = s.call(this) || this;
|
|
90
|
+
return e.destination = r, e.source = t, e;
|
|
91
|
+
}
|
|
92
|
+
return o.prototype.next = function(r) {
|
|
93
|
+
var t, e;
|
|
94
|
+
(e = (t = this.destination) === null || t === void 0 ? void 0 : t.next) === null || e === void 0 || e.call(t, r);
|
|
95
|
+
}, o.prototype.error = function(r) {
|
|
96
|
+
var t, e;
|
|
97
|
+
(e = (t = this.destination) === null || t === void 0 ? void 0 : t.error) === null || e === void 0 || e.call(t, r);
|
|
98
|
+
}, o.prototype.complete = function() {
|
|
99
|
+
var r, t;
|
|
100
|
+
(t = (r = this.destination) === null || r === void 0 ? void 0 : r.complete) === null || t === void 0 || t.call(r);
|
|
101
|
+
}, o.prototype._subscribe = function(r) {
|
|
102
|
+
var t, e;
|
|
103
|
+
return (e = (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(r)) !== null && e !== void 0 ? e : h;
|
|
104
|
+
}, o;
|
|
105
|
+
}(S);
|
|
106
|
+
export {
|
|
107
|
+
p as AnonymousSubject,
|
|
108
|
+
S as Subject
|
|
109
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { __extends as c } from "../../../../tslib/tslib.es6.js";
|
|
2
|
+
import { isFunction as a } from "./util/isFunction.js";
|
|
3
|
+
import { isSubscription as l, Subscription as f } from "./Subscription.js";
|
|
4
|
+
import { reportUnhandledError as h } from "./util/reportUnhandledError.js";
|
|
5
|
+
import { noop as u } from "./util/noop.js";
|
|
6
|
+
var d = function(e) {
|
|
7
|
+
c(r, e);
|
|
8
|
+
function r(t) {
|
|
9
|
+
var i = e.call(this) || this;
|
|
10
|
+
return i.isStopped = !1, t ? (i.destination = t, l(t) && t.add(i)) : i.destination = y, i;
|
|
11
|
+
}
|
|
12
|
+
return r.create = function(t, i, n) {
|
|
13
|
+
return new m(t, i, n);
|
|
14
|
+
}, r.prototype.next = function(t) {
|
|
15
|
+
this.isStopped || this._next(t);
|
|
16
|
+
}, r.prototype.error = function(t) {
|
|
17
|
+
this.isStopped || (this.isStopped = !0, this._error(t));
|
|
18
|
+
}, r.prototype.complete = function() {
|
|
19
|
+
this.isStopped || (this.isStopped = !0, this._complete());
|
|
20
|
+
}, r.prototype.unsubscribe = function() {
|
|
21
|
+
this.closed || (this.isStopped = !0, e.prototype.unsubscribe.call(this), this.destination = null);
|
|
22
|
+
}, r.prototype._next = function(t) {
|
|
23
|
+
this.destination.next(t);
|
|
24
|
+
}, r.prototype._error = function(t) {
|
|
25
|
+
try {
|
|
26
|
+
this.destination.error(t);
|
|
27
|
+
} finally {
|
|
28
|
+
this.unsubscribe();
|
|
29
|
+
}
|
|
30
|
+
}, r.prototype._complete = function() {
|
|
31
|
+
try {
|
|
32
|
+
this.destination.complete();
|
|
33
|
+
} finally {
|
|
34
|
+
this.unsubscribe();
|
|
35
|
+
}
|
|
36
|
+
}, r;
|
|
37
|
+
}(f), b = function() {
|
|
38
|
+
function e(r) {
|
|
39
|
+
this.partialObserver = r;
|
|
40
|
+
}
|
|
41
|
+
return e.prototype.next = function(r) {
|
|
42
|
+
var t = this.partialObserver;
|
|
43
|
+
if (t.next)
|
|
44
|
+
try {
|
|
45
|
+
t.next(r);
|
|
46
|
+
} catch (i) {
|
|
47
|
+
o(i);
|
|
48
|
+
}
|
|
49
|
+
}, e.prototype.error = function(r) {
|
|
50
|
+
var t = this.partialObserver;
|
|
51
|
+
if (t.error)
|
|
52
|
+
try {
|
|
53
|
+
t.error(r);
|
|
54
|
+
} catch (i) {
|
|
55
|
+
o(i);
|
|
56
|
+
}
|
|
57
|
+
else
|
|
58
|
+
o(r);
|
|
59
|
+
}, e.prototype.complete = function() {
|
|
60
|
+
var r = this.partialObserver;
|
|
61
|
+
if (r.complete)
|
|
62
|
+
try {
|
|
63
|
+
r.complete();
|
|
64
|
+
} catch (t) {
|
|
65
|
+
o(t);
|
|
66
|
+
}
|
|
67
|
+
}, e;
|
|
68
|
+
}(), m = function(e) {
|
|
69
|
+
c(r, e);
|
|
70
|
+
function r(t, i, n) {
|
|
71
|
+
var p = e.call(this) || this, s;
|
|
72
|
+
return a(t) || !t ? s = {
|
|
73
|
+
next: t ?? void 0,
|
|
74
|
+
error: i ?? void 0,
|
|
75
|
+
complete: n ?? void 0
|
|
76
|
+
} : s = t, p.destination = new b(s), p;
|
|
77
|
+
}
|
|
78
|
+
return r;
|
|
79
|
+
}(d);
|
|
80
|
+
function o(e) {
|
|
81
|
+
h(e);
|
|
82
|
+
}
|
|
83
|
+
function v(e) {
|
|
84
|
+
throw e;
|
|
85
|
+
}
|
|
86
|
+
var y = {
|
|
87
|
+
closed: !0,
|
|
88
|
+
next: u,
|
|
89
|
+
error: v,
|
|
90
|
+
complete: u
|
|
91
|
+
};
|
|
92
|
+
export {
|
|
93
|
+
y as EMPTY_OBSERVER,
|
|
94
|
+
m as SafeSubscriber,
|
|
95
|
+
d as Subscriber
|
|
96
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { __values as d, __spreadArray as m, __read as b } from "../../../../tslib/tslib.es6.js";
|
|
2
|
+
import { isFunction as a } from "./util/isFunction.js";
|
|
3
|
+
import { UnsubscriptionError as l } from "./util/UnsubscriptionError.js";
|
|
4
|
+
import { arrRemove as P } from "./util/arrRemove.js";
|
|
5
|
+
var x = function() {
|
|
6
|
+
function t(r) {
|
|
7
|
+
this.initialTeardown = r, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
8
|
+
}
|
|
9
|
+
return t.prototype.unsubscribe = function() {
|
|
10
|
+
var r, i, h, y, s;
|
|
11
|
+
if (!this.closed) {
|
|
12
|
+
this.closed = !0;
|
|
13
|
+
var c = this._parentage;
|
|
14
|
+
if (c)
|
|
15
|
+
if (this._parentage = null, Array.isArray(c))
|
|
16
|
+
try {
|
|
17
|
+
for (var f = d(c), o = f.next(); !o.done; o = f.next()) {
|
|
18
|
+
var T = o.value;
|
|
19
|
+
T.remove(this);
|
|
20
|
+
}
|
|
21
|
+
} catch (e) {
|
|
22
|
+
r = { error: e };
|
|
23
|
+
} finally {
|
|
24
|
+
try {
|
|
25
|
+
o && !o.done && (i = f.return) && i.call(f);
|
|
26
|
+
} finally {
|
|
27
|
+
if (r) throw r.error;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else
|
|
31
|
+
c.remove(this);
|
|
32
|
+
var v = this.initialTeardown;
|
|
33
|
+
if (a(v))
|
|
34
|
+
try {
|
|
35
|
+
v();
|
|
36
|
+
} catch (e) {
|
|
37
|
+
s = e instanceof l ? e.errors : [e];
|
|
38
|
+
}
|
|
39
|
+
var p = this._finalizers;
|
|
40
|
+
if (p) {
|
|
41
|
+
this._finalizers = null;
|
|
42
|
+
try {
|
|
43
|
+
for (var u = d(p), n = u.next(); !n.done; n = u.next()) {
|
|
44
|
+
var S = n.value;
|
|
45
|
+
try {
|
|
46
|
+
A(S);
|
|
47
|
+
} catch (e) {
|
|
48
|
+
s = s ?? [], e instanceof l ? s = m(m([], b(s)), b(e.errors)) : s.push(e);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
} catch (e) {
|
|
52
|
+
h = { error: e };
|
|
53
|
+
} finally {
|
|
54
|
+
try {
|
|
55
|
+
n && !n.done && (y = u.return) && y.call(u);
|
|
56
|
+
} finally {
|
|
57
|
+
if (h) throw h.error;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (s)
|
|
62
|
+
throw new l(s);
|
|
63
|
+
}
|
|
64
|
+
}, t.prototype.add = function(r) {
|
|
65
|
+
var i;
|
|
66
|
+
if (r && r !== this)
|
|
67
|
+
if (this.closed)
|
|
68
|
+
A(r);
|
|
69
|
+
else {
|
|
70
|
+
if (r instanceof t) {
|
|
71
|
+
if (r.closed || r._hasParent(this))
|
|
72
|
+
return;
|
|
73
|
+
r._addParent(this);
|
|
74
|
+
}
|
|
75
|
+
(this._finalizers = (i = this._finalizers) !== null && i !== void 0 ? i : []).push(r);
|
|
76
|
+
}
|
|
77
|
+
}, t.prototype._hasParent = function(r) {
|
|
78
|
+
var i = this._parentage;
|
|
79
|
+
return i === r || Array.isArray(i) && i.includes(r);
|
|
80
|
+
}, t.prototype._addParent = function(r) {
|
|
81
|
+
var i = this._parentage;
|
|
82
|
+
this._parentage = Array.isArray(i) ? (i.push(r), i) : i ? [i, r] : r;
|
|
83
|
+
}, t.prototype._removeParent = function(r) {
|
|
84
|
+
var i = this._parentage;
|
|
85
|
+
i === r ? this._parentage = null : Array.isArray(i) && P(i, r);
|
|
86
|
+
}, t.prototype.remove = function(r) {
|
|
87
|
+
var i = this._finalizers;
|
|
88
|
+
i && P(i, r), r instanceof t && r._removeParent(this);
|
|
89
|
+
}, t.EMPTY = function() {
|
|
90
|
+
var r = new t();
|
|
91
|
+
return r.closed = !0, r;
|
|
92
|
+
}(), t;
|
|
93
|
+
}(), R = x.EMPTY;
|
|
94
|
+
function U(t) {
|
|
95
|
+
return t instanceof x || t && "closed" in t && a(t.remove) && a(t.add) && a(t.unsubscribe);
|
|
96
|
+
}
|
|
97
|
+
function A(t) {
|
|
98
|
+
a(t) ? t() : t.unsubscribe();
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
R as EMPTY_SUBSCRIPTION,
|
|
102
|
+
x as Subscription,
|
|
103
|
+
U as isSubscription
|
|
104
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { __spreadArray as o, __read as u } from "../../../../../tslib/tslib.es6.js";
|
|
2
|
+
var m = {
|
|
3
|
+
setTimeout: function(r, a) {
|
|
4
|
+
for (var t = [], e = 2; e < arguments.length; e++)
|
|
5
|
+
t[e - 2] = arguments[e];
|
|
6
|
+
return setTimeout.apply(void 0, o([r, a], u(t)));
|
|
7
|
+
},
|
|
8
|
+
clearTimeout: function(r) {
|
|
9
|
+
return clearTimeout(r);
|
|
10
|
+
},
|
|
11
|
+
delegate: void 0
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
m as timeoutProvider
|
|
15
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createErrorClass as o } from "./createErrorClass.js";
|
|
2
|
+
var c = o(function(n) {
|
|
3
|
+
return function(r) {
|
|
4
|
+
n(this), this.message = r ? r.length + ` errors occurred during unsubscription:
|
|
5
|
+
` + r.map(function(i, t) {
|
|
6
|
+
return t + 1 + ") " + i.toString();
|
|
7
|
+
}).join(`
|
|
8
|
+
`) : "", this.name = "UnsubscriptionError", this.errors = r;
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
c as UnsubscriptionError
|
|
13
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var u = function(r, t) {
|
|
2
|
+
return u = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, e) {
|
|
3
|
+
n.__proto__ = e;
|
|
4
|
+
} || function(n, e) {
|
|
5
|
+
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (n[o] = e[o]);
|
|
6
|
+
}, u(r, t);
|
|
7
|
+
};
|
|
8
|
+
function a(r, t) {
|
|
9
|
+
if (typeof t != "function" && t !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
11
|
+
u(r, t);
|
|
12
|
+
function n() {
|
|
13
|
+
this.constructor = r;
|
|
14
|
+
}
|
|
15
|
+
r.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
|
|
16
|
+
}
|
|
17
|
+
function f(r) {
|
|
18
|
+
var t = typeof Symbol == "function" && Symbol.iterator, n = t && r[t], e = 0;
|
|
19
|
+
if (n) return n.call(r);
|
|
20
|
+
if (r && typeof r.length == "number") return {
|
|
21
|
+
next: function() {
|
|
22
|
+
return r && e >= r.length && (r = void 0), { value: r && r[e++], done: !r };
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
26
|
+
}
|
|
27
|
+
function p(r, t) {
|
|
28
|
+
var n = typeof Symbol == "function" && r[Symbol.iterator];
|
|
29
|
+
if (!n) return r;
|
|
30
|
+
var e = n.call(r), o, i = [], l;
|
|
31
|
+
try {
|
|
32
|
+
for (; (t === void 0 || t-- > 0) && !(o = e.next()).done; ) i.push(o.value);
|
|
33
|
+
} catch (c) {
|
|
34
|
+
l = { error: c };
|
|
35
|
+
} finally {
|
|
36
|
+
try {
|
|
37
|
+
o && !o.done && (n = e.return) && n.call(e);
|
|
38
|
+
} finally {
|
|
39
|
+
if (l) throw l.error;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return i;
|
|
43
|
+
}
|
|
44
|
+
function s(r, t, n) {
|
|
45
|
+
if (n || arguments.length === 2) for (var e = 0, o = t.length, i; e < o; e++)
|
|
46
|
+
(i || !(e in t)) && (i || (i = Array.prototype.slice.call(t, 0, e)), i[e] = t[e]);
|
|
47
|
+
return r.concat(i || Array.prototype.slice.call(t));
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
a as __extends,
|
|
51
|
+
p as __read,
|
|
52
|
+
s as __spreadArray,
|
|
53
|
+
f as __values
|
|
54
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class TabComponent extends LitElement {
|
|
3
|
+
id: string;
|
|
4
|
+
relatedPanel: string;
|
|
5
|
+
/**
|
|
6
|
+
* Retrieves the `TabService` from the closest `tabs-component`.
|
|
7
|
+
*/
|
|
8
|
+
private tabService;
|
|
9
|
+
private isActive;
|
|
10
|
+
private subscription?;
|
|
11
|
+
connectedCallback(): void;
|
|
12
|
+
disconnectedCallback(): void;
|
|
13
|
+
private onClick;
|
|
14
|
+
firstUpdated(): void;
|
|
15
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import "../node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { html as l } from "../node_modules/lit-html/lit-html.js";
|
|
3
|
+
import { LitElement as b } from "../node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { customElement as m } from "../node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
5
|
+
import { property as p } from "../node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
+
import { state as u } from "../node_modules/@lit/reactive-element/decorators/state.js";
|
|
7
|
+
import { consume as d } from "../node_modules/@lit/context/lib/decorators/consume.js";
|
|
8
|
+
import { tabContext as f } from "../common/context/tab-context.js";
|
|
9
|
+
var h = Object.defineProperty, v = Object.getOwnPropertyDescriptor, s = (t, i, c, o) => {
|
|
10
|
+
for (var e = o > 1 ? void 0 : o ? v(i, c) : i, n = t.length - 1, a; n >= 0; n--)
|
|
11
|
+
(a = t[n]) && (e = (o ? a(i, c, e) : a(e)) || e);
|
|
12
|
+
return o && e && h(i, c, e), e;
|
|
13
|
+
};
|
|
14
|
+
let r = class extends b {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments), this.isActive = !1;
|
|
17
|
+
}
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
super.connectedCallback(), this.subscription = this.tabService.activeTabData$.subscribe((t) => {
|
|
20
|
+
this.isActive = (t == null ? void 0 : t.tabId) === this.id, this.requestUpdate();
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
disconnectedCallback() {
|
|
24
|
+
var t;
|
|
25
|
+
super.disconnectedCallback(), (t = this.subscription) == null || t.unsubscribe();
|
|
26
|
+
}
|
|
27
|
+
onClick() {
|
|
28
|
+
this.tabService.setActiveTab(this);
|
|
29
|
+
}
|
|
30
|
+
firstUpdated() {
|
|
31
|
+
this.setAttribute("role", "tab");
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return l`
|
|
35
|
+
<button
|
|
36
|
+
role="tab"
|
|
37
|
+
id=${this.id}
|
|
38
|
+
aria-selected=${this.isActive ? "true" : "false"}
|
|
39
|
+
aria-controls=${this.relatedPanel}
|
|
40
|
+
tabindex=${this.isActive ? "0" : "-1"}
|
|
41
|
+
@click=${this.onClick}
|
|
42
|
+
>
|
|
43
|
+
<slot></slot>
|
|
44
|
+
</button>
|
|
45
|
+
`;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
s([
|
|
49
|
+
p({ type: String, reflect: !0 })
|
|
50
|
+
], r.prototype, "id", 2);
|
|
51
|
+
s([
|
|
52
|
+
p({ type: String, reflect: !0, attribute: "related-panel" })
|
|
53
|
+
], r.prototype, "relatedPanel", 2);
|
|
54
|
+
s([
|
|
55
|
+
d({ context: f })
|
|
56
|
+
], r.prototype, "tabService", 2);
|
|
57
|
+
s([
|
|
58
|
+
u()
|
|
59
|
+
], r.prototype, "isActive", 2);
|
|
60
|
+
r = s([
|
|
61
|
+
m("tab-component")
|
|
62
|
+
], r);
|
|
63
|
+
export {
|
|
64
|
+
r as TabComponent
|
|
65
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class TabPanelComponent extends LitElement {
|
|
3
|
+
id: string;
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves the `TabService` from the closest `tabs-component`.
|
|
6
|
+
*/
|
|
7
|
+
private tabService;
|
|
8
|
+
private isActive;
|
|
9
|
+
private subscription?;
|
|
10
|
+
private activeTabId;
|
|
11
|
+
static styles: import('lit').CSSResult;
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
disconnectedCallback(): void;
|
|
14
|
+
firstUpdated(): void;
|
|
15
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import "../node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { nothing as c, html as a } from "../node_modules/lit-html/lit-html.js";
|
|
3
|
+
import { LitElement as b } from "../node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { customElement as d } from "../node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
5
|
+
import { property as m } from "../node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
+
import { state as h } from "../node_modules/@lit/reactive-element/decorators/state.js";
|
|
7
|
+
import { consume as u } from "../node_modules/@lit/context/lib/decorators/consume.js";
|
|
8
|
+
import { tabContext as f } from "../common/context/tab-context.js";
|
|
9
|
+
import { css as v } from "../node_modules/@lit/reactive-element/css-tag.js";
|
|
10
|
+
var y = Object.defineProperty, A = Object.getOwnPropertyDescriptor, o = (t, i, n, r) => {
|
|
11
|
+
for (var e = r > 1 ? void 0 : r ? A(i, n) : i, l = t.length - 1, p; l >= 0; l--)
|
|
12
|
+
(p = t[l]) && (e = (r ? p(i, n, e) : p(e)) || e);
|
|
13
|
+
return r && e && y(i, n, e), e;
|
|
14
|
+
};
|
|
15
|
+
let s = class extends b {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments), this.isActive = !1, this.activeTabId = null;
|
|
18
|
+
}
|
|
19
|
+
connectedCallback() {
|
|
20
|
+
super.connectedCallback(), this.subscription = this.tabService.activeTabData$.subscribe((t) => {
|
|
21
|
+
this.isActive = (t == null ? void 0 : t.relatedPanel) === this.id, this.activeTabId = (t == null ? void 0 : t.tabId) || null, this.ariaLabel = this.activeTabId, this.ariaHidden = (!this.isActive).toString();
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
disconnectedCallback() {
|
|
25
|
+
var t;
|
|
26
|
+
super.disconnectedCallback(), (t = this.subscription) == null || t.unsubscribe();
|
|
27
|
+
}
|
|
28
|
+
firstUpdated() {
|
|
29
|
+
this.setAttribute("role", "tabpanel");
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return a`
|
|
33
|
+
${this.isActive ? a`
|
|
34
|
+
<div
|
|
35
|
+
role="tabpanel"
|
|
36
|
+
id=${this.id}
|
|
37
|
+
aria-labelledby=${this.activeTabId}
|
|
38
|
+
aria-hidden=${!this.isActive}
|
|
39
|
+
?hidden=${!this.isActive}
|
|
40
|
+
class="tab-panel"
|
|
41
|
+
>
|
|
42
|
+
<slot></slot>
|
|
43
|
+
</div>
|
|
44
|
+
` : c}
|
|
45
|
+
`;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
s.styles = v`
|
|
49
|
+
.tab-panel {
|
|
50
|
+
display: block;
|
|
51
|
+
padding: 16px;
|
|
52
|
+
border: 1px solid #ccc;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
`;
|
|
56
|
+
o([
|
|
57
|
+
m({ type: String, reflect: !0 })
|
|
58
|
+
], s.prototype, "id", 2);
|
|
59
|
+
o([
|
|
60
|
+
u({ context: f })
|
|
61
|
+
], s.prototype, "tabService", 2);
|
|
62
|
+
o([
|
|
63
|
+
h()
|
|
64
|
+
], s.prototype, "isActive", 2);
|
|
65
|
+
s = o([
|
|
66
|
+
d("tab-panel-component")
|
|
67
|
+
], s);
|
|
68
|
+
export {
|
|
69
|
+
s as TabPanelComponent
|
|
70
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
export declare class TabsComponent extends LitElement {
|
|
3
|
+
/**
|
|
4
|
+
* Provides a unique `TabService` instance for this `tabs-component`.
|
|
5
|
+
*/
|
|
6
|
+
private tabService;
|
|
7
|
+
activeTab: string | null;
|
|
8
|
+
private subscription?;
|
|
9
|
+
private tabs;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
firstUpdated(): void;
|
|
12
|
+
protected updated(_changedProperties: PropertyValues): void;
|
|
13
|
+
disconnectedCallback(): void;
|
|
14
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import "../node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { html as n } from "../node_modules/lit-html/lit-html.js";
|
|
3
|
+
import { LitElement as p } from "../node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { customElement as l } from "../node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
5
|
+
import { property as m } from "../node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
+
import { queryAssignedElements as v } from "../node_modules/@lit/reactive-element/decorators/query-assigned-elements.js";
|
|
7
|
+
import { provide as u } from "../node_modules/@lit/context/lib/decorators/provide.js";
|
|
8
|
+
import { TabService as d } from "./tabs.service.js";
|
|
9
|
+
import { tabContext as f } from "../common/context/tab-context.js";
|
|
10
|
+
var h = Object.defineProperty, T = Object.getOwnPropertyDescriptor, o = (t, e, a, r) => {
|
|
11
|
+
for (var s = r > 1 ? void 0 : r ? T(e, a) : e, b = t.length - 1, c; b >= 0; b--)
|
|
12
|
+
(c = t[b]) && (s = (r ? c(e, a, s) : c(s)) || s);
|
|
13
|
+
return r && s && h(e, a, s), s;
|
|
14
|
+
};
|
|
15
|
+
let i = class extends p {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments), this.tabService = new d(), this.activeTab = null;
|
|
18
|
+
}
|
|
19
|
+
connectedCallback() {
|
|
20
|
+
super.connectedCallback(), this.subscription = this.tabService.activeTabData$.subscribe((t) => {
|
|
21
|
+
t && this.activeTab !== t.tabId && (this.activeTab = t.tabId);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
firstUpdated() {
|
|
25
|
+
!this.activeTab && this.tabs.length > 0 && this.tabService.setActiveTab(this.tabs[0]), this.setAttribute("role", "tablist");
|
|
26
|
+
}
|
|
27
|
+
updated(t) {
|
|
28
|
+
if (super.updated(t), t.has("activeTab")) {
|
|
29
|
+
const e = this.tabs.find((a) => a.id === this.activeTab);
|
|
30
|
+
e && this.tabService.setActiveTab(e);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
disconnectedCallback() {
|
|
34
|
+
var t;
|
|
35
|
+
super.disconnectedCallback(), (t = this.subscription) == null || t.unsubscribe();
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
return n`
|
|
39
|
+
<div class="tabs" role="tablist">
|
|
40
|
+
<slot></slot> <!-- Tabs -->
|
|
41
|
+
</div>
|
|
42
|
+
<div class="tab-panels">
|
|
43
|
+
<slot name="tab-panel"></slot> <!-- Panels -->
|
|
44
|
+
</div>
|
|
45
|
+
`;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
o([
|
|
49
|
+
u({ context: f })
|
|
50
|
+
], i.prototype, "tabService", 2);
|
|
51
|
+
o([
|
|
52
|
+
m({ type: String, reflect: !0, attribute: "active-tab" })
|
|
53
|
+
], i.prototype, "activeTab", 2);
|
|
54
|
+
o([
|
|
55
|
+
v({ slot: "", flatten: !0 })
|
|
56
|
+
], i.prototype, "tabs", 2);
|
|
57
|
+
i = o([
|
|
58
|
+
l("tabs-component")
|
|
59
|
+
], i);
|
|
60
|
+
export {
|
|
61
|
+
i as TabsComponent
|
|
62
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TabComponent } from '../tab/tab.component';
|
|
2
|
+
export interface ActiveTabData {
|
|
3
|
+
tabId: string;
|
|
4
|
+
relatedPanel: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Service that manages active tab state within a single <tabs-component>.
|
|
8
|
+
*/
|
|
9
|
+
export declare class TabService {
|
|
10
|
+
private activeTabDataSubject;
|
|
11
|
+
activeTabData$: import('rxjs').Observable<ActiveTabData | null>;
|
|
12
|
+
setActiveTab(tab: TabComponent): void;
|
|
13
|
+
getActiveTabData(): ActiveTabData | null;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BehaviorSubject as c } from "../node_modules/rxjs/dist/esm5/internal/BehaviorSubject.js";
|
|
2
|
+
class r {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.activeTabDataSubject = new c(null), this.activeTabData$ = this.activeTabDataSubject.asObservable();
|
|
5
|
+
}
|
|
6
|
+
setActiveTab(t) {
|
|
7
|
+
const e = t.getAttribute("id"), a = t.getAttribute("related-panel");
|
|
8
|
+
this.activeTabDataSubject.next({ tabId: e, relatedPanel: a });
|
|
9
|
+
}
|
|
10
|
+
getActiveTabData() {
|
|
11
|
+
return this.activeTabDataSubject.getValue();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
r as TabService
|
|
16
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@styleon/foundation",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.0-next.
|
|
4
|
+
"version": "0.0.0-next.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@chromatic-com/storybook": "^3.2.4",
|
|
20
|
+
"@lit/context": "^1.1.4",
|
|
20
21
|
"@storybook/addon-essentials": "^8.5.8",
|
|
21
22
|
"@storybook/blocks": "^8.5.8",
|
|
22
23
|
"@storybook/test": "^8.5.8",
|
|
@@ -24,6 +25,7 @@
|
|
|
24
25
|
"@storybook/web-components-vite": "^8.5.8",
|
|
25
26
|
"@types/node": "^22.13.8",
|
|
26
27
|
"lit": "^3.2.1",
|
|
28
|
+
"rxjs": "^7.8.2",
|
|
27
29
|
"sass": "^1.85.0",
|
|
28
30
|
"semantic-release": "^24.2.3",
|
|
29
31
|
"storybook": "^8.5.8",
|