scb-wc-test 0.1.75 → 0.1.76
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/mvc/components/scb-app-bar/scb-app-bar.js +3 -2
- package/mvc/components/scb-dialog/scb-dialog.js +5 -1
- package/mvc/components/scb-menu/scb-menu.js +4 -2
- package/mvc/components/scb-segmented-button/scb-segmented-button.js +1 -0
- package/package.json +2 -2
- package/scb-app-bar/scb-app-bar.d.ts +1 -0
- package/scb-app-bar/scb-app-bar.js +33 -28
- package/scb-dialog/scb-dialog.js +5 -1
- package/scb-menu/scb-menu.js +2 -0
- package/scb-segmented-button/scb-segmented-button.js +5 -4
- package/scb-wc-test.bundle.js +317 -309
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h,n as d,i as c,x as r,t as
|
|
1
|
+
import{a as h,n as d,i as c,x as r,t as m}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-search/scb-search.js";import"../scb-avatar/scb-avatar.js";import"../../vendor/preload-helper.js";import"../../vendor/vendor-material.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-button/scb-button.js";import"../scb-list/scb-list.js";import"../scb-list/scb-list-item.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(a,t,i){try{customElements.get(a)||s(a,t,i)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var g=Object.defineProperty,v=Object.getOwnPropertyDescriptor,p=(e,s,a,t)=>{for(var i=t>1?void 0:t?v(s,a):s,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=(t?o(s,a,i):o(i))||i);return t&&i&&g(s,a,i),i};let l=class extends c{constructor(){super(...arguments),this.title="",this.type="default",this.position="default",this.searchSupportingText=""}handleAvatarSlotChange(e){e.target.assignedElements({flatten:!0}).forEach(t=>{t.tagName==="SCB-AVATAR"&&t.setAttribute("size","small")})}updated(e){e.has("title")&&this.dispatchEvent(new CustomEvent("title-changed",{detail:{title:this.title},bubbles:!0,composed:!0})),e.has("position")&&this.dispatchEvent(new CustomEvent("position-changed",{detail:{position:this.position},bubbles:!0,composed:!0})),e.has("type")&&this.dispatchEvent(new CustomEvent("type-changed",{detail:{type:this.type},bubbles:!0,composed:!0})),e.has("searchSupportingText")&&this.dispatchEvent(new CustomEvent("search-supporting-text-changed",{detail:{searchSupportingText:this.searchSupportingText},bubbles:!0,composed:!0}))}render(){switch(this.type){case"small-flexible":return r`
|
|
2
2
|
<header class="small-flexible ${this.position=="bottom"?"position-bottom":this.position=="top"?"position-top":""}" role="banner" aria-label="Small app bar">
|
|
3
3
|
<div class="leading">
|
|
4
4
|
<slot name="leading"></slot>
|
|
@@ -62,6 +62,7 @@ import{a as h,n as d,i as c,x as r,t as g}from"../../vendor/vendor.js";import"..
|
|
|
62
62
|
`}}};l.styles=[h`
|
|
63
63
|
:host {
|
|
64
64
|
display: block;
|
|
65
|
+
font-family: var(--brand, Inter);
|
|
65
66
|
position: relative;
|
|
66
67
|
container-type: inline-size;
|
|
67
68
|
container-name: app-bar-container;
|
|
@@ -155,4 +156,4 @@ import{a as h,n as d,i as c,x as r,t as g}from"../../vendor/vendor.js";import"..
|
|
|
155
156
|
display: flex;
|
|
156
157
|
align-items: center;
|
|
157
158
|
}
|
|
158
|
-
`];p([d({type:String})],l.prototype,"title",2);p([d({type:String})],l.prototype,"type",2);p([d({type:String,reflect:!0})],l.prototype,"position",2);p([d({type:String,attribute:"search-supporting-text"})],l.prototype,"searchSupportingText",2);l=p([
|
|
159
|
+
`];p([d({type:String})],l.prototype,"title",2);p([d({type:String})],l.prototype,"type",2);p([d({type:String,reflect:!0})],l.prototype,"position",2);p([d({type:String,attribute:"search-supporting-text"})],l.prototype,"searchSupportingText",2);l=p([m("scb-app-bar")],l);
|
|
@@ -46,7 +46,11 @@ import{_ as d}from"../../vendor/preload-helper.js";import{a as h,n,i as m,E as p
|
|
|
46
46
|
${this.renderBody(t,e)}
|
|
47
47
|
</div>
|
|
48
48
|
`}};i.styles=h`
|
|
49
|
-
:host {
|
|
49
|
+
:host {
|
|
50
|
+
display:block;
|
|
51
|
+
position:relative;
|
|
52
|
+
font-family: var(--brand, Inter);
|
|
53
|
+
}
|
|
50
54
|
|
|
51
55
|
.scrim {
|
|
52
56
|
position: var(--scb-dialog-scrim-position, fixed);
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import{a as u,n as l,i as p,x as d,t as h}from"../../vendor/vendor.js";import"./scb-menu-item.js";import"./scb-sub-menu.js";import"../scb-divider/scb-divider.js";import"../../vendor/vendor-material.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var
|
|
1
|
+
import{a as u,n as l,i as p,x as d,t as h}from"../../vendor/vendor.js";import"./scb-menu-item.js";import"./scb-sub-menu.js";import"../scb-divider/scb-divider.js";import"../../vendor/vendor-material.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var n=customElements.define.bind(customElements);customElements.define=function(e,i,s){try{customElements.get(e)||n(e,i,s)}catch(r){var o=String(r||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var m=Object.defineProperty,_=Object.getOwnPropertyDescriptor,c=(t,n,e,i)=>{for(var s=i>1?void 0:i?_(n,e):n,o=t.length-1,r;o>=0;o--)(r=t[o])&&(s=(i?r(n,e,s):r(s))||s);return i&&s&&m(n,e,s),s};let a=class extends p{constructor(){super(...arguments),this.open=!1,this.inSb=!1,this.__lastTriggerEl=null,this.__onDocumentClick=t=>{if(!this.inSb&&this.open&&!this.isClickInScbMenu(t)){this.__setOpen(!1);return}const n=this.__getActionFromEvent(t);if(n){n==="open"&&(this.__setOpen(!0),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0}))),n==="close"&&(this.__setOpen(!1),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))),n==="toggle"&&(this.__setOpen(!this.open),this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0,composed:!0}))),t.stopPropagation();return}},this.__onDocumentKeydown=t=>{if(this.open&&t.key==="Escape"){this.__setOpen(!1);return}}}render(){return d`
|
|
2
2
|
<div
|
|
3
3
|
role="menu"
|
|
4
4
|
class="scb-menu-panel${this.open?" open":""}"
|
|
5
5
|
>
|
|
6
6
|
<slot></slot>
|
|
7
7
|
</div>
|
|
8
|
-
`}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),super.disconnectedCallback()}__setOpen(t){this.open=t}__getActionFromEvent(t){if(!this.id)return null;const
|
|
8
|
+
`}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),super.disconnectedCallback()}__setOpen(t){this.open=t}__getActionFromEvent(t){if(!this.id)return null;const n=t.composedPath();for(const e of n)if(e instanceof Element){if(e.getAttribute("data-menu-open")===this.id)return this.__lastTriggerEl=e,"open";if(e.getAttribute("data-menu-close")===this.id)return this.__lastTriggerEl=e,"close";if(e.getAttribute("data-menu-toggle")===this.id)return this.__lastTriggerEl=e,"toggle";if(e.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=e,"toggle"}return null}isClickInScbMenu(t){return t.composedPath().some(e=>e instanceof Element&&(e.tagName==="SCB-MENU"||e.tagName==="SCB-SUB-MENU"))}updated(t){t.has("open")&&(this.__applyOpenSideEffects(),this.open?this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}__applyOpenSideEffects(){this.__updateTriggersExpanded()}__updateTriggersExpanded(){if(!this.id)return;document.querySelectorAll(`[aria-controls="${this.id}"], [data-menu-open="${this.id}"], [data-menu-close="${this.id}"], [data-menu-toggle="${this.id}"]`).forEach(n=>{n.hasAttribute("aria-controls")&&n.setAttribute("aria-expanded",String(this.open))})}};a.styles=u`
|
|
9
9
|
:host {
|
|
10
10
|
position: absolute;
|
|
11
11
|
display: block;
|
|
12
12
|
width: fit-content;
|
|
13
|
+
font-family: var(--brand-font);
|
|
13
14
|
--scb-menu-max-width: 300px;
|
|
14
15
|
--scb-menu-max-height: 600px;
|
|
16
|
+
z-index: 1000;
|
|
15
17
|
}
|
|
16
18
|
:host > .scb-menu-panel {
|
|
17
19
|
padding: var(--spacing-3) 0;
|
|
@@ -7,6 +7,7 @@ import{a as u,n as a,i as c,x as h,t as m}from"../../vendor/vendor.js";import"./
|
|
|
7
7
|
display: grid;
|
|
8
8
|
grid-auto-flow: column;
|
|
9
9
|
grid-auto-columns: 1fr;
|
|
10
|
+
font-family: var(--brand, Inter);
|
|
10
11
|
}
|
|
11
12
|
/* Border radius only on first and last button */
|
|
12
13
|
::slotted(scb-segmented-item:first-child .segmented-item),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.76",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -304,5 +304,5 @@
|
|
|
304
304
|
},
|
|
305
305
|
"./mvc/*": "./mvc/*"
|
|
306
306
|
},
|
|
307
|
-
"buildHash": "
|
|
307
|
+
"buildHash": "3D7F0B98A0A0FA5BCFAFC2684A93EE1AC54E4178D2537C2064B8CAD4DCAE7D05"
|
|
308
308
|
}
|
|
@@ -6,5 +6,6 @@ export declare class ScbAppBar extends LitElement {
|
|
|
6
6
|
searchSupportingText: string;
|
|
7
7
|
static styles: import('lit').CSSResult[];
|
|
8
8
|
private handleAvatarSlotChange;
|
|
9
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
9
10
|
render(): import('lit-html').TemplateResult<1>;
|
|
10
11
|
}
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
import { css as d, LitElement as c, html as
|
|
2
|
-
import { property as r, customElement as
|
|
1
|
+
import { css as d, LitElement as c, html as l } from "lit";
|
|
2
|
+
import { property as r, customElement as m } from "lit/decorators.js";
|
|
3
3
|
import "../scb-icon-button/scb-icon-button.js";
|
|
4
4
|
import "../scb-search/scb-search.js";
|
|
5
5
|
import "../scb-avatar/scb-avatar.js";
|
|
6
|
-
var
|
|
7
|
-
for (var
|
|
8
|
-
(h =
|
|
9
|
-
return
|
|
6
|
+
var g = Object.defineProperty, v = Object.getOwnPropertyDescriptor, n = (e, s, o, t) => {
|
|
7
|
+
for (var i = t > 1 ? void 0 : t ? v(s, o) : s, p = e.length - 1, h; p >= 0; p--)
|
|
8
|
+
(h = e[p]) && (i = (t ? h(s, o, i) : h(i)) || i);
|
|
9
|
+
return t && i && g(s, o, i), i;
|
|
10
10
|
};
|
|
11
|
-
let
|
|
11
|
+
let a = class extends c {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments), this.title = "", this.type = "default", this.position = "default", this.searchSupportingText = "";
|
|
14
14
|
}
|
|
15
|
-
handleAvatarSlotChange(
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
handleAvatarSlotChange(e) {
|
|
16
|
+
e.target.assignedElements({ flatten: !0 }).forEach((t) => {
|
|
17
|
+
t.tagName === "SCB-AVATAR" && t.setAttribute("size", "small");
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
+
// Sänd förändrings-event när egenskaper uppdateras
|
|
21
|
+
updated(e) {
|
|
22
|
+
e.has("title") && this.dispatchEvent(new CustomEvent("title-changed", { detail: { title: this.title }, bubbles: !0, composed: !0 })), e.has("position") && this.dispatchEvent(new CustomEvent("position-changed", { detail: { position: this.position }, bubbles: !0, composed: !0 })), e.has("type") && this.dispatchEvent(new CustomEvent("type-changed", { detail: { type: this.type }, bubbles: !0, composed: !0 })), e.has("searchSupportingText") && this.dispatchEvent(new CustomEvent("search-supporting-text-changed", { detail: { searchSupportingText: this.searchSupportingText }, bubbles: !0, composed: !0 }));
|
|
23
|
+
}
|
|
20
24
|
render() {
|
|
21
25
|
switch (this.type) {
|
|
22
26
|
case "small-flexible":
|
|
23
|
-
return
|
|
27
|
+
return l`
|
|
24
28
|
<header class="small-flexible ${this.position == "bottom" ? "position-bottom" : this.position == "top" ? "position-top" : ""}" role="banner" aria-label="Small app bar">
|
|
25
29
|
<div class="leading">
|
|
26
30
|
<slot name="leading"></slot>
|
|
@@ -33,7 +37,7 @@ let i = class extends c {
|
|
|
33
37
|
</header>
|
|
34
38
|
`;
|
|
35
39
|
case "medium-flexible":
|
|
36
|
-
return
|
|
40
|
+
return l`
|
|
37
41
|
<header class="medium-flexible ${this.position == "bottom" ? "position-bottom" : this.position == "top" ? "position-top" : ""}" role="banner" aria-label="Medium flexible app bar">
|
|
38
42
|
<div class="action-elements">
|
|
39
43
|
<div>
|
|
@@ -48,7 +52,7 @@ let i = class extends c {
|
|
|
48
52
|
</header>
|
|
49
53
|
`;
|
|
50
54
|
case "large-flexible":
|
|
51
|
-
return
|
|
55
|
+
return l`
|
|
52
56
|
<header class="large-flexible ${this.position == "bottom" ? "position-bottom" : this.position == "top" ? "position-top" : ""}" role="banner" aria-label="Large flexible app bar">
|
|
53
57
|
<div class="action-elements">
|
|
54
58
|
<div style="">
|
|
@@ -63,7 +67,7 @@ let i = class extends c {
|
|
|
63
67
|
</header>
|
|
64
68
|
`;
|
|
65
69
|
case "search":
|
|
66
|
-
return
|
|
70
|
+
return l`
|
|
67
71
|
<header class="search ${this.position == "bottom" ? "position-bottom" : this.position == "top" ? "position-top" : ""}" role="banner" aria-label="Search app bar">
|
|
68
72
|
<div class="leading">
|
|
69
73
|
<slot name="leading"></slot>
|
|
@@ -78,7 +82,7 @@ let i = class extends c {
|
|
|
78
82
|
</header>
|
|
79
83
|
`;
|
|
80
84
|
default:
|
|
81
|
-
return
|
|
85
|
+
return l`
|
|
82
86
|
<header class="default ${this.position == "bottom" ? "position-bottom" : this.position == "top" ? "position-top" : ""}" role="banner" aria-label="Small app bar">
|
|
83
87
|
<div class="leading">
|
|
84
88
|
<slot name="leading"></slot>
|
|
@@ -93,10 +97,11 @@ let i = class extends c {
|
|
|
93
97
|
}
|
|
94
98
|
}
|
|
95
99
|
};
|
|
96
|
-
|
|
100
|
+
a.styles = [
|
|
97
101
|
d`
|
|
98
102
|
:host {
|
|
99
103
|
display: block;
|
|
104
|
+
font-family: var(--brand, Inter);
|
|
100
105
|
position: relative;
|
|
101
106
|
container-type: inline-size;
|
|
102
107
|
container-name: app-bar-container;
|
|
@@ -192,21 +197,21 @@ i.styles = [
|
|
|
192
197
|
}
|
|
193
198
|
`
|
|
194
199
|
];
|
|
195
|
-
|
|
200
|
+
n([
|
|
196
201
|
r({ type: String })
|
|
197
|
-
],
|
|
198
|
-
|
|
202
|
+
], a.prototype, "title", 2);
|
|
203
|
+
n([
|
|
199
204
|
r({ type: String })
|
|
200
|
-
],
|
|
201
|
-
|
|
205
|
+
], a.prototype, "type", 2);
|
|
206
|
+
n([
|
|
202
207
|
r({ type: String, reflect: !0 })
|
|
203
|
-
],
|
|
204
|
-
|
|
208
|
+
], a.prototype, "position", 2);
|
|
209
|
+
n([
|
|
205
210
|
r({ type: String, attribute: "search-supporting-text" })
|
|
206
|
-
],
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
],
|
|
211
|
+
], a.prototype, "searchSupportingText", 2);
|
|
212
|
+
a = n([
|
|
213
|
+
m("scb-app-bar")
|
|
214
|
+
], a);
|
|
210
215
|
export {
|
|
211
|
-
|
|
216
|
+
a as ScbAppBar
|
|
212
217
|
};
|
package/scb-dialog/scb-dialog.js
CHANGED
|
@@ -221,7 +221,11 @@ let i = class extends u {
|
|
|
221
221
|
}
|
|
222
222
|
};
|
|
223
223
|
i.styles = h`
|
|
224
|
-
:host {
|
|
224
|
+
:host {
|
|
225
|
+
display:block;
|
|
226
|
+
position:relative;
|
|
227
|
+
font-family: var(--brand, Inter);
|
|
228
|
+
}
|
|
225
229
|
|
|
226
230
|
.scrim {
|
|
227
231
|
position: var(--scb-dialog-scrim-position, fixed);
|
package/scb-menu/scb-menu.js
CHANGED
|
@@ -92,8 +92,10 @@ i.styles = u`
|
|
|
92
92
|
position: absolute;
|
|
93
93
|
display: block;
|
|
94
94
|
width: fit-content;
|
|
95
|
+
font-family: var(--brand-font);
|
|
95
96
|
--scb-menu-max-width: 300px;
|
|
96
97
|
--scb-menu-max-height: 600px;
|
|
98
|
+
z-index: 1000;
|
|
97
99
|
}
|
|
98
100
|
:host > .scb-menu-panel {
|
|
99
101
|
padding: var(--spacing-3) 0;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { css as
|
|
1
|
+
import { css as u, LitElement as c, html as m } from "lit";
|
|
2
2
|
import { property as n, customElement as h } from "lit/decorators.js";
|
|
3
3
|
import "./scb-segmented-item.js";
|
|
4
4
|
var b = Object.defineProperty, f = Object.getOwnPropertyDescriptor, d = (r, i, e, t) => {
|
|
5
|
-
for (var s = t > 1 ? void 0 : t ? f(i, e) : i, o = r.length - 1,
|
|
6
|
-
(
|
|
5
|
+
for (var s = t > 1 ? void 0 : t ? f(i, e) : i, o = r.length - 1, a; o >= 0; o--)
|
|
6
|
+
(a = r[o]) && (s = (t ? a(i, e, s) : a(s)) || s);
|
|
7
7
|
return t && s && b(i, e, s), s;
|
|
8
8
|
};
|
|
9
9
|
let l = class extends c {
|
|
@@ -58,7 +58,7 @@ let l = class extends c {
|
|
|
58
58
|
return m`<slot></slot>`;
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
|
-
l.styles =
|
|
61
|
+
l.styles = u`
|
|
62
62
|
:host {
|
|
63
63
|
--scb-segmented-button-width: 100%;
|
|
64
64
|
--scb-segmented-button-height: 48px;
|
|
@@ -67,6 +67,7 @@ l.styles = a`
|
|
|
67
67
|
display: grid;
|
|
68
68
|
grid-auto-flow: column;
|
|
69
69
|
grid-auto-columns: 1fr;
|
|
70
|
+
font-family: var(--brand, Inter);
|
|
70
71
|
}
|
|
71
72
|
/* Border radius only on first and last button */
|
|
72
73
|
::slotted(scb-segmented-item:first-child .segmented-item),
|