@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.
Files changed (136) hide show
  1. package/CHANGELOG.md +2153 -0
  2. package/dist/cjs/index-e3299e0a.js +14 -30
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/web-components-library.cjs.js +1 -1
  5. package/dist/cjs/z-app-switcher.cjs.entry.js +29 -0
  6. package/dist/cjs/z-combobox.cjs.entry.js +13 -10
  7. package/dist/cjs/{z-modal.cjs.entry.js → z-dragdrop-area_3.cjs.entry.js} +43 -0
  8. package/dist/cjs/z-input_2.cjs.entry.js +1 -1
  9. package/dist/cjs/{z-app-switcher_2.cjs.entry.js → z-logo.cjs.entry.js} +0 -23
  10. package/dist/cjs/z-offcanvas.cjs.entry.js +7 -1
  11. package/dist/cjs/z-table-row.cjs.entry.js +2 -2
  12. package/dist/collection/collection-manifest.json +0 -4
  13. package/dist/collection/components/inputs/z-combobox/index.js +14 -9
  14. package/dist/collection/components/inputs/z-input/styles.css +3 -0
  15. package/dist/collection/components/z-offcanvas/index.js +7 -1
  16. package/dist/collection/components/z-table/z-table-row/index.js +2 -2
  17. package/dist/esm/index-a2ca4b97.js +14 -30
  18. package/dist/esm/index.js +1 -1
  19. package/dist/esm/loader.js +1 -1
  20. package/dist/esm/{utils-ccb4d66f.js → utils-6cf7efe2.js} +1 -1
  21. package/dist/esm/web-components-library.js +1 -1
  22. package/dist/esm/z-app-switcher.entry.js +25 -0
  23. package/dist/esm/z-chip.entry.js +1 -1
  24. package/dist/esm/z-combobox.entry.js +14 -11
  25. package/dist/esm/{z-modal.entry.js → z-dragdrop-area_3.entry.js} +42 -1
  26. package/dist/esm/z-file-upload.entry.js +1 -1
  27. package/dist/esm/z-input_2.entry.js +2 -2
  28. package/dist/esm/{z-app-switcher_2.entry.js → z-logo.entry.js} +2 -24
  29. package/dist/esm/z-myz-card-info.entry.js +1 -1
  30. package/dist/esm/z-myz-list-item.entry.js +1 -1
  31. package/dist/esm/z-offcanvas.entry.js +7 -1
  32. package/dist/esm/z-pocket_3.entry.js +1 -1
  33. package/dist/esm/z-popover.entry.js +1 -1
  34. package/dist/esm/z-select.entry.js +1 -1
  35. package/dist/esm/z-skip-to-content.entry.js +1 -1
  36. package/dist/esm/z-slideshow.entry.js +1 -1
  37. package/dist/esm/z-table-header.entry.js +1 -1
  38. package/dist/esm/z-table-row.entry.js +2 -2
  39. package/dist/esm/z-toggle-switch.entry.js +1 -1
  40. package/dist/types/components/inputs/z-combobox/index.d.ts +2 -0
  41. package/dist/types/components/z-offcanvas/index.d.ts +1 -0
  42. package/dist/types/components.d.ts +2 -230
  43. package/dist/web-components-library/index.esm.js +1 -1
  44. package/dist/web-components-library/p-1d66b265.entry.js +1 -0
  45. package/{www/build/p-9965827d.entry.js → dist/web-components-library/p-26033729.entry.js} +1 -1
  46. package/dist/web-components-library/{p-8bf0844b.entry.js → p-53065788.entry.js} +1 -1
  47. package/dist/web-components-library/p-56d2b76d.entry.js +1 -0
  48. package/dist/web-components-library/{p-1b6279a6.entry.js → p-5c62387a.entry.js} +1 -1
  49. package/dist/web-components-library/{p-20a3247c.entry.js → p-6c163539.entry.js} +1 -1
  50. package/dist/web-components-library/{p-279655eb.entry.js → p-7b3b99ee.entry.js} +1 -1
  51. package/{www/build/p-3d9ecc23.entry.js → dist/web-components-library/p-7ea553e9.entry.js} +1 -1
  52. package/dist/web-components-library/{p-cd43f80d.js → p-8ebe4adf.js} +1 -1
  53. package/{www/build/p-98c94e81.entry.js → dist/web-components-library/p-91a74348.entry.js} +1 -1
  54. package/dist/web-components-library/{p-c25b0b2a.entry.js → p-93142fac.entry.js} +1 -1
  55. package/dist/web-components-library/p-9a613586.entry.js +1 -0
  56. package/dist/web-components-library/{p-411cbcd6.entry.js → p-a05ce0a6.entry.js} +1 -1
  57. package/{www/build/p-bdc6f2e5.entry.js → dist/web-components-library/p-a6c0f149.entry.js} +1 -1
  58. package/dist/web-components-library/p-ae79573a.entry.js +1 -0
  59. package/dist/web-components-library/p-bdefe224.entry.js +1 -0
  60. package/dist/web-components-library/{p-8980398c.entry.js → p-d2127d84.entry.js} +1 -1
  61. package/dist/web-components-library/{p-8b960526.entry.js → p-dd000757.entry.js} +1 -1
  62. package/dist/web-components-library/p-de55c171.entry.js +1 -0
  63. package/dist/web-components-library/web-components-library.esm.js +1 -1
  64. package/package.json +1 -1
  65. package/react/components.d.ts +0 -4
  66. package/react/components.js +2 -6
  67. package/react/components.js.map +1 -1
  68. package/src-react/index.ts +1 -0
  69. package/www/build/index.esm.js +1 -1
  70. package/www/build/p-1674fd9c.js +1 -0
  71. package/www/build/p-1d66b265.entry.js +1 -0
  72. package/{dist/web-components-library/p-9965827d.entry.js → www/build/p-26033729.entry.js} +1 -1
  73. package/www/build/{p-8bf0844b.entry.js → p-53065788.entry.js} +1 -1
  74. package/www/build/p-56d2b76d.entry.js +1 -0
  75. package/www/build/{p-1b6279a6.entry.js → p-5c62387a.entry.js} +1 -1
  76. package/www/build/{p-20a3247c.entry.js → p-6c163539.entry.js} +1 -1
  77. package/www/build/{p-279655eb.entry.js → p-7b3b99ee.entry.js} +1 -1
  78. package/{dist/web-components-library/p-3d9ecc23.entry.js → www/build/p-7ea553e9.entry.js} +1 -1
  79. package/www/build/{p-cd43f80d.js → p-8ebe4adf.js} +1 -1
  80. package/{dist/web-components-library/p-98c94e81.entry.js → www/build/p-91a74348.entry.js} +1 -1
  81. package/www/build/{p-c25b0b2a.entry.js → p-93142fac.entry.js} +1 -1
  82. package/www/build/p-9a613586.entry.js +1 -0
  83. package/www/build/{p-411cbcd6.entry.js → p-a05ce0a6.entry.js} +1 -1
  84. package/{dist/web-components-library/p-bdc6f2e5.entry.js → www/build/p-a6c0f149.entry.js} +1 -1
  85. package/www/build/p-ae79573a.entry.js +1 -0
  86. package/www/build/p-bdefe224.entry.js +1 -0
  87. package/www/build/{p-8980398c.entry.js → p-d2127d84.entry.js} +1 -1
  88. package/www/build/{p-8b960526.entry.js → p-dd000757.entry.js} +1 -1
  89. package/www/build/p-de55c171.entry.js +1 -0
  90. package/www/build/web-components-library.esm.js +1 -1
  91. package/www/index.html +1 -1
  92. package/www/pages/file-upload.html +0 -33
  93. package/www/pages/notification.html +0 -33
  94. package/dist/cjs/z-app-topbar.cjs.entry.js +0 -41
  95. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +0 -49
  96. package/dist/cjs/z-menu-dropdown.cjs.entry.js +0 -59
  97. package/dist/cjs/z-modal-login.cjs.entry.js +0 -84
  98. package/dist/cjs/z-user-dropdown.cjs.entry.js +0 -93
  99. package/dist/collection/components/modal/z-modal-login/index.js +0 -251
  100. package/dist/collection/components/modal/z-modal-login/styles.css +0 -150
  101. package/dist/collection/components/navigation/z-app-topbar/index.js +0 -156
  102. package/dist/collection/components/navigation/z-app-topbar/styles.css +0 -65
  103. package/dist/collection/components/navigation/z-menu-dropdown/index.js +0 -124
  104. package/dist/collection/components/navigation/z-menu-dropdown/styles.css +0 -146
  105. package/dist/collection/components/navigation/z-user-dropdown/index.js +0 -247
  106. package/dist/collection/components/navigation/z-user-dropdown/styles.css +0 -306
  107. package/dist/esm/z-app-topbar.entry.js +0 -37
  108. package/dist/esm/z-dragdrop-area_2.entry.js +0 -44
  109. package/dist/esm/z-menu-dropdown.entry.js +0 -55
  110. package/dist/esm/z-modal-login.entry.js +0 -80
  111. package/dist/esm/z-user-dropdown.entry.js +0 -89
  112. package/dist/types/components/modal/z-modal-login/index.d.ts +0 -41
  113. package/dist/types/components/navigation/z-app-topbar/index.d.ts +0 -20
  114. package/dist/types/components/navigation/z-menu-dropdown/index.d.ts +0 -19
  115. package/dist/types/components/navigation/z-user-dropdown/index.d.ts +0 -39
  116. package/dist/web-components-library/p-1ba8d432.entry.js +0 -1
  117. package/dist/web-components-library/p-3c2d438b.entry.js +0 -1
  118. package/dist/web-components-library/p-4cd6c6f4.entry.js +0 -1
  119. package/dist/web-components-library/p-4e8fd5be.entry.js +0 -1
  120. package/dist/web-components-library/p-547d3b1f.entry.js +0 -1
  121. package/dist/web-components-library/p-682528b2.entry.js +0 -1
  122. package/dist/web-components-library/p-9ed27651.entry.js +0 -1
  123. package/dist/web-components-library/p-a2b67e2d.entry.js +0 -1
  124. package/dist/web-components-library/p-b17981a4.entry.js +0 -1
  125. package/dist/web-components-library/p-f20d1242.entry.js +0 -1
  126. package/www/build/p-13cf5e67.js +0 -1
  127. package/www/build/p-1ba8d432.entry.js +0 -1
  128. package/www/build/p-3c2d438b.entry.js +0 -1
  129. package/www/build/p-4cd6c6f4.entry.js +0 -1
  130. package/www/build/p-4e8fd5be.entry.js +0 -1
  131. package/www/build/p-547d3b1f.entry.js +0 -1
  132. package/www/build/p-682528b2.entry.js +0 -1
  133. package/www/build/p-9ed27651.entry.js +0 -1
  134. package/www/build/p-a2b67e2d.entry.js +0 -1
  135. package/www/build/p-b17981a4.entry.js +0 -1
  136. package/www/build/p-f20d1242.entry.js +0 -1
