@duetds/components 8.6.0 → 8.6.2
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/hydrate/index.js +52 -170
- package/lib/cjs/duet-action-button.cjs.entry.js +5 -6
- package/lib/cjs/duet-banner.cjs.entry.js +10 -7
- package/lib/cjs/duet-caption_4.cjs.entry.js +5 -2
- package/lib/cjs/duet-choice_2.cjs.entry.js +7 -0
- package/lib/cjs/duet-menu-bar-button.cjs.entry.js +2 -34
- package/lib/cjs/duet-menu-bar-dropdown.cjs.entry.js +2 -37
- package/lib/cjs/duet-menu-bar-link.cjs.entry.js +2 -37
- package/lib/cjs/duet-submenu-bar-dropdown.cjs.entry.js +2 -5
- package/lib/cjs/duet-submenu-bar-link.cjs.entry.js +2 -37
- package/lib/cjs/duet.cjs.js +1 -1
- package/lib/cjs/loader.cjs.js +1 -1
- package/lib/collection/components/duet-action-button/duet-action-button.js +6 -8
- package/lib/collection/components/duet-banner/duet-banner.css +113 -133
- package/lib/collection/components/duet-banner/duet-banner.js +9 -6
- package/lib/collection/components/duet-choice-group/duet-choice-group.e2e.js +15 -0
- package/lib/collection/components/duet-choice-group/duet-choice-group.js +31 -0
- package/lib/collection/components/duet-link/duet-link.css +3 -0
- package/lib/collection/components/duet-link/duet-link.js +39 -1
- package/lib/collection/components/duet-menu-bar-button/duet-menu-bar-button.css +10 -0
- package/lib/collection/components/duet-menu-bar-button/duet-menu-bar-button.js +1 -38
- package/lib/collection/components/duet-menu-bar-dropdown/duet-menu-bar-dropdown.css +10 -0
- package/lib/collection/components/duet-menu-bar-dropdown/duet-menu-bar-dropdown.js +1 -41
- package/lib/collection/components/duet-menu-bar-link/duet-menu-bar-link.css +10 -0
- package/lib/collection/components/duet-menu-bar-link/duet-menu-bar-link.js +1 -41
- package/lib/collection/components/duet-submenu-bar-dropdown/duet-submenu-bar-dropdown.css +10 -0
- package/lib/collection/components/duet-submenu-bar-dropdown/duet-submenu-bar-dropdown.js +2 -6
- package/lib/collection/components/duet-submenu-bar-link/duet-submenu-bar-link.css +10 -0
- package/lib/collection/components/duet-submenu-bar-link/duet-submenu-bar-link.js +1 -41
- package/lib/collection/components/duet-upload-aria-status/duet-upload-aria-status.js +4 -0
- package/lib/collection/components/duet-upload-item/duet-upload-item.js +4 -0
- package/lib/dist-custom-elements/duet-action-button.js +1 -1
- package/lib/dist-custom-elements/duet-banner.js +10 -7
- package/lib/dist-custom-elements/duet-choice-group.js +9 -1
- package/lib/dist-custom-elements/duet-contact-card.js +1 -1
- package/lib/dist-custom-elements/duet-date-picker.js +1 -1
- package/lib/dist-custom-elements/duet-editable-table.js +1 -1
- package/lib/dist-custom-elements/duet-link.js +1 -1
- package/lib/dist-custom-elements/duet-menu-bar-button.js +2 -35
- package/lib/dist-custom-elements/duet-menu-bar-dropdown.js +2 -38
- package/lib/dist-custom-elements/duet-menu-bar-link.js +3 -39
- package/lib/dist-custom-elements/duet-pagination.js +1 -1
- package/lib/dist-custom-elements/duet-range-stepper.js +1 -1
- package/lib/dist-custom-elements/duet-submenu-bar-dropdown.js +2 -6
- package/lib/dist-custom-elements/duet-submenu-bar-link.js +3 -39
- package/lib/dist-custom-elements/duet-upload-item.js +1 -1
- package/lib/dist-custom-elements/duet-upload.js +3 -3
- package/lib/dist-custom-elements/{p-68ba7bf1.js → p-2f410810.js} +7 -2
- package/lib/dist-custom-elements/{p-24693e9a.js → p-e10f446d.js} +2 -2
- package/lib/dist-custom-elements/{p-03152b20.js → p-f4ac6968.js} +5 -6
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/{p-c9370d43.system.entry.js → p-0fc721ab.system.entry.js} +1 -1
- package/lib/duet/p-25048bf8.system.entry.js +4 -0
- package/lib/duet/{p-aba91113.system.entry.js → p-27363096.system.entry.js} +1 -1
- package/lib/duet/{p-83238fe7.entry.js → p-436fcaf7.entry.js} +1 -1
- package/lib/duet/p-51e3af7b.system.entry.js +4 -0
- package/lib/duet/p-5c8e3667.entry.js +4 -0
- package/lib/duet/p-6151635f.system.js +1 -1
- package/lib/duet/p-69e67b58.entry.js +4 -0
- package/lib/duet/p-70b705ad.entry.js +4 -0
- package/lib/duet/p-723e165b.system.entry.js +4 -0
- package/lib/duet/p-82d1fd63.system.entry.js +4 -0
- package/lib/duet/p-9065a864.entry.js +4 -0
- package/lib/duet/p-9ac25886.system.entry.js +4 -0
- package/lib/duet/{p-cd87960a.system.entry.js → p-a659cdb5.system.entry.js} +1 -1
- package/lib/duet/p-b02ca265.entry.js +4 -0
- package/lib/duet/p-c12d34fd.system.entry.js +4 -0
- package/lib/duet/p-c776e072.entry.js +4 -0
- package/lib/duet/p-d1d79e0c.entry.js +4 -0
- package/lib/duet/p-ffab115e.entry.js +4 -0
- package/lib/esm/duet-action-button.entry.js +5 -6
- package/lib/esm/duet-banner.entry.js +10 -7
- package/lib/esm/duet-caption_4.entry.js +5 -2
- package/lib/esm/duet-choice_2.entry.js +7 -0
- package/lib/esm/duet-menu-bar-button.entry.js +2 -34
- package/lib/esm/duet-menu-bar-dropdown.entry.js +2 -37
- package/lib/esm/duet-menu-bar-link.entry.js +2 -37
- package/lib/esm/duet-submenu-bar-dropdown.entry.js +2 -5
- package/lib/esm/duet-submenu-bar-link.entry.js +2 -37
- package/lib/esm/duet.js +1 -1
- package/lib/esm/loader.js +1 -1
- package/lib/esm-es5/duet-action-button.entry.js +1 -1
- package/lib/esm-es5/duet-banner.entry.js +1 -1
- package/lib/esm-es5/duet-caption_4.entry.js +1 -1
- package/lib/esm-es5/duet-choice_2.entry.js +1 -1
- package/lib/esm-es5/duet-menu-bar-button.entry.js +1 -1
- package/lib/esm-es5/duet-menu-bar-dropdown.entry.js +2 -2
- package/lib/esm-es5/duet-menu-bar-link.entry.js +1 -1
- package/lib/esm-es5/duet-submenu-bar-dropdown.entry.js +2 -2
- package/lib/esm-es5/duet-submenu-bar-link.entry.js +1 -1
- package/lib/esm-es5/duet.js +1 -1
- package/lib/esm-es5/loader.js +1 -1
- package/lib/types/components/duet-banner/duet-banner.d.ts +1 -1
- package/lib/types/components/duet-choice-group/duet-choice-group.d.ts +5 -0
- package/lib/types/components/duet-link/duet-link.d.ts +11 -0
- package/lib/types/components/duet-menu-bar-button/duet-menu-bar-button.d.ts +1 -7
- package/lib/types/components/duet-menu-bar-dropdown/duet-menu-bar-dropdown.d.ts +1 -7
- package/lib/types/components/duet-menu-bar-link/duet-menu-bar-link.d.ts +1 -10
- package/lib/types/components/duet-submenu-bar-dropdown/duet-submenu-bar-dropdown.d.ts +1 -2
- package/lib/types/components/duet-submenu-bar-link/duet-submenu-bar-link.d.ts +1 -10
- package/lib/types/components/duet-upload-aria-status/duet-upload-aria-status.d.ts +4 -0
- package/lib/types/components/duet-upload-item/duet-upload-item.d.ts +4 -0
- package/lib/types/components.d.ts +17 -0
- package/package.json +2 -2
- package/lib/duet/p-0de8d0c0.system.entry.js +0 -4
- package/lib/duet/p-29491f9f.entry.js +0 -4
- package/lib/duet/p-36f031e7.entry.js +0 -4
- package/lib/duet/p-3f2d14e3.system.entry.js +0 -4
- package/lib/duet/p-8cc30578.entry.js +0 -4
- package/lib/duet/p-9735b2f9.entry.js +0 -4
- package/lib/duet/p-9be9b4d2.entry.js +0 -4
- package/lib/duet/p-b2fc4b72.system.entry.js +0 -4
- package/lib/duet/p-bece15cd.system.entry.js +0 -4
- package/lib/duet/p-cba00852.entry.js +0 -4
- package/lib/duet/p-cc949a27.entry.js +0 -4
- package/lib/duet/p-e614e39f.system.entry.js +0 -4
- package/lib/duet/p-e7fd0d14.entry.js +0 -4
- package/lib/duet/p-e86cafa6.system.entry.js +0 -4
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { media_query_large } from "@duetds/tokens/lib/tokens.json";
|
|
5
4
|
import { h, Host } from "@stencil/core";
|
|
6
5
|
import { inheritGlobalTheme } from "../../common/themeable-component";
|
|
7
6
|
import { isEscapeKey } from "../../utils/keyboard-utils";
|
|
8
7
|
export class DuetMenuBarDropdown {
|
|
9
8
|
constructor() {
|
|
10
|
-
/**
|
|
11
|
-
* Own Properties.
|
|
12
|
-
*/
|
|
13
|
-
this.mql = [window.matchMedia(media_query_large.replace(/'/g, ""))];
|
|
14
|
-
this.boundMqlFunctions = [];
|
|
15
|
-
this.changeIconSize = () => {
|
|
16
|
-
if (this.mql[0].matches) {
|
|
17
|
-
this.iconSize = "x-small";
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
this.iconSize = "small";
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
9
|
this.onClick = () => {
|
|
24
10
|
this.open = !this.open;
|
|
25
11
|
};
|
|
@@ -34,7 +20,6 @@ export class DuetMenuBarDropdown {
|
|
|
34
20
|
return "right";
|
|
35
21
|
}
|
|
36
22
|
};
|
|
37
|
-
this.iconSize = "x-small";
|
|
38
23
|
this.accessibleLabel = undefined;
|
|
39
24
|
this.theme = "";
|
|
40
25
|
this.open = false;
|
|
@@ -52,26 +37,6 @@ export class DuetMenuBarDropdown {
|
|
|
52
37
|
componentWillLoad() {
|
|
53
38
|
inheritGlobalTheme(this);
|
|
54
39
|
}
|
|
55
|
-
connectedCallback() {
|
|
56
|
-
this.changeIconSize();
|
|
57
|
-
for (let i = 0; i < this.mql.length; i++) {
|
|
58
|
-
// addEventListener is not available in Stencil hydrate
|
|
59
|
-
if (this.mql[i].addEventListener) {
|
|
60
|
-
const bound = this.changeIconSize.bind(this);
|
|
61
|
-
this.mql[i].addEventListener("change", bound);
|
|
62
|
-
this.boundMqlFunctions[i] = bound;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
disconnectedCallback() {
|
|
67
|
-
for (let i = 0; i < this.mql.length; i++) {
|
|
68
|
-
// removeEventListener is not available in Stencil hydrate
|
|
69
|
-
if (this.mql[i].removeEventListener) {
|
|
70
|
-
this.mql[i].removeEventListener("change", this.boundMqlFunctions[i]);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
this.boundMqlFunctions = [];
|
|
74
|
-
}
|
|
75
40
|
handleEscape(e) {
|
|
76
41
|
if (isEscapeKey(e)) {
|
|
77
42
|
this.open = false;
|
|
@@ -96,7 +61,7 @@ export class DuetMenuBarDropdown {
|
|
|
96
61
|
[`duet-menu-bar-dropdown--slot-${this.getVariant()}`]: true,
|
|
97
62
|
} }, h("button", { ref: element => (this.button = element), "aria-label": this.accessibleLabel, "aria-haspopup": "menu", "aria-controls": "menu", "aria-expanded": this.open ? "true" : "false", id: "button", type: "button", class: {
|
|
98
63
|
active: this.open,
|
|
99
|
-
}, onClick: this.onClick, onKeyUp: e => this.handleEscape(e) }, this.icon && (h("duet-icon", { theme: this.theme, name: this.icon, size:
|
|
64
|
+
}, onClick: this.onClick, onKeyUp: e => this.handleEscape(e) }, this.icon && (h("duet-icon", { class: "menu-bar-dropdown-icon", theme: this.theme, name: this.icon, size: "auto", margin: "none", color: "currentColor" })), h("div", { class: "label" }, h("slot", { name: "label" }), h("duet-icon", { class: "caret", theme: this.theme, name: "action-arrow-down-small", margin: "none", size: "xxx-small", color: "currentColor" }))), h("div", { tabindex: "-1", role: "menu", id: "menu", "aria-labelledby": "button", class: {
|
|
100
65
|
items: true,
|
|
101
66
|
hidden: !this.open,
|
|
102
67
|
} }, h("slot", null)))));
|
|
@@ -194,11 +159,6 @@ export class DuetMenuBarDropdown {
|
|
|
194
159
|
}
|
|
195
160
|
};
|
|
196
161
|
}
|
|
197
|
-
static get states() {
|
|
198
|
-
return {
|
|
199
|
-
"iconSize": {}
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
162
|
static get methods() {
|
|
203
163
|
return {
|
|
204
164
|
"setFocus": {
|
|
@@ -44,6 +44,16 @@
|
|
|
44
44
|
.duet-theme-turva .duet-menu-bar-link:focus, .duet-menu-bar-link:focus.duet-theme-turva {
|
|
45
45
|
box-shadow: 0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a;
|
|
46
46
|
}
|
|
47
|
+
.duet-menu-bar-link .menu-bar-link-icon {
|
|
48
|
+
width: 20px;
|
|
49
|
+
height: 20px;
|
|
50
|
+
}
|
|
51
|
+
@media (min-width: 62em) {
|
|
52
|
+
.duet-menu-bar-link .menu-bar-link-icon {
|
|
53
|
+
width: 16px;
|
|
54
|
+
height: 16px;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
47
57
|
.duet-menu-bar-link.duet-theme-turva {
|
|
48
58
|
font-family: "turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
49
59
|
}
|
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { media_query_large } from "@duetds/tokens/lib/tokens.json";
|
|
5
4
|
import { h, Host } from "@stencil/core";
|
|
6
5
|
import { inheritGlobalTheme } from "../../common/themeable-component";
|
|
7
6
|
export class DuetMenuBarLink {
|
|
8
7
|
constructor() {
|
|
9
|
-
/**
|
|
10
|
-
* Own Properties.
|
|
11
|
-
*/
|
|
12
|
-
this.mql = [window.matchMedia(media_query_large.replace(/'/g, ""))];
|
|
13
|
-
this.boundMqlFunctions = [];
|
|
14
|
-
this.changeIconSize = () => {
|
|
15
|
-
if (this.mql[0].matches) {
|
|
16
|
-
this.iconSize = "x-small";
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
this.iconSize = "small";
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
this.iconSize = "x-small";
|
|
23
8
|
this.theme = "";
|
|
24
9
|
this.active = false;
|
|
25
10
|
this.href = "#";
|
|
@@ -32,26 +17,6 @@ export class DuetMenuBarLink {
|
|
|
32
17
|
componentWillLoad() {
|
|
33
18
|
inheritGlobalTheme(this);
|
|
34
19
|
}
|
|
35
|
-
connectedCallback() {
|
|
36
|
-
this.changeIconSize();
|
|
37
|
-
for (let i = 0; i < this.mql.length; i++) {
|
|
38
|
-
// addEventListener is not available in Stencil hydrate
|
|
39
|
-
if (this.mql[i].addEventListener) {
|
|
40
|
-
const bound = this.changeIconSize.bind(this);
|
|
41
|
-
this.mql[i].addEventListener("change", bound);
|
|
42
|
-
this.boundMqlFunctions[i] = bound;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
disconnectedCallback() {
|
|
47
|
-
for (let i = 0; i < this.mql.length; i++) {
|
|
48
|
-
// removeEventListener is not available in Stencil hydrate
|
|
49
|
-
if (this.mql[i].removeEventListener) {
|
|
50
|
-
this.mql[i].removeEventListener("change", this.boundMqlFunctions[i]);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
this.boundMqlFunctions = [];
|
|
54
|
-
}
|
|
55
20
|
/**
|
|
56
21
|
* render() function
|
|
57
22
|
* Always the last one in the class.
|
|
@@ -61,7 +26,7 @@ export class DuetMenuBarLink {
|
|
|
61
26
|
"duet-menu-bar-link": true,
|
|
62
27
|
"duet-theme-turva": this.theme === "turva",
|
|
63
28
|
active: this.active,
|
|
64
|
-
}, href: this.href, "aria-current": this.active ? "true" : "false", "aria-label": this.accessibleLabel }, this.icon && (h("duet-icon", { theme: this.theme, size:
|
|
29
|
+
}, href: this.href, "aria-current": this.active ? "true" : "false", "aria-label": this.accessibleLabel }, this.icon && (h("duet-icon", { class: "menu-bar-link-icon", theme: this.theme, size: "auto", name: this.icon, margin: "none", color: "currentColor" })), h("slot", null))));
|
|
65
30
|
}
|
|
66
31
|
static get is() { return "duet-menu-bar-link"; }
|
|
67
32
|
static get encapsulation() { return "shadow"; }
|
|
@@ -174,10 +139,5 @@ export class DuetMenuBarLink {
|
|
|
174
139
|
}
|
|
175
140
|
};
|
|
176
141
|
}
|
|
177
|
-
static get states() {
|
|
178
|
-
return {
|
|
179
|
-
"iconSize": {}
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
142
|
static get elementRef() { return "element"; }
|
|
183
143
|
}
|
|
@@ -139,6 +139,16 @@
|
|
|
139
139
|
background: rgb(198, 12, 48);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
+
.duet-submenu-bar-dropdown .submenu-bar-dropdown-icon {
|
|
143
|
+
width: 20px;
|
|
144
|
+
height: 20px;
|
|
145
|
+
}
|
|
146
|
+
@media (min-width: 62em) {
|
|
147
|
+
.duet-submenu-bar-dropdown .submenu-bar-dropdown-icon {
|
|
148
|
+
width: 16px;
|
|
149
|
+
height: 16px;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
142
152
|
.duet-submenu-bar-dropdown .items {
|
|
143
153
|
display: flex;
|
|
144
154
|
flex-direction: column;
|
|
@@ -15,11 +15,9 @@ export class DuetSubmenuBarDropdown {
|
|
|
15
15
|
this.checkIsDesktop = () => {
|
|
16
16
|
if (this.mql[0].matches) {
|
|
17
17
|
this.isDesktop = true;
|
|
18
|
-
this.iconSize = "x-small";
|
|
19
18
|
}
|
|
20
19
|
else {
|
|
21
20
|
this.isDesktop = false;
|
|
22
|
-
this.iconSize = "small";
|
|
23
21
|
}
|
|
24
22
|
};
|
|
25
23
|
this.onClick = () => {
|
|
@@ -38,7 +36,6 @@ export class DuetSubmenuBarDropdown {
|
|
|
38
36
|
}
|
|
39
37
|
};
|
|
40
38
|
this.isDesktop = false;
|
|
41
|
-
this.iconSize = "small";
|
|
42
39
|
this.theme = "";
|
|
43
40
|
this.active = false;
|
|
44
41
|
this.open = false;
|
|
@@ -107,7 +104,7 @@ export class DuetSubmenuBarDropdown {
|
|
|
107
104
|
} }, h("button", { ref: element => (this.button = element), "aria-haspopup": "menu", "aria-controls": "menu", "aria-expanded": this.open ? "true" : "false", "aria-current": this.active ? "true" : "false", id: "button", type: "button", class: {
|
|
108
105
|
open: this.open,
|
|
109
106
|
active: this.active,
|
|
110
|
-
}, onClick: this.onClick, onKeyUp: e => this.handleEscape(e) }, this.icon && (h("duet-icon", { theme: this.theme, name: this.icon, size:
|
|
107
|
+
}, onClick: this.onClick, onKeyUp: e => this.handleEscape(e) }, this.icon && (h("duet-icon", { class: "submenu-bar-dropdown-icon", theme: this.theme, name: this.icon, size: "auto", margin: "none", color: "currentColor" })), h("div", { class: "label" }, h("span", { class: "label-text" }, h("slot", { name: "label" })), h("duet-icon", { class: "caret", theme: this.theme, name: "action-arrow-down-small", margin: "none", size: "xxx-small", color: "currentColor" }))), h("div", { tabindex: "-1", role: "menu", id: "menu", "aria-labelledby": "button", class: {
|
|
111
108
|
items: true,
|
|
112
109
|
hidden: !this.open,
|
|
113
110
|
} }, h("slot", null)))));
|
|
@@ -208,8 +205,7 @@ export class DuetSubmenuBarDropdown {
|
|
|
208
205
|
}
|
|
209
206
|
static get states() {
|
|
210
207
|
return {
|
|
211
|
-
"isDesktop": {}
|
|
212
|
-
"iconSize": {}
|
|
208
|
+
"isDesktop": {}
|
|
213
209
|
};
|
|
214
210
|
}
|
|
215
211
|
static get methods() {
|
|
@@ -52,6 +52,16 @@
|
|
|
52
52
|
.duet-theme-turva .duet-submenu-bar-link:focus, .duet-submenu-bar-link:focus.duet-theme-turva {
|
|
53
53
|
box-shadow: 0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a;
|
|
54
54
|
}
|
|
55
|
+
.duet-submenu-bar-link .submenu-bar-link-icon {
|
|
56
|
+
width: 20px;
|
|
57
|
+
height: 20px;
|
|
58
|
+
}
|
|
59
|
+
@media (min-width: 62em) {
|
|
60
|
+
.duet-submenu-bar-link .submenu-bar-link-icon {
|
|
61
|
+
width: 16px;
|
|
62
|
+
height: 16px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
55
65
|
@media (min-width: 62em) {
|
|
56
66
|
.duet-submenu-bar-link {
|
|
57
67
|
flex-direction: column;
|
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { media_query_large } from "@duetds/tokens/lib/tokens.json";
|
|
5
4
|
import { h, Host } from "@stencil/core";
|
|
6
5
|
import { inheritGlobalTheme } from "../../common/themeable-component";
|
|
7
6
|
import { isEscapeKey } from "../../utils/keyboard-utils";
|
|
8
7
|
export class DuetSubmenuBarLink {
|
|
9
8
|
constructor() {
|
|
10
|
-
/**
|
|
11
|
-
* Own Properties.
|
|
12
|
-
*/
|
|
13
|
-
this.mql = [window.matchMedia(media_query_large.replace(/'/g, ""))];
|
|
14
|
-
this.boundMqlFunctions = [];
|
|
15
|
-
this.changeIconSize = () => {
|
|
16
|
-
if (this.mql[0].matches) {
|
|
17
|
-
this.iconSize = "x-small";
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
this.iconSize = "small";
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
this.iconSize = "small";
|
|
24
9
|
this.theme = "";
|
|
25
10
|
this.active = false;
|
|
26
11
|
this.href = "#";
|
|
@@ -32,26 +17,6 @@ export class DuetSubmenuBarLink {
|
|
|
32
17
|
componentWillLoad() {
|
|
33
18
|
inheritGlobalTheme(this);
|
|
34
19
|
}
|
|
35
|
-
connectedCallback() {
|
|
36
|
-
this.changeIconSize();
|
|
37
|
-
for (let i = 0; i < this.mql.length; i++) {
|
|
38
|
-
// addEventListener is not available in Stencil hydrate
|
|
39
|
-
if (this.mql[i].addEventListener) {
|
|
40
|
-
const bound = this.changeIconSize.bind(this);
|
|
41
|
-
this.mql[i].addEventListener("change", bound);
|
|
42
|
-
this.boundMqlFunctions[i] = bound;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
disconnectedCallback() {
|
|
47
|
-
for (let i = 0; i < this.mql.length; i++) {
|
|
48
|
-
// removeEventListener is not available in Stencil hydrate
|
|
49
|
-
if (this.mql[i].removeEventListener) {
|
|
50
|
-
this.mql[i].removeEventListener("change", this.boundMqlFunctions[i]);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
this.boundMqlFunctions = [];
|
|
54
|
-
}
|
|
55
20
|
handleEscape(e) {
|
|
56
21
|
if (isEscapeKey(e)) {
|
|
57
22
|
const dropdown = this.element.closest("duet-submenu-bar");
|
|
@@ -64,7 +29,7 @@ export class DuetSubmenuBarLink {
|
|
|
64
29
|
* Always the last one in the class.
|
|
65
30
|
*/
|
|
66
31
|
render() {
|
|
67
|
-
return (h(Host, null, h("a", { class: { "duet-submenu-bar-link": true, "duet-theme-turva": this.theme === "turva", active: this.active }, href: this.href, onKeyUp: e => this.handleEscape(e), "aria-current": this.active ? "true" : "false" }, this.icon && (h("duet-icon", { theme: this.theme, name: this.icon, size:
|
|
32
|
+
return (h(Host, null, h("a", { class: { "duet-submenu-bar-link": true, "duet-theme-turva": this.theme === "turva", active: this.active }, href: this.href, onKeyUp: e => this.handleEscape(e), "aria-current": this.active ? "true" : "false" }, this.icon && (h("duet-icon", { class: "submenu-bar-link-icon", theme: this.theme, name: this.icon, size: "auto", margin: "none", color: "currentColor" })), h("span", { class: "label" }, h("slot", null)))));
|
|
68
33
|
}
|
|
69
34
|
static get is() { return "duet-submenu-bar-link"; }
|
|
70
35
|
static get encapsulation() { return "shadow"; }
|
|
@@ -160,10 +125,5 @@ export class DuetSubmenuBarLink {
|
|
|
160
125
|
}
|
|
161
126
|
};
|
|
162
127
|
}
|
|
163
|
-
static get states() {
|
|
164
|
-
return {
|
|
165
|
-
"iconSize": {}
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
128
|
static get elementRef() { return "element"; }
|
|
169
129
|
}
|
|
@@ -6,6 +6,10 @@ import { inheritGlobalTheme } from "../../common";
|
|
|
6
6
|
import { getLocaleString } from "../../utils/language-utils";
|
|
7
7
|
import { getI18nError } from "../duet-upload/errorcodes.utils";
|
|
8
8
|
import { formatBytes } from "../duet-upload/upload.helpers";
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
* This component is for internal use.
|
|
12
|
+
*/
|
|
9
13
|
export class DuetUploadItem {
|
|
10
14
|
constructor() {
|
|
11
15
|
this.fileUploadingInfo = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { D as DuetActionButton$1, d as defineCustomElement$1 } from './p-
|
|
4
|
+
import { D as DuetActionButton$1, d as defineCustomElement$1 } from './p-f4ac6968.js';
|
|
5
5
|
|
|
6
6
|
const DuetActionButton = DuetActionButton$1;
|
|
7
7
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -17,14 +17,14 @@ const DuetPicture = ({ img, sources }) => {
|
|
|
17
17
|
h("img", Object.assign({}, img))));
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
const duetBannerCss = "
|
|
20
|
+
const duetBannerCss = "*,\n*::after,\n*::before {\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n background: transparent;\n border: 0;\n -moz-appearance: none;\n -webkit-appearance: none;\n appearance: none;\n}\n\n:host {\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n background: transparent;\n border: 0;\n -moz-appearance: none;\n -webkit-appearance: none;\n appearance: none;\n margin-right: 36px !important;\n margin-bottom: 36px !important;\n display: flex;\n justify-content: center;\n width: auto;\n container: duet-banner-container;\n container-type: inline-size;\n}\n:host:last-child, :host:last-of-type {\n margin-right: 0 !important;\n}\n\n:host(.duet-m-0) {\n margin: 0 !important;\n}\n\n.duet-banner {\n display: grid;\n grid-template-rows: min-content 1fr;\n width: 100%;\n height: 100%;\n font-family: \"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n font-style: normal;\n text-align: left;\n border-radius: 16px;\n /* stylelint-disable */\n /* stylelint-disable */\n /* stylelint-disable */\n}\n.duet-banner.duet-p-0 {\n padding: 0 !important;\n}\n.duet-banner.duet-m-0 {\n margin: 0 !important;\n}\n.duet-banner .visual {\n position: relative;\n display: none;\n overflow: hidden;\n /* stylelint-disable */\n}\n@container duet-banner-container (min-width: 0px) {\n .duet-banner .visual {\n /* stylelint-enable */\n display: block;\n }\n}\n.duet-banner .visual .image-container {\n position: relative;\n aspect-ratio: 2/1;\n overflow: hidden;\n}\n.duet-banner .visual .image {\n position: relative;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center;\n}\n.duet-banner .visual .icon {\n position: absolute;\n}\n.duet-banner .visual .brand-shape {\n position: absolute;\n top: 0;\n left: 72%;\n display: none;\n width: 100%;\n height: 100%;\n background: url(\"data:image/svg+xml,%3Csvg%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20160%20344%22%20fill%3D%22none%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M2.72641e-07%2091.1902C0.000476976%2097.9034%200.626077%20104.726%201.92282%20111.592L42.7493%20327.771C43.8045%20333.358%2045.2667%20338.776%2047.0996%20344H160V0H51.1439C19.7799%2019.1253%200.00268143%2053.4178%202.72641e-07%2091.1749C-9.08807e-08%2091.18%20-9.08875e-08%2091.1851%202.72641e-07%2091.1902Z%22%20fill%3D%22%23E6F2F8%22%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fsvg%3E\");\n}\n.duet-banner .content {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 16px 20px 28px;\n}\n.duet-banner .content .description {\n hyphens: auto;\n}\n.duet-banner .action {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n align-items: flex-start;\n justify-content: flex-end;\n padding-top: 16px;\n}\n.duet-banner .visual {\n border-top-left-radius: 16px;\n border-top-right-radius: 16px;\n}\n.duet-banner .visual .image-container {\n width: 100%;\n height: auto;\n border-radius: 0;\n}\n.duet-banner .visual .icon {\n bottom: 30px;\n left: 15px;\n}\n.duet-banner.duet-theme-turva {\n font-family: \"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n}\n.duet-banner.duet-theme-turva .visual .brand-shape {\n background-image: url(\"data:image/svg+xml,%3Csvg viewBox='0 0 160 344' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_7920_3801)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2.58983 142.533C0.751086 155.147 0.0746585 167.857 0.00796847 179.225C0.00263853 179.814 0 180.409 0 181.007C0 194.845 1.41172 210.806 3.58065 223.171C5.6528 234.934 8.58716 246.495 12.5981 257.779C21.2249 282.059 34.0151 304.109 50.8401 323.977C56.7824 330.993 63.0921 337.68 69.8162 344H160V0H65.0733C52.1771 10.7866 41.4339 23.4177 32.7528 37.7978C21.1154 57.0822 14.0367 77.9583 9.75424 99.7913C9.09214 103.157 8.55049 106.545 8.00901 109.933C7.75185 111.542 7.49474 113.15 7.22478 114.756C6.74308 117.618 6.24543 120.479 5.74776 123.34C4.6361 129.729 3.52432 136.12 2.58983 142.533Z' fill='%23F5F5F7'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_7920_3801'%3E%3Crect width='160' height='344' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A\");\n}\n@container duet-banner-container (min-width: 486px) {\n .duet-banner {\n /* stylelint-enable */\n grid-template-rows: none;\n grid-template-columns: 50% 50%;\n }\n .duet-banner .visual {\n border-top-left-radius: 16px;\n border-top-right-radius: 0;\n border-bottom-left-radius: 16px;\n }\n .duet-banner .visual .image-container {\n height: 100%;\n }\n .duet-banner .visual .image {\n width: 100%;\n height: 100%;\n }\n .duet-banner .visual .icon {\n top: 36px;\n left: 168px;\n }\n .duet-banner .visual .brand-shape {\n display: block;\n }\n .duet-banner .content {\n align-items: flex-start;\n justify-content: center;\n padding: 28px 28px 28px 0;\n }\n .duet-banner .action {\n flex-grow: 0;\n }\n}\n@container duet-banner-container (min-width: 586px) {\n .duet-banner {\n /* stylelint-enable */\n }\n .duet-banner .visual .brand-shape {\n left: 80%;\n }\n}\n@container duet-banner-container (min-width: 900px) {\n .duet-banner {\n /* stylelint-enable */\n grid-template-rows: none;\n grid-template-columns: 50% 50%;\n }\n .duet-banner .visual {\n border-top-left-radius: 16px;\n border-bottom-left-radius: 16px;\n }\n .duet-banner .visual .image-container {\n height: 100%;\n }\n .duet-banner .visual .image {\n width: 100%;\n height: 100%;\n }\n .duet-banner .visual .icon {\n top: 40px;\n bottom: auto;\n left: 335px;\n }\n .duet-banner .visual .brand-shape {\n display: block;\n }\n .duet-banner .content {\n align-items: flex-start;\n justify-content: center;\n padding: 48px 48px 48px 0;\n }\n .duet-banner .action {\n flex-grow: 0;\n }\n}";
|
|
21
21
|
|
|
22
22
|
const DuetBanner$1 = /*@__PURE__*/ proxyCustomElement(class DuetBanner extends H {
|
|
23
23
|
constructor() {
|
|
24
24
|
super();
|
|
25
25
|
this.__registerHost();
|
|
26
26
|
this.__attachShadow();
|
|
27
|
-
this.
|
|
27
|
+
this.checkCurrentSize = () => {
|
|
28
28
|
const elementSize = this.element.clientWidth;
|
|
29
29
|
if (elementSize < 500 || this.size === "small") {
|
|
30
30
|
this.currentSize = "small";
|
|
@@ -41,12 +41,15 @@ const DuetBanner$1 = /*@__PURE__*/ proxyCustomElement(class DuetBanner extends H
|
|
|
41
41
|
* Default to smaller button size for small and medium banners.
|
|
42
42
|
*/
|
|
43
43
|
this.setButtonSize = () => {
|
|
44
|
-
if (this.hasActionSlot) {
|
|
44
|
+
if (this.hasActionSlot && this.currentSize) {
|
|
45
45
|
const buttons = this.element.querySelectorAll("[slot='action'] duet-button, duet-button[slot='action']");
|
|
46
46
|
for (const button of buttons) {
|
|
47
47
|
if (button && button.getAttribute("size") === null && this.currentSize !== "large") {
|
|
48
48
|
button.size = "small";
|
|
49
49
|
}
|
|
50
|
+
else if (button && button.getAttribute("size") === null && this.currentSize === "large") {
|
|
51
|
+
button.size = "medium";
|
|
52
|
+
}
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
55
|
};
|
|
@@ -75,13 +78,13 @@ const DuetBanner$1 = /*@__PURE__*/ proxyCustomElement(class DuetBanner extends H
|
|
|
75
78
|
this.setButtonSize();
|
|
76
79
|
}
|
|
77
80
|
connectedCallback() {
|
|
78
|
-
window.addEventListener("resize", this.
|
|
81
|
+
window.addEventListener("resize", this.checkCurrentSize);
|
|
79
82
|
}
|
|
80
83
|
disconnectedCallback() {
|
|
81
|
-
window.removeEventListener("resize", this.
|
|
84
|
+
window.removeEventListener("resize", this.checkCurrentSize);
|
|
82
85
|
}
|
|
83
86
|
componentDidRender() {
|
|
84
|
-
this.
|
|
87
|
+
this.checkCurrentSize();
|
|
85
88
|
}
|
|
86
89
|
/**
|
|
87
90
|
* render() function
|
|
@@ -102,7 +105,7 @@ const DuetBanner$1 = /*@__PURE__*/ proxyCustomElement(class DuetBanner extends H
|
|
|
102
105
|
"duet-banner": true,
|
|
103
106
|
"duet-theme-turva": this.theme === "turva",
|
|
104
107
|
[this.currentSize]: true,
|
|
105
|
-
}, style: bannerStyles }, h$1("div", { class: "visual" }, h$1("div", { class: "image-container" }, this.image && h$1(DuetPicture, Object.assign({}, pictureSource))),
|
|
108
|
+
}, style: bannerStyles }, h$1("div", { class: "visual" }, h$1("div", { class: "image-container" }, this.image && h$1(DuetPicture, Object.assign({}, pictureSource))), 1 > 2 , h$1("div", { class: "brand-shape" })), h$1("div", { class: "content" }, this.hasHeadingSlot && (h$1("div", { class: "heading" }, h$1("duet-heading", { theme: this.theme, level: this.headingLevel, "visual-level": this.currentSize === "large" ? "h2" : "h3", "fixed-size": true, margin: "none", color: this.textColor }, h$1("span", null, h$1("slot", { name: "heading" }))))), this.hasDescriptionSlot && (h$1("div", { class: "description", style: { color } }, h$1("slot", { name: "description" }))), this.hasActionSlot && (h$1("div", { class: "action" }, h$1("slot", { name: "action" })))))));
|
|
106
109
|
}
|
|
107
110
|
get element() { return this; }
|
|
108
111
|
static get style() { return duetBannerCss; }
|
|
@@ -83,6 +83,13 @@ const DuetChoiceGroup$1 = /*@__PURE__*/ proxyCustomElement(class DuetChoiceGroup
|
|
|
83
83
|
this.initialValue = this.value;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* @internal
|
|
88
|
+
* Get initial value
|
|
89
|
+
*/
|
|
90
|
+
async getInitialValue() {
|
|
91
|
+
return this.initialValue;
|
|
92
|
+
}
|
|
86
93
|
/**
|
|
87
94
|
* Local methods
|
|
88
95
|
*/
|
|
@@ -155,7 +162,8 @@ const DuetChoiceGroup$1 = /*@__PURE__*/ proxyCustomElement(class DuetChoiceGroup
|
|
|
155
162
|
"value": [1537],
|
|
156
163
|
"disabled": [4],
|
|
157
164
|
"required": [4],
|
|
158
|
-
"accessibleLiveError": [1, "accessible-live-error"]
|
|
165
|
+
"accessibleLiveError": [1, "accessible-live-error"],
|
|
166
|
+
"getInitialValue": [64]
|
|
159
167
|
}, undefined, {
|
|
160
168
|
"value": ["setInitialValue", "updateChoices"],
|
|
161
169
|
"disabled": ["updateChoices"],
|
|
@@ -7,7 +7,7 @@ import { a as getLanguage, c as connectLanguageChangeObserver, d as disconnectLa
|
|
|
7
7
|
import { d as defineCustomElement$8 } from './p-83231ea8.js';
|
|
8
8
|
import { d as defineCustomElement$7 } from './p-a167e2a0.js';
|
|
9
9
|
import { d as defineCustomElement$6 } from './p-667579b0.js';
|
|
10
|
-
import { d as defineCustomElement$5 } from './p-
|
|
10
|
+
import { d as defineCustomElement$5 } from './p-2f410810.js';
|
|
11
11
|
import { d as defineCustomElement$4 } from './p-17ed32c8.js';
|
|
12
12
|
import { d as defineCustomElement$3 } from './p-63954651.js';
|
|
13
13
|
import { d as defineCustomElement$2 } from './p-d1815d2a.js';
|
|
@@ -8,7 +8,7 @@ import { F as FocusGuard } from './p-4bd749d9.js';
|
|
|
8
8
|
import { a as getLanguage, g as getLocaleString, c as connectLanguageChangeObserver, d as disconnectLanguageChangeObserver } from './p-2e36d5bf.js';
|
|
9
9
|
import { c as checkNamedSlotElement } from './p-06e608ae.js';
|
|
10
10
|
import { h } from './p-33937fd7.js';
|
|
11
|
-
import { d as defineCustomElement$d } from './p-
|
|
11
|
+
import { d as defineCustomElement$d } from './p-f4ac6968.js';
|
|
12
12
|
import { d as defineCustomElement$c } from './p-83231ea8.js';
|
|
13
13
|
import { d as defineCustomElement$b } from './p-b6322d8d.js';
|
|
14
14
|
import { d as defineCustomElement$a } from './p-667579b0.js';
|
|
@@ -7,7 +7,7 @@ import { f as fieldSorter } from './p-9e371678.js';
|
|
|
7
7
|
import { i as isKeyboardClick } from './p-785686e3.js';
|
|
8
8
|
import { a as getLanguage, c as connectLanguageChangeObserver, d as disconnectLanguageChangeObserver, g as getLocaleString } from './p-2e36d5bf.js';
|
|
9
9
|
import { h } from './p-33937fd7.js';
|
|
10
|
-
import { d as defineCustomElement$7 } from './p-
|
|
10
|
+
import { d as defineCustomElement$7 } from './p-f4ac6968.js';
|
|
11
11
|
import { d as defineCustomElement$6 } from './p-83231ea8.js';
|
|
12
12
|
import { d as defineCustomElement$5 } from './p-667579b0.js';
|
|
13
13
|
import { d as defineCustomElement$4 } from './p-63954651.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import { D as DuetLink$1, d as defineCustomElement$1 } from './p-
|
|
4
|
+
import { D as DuetLink$1, d as defineCustomElement$1 } from './p-2f410810.js';
|
|
5
5
|
|
|
6
6
|
const DuetLink = DuetLink$1;
|
|
7
7
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -2,28 +2,16 @@
|
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
4
|
import { p as proxyCustomElement, H, h, d as Host } from './p-e98f9bb0.js';
|
|
5
|
-
import { a as media_query_large } from './p-f9a8d356.js';
|
|
6
5
|
import { i as inheritGlobalTheme } from './p-a58bd561.js';
|
|
7
6
|
import { d as defineCustomElement$2 } from './p-667579b0.js';
|
|
8
7
|
|
|
9
|
-
const duetMenuBarButtonCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;height:100%}.duet-menu-bar-button{position:relative;display:flex;gap:8px;align-items:center;justify-content:center;height:100%;padding:0 12px;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:inherit;color:inherit;text-align:center;text-decoration:none;cursor:pointer}.duet-menu-bar-button:focus{outline:0;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva .duet-menu-bar-button:focus,.duet-menu-bar-button:focus.duet-theme-turva{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-menu-bar-button.duet-theme-turva{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}@media (min-width: 62em){.duet-menu-bar-button{padding:0 16px}}@media (min-width: 76.25em){.duet-menu-bar-button{padding:0 28px}}@media (min-width: 62em){.duet-menu-bar-button:hover{color:rgb(0, 119, 179)}.duet-menu-bar-button:hover.duet-theme-turva{color:rgb(198, 12, 48)}}";
|
|
8
|
+
const duetMenuBarButtonCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;height:100%}.duet-menu-bar-button{position:relative;display:flex;gap:8px;align-items:center;justify-content:center;height:100%;padding:0 12px;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:inherit;color:inherit;text-align:center;text-decoration:none;cursor:pointer}.duet-menu-bar-button:focus{outline:0;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva .duet-menu-bar-button:focus,.duet-menu-bar-button:focus.duet-theme-turva{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-menu-bar-button .menu-bar-button-icon{width:20px;height:20px}@media (min-width: 62em){.duet-menu-bar-button .menu-bar-button-icon{width:16px;height:16px}}.duet-menu-bar-button.duet-theme-turva{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}@media (min-width: 62em){.duet-menu-bar-button{padding:0 16px}}@media (min-width: 76.25em){.duet-menu-bar-button{padding:0 28px}}@media (min-width: 62em){.duet-menu-bar-button:hover{color:rgb(0, 119, 179)}.duet-menu-bar-button:hover.duet-theme-turva{color:rgb(198, 12, 48)}}";
|
|
10
9
|
|
|
11
10
|
const DuetMenuBarButton$1 = /*@__PURE__*/ proxyCustomElement(class DuetMenuBarButton extends H {
|
|
12
11
|
constructor() {
|
|
13
12
|
super();
|
|
14
13
|
this.__registerHost();
|
|
15
14
|
this.__attachShadow();
|
|
16
|
-
this.mql = [window.matchMedia(media_query_large.replace(/'/g, ""))];
|
|
17
|
-
this.boundMqlFunctions = [];
|
|
18
|
-
this.changeIconSize = () => {
|
|
19
|
-
if (this.mql[0].matches) {
|
|
20
|
-
this.iconSize = "x-small";
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
this.iconSize = "small";
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
this.iconSize = "x-small";
|
|
27
15
|
this.accessibleLabel = undefined;
|
|
28
16
|
this.accessibleControls = undefined;
|
|
29
17
|
this.accessiblePopup = "false";
|
|
@@ -44,26 +32,6 @@ const DuetMenuBarButton$1 = /*@__PURE__*/ proxyCustomElement(class DuetMenuBarBu
|
|
|
44
32
|
componentWillLoad() {
|
|
45
33
|
inheritGlobalTheme(this);
|
|
46
34
|
}
|
|
47
|
-
connectedCallback() {
|
|
48
|
-
this.changeIconSize();
|
|
49
|
-
for (let i = 0; i < this.mql.length; i++) {
|
|
50
|
-
// addEventListener is not available in Stencil hydrate
|
|
51
|
-
if (this.mql[i].addEventListener) {
|
|
52
|
-
const bound = this.changeIconSize.bind(this);
|
|
53
|
-
this.mql[i].addEventListener("change", bound);
|
|
54
|
-
this.boundMqlFunctions[i] = bound;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
disconnectedCallback() {
|
|
59
|
-
for (let i = 0; i < this.mql.length; i++) {
|
|
60
|
-
// removeEventListener is not available in Stencil hydrate
|
|
61
|
-
if (this.mql[i].removeEventListener) {
|
|
62
|
-
this.mql[i].removeEventListener("change", this.boundMqlFunctions[i]);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
this.boundMqlFunctions = [];
|
|
66
|
-
}
|
|
67
35
|
/**
|
|
68
36
|
* Sets focus on underlying button element.
|
|
69
37
|
*/
|
|
@@ -80,7 +48,7 @@ const DuetMenuBarButton$1 = /*@__PURE__*/ proxyCustomElement(class DuetMenuBarBu
|
|
|
80
48
|
return (h(Host, { role: "listitem", onfocus: () => this.setFocus() }, h("button", { ref: button => (this.nativeButton = button), class: {
|
|
81
49
|
"duet-menu-bar-button": true,
|
|
82
50
|
"duet-theme-turva": this.theme === "turva",
|
|
83
|
-
}, "aria-controls": this.accessibleControls, "aria-label": this.accessibleLabel, "aria-expanded": this.accessibleExpanded != null ? this.accessibleExpanded.toString() : undefined, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, "aria-describedby": this.accessibleDescribedBy, "aria-labelledby": this.accessibleLabelledBy, "aria-details": this.accessibleDetails, "aria-description": this.accessibleDescription, "aria-pressed": this.accessiblePressed != null ? this.accessiblePressed.toString() : undefined, "aria-haspopup": this.accessiblePopup != null ? this.accessiblePopup.toString() : undefined }, this.icon && (h("duet-icon", { theme: this.theme, size:
|
|
51
|
+
}, "aria-controls": this.accessibleControls, "aria-label": this.accessibleLabel, "aria-expanded": this.accessibleExpanded != null ? this.accessibleExpanded.toString() : undefined, "aria-activedescendant": this.accessibleActiveDescendant, "aria-owns": this.accessibleOwns, "aria-describedby": this.accessibleDescribedBy, "aria-labelledby": this.accessibleLabelledBy, "aria-details": this.accessibleDetails, "aria-description": this.accessibleDescription, "aria-pressed": this.accessiblePressed != null ? this.accessiblePressed.toString() : undefined, "aria-haspopup": this.accessiblePopup != null ? this.accessiblePopup.toString() : undefined }, this.icon && (h("duet-icon", { class: "menu-bar-button-icon", theme: this.theme, size: "auto", name: this.icon, margin: "none", color: "currentColor" })), h("slot", null))));
|
|
84
52
|
}
|
|
85
53
|
get element() { return this; }
|
|
86
54
|
static get style() { return duetMenuBarButtonCss; }
|
|
@@ -98,7 +66,6 @@ const DuetMenuBarButton$1 = /*@__PURE__*/ proxyCustomElement(class DuetMenuBarBu
|
|
|
98
66
|
"accessiblePressed": [4, "accessible-pressed"],
|
|
99
67
|
"theme": [1025],
|
|
100
68
|
"icon": [1537],
|
|
101
|
-
"iconSize": [32],
|
|
102
69
|
"setFocus": [64]
|
|
103
70
|
}]);
|
|
104
71
|
function defineCustomElement$1() {
|