@zanichelli/albe-web-components 6.5.0 → 6.5.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/CHANGELOG.md +2153 -0
- package/dist/cjs/index-e3299e0a.js +14 -30
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-switcher.cjs.entry.js +29 -0
- package/dist/cjs/z-combobox.cjs.entry.js +13 -10
- package/dist/cjs/{z-modal.cjs.entry.js → z-dragdrop-area_3.cjs.entry.js} +43 -0
- package/dist/cjs/z-input_2.cjs.entry.js +1 -1
- package/dist/cjs/{z-app-switcher_2.cjs.entry.js → z-logo.cjs.entry.js} +0 -23
- package/dist/cjs/z-offcanvas.cjs.entry.js +7 -1
- package/dist/cjs/z-table-row.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +0 -4
- package/dist/collection/components/inputs/z-combobox/index.js +14 -9
- package/dist/collection/components/inputs/z-input/styles.css +3 -0
- package/dist/collection/components/z-offcanvas/index.js +7 -1
- package/dist/collection/components/z-table/z-table-row/index.js +2 -2
- package/dist/esm/index-a2ca4b97.js +14 -30
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-ccb4d66f.js → utils-6cf7efe2.js} +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-switcher.entry.js +25 -0
- package/dist/esm/z-chip.entry.js +1 -1
- package/dist/esm/z-combobox.entry.js +14 -11
- package/dist/esm/{z-modal.entry.js → z-dragdrop-area_3.entry.js} +42 -1
- package/dist/esm/z-file-upload.entry.js +1 -1
- package/dist/esm/z-input_2.entry.js +2 -2
- package/dist/esm/{z-app-switcher_2.entry.js → z-logo.entry.js} +2 -24
- package/dist/esm/z-myz-card-info.entry.js +1 -1
- package/dist/esm/z-myz-list-item.entry.js +1 -1
- package/dist/esm/z-offcanvas.entry.js +7 -1
- package/dist/esm/z-pocket_3.entry.js +1 -1
- package/dist/esm/z-popover.entry.js +1 -1
- package/dist/esm/z-select.entry.js +1 -1
- package/dist/esm/z-skip-to-content.entry.js +1 -1
- package/dist/esm/z-slideshow.entry.js +1 -1
- package/dist/esm/z-table-header.entry.js +1 -1
- package/dist/esm/z-table-row.entry.js +2 -2
- package/dist/esm/z-toggle-switch.entry.js +1 -1
- package/dist/types/components/inputs/z-combobox/index.d.ts +2 -0
- package/dist/types/components/z-offcanvas/index.d.ts +1 -0
- package/dist/types/components.d.ts +2 -230
- package/dist/web-components-library/index.esm.js +1 -1
- package/dist/web-components-library/p-1d66b265.entry.js +1 -0
- package/{www/build/p-9965827d.entry.js → dist/web-components-library/p-26033729.entry.js} +1 -1
- package/dist/web-components-library/{p-8bf0844b.entry.js → p-53065788.entry.js} +1 -1
- package/dist/web-components-library/p-56d2b76d.entry.js +1 -0
- package/dist/web-components-library/{p-1b6279a6.entry.js → p-5c62387a.entry.js} +1 -1
- package/dist/web-components-library/{p-20a3247c.entry.js → p-6c163539.entry.js} +1 -1
- package/dist/web-components-library/{p-279655eb.entry.js → p-7b3b99ee.entry.js} +1 -1
- package/{www/build/p-3d9ecc23.entry.js → dist/web-components-library/p-7ea553e9.entry.js} +1 -1
- package/dist/web-components-library/{p-cd43f80d.js → p-8ebe4adf.js} +1 -1
- package/{www/build/p-98c94e81.entry.js → dist/web-components-library/p-91a74348.entry.js} +1 -1
- package/dist/web-components-library/{p-c25b0b2a.entry.js → p-93142fac.entry.js} +1 -1
- package/dist/web-components-library/p-9a613586.entry.js +1 -0
- package/dist/web-components-library/{p-411cbcd6.entry.js → p-a05ce0a6.entry.js} +1 -1
- package/{www/build/p-bdc6f2e5.entry.js → dist/web-components-library/p-a6c0f149.entry.js} +1 -1
- package/dist/web-components-library/p-ae79573a.entry.js +1 -0
- package/dist/web-components-library/p-bdefe224.entry.js +1 -0
- package/dist/web-components-library/{p-8980398c.entry.js → p-d2127d84.entry.js} +1 -1
- package/dist/web-components-library/{p-8b960526.entry.js → p-dd000757.entry.js} +1 -1
- package/dist/web-components-library/p-de55c171.entry.js +1 -0
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/package.json +1 -1
- package/react/components.d.ts +0 -4
- package/react/components.js +2 -6
- package/react/components.js.map +1 -1
- package/src-react/index.ts +1 -0
- package/www/build/index.esm.js +1 -1
- package/www/build/p-1674fd9c.js +1 -0
- package/www/build/p-1d66b265.entry.js +1 -0
- package/{dist/web-components-library/p-9965827d.entry.js → www/build/p-26033729.entry.js} +1 -1
- package/www/build/{p-8bf0844b.entry.js → p-53065788.entry.js} +1 -1
- package/www/build/p-56d2b76d.entry.js +1 -0
- package/www/build/{p-1b6279a6.entry.js → p-5c62387a.entry.js} +1 -1
- package/www/build/{p-20a3247c.entry.js → p-6c163539.entry.js} +1 -1
- package/www/build/{p-279655eb.entry.js → p-7b3b99ee.entry.js} +1 -1
- package/{dist/web-components-library/p-3d9ecc23.entry.js → www/build/p-7ea553e9.entry.js} +1 -1
- package/www/build/{p-cd43f80d.js → p-8ebe4adf.js} +1 -1
- package/{dist/web-components-library/p-98c94e81.entry.js → www/build/p-91a74348.entry.js} +1 -1
- package/www/build/{p-c25b0b2a.entry.js → p-93142fac.entry.js} +1 -1
- package/www/build/p-9a613586.entry.js +1 -0
- package/www/build/{p-411cbcd6.entry.js → p-a05ce0a6.entry.js} +1 -1
- package/{dist/web-components-library/p-bdc6f2e5.entry.js → www/build/p-a6c0f149.entry.js} +1 -1
- package/www/build/p-ae79573a.entry.js +1 -0
- package/www/build/p-bdefe224.entry.js +1 -0
- package/www/build/{p-8980398c.entry.js → p-d2127d84.entry.js} +1 -1
- package/www/build/{p-8b960526.entry.js → p-dd000757.entry.js} +1 -1
- package/www/build/p-de55c171.entry.js +1 -0
- package/www/build/web-components-library.esm.js +1 -1
- package/www/index.html +1 -1
- package/www/pages/file-upload.html +0 -33
- package/www/pages/notification.html +0 -33
- package/dist/cjs/z-app-topbar.cjs.entry.js +0 -41
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +0 -49
- package/dist/cjs/z-menu-dropdown.cjs.entry.js +0 -59
- package/dist/cjs/z-modal-login.cjs.entry.js +0 -84
- package/dist/cjs/z-user-dropdown.cjs.entry.js +0 -93
- package/dist/collection/components/modal/z-modal-login/index.js +0 -251
- package/dist/collection/components/modal/z-modal-login/styles.css +0 -150
- package/dist/collection/components/navigation/z-app-topbar/index.js +0 -156
- package/dist/collection/components/navigation/z-app-topbar/styles.css +0 -65
- package/dist/collection/components/navigation/z-menu-dropdown/index.js +0 -124
- package/dist/collection/components/navigation/z-menu-dropdown/styles.css +0 -146
- package/dist/collection/components/navigation/z-user-dropdown/index.js +0 -247
- package/dist/collection/components/navigation/z-user-dropdown/styles.css +0 -306
- package/dist/esm/z-app-topbar.entry.js +0 -37
- package/dist/esm/z-dragdrop-area_2.entry.js +0 -44
- package/dist/esm/z-menu-dropdown.entry.js +0 -55
- package/dist/esm/z-modal-login.entry.js +0 -80
- package/dist/esm/z-user-dropdown.entry.js +0 -89
- package/dist/types/components/modal/z-modal-login/index.d.ts +0 -41
- package/dist/types/components/navigation/z-app-topbar/index.d.ts +0 -20
- package/dist/types/components/navigation/z-menu-dropdown/index.d.ts +0 -19
- package/dist/types/components/navigation/z-user-dropdown/index.d.ts +0 -39
- package/dist/web-components-library/p-1ba8d432.entry.js +0 -1
- package/dist/web-components-library/p-3c2d438b.entry.js +0 -1
- package/dist/web-components-library/p-4cd6c6f4.entry.js +0 -1
- package/dist/web-components-library/p-4e8fd5be.entry.js +0 -1
- package/dist/web-components-library/p-547d3b1f.entry.js +0 -1
- package/dist/web-components-library/p-682528b2.entry.js +0 -1
- package/dist/web-components-library/p-9ed27651.entry.js +0 -1
- package/dist/web-components-library/p-a2b67e2d.entry.js +0 -1
- package/dist/web-components-library/p-b17981a4.entry.js +0 -1
- package/dist/web-components-library/p-f20d1242.entry.js +0 -1
- package/www/build/p-13cf5e67.js +0 -1
- package/www/build/p-1ba8d432.entry.js +0 -1
- package/www/build/p-3c2d438b.entry.js +0 -1
- package/www/build/p-4cd6c6f4.entry.js +0 -1
- package/www/build/p-4e8fd5be.entry.js +0 -1
- package/www/build/p-547d3b1f.entry.js +0 -1
- package/www/build/p-682528b2.entry.js +0 -1
- package/www/build/p-9ed27651.entry.js +0 -1
- package/www/build/p-a2b67e2d.entry.js +0 -1
- package/www/build/p-b17981a4.entry.js +0 -1
- package/www/build/p-f20d1242.entry.js +0 -1
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
2
|
-
import { KeyboardKeyCode } from "../../../beans/index";
|
|
3
|
-
import { handleKeyboardSubmit, getClickedElement, getElementTree } from "../../../utils/utils";
|
|
4
|
-
export class ZMenuDropdown {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.ismenuopen = false;
|
|
7
|
-
this.handleToggle = this.handleToggle.bind(this);
|
|
8
|
-
this.handleFocus = this.handleFocus.bind(this);
|
|
9
|
-
}
|
|
10
|
-
componentWillRender() {
|
|
11
|
-
this.linkarray = typeof this.menucontent === "string" ? JSON.parse(this.menucontent) : this.menucontent;
|
|
12
|
-
}
|
|
13
|
-
renderMenuOpen() {
|
|
14
|
-
if (this.ismenuopen) {
|
|
15
|
-
return (h("ul", null, this.linkarray.map((bean) => (h("li", null, h("z-link", { htmlid: bean.id, href: bean.link, icon: bean.icon }, bean.label))))));
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
renderButtonMenu() {
|
|
19
|
-
return (h("span", { class: "arrow" }, h("z-icon", { name: "caret-down", width: 14, height: 14 })));
|
|
20
|
-
}
|
|
21
|
-
retriveMenuClass() {
|
|
22
|
-
if (this.ismenuopen) {
|
|
23
|
-
return "menu-opened";
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
handleToggle() {
|
|
27
|
-
this.ismenuopen = !this.ismenuopen;
|
|
28
|
-
}
|
|
29
|
-
handleFocus(e) {
|
|
30
|
-
if (e instanceof KeyboardEvent && e.keyCode !== KeyboardKeyCode.TAB) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const tree = getElementTree(getClickedElement());
|
|
34
|
-
const menuParent = tree.find((elem) => elem.nodeName.toLowerCase() === "z-menu-dropdown");
|
|
35
|
-
if (!menuParent) {
|
|
36
|
-
document.removeEventListener("click", this.handleFocus);
|
|
37
|
-
document.removeEventListener("keyup", this.handleFocus);
|
|
38
|
-
this.ismenuopen = false;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
render() {
|
|
42
|
-
return (h("a", { class: this.retriveMenuClass(), role: "button", tabindex: "0", onFocus: () => {
|
|
43
|
-
document.addEventListener("click", this.handleFocus);
|
|
44
|
-
document.addEventListener("keyup", this.handleFocus);
|
|
45
|
-
}, onKeyUp: (e) => handleKeyboardSubmit(e, this.handleToggle) }, h("div", { class: "container", onClick: () => this.handleToggle() }, h("span", { class: "user-wrapper" }, h("z-icon", { name: "user-avatar", width: 14, height: 14 }), h("span", { class: "user" }, this.nomeutente)), this.renderButtonMenu()), this.renderMenuOpen()));
|
|
46
|
-
}
|
|
47
|
-
static get is() { return "z-menu-dropdown"; }
|
|
48
|
-
static get encapsulation() { return "shadow"; }
|
|
49
|
-
static get originalStyleUrls() {
|
|
50
|
-
return {
|
|
51
|
-
"$": ["styles.css"]
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
static get styleUrls() {
|
|
55
|
-
return {
|
|
56
|
-
"$": ["styles.css"]
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
static get properties() {
|
|
60
|
-
return {
|
|
61
|
-
"nomeutente": {
|
|
62
|
-
"type": "string",
|
|
63
|
-
"mutable": false,
|
|
64
|
-
"complexType": {
|
|
65
|
-
"original": "string",
|
|
66
|
-
"resolved": "string",
|
|
67
|
-
"references": {}
|
|
68
|
-
},
|
|
69
|
-
"required": false,
|
|
70
|
-
"optional": false,
|
|
71
|
-
"docs": {
|
|
72
|
-
"tags": [],
|
|
73
|
-
"text": "user name text"
|
|
74
|
-
},
|
|
75
|
-
"attribute": "nomeutente",
|
|
76
|
-
"reflect": false
|
|
77
|
-
},
|
|
78
|
-
"menucontent": {
|
|
79
|
-
"type": "string",
|
|
80
|
-
"mutable": false,
|
|
81
|
-
"complexType": {
|
|
82
|
-
"original": "string | MenuItem[]",
|
|
83
|
-
"resolved": "MenuItem[] | string",
|
|
84
|
-
"references": {
|
|
85
|
-
"MenuItem": {
|
|
86
|
-
"location": "import",
|
|
87
|
-
"path": "../../../beans/index"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
"required": false,
|
|
92
|
-
"optional": false,
|
|
93
|
-
"docs": {
|
|
94
|
-
"tags": [],
|
|
95
|
-
"text": "Json stringified or array to fill menu dropdown"
|
|
96
|
-
},
|
|
97
|
-
"attribute": "menucontent",
|
|
98
|
-
"reflect": false
|
|
99
|
-
},
|
|
100
|
-
"buttonid": {
|
|
101
|
-
"type": "string",
|
|
102
|
-
"mutable": false,
|
|
103
|
-
"complexType": {
|
|
104
|
-
"original": "string",
|
|
105
|
-
"resolved": "string",
|
|
106
|
-
"references": {}
|
|
107
|
-
},
|
|
108
|
-
"required": false,
|
|
109
|
-
"optional": false,
|
|
110
|
-
"docs": {
|
|
111
|
-
"tags": [],
|
|
112
|
-
"text": "unique button id"
|
|
113
|
-
},
|
|
114
|
-
"attribute": "buttonid",
|
|
115
|
-
"reflect": false
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
static get states() {
|
|
120
|
-
return {
|
|
121
|
-
"ismenuopen": {}
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
width: inherit;
|
|
3
|
-
height: 32px;
|
|
4
|
-
font-family: var(--dashboard-font);
|
|
5
|
-
font-size: 12px;
|
|
6
|
-
font-weight: var(--font-sb);
|
|
7
|
-
letter-spacing: 0.17px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
a,
|
|
11
|
-
a:visited,
|
|
12
|
-
a:active {
|
|
13
|
-
color: inherit;
|
|
14
|
-
text-decoration: none;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:host > a {
|
|
18
|
-
display: block;
|
|
19
|
-
border: var(--border-size-small) solid transparent;
|
|
20
|
-
background: var(--bg-grey-050);
|
|
21
|
-
border-radius: var(--border-radius);
|
|
22
|
-
color: var(--text-grey-800);
|
|
23
|
-
outline: none;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
:host > a::-moz-focus-inner {
|
|
27
|
-
border: 0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
:host > a:hover,
|
|
31
|
-
:host > a.menu-opened:hover {
|
|
32
|
-
color: var(--myz-blue-dark);
|
|
33
|
-
fill: var(--myz-blue-dark);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
:host > a:focus {
|
|
37
|
-
border: var(--border-size-small) solid var(--myz-blue);
|
|
38
|
-
box-shadow: 0 0 2px 2px var(--myz-blue-light);
|
|
39
|
-
color: var(--myz-blue);
|
|
40
|
-
fill: var(--myz-blue);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
:host > a:active {
|
|
44
|
-
border: var(--border-size-small) solid var(--myz-blue-light);
|
|
45
|
-
box-shadow: 0 2px 4px 0 rgb(0 0 0 / 40%);
|
|
46
|
-
color: var(--myz-blue-light);
|
|
47
|
-
fill: var(--myz-blue-light);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
div.container {
|
|
51
|
-
position: relative;
|
|
52
|
-
display: flex;
|
|
53
|
-
height: 32px;
|
|
54
|
-
align-items: center;
|
|
55
|
-
justify-content: space-between;
|
|
56
|
-
padding: 0 var(--basex1);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
div.container > span.user-wrapper {
|
|
60
|
-
display: flex;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
div.container > span.user-wrapper > span.user {
|
|
64
|
-
overflow: hidden;
|
|
65
|
-
width: 30px;
|
|
66
|
-
padding: 0 var(--basex1);
|
|
67
|
-
cursor: pointer;
|
|
68
|
-
text-overflow: ellipsis;
|
|
69
|
-
white-space: nowrap;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
div.container > span.arrow {
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
justify-content: center;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
div.container > span.arrow > z-icon {
|
|
79
|
-
transform: rotate(360deg);
|
|
80
|
-
transition: all 200ms linear;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
ul {
|
|
84
|
-
padding: 0 calc(var(--space-unit) * 2);
|
|
85
|
-
margin: 0;
|
|
86
|
-
list-style: none;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
li {
|
|
90
|
-
display: flex;
|
|
91
|
-
width: max-content;
|
|
92
|
-
height: var(--basex3);
|
|
93
|
-
align-items: center;
|
|
94
|
-
padding: calc(var(--space-unit) / 4) 0;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/* Expanded dropdown menu */
|
|
98
|
-
.menu-opened {
|
|
99
|
-
position: inherit;
|
|
100
|
-
width: auto !important;
|
|
101
|
-
min-width: 147px;
|
|
102
|
-
padding-bottom: calc(var(--space-unit) * 2);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.menu-opened a,
|
|
106
|
-
.menu-opened a:active,
|
|
107
|
-
.menu-opened a:visited {
|
|
108
|
-
color: var(--myz-blue);
|
|
109
|
-
fill: var(--myz-blue);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.menu-opened a:hover {
|
|
113
|
-
color: var(--myz-blue-dark);
|
|
114
|
-
fill: var(--myz-blue-dark);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.menu-opened > div.container {
|
|
118
|
-
margin-bottom: var(--basex1);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.menu-opened > div.container > span.user-wrapper > span.user {
|
|
122
|
-
width: auto;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.menu-opened > div.container > span.arrow > z-icon {
|
|
126
|
-
transform: rotate(180deg);
|
|
127
|
-
transition: all 200ms linear;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/* Desktop breakpoint */
|
|
131
|
-
|
|
132
|
-
@media only screen and (min-width: 1152px) {
|
|
133
|
-
:host > a {
|
|
134
|
-
width: 147px;
|
|
135
|
-
padding: 0 calc(var(--space-unit) / 4);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
:host > a.menu-opened {
|
|
139
|
-
width: 147px;
|
|
140
|
-
padding-bottom: calc(var(--space-unit) * 2);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
div.container > span.user-wrapper > span.user {
|
|
144
|
-
width: 80px;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { mobileBreakpoint } from "../../../constants/breakpoints";
|
|
3
|
-
export class ZUserDropdown {
|
|
4
|
-
constructor() {
|
|
5
|
-
/** if inner components colors are inverted, or not, default false */
|
|
6
|
-
this.useInverseColors = false;
|
|
7
|
-
this.isMenuOpen = false;
|
|
8
|
-
this.handleLoggedButtonClick = this.handleLoggedButtonClick.bind(this);
|
|
9
|
-
this.emitDropdownMenuLinkClick = this.emitDropdownMenuLinkClick.bind(this);
|
|
10
|
-
}
|
|
11
|
-
componentDidLoad() {
|
|
12
|
-
this.setMobileAndDivToResizeWidth();
|
|
13
|
-
}
|
|
14
|
-
componentWillUpdate() {
|
|
15
|
-
this.setMobileAndDivToResizeWidth();
|
|
16
|
-
}
|
|
17
|
-
componentWillRender() {
|
|
18
|
-
if (this.menuContent) {
|
|
19
|
-
this.linkArray = typeof this.menuContent === "string" ? JSON.parse(this.menuContent) : this.menuContent;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
setMobileAndDivToResizeWidth() {
|
|
23
|
-
var _a;
|
|
24
|
-
if (this.divToResize) {
|
|
25
|
-
this.isMobile = window.screen.width <= mobileBreakpoint || window.innerWidth <= mobileBreakpoint;
|
|
26
|
-
if (this.logged && !this.isMobile && this.isMenuOpen) {
|
|
27
|
-
this.divToResize.style.width = `${(_a = this.userButton) === null || _a === void 0 ? void 0 : _a.offsetWidth}px`;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
this.divToResize.removeAttribute("style");
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
emitUserButtonClick() {
|
|
35
|
-
this.userButtonClick.emit(this.isMenuOpen);
|
|
36
|
-
}
|
|
37
|
-
emitDropdownMenuLinkClick(e) {
|
|
38
|
-
this.isMenuOpen = false;
|
|
39
|
-
this.dropdownMenuLinkClick.emit({ e, linkId: e.detail.linkId });
|
|
40
|
-
}
|
|
41
|
-
handleResize() {
|
|
42
|
-
this.isMobile = window.innerWidth <= mobileBreakpoint;
|
|
43
|
-
}
|
|
44
|
-
handleOrientationChange() {
|
|
45
|
-
this.isMobile = screen.width <= mobileBreakpoint;
|
|
46
|
-
}
|
|
47
|
-
handleClickOutside(e) {
|
|
48
|
-
if (e.target.nodeName !== "Z-USER-DROPDOWN") {
|
|
49
|
-
this.isMenuOpen = false;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
handleLoggedButtonClick() {
|
|
53
|
-
this.isMenuOpen = !this.isMenuOpen;
|
|
54
|
-
this.emitUserButtonClick();
|
|
55
|
-
}
|
|
56
|
-
renderGuestButton() {
|
|
57
|
-
return (h("button", { id: "guestbutton", class: this.useInverseColors ? "inverse" : "", onClick: () => this.emitUserButtonClick() }, "ENTRA"));
|
|
58
|
-
}
|
|
59
|
-
renderLoggedButton() {
|
|
60
|
-
const direction = this.isMenuOpen ? "up" : "down";
|
|
61
|
-
const colorClass = this.useInverseColors ? "inverse" : "";
|
|
62
|
-
return (h("button", { ref: (el) => (this.userButton = el), title: this.userFullName, class: `${colorClass} ${this.isMenuOpen ? "open" : ""}`, onClick: this.handleLoggedButtonClick }, h("div", null, h("div", { class: "firstline" }, h("z-icon", { class: colorClass, name: "user-avatar-filled", height: 16, width: 16 }), !this.isMobile && h("div", { class: `userfullname ${colorClass}` }, this.userFullName), h("z-icon", { class: colorClass, name: `caret-${direction}-filled`, height: 16, width: 16 })), !this.isMobile && this.isMenuOpen && h("div", { class: `useremail ${colorClass}` }, this.userEmail))));
|
|
63
|
-
}
|
|
64
|
-
getZLinkTextcolor() {
|
|
65
|
-
if (this.isMobile) {
|
|
66
|
-
return this.useInverseColors ? "black" : "white";
|
|
67
|
-
}
|
|
68
|
-
return this.useInverseColors ? "white" : "black";
|
|
69
|
-
}
|
|
70
|
-
renderDropdownMenu() {
|
|
71
|
-
const colorClass = this.useInverseColors ? "inverse" : "";
|
|
72
|
-
return (this.isMenuOpen && (h("ul", { class: colorClass }, this.isMobile && (h("li", { class: colorClass }, h("div", { class: `userfullname ${colorClass}` }, this.userFullName), h("div", { class: `useremail ${colorClass}` }, this.userEmail))), this.linkArray &&
|
|
73
|
-
this.linkArray.map((link) => (h("li", { id: link.id, class: colorClass }, h("z-link", { textcolor: this.getZLinkTextcolor(), href: link.link, htmlid: link.id, target: link.target, icon: link.icon, onZLinkClick: this.emitDropdownMenuLinkClick }, link.label)))))));
|
|
74
|
-
}
|
|
75
|
-
render() {
|
|
76
|
-
const openClass = `${this.logged && this.isMenuOpen ? "open" : ""}`;
|
|
77
|
-
const colorClass = this.useInverseColors ? "inverse" : "";
|
|
78
|
-
return (h(Host, { class: colorClass }, h("div", { ref: (el) => (this.divToResize = el), class: openClass }, h("div", { class: `${colorClass} ${openClass}` }, this.logged ? this.renderLoggedButton() : this.renderGuestButton(), this.logged && this.renderDropdownMenu()))));
|
|
79
|
-
}
|
|
80
|
-
static get is() { return "z-user-dropdown"; }
|
|
81
|
-
static get encapsulation() { return "shadow"; }
|
|
82
|
-
static get originalStyleUrls() {
|
|
83
|
-
return {
|
|
84
|
-
"$": ["styles.css"]
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
static get styleUrls() {
|
|
88
|
-
return {
|
|
89
|
-
"$": ["styles.css"]
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
static get properties() {
|
|
93
|
-
return {
|
|
94
|
-
"logged": {
|
|
95
|
-
"type": "boolean",
|
|
96
|
-
"mutable": false,
|
|
97
|
-
"complexType": {
|
|
98
|
-
"original": "boolean",
|
|
99
|
-
"resolved": "boolean",
|
|
100
|
-
"references": {}
|
|
101
|
-
},
|
|
102
|
-
"required": false,
|
|
103
|
-
"optional": true,
|
|
104
|
-
"docs": {
|
|
105
|
-
"tags": [],
|
|
106
|
-
"text": "logged status flag"
|
|
107
|
-
},
|
|
108
|
-
"attribute": "logged",
|
|
109
|
-
"reflect": false
|
|
110
|
-
},
|
|
111
|
-
"userFullName": {
|
|
112
|
-
"type": "string",
|
|
113
|
-
"mutable": false,
|
|
114
|
-
"complexType": {
|
|
115
|
-
"original": "string",
|
|
116
|
-
"resolved": "string",
|
|
117
|
-
"references": {}
|
|
118
|
-
},
|
|
119
|
-
"required": false,
|
|
120
|
-
"optional": true,
|
|
121
|
-
"docs": {
|
|
122
|
-
"tags": [],
|
|
123
|
-
"text": "user full name"
|
|
124
|
-
},
|
|
125
|
-
"attribute": "user-full-name",
|
|
126
|
-
"reflect": false
|
|
127
|
-
},
|
|
128
|
-
"userEmail": {
|
|
129
|
-
"type": "string",
|
|
130
|
-
"mutable": false,
|
|
131
|
-
"complexType": {
|
|
132
|
-
"original": "string",
|
|
133
|
-
"resolved": "string",
|
|
134
|
-
"references": {}
|
|
135
|
-
},
|
|
136
|
-
"required": false,
|
|
137
|
-
"optional": true,
|
|
138
|
-
"docs": {
|
|
139
|
-
"tags": [],
|
|
140
|
-
"text": "user email"
|
|
141
|
-
},
|
|
142
|
-
"attribute": "user-email",
|
|
143
|
-
"reflect": false
|
|
144
|
-
},
|
|
145
|
-
"menuContent": {
|
|
146
|
-
"type": "string",
|
|
147
|
-
"mutable": false,
|
|
148
|
-
"complexType": {
|
|
149
|
-
"original": "string | MenuItem[]",
|
|
150
|
-
"resolved": "MenuItem[] | string",
|
|
151
|
-
"references": {
|
|
152
|
-
"MenuItem": {
|
|
153
|
-
"location": "import",
|
|
154
|
-
"path": "../../../beans"
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
"required": false,
|
|
159
|
-
"optional": true,
|
|
160
|
-
"docs": {
|
|
161
|
-
"tags": [],
|
|
162
|
-
"text": "Json stringified or array to fill menu dropdown"
|
|
163
|
-
},
|
|
164
|
-
"attribute": "menu-content",
|
|
165
|
-
"reflect": false
|
|
166
|
-
},
|
|
167
|
-
"useInverseColors": {
|
|
168
|
-
"type": "boolean",
|
|
169
|
-
"mutable": false,
|
|
170
|
-
"complexType": {
|
|
171
|
-
"original": "boolean",
|
|
172
|
-
"resolved": "boolean",
|
|
173
|
-
"references": {}
|
|
174
|
-
},
|
|
175
|
-
"required": false,
|
|
176
|
-
"optional": true,
|
|
177
|
-
"docs": {
|
|
178
|
-
"tags": [],
|
|
179
|
-
"text": "if inner components colors are inverted, or not, default false"
|
|
180
|
-
},
|
|
181
|
-
"attribute": "use-inverse-colors",
|
|
182
|
-
"reflect": false,
|
|
183
|
-
"defaultValue": "false"
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
static get states() {
|
|
188
|
-
return {
|
|
189
|
-
"isMenuOpen": {},
|
|
190
|
-
"isMobile": {}
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
static get events() {
|
|
194
|
-
return [{
|
|
195
|
-
"method": "userButtonClick",
|
|
196
|
-
"name": "userButtonClick",
|
|
197
|
-
"bubbles": true,
|
|
198
|
-
"cancelable": true,
|
|
199
|
-
"composed": true,
|
|
200
|
-
"docs": {
|
|
201
|
-
"tags": [],
|
|
202
|
-
"text": "Emitted on enter or user Button click, returns isMenuOpen (bool)"
|
|
203
|
-
},
|
|
204
|
-
"complexType": {
|
|
205
|
-
"original": "any",
|
|
206
|
-
"resolved": "any",
|
|
207
|
-
"references": {}
|
|
208
|
-
}
|
|
209
|
-
}, {
|
|
210
|
-
"method": "dropdownMenuLinkClick",
|
|
211
|
-
"name": "dropdownMenuLinkClick",
|
|
212
|
-
"bubbles": true,
|
|
213
|
-
"cancelable": true,
|
|
214
|
-
"composed": true,
|
|
215
|
-
"docs": {
|
|
216
|
-
"tags": [],
|
|
217
|
-
"text": "Emitted on dropdown menu zlink click, returns event"
|
|
218
|
-
},
|
|
219
|
-
"complexType": {
|
|
220
|
-
"original": "any",
|
|
221
|
-
"resolved": "any",
|
|
222
|
-
"references": {}
|
|
223
|
-
}
|
|
224
|
-
}];
|
|
225
|
-
}
|
|
226
|
-
static get listeners() {
|
|
227
|
-
return [{
|
|
228
|
-
"name": "resize",
|
|
229
|
-
"method": "handleResize",
|
|
230
|
-
"target": "window",
|
|
231
|
-
"capture": false,
|
|
232
|
-
"passive": true
|
|
233
|
-
}, {
|
|
234
|
-
"name": "orientationchange",
|
|
235
|
-
"method": "handleOrientationChange",
|
|
236
|
-
"target": "window",
|
|
237
|
-
"capture": false,
|
|
238
|
-
"passive": false
|
|
239
|
-
}, {
|
|
240
|
-
"name": "click",
|
|
241
|
-
"method": "handleClickOutside",
|
|
242
|
-
"target": "window",
|
|
243
|
-
"capture": false,
|
|
244
|
-
"passive": false
|
|
245
|
-
}];
|
|
246
|
-
}
|
|
247
|
-
}
|