@@ -1,306 +0,0 @@
1
- :host {
2
- background-color: var(--gray900);
3
- }
4
-
5
- :host(.inverse) {
6
- background-color: var(--color-white);
7
- }
8
-
9
- button {
10
- display: flex;
11
- width: 100%;
12
- flex-direction: column;
13
- padding: 0;
14
- border: none;
15
- margin: 0;
16
- background-color: var(--gray900);
17
- cursor: pointer;
18
- letter-spacing: 0.16px;
19
- white-space: nowrap;
20
- }
21
-
22
- button.inverse {
23
- background-color: var(--color-white);
24
- }
25
-
26
- button div.firstline {
27
- display: flex;
28
- max-width: 200px;
29
- align-items: center;
30
- justify-content: flex-end;
31
- }
32
-
33
- button.open div.firstline {
34
- max-width: none;
35
- }
36
-
37
- z-icon {
38
- padding: 0 2px;
39
- fill: var(--color-white);
40
- }
41
-
42
- z-icon.inverse {
43
- fill: var(--gray900);
44
- }
45
-
46
- ul {
47
- position: absolute;
48
- left: 0;
49
- width: 100%;
50
- box-sizing: border-box;
51
- padding: calc(var(--space-unit) / 2) calc(var(--space-unit) * 2) 0 calc(var(--space-unit) * 2);
52
- margin: calc(var(--space-unit) * 1.5) 0 0 0;
53
- background-color: var(--gray900);
54
- font-family: var(--font-family-sans);
55
- font-size: 14px;
56
- font-weight: var(--font-sb);
57
- letter-spacing: 0.3px;
58
- line-height: 20px;
59
- }
60
-
61
- ul.inverse {
62
- background-color: var(--color-white);
63
- }
64
-
65
- ul > li {
66
- display: flex;
67
- justify-content: flex-end;
68
- padding: calc(var(--space-unit) * 1.5 - 1px) 0;
69
- border-bottom: var(--border-base) solid var(--gray700);
70
- margin: 0;
71
- white-space: nowrap;
72
- }
73
-
74
- ul > li.inverse {
75
- border-bottom-color: var(--gray400);
76
- }
77
-
78
- ul > li:first-child {
79
- flex-direction: column;
80
- align-items: end;
81
- padding-top: 0;
82
- padding-bottom: calc(var(--space-unit) + 6px);
83
- border-top: none;
84
- }
85
-
86
- ul > li:last-child {
87
- border-bottom: none;
88
- margin-bottom: 0;
89
- }
90
-
91
- #guestbutton {
92
- display: inline-flex;
93
- width: 100%;
94
- min-width: 32px;
95
- height: 32px;
96
- box-sizing: border-box;
97
- flex-direction: row;
98
- align-items: center;
99
- justify-content: center;
100
- padding: 0 calc(var(--space-unit) * 2);
101
- border-width: var(--border-size-medium);
102
- border-style: solid;
103
- border-color: var(--color-white);
104
- background-color: var(--color-white);
105
- border-radius: var(--border-radius);
106
- color: var(--gray800);
107
- cursor: pointer;
108
- fill: currentcolor;
109
- font-family: var(--font-family-sans);
110
- font-size: 14px;
111
- font-weight: var(--font-sb);
112
- letter-spacing: 0.3px;
113
- line-height: 1;
114
- outline: none;
115
- text-decoration: none;
116
- text-transform: uppercase;
117
- vertical-align: middle;
118
- }
119
-
120
- #guestbutton.inverse {
121
- border-color: var(--gray800);
122
- background-color: var(--gray800);
123
- color: var(--color-white);
124
- }
125
-
126
- .userfullname {
127
- overflow: hidden;
128
- width: 100%;
129
- max-width: 250px;
130
- padding: 0;
131
- color: var(--color-white);
132
- font-family: var(--font-family-sans);
133
- font-size: 16px;
134
- font-weight: var(--font-sb);
135
- letter-spacing: 0;
136
- line-height: 24px;
137
- text-align: right;
138
- text-overflow: ellipsis;
139
- }
140
-
141
- .userfullname.inverse {
142
- color: var(--gray800);
143
- }
144
-
145
- .useremail {
146
- overflow: hidden;
147
- width: 100%;
148
- color: var(--color-white);
149
- font-family: var(--font-family-sans);
150
- font-size: 12px;
151
- font-weight: var(--font-rg);
152
- letter-spacing: 0.32px;
153
- line-height: 16px;
154
- text-align: right;
155
- text-overflow: ellipsis;
156
- }
157
-
158
- .useremail.inverse {
159
- color: var(--gray800);
160
- }
161
-
162
- /* Tablet breakpoint */
163
- @media only screen and (min-width: 768px) {
164
- :host {
165
- height: calc(var(--space-unit) * 4);
166
- background-color: var(--gray900);
167
- }
168
-
169
- :host(.inverse) {
170
- background-color: var(--color-white);
171
- }
172
-
173
- :host > div {
174
- position: relative;
175
- top: 50%;
176
- transform: translateY(-50%);
177
- }
178
-
179
- :host > div.open {
180
- top: auto;
181
- transform: none;
182
- }
183
-
184
- :host > div > div {
185
- padding: 0;
186
- }
187
-
188
- :host > div > div.open {
189
- position: absolute;
190
- right: calc(var(--space-unit) * -1);
191
- padding: calc(var(--space-unit) / 2 + 1px) var(--space-unit) 0 var(--space-unit);
192
- margin-top: calc(var(--space-unit) / 2);
193
- background-color: var(--color-white);
194
- box-shadow: 0 2px calc(var(--space-unit) * 0.5) 0 rgb(0 0 0 / 50%);
195
- transform: translate(0, -4px);
196
- }
197
-
198
- :host > div > div.inverse.open {
199
- background-color: var(--gray800);
200
- }
201
-
202
- button {
203
- display: flex;
204
- flex-flow: row nowrap;
205
- align-content: center;
206
- align-items: end;
207
- justify-content: flex-end;
208
- }
209
-
210
- button.open {
211
- max-width: initial;
212
- padding-right: var(--space-unit);
213
- border-top: var(--border-size-small) solid var(--color-white);
214
- margin-left: var(--space-unit);
215
- background-color: var(--color-white);
216
- border-top-left-radius: calc(var(--space-unit) * 0.5);
217
- border-top-right-radius: calc(var(--space-unit) * 0.5);
218
- }
219
-
220
- button.open.inverse {
221
- border-top-color: var(--gray800);
222
- background-color: var(--gray800);
223
- }
224
-
225
- button:not(.open) z-icon {
226
- fill: var(--color-white);
227
- }
228
-
229
- button:not(.open) z-icon.inverse {
230
- fill: var(--gray800);
231
- }
232
-
233
- button.open z-icon {
234
- fill: var(--gray800);
235
- }
236
-
237
- button.open z-icon.inverse {
238
- fill: var(--color-white);
239
- }
240
-
241
- .userfullname {
242
- width: auto;
243
- padding: 0 calc(var(--space-unit) - 6px) 0 calc(var(--space-unit) - 2px);
244
- font-family: var(--font-family-sans);
245
- font-size: 14px;
246
- font-weight: var(--font-sb);
247
- letter-spacing: 0.16px;
248
- line-height: 20px;
249
- }
250
-
251
- .userfullname.inverse {
252
- color: var(--gray800);
253
- }
254
-
255
- button.open div.userfullname {
256
- max-width: none;
257
- color: var(--gray800);
258
- text-overflow: clip;
259
- }
260
-
261
- button.open div.userfullname.inverse {
262
- color: var(--color-white);
263
- }
264
-
265
- .useremail {
266
- box-sizing: border-box;
267
- padding-right: calc(var(--space-unit) * 3 - 2px);
268
- }
269
-
270
- button.open div.useremail {
271
- color: var(--gray800);
272
- }
273
-
274
- button.open div.useremail.inverse {
275
- color: var(--color-white);
276
- }
277
-
278
- ul {
279
- position: initial;
280
- left: initial;
281
- width: 100%;
282
- padding: 0;
283
- background-color: var(--color-white);
284
- }
285
-
286
- ul.inverse {
287
- border-bottom-color: var(--gray800);
288
- background-color: var(--gray800);
289
- }
290
-
291
- ul > li {
292
- border-bottom: var(--border-base) solid var(--gray400);
293
- margin: 0 var(--space-unit);
294
- color: var(--gray800);
295
- }
296
-
297
- ul > li.inverse {
298
- color: var(--color-white);
299
- }
300
-
301
- ul > li:first-child {
302
- padding-top: calc(var(--space-unit) + 3px);
303
- padding-bottom: calc(var(--space-unit) + 5px);
304
- border-top: var(--border-base) solid var(--gray400);
305
- }
306
- }
@@ -1,37 +0,0 @@
1
- import { r as registerInstance, h, H as Host } from './index-a2ca4b97.js';
2
- import { T as ThemeVariant, f as DividerOrientation } from './index-968a240f.js';
3
- import { m as mobileBreakpoint } from './breakpoints-c386984e.js';
4
-
5
- const stylesCss = ":host{position:sticky;z-index:99;top:0;display:block;height:calc(var(--space-unit) * 6);box-sizing:border-box;padding:calc(var(--space-unit) / 2) calc(var(--space-unit) * 2);background-color:var(--gray900);border-radius:var(--border-no-radius)}:host(.light){background-color:var(--color-white)}:host>div{display:flex;align-items:center;justify-content:space-between}:host(.limited-width) #content-container{--mw:none;max-width:var(--mw);margin:auto}.content-panel{display:flex;align-items:center}.content-panel>:not(:last-child){margin-right:calc(var(--space-unit) * 2)}#divider-container{display:none}z-link{font-family:var(--font-family-sans);font-size:14px;font-weight:var(--font-sb);letter-spacing:0.3px;line-height:20px}@media only screen and (min-width: 768px){:host{padding:var(--space-unit) calc(var(--space-unit) * 2) var(--space-unit) var(--space-unit)}:host(.limited-width){padding:var(--space-unit)}#divider-container{display:block;height:calc(var(--space-unit) * 3)}}";
6
-
7
- const ZAppTopbar = class {
8
- constructor(hostRef) {
9
- registerInstance(this, hostRef);
10
- /** theme variant, default 'dark' */
11
- this.theme = ThemeVariant.DARK;
12
- this.topbarLinks = [];
13
- }
14
- handleResize() {
15
- this.isMobile = window.innerWidth <= mobileBreakpoint;
16
- }
17
- componentWillLoad() {
18
- this.isMobile = window.screen.width <= mobileBreakpoint || window.innerWidth <= mobileBreakpoint;
19
- }
20
- componentWillRender() {
21
- if (this.topbarContent) {
22
- this.topbarLinks = typeof this.topbarContent === "string" ? JSON.parse(this.topbarContent) : this.topbarContent;
23
- }
24
- }
25
- renderTopbarLinks() {
26
- return this.topbarLinks.map((link) => (h("z-link", { htmlid: link.id, textcolor: this.theme === ThemeVariant.LIGHT ? "black" : "white", href: link.link, target: link.target, icon: this.isMobile ? link.icon : undefined }, !this.isMobile && link.label)));
27
- }
28
- render() {
29
- return (h(Host, { class: {
30
- [this.theme]: true,
31
- "limited-width": !!this.contentMaxWidth,
32
- } }, h("div", { id: "content-container", style: this.contentMaxWidth ? { "--mw": `${this.contentMaxWidth}px` } : {} }, h("div", { id: "left-panel", class: "content-panel" }, h("z-logo", { mobileLogo: this.isMobile, width: this.isMobile ? 32 : 128, height: this.isMobile ? 40 : 32, imageAlt: "zanichelli-logo", link: this.logoLink, targetBlank: true }), this.isMobile && this.renderTopbarLinks()), h("div", { id: "right-panel", class: "content-panel" }, !this.isMobile && this.renderTopbarLinks(), this.showAppSwitcher && h("z-app-switcher", { theme: this.theme }), h("div", { id: "divider-container" }, h("z-divider", { orientation: DividerOrientation.VERTICAL, color: this.theme === ThemeVariant.LIGHT ? "gray800" : "color-white" })), h("slot", { name: "login" })))));
33
- }
34
- };
35
- ZAppTopbar.style = stylesCss;
36
-
37
- export { ZAppTopbar as z_app_topbar };
@@ -1,44 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-a2ca4b97.js';
2
-
3
- const stylesCss = ":host{margin-top:calc(var(--space-unit) * 3);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.dragdrop{position:relative;display:flex;height:228px;flex-direction:column;border-color:var(--color-surface04);background-color:var(--color-surface02);background-image:url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='2' ry='2' stroke='%23CACCCEFF' stroke-width='2' stroke-dasharray='15%2c 10%2c 14%2c 11' stroke-dashoffset='3' stroke-linecap='square'/%3e%3c/svg%3e\");border-radius:2px;color:var(--color-text01)}:host>.dragdrop.dragover *{pointer-events:none}:host>.dragdrop .dragover-container{position:absolute;z-index:10;top:0;left:0;display:none;width:100%;height:100%;background-color:var(--color-primary03);box-shadow:var(--shadow-focus-primary)}:host>.dragdrop .dragover-container .dragover-message{padding:10px 28px;background-color:var(--color-link-primary);color:var(--color-text04)}:host>.dragdrop.dragover .dragover-container{display:flex;align-items:center;justify-content:center}";
4
-
5
- const ZDragdropArea = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- this.fileDropped = createEvent(this, "fileDropped", 7);
9
- }
10
- fileDroppedHandler(files) {
11
- this.fileDropped.emit(files);
12
- }
13
- renderOnDragOverMessage() {
14
- return (h("div", { class: "dragover-container" }, h("div", { class: "dragover-message" }, h("z-body", { variant: "semibold", level: 2 }, "Rilascia i file in questa area per allegarli."))));
15
- }
16
- render() {
17
- return (h("div", { tabIndex: 0, ref: (val) => (this.dragDropContainer = val), class: "dragdrop", onDragOver: (e) => {
18
- e.preventDefault();
19
- this.dragDropContainer.classList.add("dragover");
20
- }, onDragLeave: () => {
21
- this.dragDropContainer.classList.remove("dragover");
22
- }, onDrop: (e) => {
23
- e.preventDefault();
24
- if (e.dataTransfer.files.length) {
25
- this.dragDropContainer.classList.remove("dragover");
26
- this.fileDroppedHandler(e.dataTransfer.files);
27
- }
28
- } }, this.renderOnDragOverMessage(), h("slot", null)));
29
- }
30
- };
31
- ZDragdropArea.style = stylesCss;
32
-
33
- const ZHeading = class {
34
- constructor(hostRef) {
35
- registerInstance(this, hostRef);
36
- /** Font weight variant */
37
- this.variant = "regular";
38
- }
39
- render() {
40
- return (h("z-typography", { tabIndex: 0, component: this.component || `h${this.level}`, level: `h${this.level}`, variant: this.variant }, h("slot", null)));
41
- }
42
- };
43
-
44
- export { ZDragdropArea as z_dragdrop_area, ZHeading as z_heading };
@@ -1,55 +0,0 @@
1
- import { r as registerInstance, h } from './index-a2ca4b97.js';
2
- import { K as KeyboardKeyCode } from './index-968a240f.js';
3
- import { a as getElementTree, h as handleKeyboardSubmit, b as getClickedElement } from './utils-ccb4d66f.js';
4
- import './breakpoints-c386984e.js';
5
-
6
- const stylesCss = ":host{width:inherit;height:32px;font-family:var(--dashboard-font);font-size:12px;font-weight:var(--font-sb);letter-spacing:0.17px}a,a:visited,a:active{color:inherit;text-decoration:none}:host>a{display:block;border:var(--border-size-small) solid transparent;background:var(--bg-grey-050);border-radius:var(--border-radius);color:var(--text-grey-800);outline:none}:host>a::-moz-focus-inner{border:0}:host>a:hover,:host>a.menu-opened:hover{color:var(--myz-blue-dark);fill:var(--myz-blue-dark)}:host>a:focus{border:var(--border-size-small) solid var(--myz-blue);box-shadow:0 0 2px 2px var(--myz-blue-light);color:var(--myz-blue);fill:var(--myz-blue)}:host>a:active{border:var(--border-size-small) solid var(--myz-blue-light);box-shadow:0 2px 4px 0 rgb(0 0 0 / 40%);color:var(--myz-blue-light);fill:var(--myz-blue-light)}div.container{position:relative;display:flex;height:32px;align-items:center;justify-content:space-between;padding:0 var(--basex1)}div.container>span.user-wrapper{display:flex}div.container>span.user-wrapper>span.user{overflow:hidden;width:30px;padding:0 var(--basex1);cursor:pointer;text-overflow:ellipsis;white-space:nowrap}div.container>span.arrow{display:flex;align-items:center;justify-content:center}div.container>span.arrow>z-icon{transform:rotate(360deg);transition:all 200ms linear}ul{padding:0 calc(var(--space-unit) * 2);margin:0;list-style:none}li{display:flex;width:max-content;height:var(--basex3);align-items:center;padding:calc(var(--space-unit) / 4) 0}.menu-opened{position:inherit;width:auto !important;min-width:147px;padding-bottom:calc(var(--space-unit) * 2)}.menu-opened a,.menu-opened a:active,.menu-opened a:visited{color:var(--myz-blue);fill:var(--myz-blue)}.menu-opened a:hover{color:var(--myz-blue-dark);fill:var(--myz-blue-dark)}.menu-opened>div.container{margin-bottom:var(--basex1)}.menu-opened>div.container>span.user-wrapper>span.user{width:auto}.menu-opened>div.container>span.arrow>z-icon{transform:rotate(180deg);transition:all 200ms linear}@media only screen and (min-width: 1152px){:host>a{width:147px;padding:0 calc(var(--space-unit) / 4)}:host>a.menu-opened{width:147px;padding-bottom:calc(var(--space-unit) * 2)}div.container>span.user-wrapper>span.user{width:80px}}";
7
-
8
- const ZMenuDropdown = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.ismenuopen = false;
12
- this.handleToggle = this.handleToggle.bind(this);
13
- this.handleFocus = this.handleFocus.bind(this);
14
- }
15
- componentWillRender() {
16
- this.linkarray = typeof this.menucontent === "string" ? JSON.parse(this.menucontent) : this.menucontent;
17
- }
18
- renderMenuOpen() {
19
- if (this.ismenuopen) {
20
- 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))))));
21
- }
22
- }
23
- renderButtonMenu() {
24
- return (h("span", { class: "arrow" }, h("z-icon", { name: "caret-down", width: 14, height: 14 })));
25
- }
26
- retriveMenuClass() {
27
- if (this.ismenuopen) {
28
- return "menu-opened";
29
- }
30
- }
31
- handleToggle() {
32
- this.ismenuopen = !this.ismenuopen;
33
- }
34
- handleFocus(e) {
35
- if (e instanceof KeyboardEvent && e.keyCode !== KeyboardKeyCode.TAB) {
36
- return;
37
- }
38
- const tree = getElementTree(getClickedElement());
39
- const menuParent = tree.find((elem) => elem.nodeName.toLowerCase() === "z-menu-dropdown");
40
- if (!menuParent) {
41
- document.removeEventListener("click", this.handleFocus);
42
- document.removeEventListener("keyup", this.handleFocus);
43
- this.ismenuopen = false;
44
- }
45
- }
46
- render() {
47
- return (h("a", { class: this.retriveMenuClass(), role: "button", tabindex: "0", onFocus: () => {
48
- document.addEventListener("click", this.handleFocus);
49
- document.addEventListener("keyup", this.handleFocus);
50
- }, 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()));
51
- }
52
- };
53
- ZMenuDropdown.style = stylesCss;
54
-
55
- export { ZMenuDropdown as z_menu_dropdown };
@@ -1,80 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a2ca4b97.js';
2
- import { d as InputStatus, B as ButtonVariant, I as InputType } from './index-968a240f.js';
3
-
4
- const stylesCss = ".sc-z-modal-login-h{font-family:var(--dashboard-font);font-weight:var(--font-rg)}.sc-z-modal-login-h div.wrapper.sc-z-modal-login{display:flex;box-sizing:border-box;flex-flow:column nowrap;align-items:stretch;justify-content:flex-start;padding:calc(var(--space-unit) * 4) calc(var(--space-unit) * 2) calc(var(--space-unit) * 3)\n calc(var(--space-unit) * 2);color:var(--text-grey-800)}z-button.sc-z-modal-login,z-input.sc-z-modal-login,.sc-z-modal-login-s>z-button,.sc-z-modal-login-s>z-input{display:inline-block;width:100%}z-link.sc-z-modal-login,.sc-z-modal-login-s>z-link{font-size:12px}.sc-z-modal-login-h div.wrapper.sc-z-modal-login>form.sc-z-modal-login{display:flex;flex-flow:column nowrap;align-items:stretch;justify-content:flex-start}div.wrapper>form>div.username.sc-z-modal-login-s>z-input,div.wrapper>form>div.password.sc-z-modal-login-s>z-input,.sc-z-modal-login-h div.wrapper.sc-z-modal-login>form.sc-z-modal-login>div.username.sc-z-modal-login z-input.sc-z-modal-login,.sc-z-modal-login-h div.wrapper.sc-z-modal-login>form.sc-z-modal-login>div.password.sc-z-modal-login z-input.sc-z-modal-login{margin-bottom:var(--space-unit)}.sc-z-modal-login-h div.wrapper.sc-z-modal-login>form.sc-z-modal-login>z-link.forget.sc-z-modal-login{align-self:flex-end;font-size:12px}div.wrapper>form>div.login.sc-z-modal-login-s>z-button,.sc-z-modal-login-h div.wrapper.sc-z-modal-login>form.sc-z-modal-login>div.login.sc-z-modal-login z-button.sc-z-modal-login{align-self:flex-start;margin:calc(var(--space-unit) * 3) 0}.sc-z-modal-login-h div.wrapper.sc-z-modal-login>hr.sc-z-modal-login{width:100%;border:none;border-top:var(--border-size-medium) solid var(--bg-grey-200);margin-bottom:calc(var(--space-unit) * 3);margin-block-start:unset}div.wrapper>div.signup.sc-z-modal-login-s>z-button,.sc-z-modal-login-h div.wrapper.sc-z-modal-login>div.signup.sc-z-modal-login z-button.sc-z-modal-login{display:inline-block;margin:calc(var(--space-unit) * 2) 0}.sc-z-modal-login-h div.providers.sc-z-modal-login{display:grid;gap:calc(var(--space-unit) * 2) 0;grid-auto-rows:auto;grid-template-columns:1fr}slot-fb[name=\"provider\"].sc-z-modal-login{display:grid;gap:calc(var(--space-unit) * 2) 0;grid-auto-rows:auto;grid-template-columns:1fr}.sc-z-modal-login-h div.providers.sc-z-modal-login>z-body.sc-z-modal-login{padding-top:calc(var(--space-unit) * 2)}.sc-z-modal-login-h div.wrapper.sc-z-modal-login>div.providers.sc-z-modal-login .zd.sc-z-modal-login{display:flex;flex-flow:row nowrap;align-content:center;align-items:center;justify-content:center}.sc-z-modal-login-h div.wrapper.sc-z-modal-login>div.providers.sc-z-modal-login .zd.sc-z-modal-login>svg.sc-z-modal-login{margin-right:var(--space-unit)}@media only screen and (min-width: 768px){z-button.sc-z-modal-login,.sc-z-modal-login-s>z-button{width:initial}.sc-z-modal-login-h div.wrapper.sc-z-modal-login{width:396px;padding:calc(var(--space-unit) * 3)}.sc-z-modal-login-h div.providers.sc-z-modal-login{display:grid;align-items:center;justify-content:center;gap:var(--space-unit);grid-auto-rows:auto;grid-template-columns:1fr 1fr}.sc-z-modal-login-h div.providers.sc-z-modal-login>z-body.sc-z-modal-login{padding-bottom:var(--space-unit);grid-column:1 / 3}.sc-z-modal-login-s>[slot=\"provider\"]{width:100%}slot-fb[name=\"provider\"].sc-z-modal-login{display:grid;align-items:center;justify-content:center;gap:var(--space-unit);grid-auto-rows:auto;grid-column:1 / 3;grid-template-columns:1fr 1fr}slot-fb[name=\"provider\"].sc-z-modal-login>*.sc-z-modal-login{width:100%}}@media only screen and (min-width: 1366px){.sc-z-modal-login-h div.wrapper.sc-z-modal-login{width:477px;padding:calc(var(--space-unit) * 4)}}";
5
-
6
- const ZModalLogin = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.loginSubmit = createEvent(this, "loginSubmit", 7);
10
- this.statusUpdate = createEvent(this, "statusUpdate", 7);
11
- this.signupClick = createEvent(this, "signupClick", 7);
12
- this.zainoDigitaleClick = createEvent(this, "zainoDigitaleClick", 7);
13
- /** Login modal title */
14
- this.heading = "Entra in MyZanichelli";
15
- this.externalProviderCheck = false;
16
- }
17
- componentDidLoad() {
18
- this.externalProviderCheck = !!this.hostElement.querySelectorAll('[slot="provider"]').length;
19
- }
20
- emitLoginSubmit() {
21
- const usernameInput = this.hostElement.querySelector("z-input#username");
22
- const passwordInput = this.hostElement.querySelector("z-input#password");
23
- // INFO: slotted inputs
24
- if (!usernameInput || !passwordInput) {
25
- return;
26
- }
27
- let username = usernameInput.value;
28
- const password = passwordInput.value;
29
- if (!username || !password) {
30
- this.status = InputStatus.ERROR;
31
- return;
32
- }
33
- username = this.cleanUsername(username);
34
- this.loginSubmit.emit({
35
- username,
36
- password,
37
- originalUsername: usernameInput.value,
38
- });
39
- }
40
- emitStatusUpdate(status) {
41
- this.statusUpdate.emit(status);
42
- }
43
- emitSignupClick() {
44
- this.signupClick.emit();
45
- }
46
- emitZainoDigitaleClick() {
47
- this.zainoDigitaleClick.emit();
48
- }
49
- handleInputKeyUp(e) {
50
- if (e.code !== "Enter") {
51
- return;
52
- }
53
- this.emitLoginSubmit();
54
- }
55
- handleInputChange() {
56
- this.status = null;
57
- this.emitStatusUpdate(this.status);
58
- }
59
- cleanUsername(username) {
60
- username = username.trim().toLowerCase();
61
- const mobileRegex = /^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g;
62
- if (mobileRegex.test(username)) {
63
- username = username.replace(/[- .)(]/g, "");
64
- if (/^[\d ]*$/.test(username)) {
65
- username = "+39" + username;
66
- }
67
- }
68
- return username;
69
- }
70
- renderZainoDigitaleButton() {
71
- return (h("z-button", { variant: ButtonVariant.SECONDARY, onClick: () => this.emitZainoDigitaleClick(), class: "zainoDigitale" }, h("div", { class: "zd" }, h("svg", { width: "18px", height: "24px", viewBox: "0 0 18 24" }, h("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" }, h("g", { transform: "translate(-313.000000, -329.000000)", fill: "#E2001A", "fill-rule": "nonzero" }, h("g", { transform: "translate(25.000000, 191.000000)" }, h("g", null, h("g", { transform: "translate(0.000000, 100.000000)" }, h("g", null, h("g", { transform: "translate(276.000000, 28.000000)" }, h("path", { d: "M29.8953704,30.5632326 C29.9143039,30.3327754 29.5356326,30.0447041 29.1380277,29.8142469 C29.2516291,28.7963947 29.4409647,26.9719425 29.2705626,26.3189807 C29.0433598,25.416357 28.3428178,24.8018047 28.380685,23.822362 C28.4185521,22.8429193 28.1913493,16.5437582 27.0364017,15.1802202 C26.1654576,14.162368 25.4649156,12.8372396 23.4390239,12.2418921 C23.4390239,12.0498445 23.4390239,11.8770016 23.4200903,11.7425683 C23.3822232,10.9167637 21.9622056,10.090959 21.6214014,10.0525495 C21.2805972,10.01414 20.371786,9.95652568 20.0309818,10.0525495 C19.6901775,10.1293685 19.0464362,11.128016 18.7434992,11.4352922 C18.5920306,11.5889302 18.5541635,11.9538207 18.5730971,12.3187111 C17.437083,12.6836015 16.1306669,13.4325871 15.4490584,14.9497631 C14.2941108,17.676839 13.4799674,18.9251483 13.6693031,24.1680477 C13.5935688,25.1090809 13.2906318,25.6084046 13.1012961,25.6852237 C12.9119604,25.7620427 12.798359,25.9156808 12.7604919,26.1077284 C12.7226247,26.2805712 12.5522226,28.37389 12.7415583,29.8718612 C12.3818205,30.1023183 12.0788834,30.3519802 12.097817,30.5632326 C12.1546177,31.0625563 11.8516806,31.7731324 12.097817,32.0612038 C12.230352,32.2148419 12.7226247,32.5413228 13.3284989,32.8293942 C13.6125024,33.4631512 14.199443,33.9240655 15.467992,33.9816797 C18.1565586,34.0584988 26.2601254,33.8664512 26.5630625,33.9048607 C26.847066,33.9432702 28.4374857,34.0008845 28.683622,32.8293942 C29.2894962,32.5413228 29.781769,32.2148419 29.9143039,32.0612038 C30.1415067,31.7731324 29.8385697,31.0625563 29.8953704,30.5632326 Z M12.0319858,31.2 C12.1173988,31.1230769 12.3736379,31.0461538 12.743761,31 C12.857645,31.3230769 12.914587,31.6615385 13,32 C12.4021089,31.8153846 11.8611598,31.5692308 12.0319858,31.2 Z M21.1618497,12.8394441 C21.1618497,12.8394441 20.6763006,12.8165075 20,13 L20,12.9770634 C20,12.5642053 20.3121387,11.3256309 20.3988439,11.1192018 C20.4855491,10.9127728 21.265896,11.0274556 21.8554913,11.0733287 C22.6358382,11.0503922 22.4624277,11.2568212 22.8092486,11.9907912 C22.9306358,12.2889666 22.982659,12.6559516 23,13 C22.4797688,12.8623806 21.8728324,12.8165075 21.1618497,12.8394441 Z M28.3324094,30 C28.6648189,30.0833333 28.9085858,30.2222222 28.9750677,30.3888889 C29.1301921,31.1666667 28.5318551,31.6388889 28,32 C28.0221606,31.5 28.0664819,31.1111111 28.0664819,31.1111111 L28.2437669,30.6111111 L28.3324094,30 Z M21.8571429,23 L21.8571429,23.8 L22.7142857,23.8 L22.7142857,24.6 L23.5714286,24.6 L23.5714286,25.4 L24.4285714,25.4 L24.4285714,26.2 L25.2857143,26.2 L25.2857143,27 L26.1428571,27 L26.1428571,27.8 L27,27.8 L27,28.6 L24.4285714,28.6 L24.4285714,29.4 L25.2857143,29.4 L25.2857143,31 L24.4285714,31 L24.4285714,30.2 L23.5714286,30.2 L23.5714286,29.4 L22.7142857,29.4 L22.7142857,30.2 L21.8571429,30.2 L21.8571429,31 L21,31 L21,23 L21.8571429,23 Z" }))))))))), h("span", null, "ZAINO DIGITALE"))));
72
- }
73
- render() {
74
- return (h("z-modal", { modaltitle: this.heading }, h("div", { class: "wrapper", slot: "modalContent" }, h("form", { method: "post" }, h("div", { class: "username" }, h("slot", { name: "username" }, h("z-input", { id: "username", label: "email o numero di cellulare", placeholder: "Inserisci l'email o il cellulare", autocomplete: "username", name: "username", status: this.status, message: this.message, onKeyUp: (e) => this.handleInputKeyUp(e), onInputChange: () => this.handleInputChange() }))), h("div", { class: "password" }, h("slot", { name: "password" }, h("z-input", { id: "password", label: "password", placeholder: "Inserisci la tua password", type: InputType.PASSWORD, name: "password", autocomplete: "current-password", status: this.status, message: this.pwdmessage, onKeyUp: (e) => this.handleInputKeyUp(e), onInputChange: () => this.handleInputChange() }))), h("z-link", { class: "forget", href: this.forgotPasswordUrl }, "Password dimenticata?"), h("div", { class: "login" }, h("slot", { name: "login" }, h("z-button", { variant: ButtonVariant.PRIMARY, onClick: () => this.emitLoginSubmit() }, "Accedi")))), h("hr", null), h("z-body", { class: "signup", level: 4, variant: "semibold" }, "Non hai ancora un account?"), h("div", { class: "signup" }, h("slot", { name: "signup" }, h("z-button", { variant: ButtonVariant.SECONDARY, onClick: () => this.emitSignupClick() }, "Registrati"))), !this.externalProviderCheck && (h("div", { class: "providers" }, h("z-body", { class: "provider", level: 5, variant: "regular" }, "OPPURE ACCEDI CON:"), h("slot", { name: "provider" }, this.renderZainoDigitaleButton(), h("z-link", { icon: "informationsource", href: "https://www.zainodigitale.it/#/landing" }, "Cos'\u00E8 Zaino Digitale?")))))));
75
- }
76
- get hostElement() { return getElement(this); }
77
- };
78
- ZModalLogin.style = stylesCss;
79
-
80
- export { ZModalLogin as z_modal_login };
@@ -1,89 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-a2ca4b97.js';
2
- import { m as mobileBreakpoint } from './breakpoints-c386984e.js';
3
-
4
- const stylesCss = ":host{background-color:var(--gray900)}:host(.inverse){background-color:var(--color-white)}button{display:flex;width:100%;flex-direction:column;padding:0;border:none;margin:0;background-color:var(--gray900);cursor:pointer;letter-spacing:0.16px;white-space:nowrap}button.inverse{background-color:var(--color-white)}button div.firstline{display:flex;max-width:200px;align-items:center;justify-content:flex-end}button.open div.firstline{max-width:none}z-icon{padding:0 2px;fill:var(--color-white)}z-icon.inverse{fill:var(--gray900)}ul{position:absolute;left:0;width:100%;box-sizing:border-box;padding:calc(var(--space-unit) / 2) calc(var(--space-unit) * 2) 0 calc(var(--space-unit) * 2);margin:calc(var(--space-unit) * 1.5) 0 0 0;background-color:var(--gray900);font-family:var(--font-family-sans);font-size:14px;font-weight:var(--font-sb);letter-spacing:0.3px;line-height:20px}ul.inverse{background-color:var(--color-white)}ul>li{display:flex;justify-content:flex-end;padding:calc(var(--space-unit) * 1.5 - 1px) 0;border-bottom:var(--border-base) solid var(--gray700);margin:0;white-space:nowrap}ul>li.inverse{border-bottom-color:var(--gray400)}ul>li:first-child{flex-direction:column;align-items:end;padding-top:0;padding-bottom:calc(var(--space-unit) + 6px);border-top:none}ul>li:last-child{border-bottom:none;margin-bottom:0}#guestbutton{display:inline-flex;width:100%;min-width:32px;height:32px;box-sizing:border-box;flex-direction:row;align-items:center;justify-content:center;padding:0 calc(var(--space-unit) * 2);border-width:var(--border-size-medium);border-style:solid;border-color:var(--color-white);background-color:var(--color-white);border-radius:var(--border-radius);color:var(--gray800);cursor:pointer;fill:currentcolor;font-family:var(--font-family-sans);font-size:14px;font-weight:var(--font-sb);letter-spacing:0.3px;line-height:1;outline:none;text-decoration:none;text-transform:uppercase;vertical-align:middle}#guestbutton.inverse{border-color:var(--gray800);background-color:var(--gray800);color:var(--color-white)}.userfullname{overflow:hidden;width:100%;max-width:250px;padding:0;color:var(--color-white);font-family:var(--font-family-sans);font-size:16px;font-weight:var(--font-sb);letter-spacing:0;line-height:24px;text-align:right;text-overflow:ellipsis}.userfullname.inverse{color:var(--gray800)}.useremail{overflow:hidden;width:100%;color:var(--color-white);font-family:var(--font-family-sans);font-size:12px;font-weight:var(--font-rg);letter-spacing:0.32px;line-height:16px;text-align:right;text-overflow:ellipsis}.useremail.inverse{color:var(--gray800)}@media only screen and (min-width: 768px){:host{height:calc(var(--space-unit) * 4);background-color:var(--gray900)}:host(.inverse){background-color:var(--color-white)}:host>div{position:relative;top:50%;transform:translateY(-50%)}:host>div.open{top:auto;transform:none}:host>div>div{padding:0}:host>div>div.open{position:absolute;right:calc(var(--space-unit) * -1);padding:calc(var(--space-unit) / 2 + 1px) var(--space-unit) 0 var(--space-unit);margin-top:calc(var(--space-unit) / 2);background-color:var(--color-white);box-shadow:0 2px calc(var(--space-unit) * 0.5) 0 rgb(0 0 0 / 50%);transform:translate(0, -4px)}:host>div>div.inverse.open{background-color:var(--gray800)}button{display:flex;flex-flow:row nowrap;align-content:center;align-items:end;justify-content:flex-end}button.open{max-width:initial;padding-right:var(--space-unit);border-top:var(--border-size-small) solid var(--color-white);margin-left:var(--space-unit);background-color:var(--color-white);border-top-left-radius:calc(var(--space-unit) * 0.5);border-top-right-radius:calc(var(--space-unit) * 0.5)}button.open.inverse{border-top-color:var(--gray800);background-color:var(--gray800)}button:not(.open) z-icon{fill:var(--color-white)}button:not(.open) z-icon.inverse{fill:var(--gray800)}button.open z-icon{fill:var(--gray800)}button.open z-icon.inverse{fill:var(--color-white)}.userfullname{width:auto;padding:0 calc(var(--space-unit) - 6px) 0 calc(var(--space-unit) - 2px);font-family:var(--font-family-sans);font-size:14px;font-weight:var(--font-sb);letter-spacing:0.16px;line-height:20px}.userfullname.inverse{color:var(--gray800)}button.open div.userfullname{max-width:none;color:var(--gray800);text-overflow:clip}button.open div.userfullname.inverse{color:var(--color-white)}.useremail{box-sizing:border-box;padding-right:calc(var(--space-unit) * 3 - 2px)}button.open div.useremail{color:var(--gray800)}button.open div.useremail.inverse{color:var(--color-white)}ul{position:initial;left:initial;width:100%;padding:0;background-color:var(--color-white)}ul.inverse{border-bottom-color:var(--gray800);background-color:var(--gray800)}ul>li{border-bottom:var(--border-base) solid var(--gray400);margin:0 var(--space-unit);color:var(--gray800)}ul>li.inverse{color:var(--color-white)}ul>li:first-child{padding-top:calc(var(--space-unit) + 3px);padding-bottom:calc(var(--space-unit) + 5px);border-top:var(--border-base) solid var(--gray400)}}";
5
-
6
- const ZUserDropdown = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.userButtonClick = createEvent(this, "userButtonClick", 7);
10
- this.dropdownMenuLinkClick = createEvent(this, "dropdownMenuLinkClick", 7);
11
- /** if inner components colors are inverted, or not, default false */
12
- this.useInverseColors = false;
13
- this.isMenuOpen = false;
14
- this.handleLoggedButtonClick = this.handleLoggedButtonClick.bind(this);
15
- this.emitDropdownMenuLinkClick = this.emitDropdownMenuLinkClick.bind(this);
16
- }
17
- componentDidLoad() {
18
- this.setMobileAndDivToResizeWidth();
19
- }
20
- componentWillUpdate() {
21
- this.setMobileAndDivToResizeWidth();
22
- }
23
- componentWillRender() {
24
- if (this.menuContent) {
25
- this.linkArray = typeof this.menuContent === "string" ? JSON.parse(this.menuContent) : this.menuContent;
26
- }
27
- }
28
- setMobileAndDivToResizeWidth() {
29
- var _a;
30
- if (this.divToResize) {
31
- this.isMobile = window.screen.width <= mobileBreakpoint || window.innerWidth <= mobileBreakpoint;
32
- if (this.logged && !this.isMobile && this.isMenuOpen) {
33
- this.divToResize.style.width = `${(_a = this.userButton) === null || _a === void 0 ? void 0 : _a.offsetWidth}px`;
34
- }
35
- else {
36
- this.divToResize.removeAttribute("style");
37
- }
38
- }
39
- }
40
- emitUserButtonClick() {
41
- this.userButtonClick.emit(this.isMenuOpen);
42
- }
43
- emitDropdownMenuLinkClick(e) {
44
- this.isMenuOpen = false;
45
- this.dropdownMenuLinkClick.emit({ e, linkId: e.detail.linkId });
46
- }
47
- handleResize() {
48
- this.isMobile = window.innerWidth <= mobileBreakpoint;
49
- }
50
- handleOrientationChange() {
51
- this.isMobile = screen.width <= mobileBreakpoint;
52
- }
53
- handleClickOutside(e) {
54
- if (e.target.nodeName !== "Z-USER-DROPDOWN") {
55
- this.isMenuOpen = false;
56
- }
57
- }
58
- handleLoggedButtonClick() {
59
- this.isMenuOpen = !this.isMenuOpen;
60
- this.emitUserButtonClick();
61
- }
62
- renderGuestButton() {
63
- return (h("button", { id: "guestbutton", class: this.useInverseColors ? "inverse" : "", onClick: () => this.emitUserButtonClick() }, "ENTRA"));
64
- }
65
- renderLoggedButton() {
66
- const direction = this.isMenuOpen ? "up" : "down";
67
- const colorClass = this.useInverseColors ? "inverse" : "";
68
- 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))));
69
- }
70
- getZLinkTextcolor() {
71
- if (this.isMobile) {
72
- return this.useInverseColors ? "black" : "white";
73
- }
74
- return this.useInverseColors ? "white" : "black";
75
- }
76
- renderDropdownMenu() {
77
- const colorClass = this.useInverseColors ? "inverse" : "";
78
- 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 &&
79
- 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)))))));
80
- }
81
- render() {
82
- const openClass = `${this.logged && this.isMenuOpen ? "open" : ""}`;
83
- const colorClass = this.useInverseColors ? "inverse" : "";
84
- 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()))));
85
- }
86
- };
87
- ZUserDropdown.style = stylesCss;
88
-
89
- export { ZUserDropdown as z_user_dropdown };