@zanichelli/albe-web-components 2.48.0 → 3.1.0

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 (134) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/web-components-library.cjs.js +1 -1
  4. package/dist/cjs/{z-app-switcher_11.cjs.entry.js → z-app-switcher_12.cjs.entry.js} +42 -6
  5. package/dist/cjs/z-cookiebar.cjs.entry.js +3 -3
  6. package/dist/cjs/z-date-picker.cjs.entry.js +104 -4
  7. package/dist/cjs/z-file-upload.cjs.entry.js +14 -11
  8. package/dist/cjs/z-footer.cjs.entry.js +12 -7
  9. package/dist/cjs/z-modal-login.cjs.entry.js +5 -4
  10. package/dist/cjs/z-myz-card-dictionary.cjs.entry.js +2 -2
  11. package/dist/cjs/z-myz-topbar.cjs.entry.js +2 -2
  12. package/dist/cjs/z-navigation-tab-link.cjs.entry.js +12 -11
  13. package/dist/cjs/z-navigation-tab.cjs.entry.js +12 -11
  14. package/dist/cjs/z-navigation-tabs.cjs.entry.js +5 -8
  15. package/dist/cjs/z-table-cell.cjs.entry.js +1 -1
  16. package/dist/cjs/z-table-header.cjs.entry.js +1 -1
  17. package/dist/cjs/z-table.cjs.entry.js +2 -2
  18. package/dist/cjs/z-toast-notification.cjs.entry.js +1 -1
  19. package/dist/collection/collection-manifest.json +1 -0
  20. package/dist/collection/components/buttons/z-button/index.js +72 -52
  21. package/dist/collection/components/buttons/z-button/styles.css +32 -111
  22. package/dist/collection/components/file-upload/z-file-upload/index.js +13 -10
  23. package/dist/collection/components/file-upload/z-file-upload/styles.css +2 -2
  24. package/dist/collection/components/footer/z-footer/index.js +19 -14
  25. package/dist/collection/components/footer/z-footer/styles.css +2 -2
  26. package/dist/collection/components/modal/z-modal-login/index.js +5 -4
  27. package/dist/collection/components/modal/z-modal-login/styles.css +8 -8
  28. package/dist/collection/components/navigation/tabs/navigation-tab.css +49 -31
  29. package/dist/collection/components/navigation/tabs/z-navigation-tab/index.js +14 -21
  30. package/dist/collection/components/navigation/tabs/z-navigation-tab-link/index.js +14 -21
  31. package/dist/collection/components/navigation/tabs/z-navigation-tabs/index.js +4 -7
  32. package/dist/collection/components/navigation/tabs/z-navigation-tabs/styles.css +6 -20
  33. package/dist/collection/components/notification/z-cookiebar/index.js +2 -2
  34. package/dist/collection/components/notification/z-cookiebar/styles.css +3 -3
  35. package/dist/collection/components/notification/z-toast-notification/styles.css +4 -2
  36. package/dist/collection/components/z-date-picker/index.js +111 -4
  37. package/dist/collection/components/z-date-picker/styles.css +14 -4
  38. package/dist/collection/components/z-table/z-table/index.js +4 -4
  39. package/dist/collection/components/z-table/z-table-cell/index.js +1 -1
  40. package/dist/collection/components/z-table/z-table-header/index.js +1 -1
  41. package/dist/collection/deprecated/z-button-deprecated/index.js +218 -0
  42. package/dist/collection/deprecated/z-button-deprecated/styles.css +231 -0
  43. package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js +1 -1
  44. package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/styles.css +1 -1
  45. package/dist/collection/snowflakes/myz/topbar/index.js +1 -1
  46. package/dist/collection/snowflakes/myz/topbar/styles.css +8 -8
  47. package/dist/esm/loader.js +1 -1
  48. package/dist/esm/web-components-library.js +1 -1
  49. package/dist/esm/{z-app-switcher_11.entry.js → z-app-switcher_12.entry.js} +42 -7
  50. package/dist/esm/z-cookiebar.entry.js +3 -3
  51. package/dist/esm/z-date-picker.entry.js +104 -4
  52. package/dist/esm/z-file-upload.entry.js +14 -11
  53. package/dist/esm/z-footer.entry.js +12 -7
  54. package/dist/esm/z-modal-login.entry.js +5 -4
  55. package/dist/esm/z-myz-card-dictionary.entry.js +2 -2
  56. package/dist/esm/z-myz-topbar.entry.js +2 -2
  57. package/dist/esm/z-navigation-tab-link.entry.js +13 -12
  58. package/dist/esm/z-navigation-tab.entry.js +13 -12
  59. package/dist/esm/z-navigation-tabs.entry.js +5 -8
  60. package/dist/esm/z-table-cell.entry.js +1 -1
  61. package/dist/esm/z-table-header.entry.js +1 -1
  62. package/dist/esm/z-table.entry.js +2 -2
  63. package/dist/esm/z-toast-notification.entry.js +1 -1
  64. package/dist/types/components/buttons/z-button/index.d.ts +13 -7
  65. package/dist/types/components/navigation/tabs/z-navigation-tab/index.d.ts +8 -5
  66. package/dist/types/components/navigation/tabs/z-navigation-tab-link/index.d.ts +8 -5
  67. package/dist/types/components/navigation/tabs/z-navigation-tabs/index.d.ts +2 -0
  68. package/dist/types/components/z-date-picker/index.d.ts +6 -0
  69. package/dist/types/components.d.ts +99 -6
  70. package/dist/types/deprecated/z-button-deprecated/index.d.ts +28 -0
  71. package/dist/web-components-library/p-0b590426.entry.js +1 -0
  72. package/dist/web-components-library/p-2b8975b1.entry.js +1 -0
  73. package/dist/web-components-library/p-2ff952a3.entry.js +1 -0
  74. package/dist/web-components-library/p-393c31c0.entry.js +1 -0
  75. package/dist/web-components-library/p-459dab30.entry.js +1 -0
  76. package/dist/web-components-library/p-709ab23c.entry.js +1 -0
  77. package/dist/web-components-library/p-8b62bd85.entry.js +1 -0
  78. package/dist/web-components-library/{p-791cbcab.entry.js → p-a391566a.entry.js} +1 -1
  79. package/{www/build/p-ae2e17b4.entry.js → dist/web-components-library/p-adad78fc.entry.js} +1 -1
  80. package/dist/web-components-library/{p-3dba3a83.entry.js → p-bbb0e7a7.entry.js} +2 -2
  81. package/dist/web-components-library/p-cadcf677.entry.js +1 -0
  82. package/dist/web-components-library/p-cce20009.entry.js +1 -0
  83. package/dist/web-components-library/p-cd2ca92b.entry.js +1 -0
  84. package/dist/web-components-library/p-da7760a3.entry.js +1 -0
  85. package/dist/web-components-library/p-dcf4d1b6.entry.js +1 -0
  86. package/dist/web-components-library/web-components-library.esm.js +1 -1
  87. package/package.json +1 -1
  88. package/react/components.d.ts +1 -0
  89. package/react/components.js +4 -3
  90. package/react/components.js.map +1 -1
  91. package/www/build/p-0b590426.entry.js +1 -0
  92. package/www/build/p-2b8975b1.entry.js +1 -0
  93. package/www/build/p-2ff952a3.entry.js +1 -0
  94. package/www/build/p-393c31c0.entry.js +1 -0
  95. package/www/build/p-459dab30.entry.js +1 -0
  96. package/www/build/p-709ab23c.entry.js +1 -0
  97. package/www/build/p-8b62bd85.entry.js +1 -0
  98. package/www/build/{p-791cbcab.entry.js → p-a391566a.entry.js} +1 -1
  99. package/{dist/web-components-library/p-ae2e17b4.entry.js → www/build/p-adad78fc.entry.js} +1 -1
  100. package/www/build/{p-3dba3a83.entry.js → p-bbb0e7a7.entry.js} +2 -2
  101. package/www/build/p-cadcf677.entry.js +1 -0
  102. package/www/build/p-cce20009.entry.js +1 -0
  103. package/www/build/p-cd2ca92b.entry.js +1 -0
  104. package/www/build/p-da7760a3.entry.js +1 -0
  105. package/www/build/p-dcf4d1b6.entry.js +1 -0
  106. package/www/build/web-components-library.esm.js +1 -1
  107. package/www/index.html +2 -2
  108. package/www/pages/notification.html +10 -7
  109. package/dist/web-components-library/p-114f3a85.entry.js +0 -1
  110. package/dist/web-components-library/p-1e1cb4ad.entry.js +0 -1
  111. package/dist/web-components-library/p-29f07a9b.entry.js +0 -1
  112. package/dist/web-components-library/p-3edd463d.entry.js +0 -1
  113. package/dist/web-components-library/p-4b166956.entry.js +0 -1
  114. package/dist/web-components-library/p-6ef6464c.entry.js +0 -1
  115. package/dist/web-components-library/p-8188846a.entry.js +0 -1
  116. package/dist/web-components-library/p-a15db194.entry.js +0 -1
  117. package/dist/web-components-library/p-a2a3a537.entry.js +0 -1
  118. package/dist/web-components-library/p-a6a9be81.entry.js +0 -1
  119. package/dist/web-components-library/p-b60fe58c.entry.js +0 -1
  120. package/dist/web-components-library/p-bea1f6b8.entry.js +0 -1
  121. package/www/build/p-114f3a85.entry.js +0 -1
  122. package/www/build/p-1e1cb4ad.entry.js +0 -1
  123. package/www/build/p-29f07a9b.entry.js +0 -1
  124. package/www/build/p-3edd463d.entry.js +0 -1
  125. package/www/build/p-4b166956.entry.js +0 -1
  126. package/www/build/p-6ef6464c.entry.js +0 -1
  127. package/www/build/p-8188846a.entry.js +0 -1
  128. package/www/build/p-a15db194.entry.js +0 -1
  129. package/www/build/p-a2a3a537.entry.js +0 -1
  130. package/www/build/p-a6a9be81.entry.js +0 -1
  131. package/www/build/p-a9db7c4f.js +0 -129
  132. package/www/build/p-b60fe58c.entry.js +0 -1
  133. package/www/build/p-bea1f6b8.entry.js +0 -1
  134. package/www/build/p-fcff1237.css +0 -812
@@ -1,9 +1,8 @@
1
- import { Component, Prop, h, Element, Listen, Event, Watch } from "@stencil/core";
1
+ import { Component, Prop, h, Listen, Event, Watch } from "@stencil/core";
2
2
  import { NavigationTabsOrientations, NavigationTabsSizes } from "../../../../beans";
3
3
  import { icons } from "../../../icons/icons";
4
4
  /**
5
5
  * Single tab component to use inside `z-navigation-tabs`. It renders a button.
6
- * @slot icon - Tab icon. If no extra customization is needed, use the `icon` prop passing the icon's name.
7
6
  */
8
7
  export class ZNavigationTab {
9
8
  constructor() {
@@ -24,12 +23,14 @@ export class ZNavigationTab {
24
23
  */
25
24
  this.size = NavigationTabsSizes.big;
26
25
  }
27
- onFocus() {
28
- this.host.scrollIntoView({
29
- behavior: "smooth",
30
- block: "nearest",
31
- inline: "nearest",
32
- });
26
+ /**
27
+ * Scroll into view to center the tab.
28
+ */
29
+ scrollToTab({ target: button }) {
30
+ const scrollOptions = this.orientation === NavigationTabsOrientations.horizontal ?
31
+ { block: "nearest", inline: "center" } :
32
+ { block: "center", inline: "nearest" };
33
+ button.scrollIntoView(Object.assign({ behavior: "smooth" }, scrollOptions));
33
34
  }
34
35
  onClick() {
35
36
  if (!this.disabled) {
@@ -38,7 +39,7 @@ export class ZNavigationTab {
38
39
  }
39
40
  onSelected() {
40
41
  if (this.selected) {
41
- this.emitSelected.emit();
42
+ this.selectedEvent.emit();
42
43
  }
43
44
  }
44
45
  /**
@@ -55,12 +56,11 @@ export class ZNavigationTab {
55
56
  return h("z-icon", { name: icon });
56
57
  }
57
58
  render() {
58
- return (h("button", { role: "tab", disabled: this.disabled, title: this.htmlTitle },
59
- h("slot", { name: "icon" }, this.icon && this.renderIcon()),
59
+ return (h("button", { role: "tab", disabled: this.disabled, title: this.htmlTitle, onFocus: this.scrollToTab.bind(this) },
60
+ this.icon && this.renderIcon(),
60
61
  this.orientation === "horizontal" && this.label));
61
62
  }
62
63
  static get is() { return "z-navigation-tab"; }
63
- static get encapsulation() { return "shadow"; }
64
64
  static get originalStyleUrls() { return {
65
65
  "$": ["../navigation-tab.css"]
66
66
  }; }
@@ -162,7 +162,7 @@ export class ZNavigationTab {
162
162
  "optional": false,
163
163
  "docs": {
164
164
  "tags": [],
165
- "text": "Name of the icon to use. Use the slot `icon` for extra customization.\nThe `filled` version will be automatically used (if found) when the tab is `selected`."
165
+ "text": "Name of the icon to use.\nThe `filled` version will be automatically used (if found) when the tab is `selected`."
166
166
  },
167
167
  "attribute": "icon",
168
168
  "reflect": false
@@ -203,7 +203,7 @@ export class ZNavigationTab {
203
203
  }
204
204
  }; }
205
205
  static get events() { return [{
206
- "method": "emitSelected",
206
+ "method": "selectedEvent",
207
207
  "name": "selected",
208
208
  "bubbles": true,
209
209
  "cancelable": true,
@@ -218,18 +218,11 @@ export class ZNavigationTab {
218
218
  "references": {}
219
219
  }
220
220
  }]; }
221
- static get elementRef() { return "host"; }
222
221
  static get watchers() { return [{
223
222
  "propName": "selected",
224
223
  "methodName": "onSelected"
225
224
  }]; }
226
225
  static get listeners() { return [{
227
- "name": "focus",
228
- "method": "onFocus",
229
- "target": undefined,
230
- "capture": false,
231
- "passive": false
232
- }, {
233
226
  "name": "click",
234
227
  "method": "onClick",
235
228
  "target": undefined,
@@ -1,9 +1,8 @@
1
- import { Component, Prop, h, Element, Listen, Event, Watch, } from "@stencil/core";
1
+ import { Component, Prop, h, Listen, Event, Watch, } from "@stencil/core";
2
2
  import { NavigationTabsOrientations, NavigationTabsSizes, } from "../../../../beans";
3
3
  import { icons } from "../../../icons/icons";
4
4
  /**
5
5
  * Single tab component to use inside `z-navigation-tabs`. It renders an anchor element.
6
- * @slot icon - Tab icon. If no extra customization is needed, use the `icon` prop passing the icon's name.
7
6
  */
8
7
  export class ZNavigationTabLink {
9
8
  constructor() {
@@ -24,19 +23,21 @@ export class ZNavigationTabLink {
24
23
  */
25
24
  this.size = NavigationTabsSizes.big;
26
25
  }
27
- onFocus() {
28
- this.host.scrollIntoView({
29
- behavior: "smooth",
30
- block: "nearest",
31
- inline: "nearest",
32
- });
26
+ /**
27
+ * Scroll into view to center the tab.
28
+ */
29
+ scrollToTab({ target: button }) {
30
+ const scrollOptions = this.orientation === NavigationTabsOrientations.horizontal ?
31
+ { block: "nearest", inline: "center" } :
32
+ { block: "center", inline: "nearest" };
33
+ button.scrollIntoView(Object.assign({ behavior: "smooth" }, scrollOptions));
33
34
  }
34
35
  onClick() {
35
36
  this.selected = true;
36
37
  }
37
38
  onSelected() {
38
39
  if (this.selected) {
39
- this.emitSelected.emit();
40
+ this.selectedEvent.emit();
40
41
  }
41
42
  }
42
43
  /**
@@ -53,12 +54,11 @@ export class ZNavigationTabLink {
53
54
  return h("z-icon", { name: icon });
54
55
  }
55
56
  render() {
56
- return (h("a", { role: "tab", href: !this.disabled && this.href, title: this.htmlTitle, target: this.target },
57
- h("slot", { name: "icon" }, this.icon && this.renderIcon()),
57
+ return (h("a", { role: "tab", href: !this.disabled && this.href, title: this.htmlTitle, target: this.target, onFocus: this.scrollToTab.bind(this) },
58
+ this.icon && this.renderIcon(),
58
59
  this.orientation === "horizontal" && this.label));
59
60
  }
60
61
  static get is() { return "z-navigation-tab-link"; }
61
- static get encapsulation() { return "shadow"; }
62
62
  static get originalStyleUrls() { return {
63
63
  "$": ["../navigation-tab.css"]
64
64
  }; }
@@ -211,7 +211,7 @@ export class ZNavigationTabLink {
211
211
  "optional": false,
212
212
  "docs": {
213
213
  "tags": [],
214
- "text": "Name of the icon to use. Use the slot `icon` for extra customization.\nThe `filled` version will be automatically used (if found) when the tab is `selected`."
214
+ "text": "Name of the icon to use.\nThe `filled` version will be automatically used (if found) when the tab is `selected`."
215
215
  },
216
216
  "attribute": "icon",
217
217
  "reflect": false
@@ -235,7 +235,7 @@ export class ZNavigationTabLink {
235
235
  }
236
236
  }; }
237
237
  static get events() { return [{
238
- "method": "emitSelected",
238
+ "method": "selectedEvent",
239
239
  "name": "selected",
240
240
  "bubbles": true,
241
241
  "cancelable": true,
@@ -250,18 +250,11 @@ export class ZNavigationTabLink {
250
250
  "references": {}
251
251
  }
252
252
  }]; }
253
- static get elementRef() { return "host"; }
254
253
  static get watchers() { return [{
255
254
  "propName": "selected",
256
255
  "methodName": "onSelected"
257
256
  }]; }
258
257
  static get listeners() { return [{
259
- "name": "focus",
260
- "method": "onFocus",
261
- "target": undefined,
262
- "capture": false,
263
- "passive": false
264
- }, {
265
258
  "name": "click",
266
259
  "method": "onClick",
267
260
  "target": undefined,
@@ -67,6 +67,8 @@ export class ZNavigationTabs {
67
67
  }
68
68
  /**
69
69
  * Listen for child tab selection.
70
+ * Deselect all other previously selected tabs,
71
+ * then scroll to the new selected tab and center it.
70
72
  * @param {CustomEvent} event `selected` event triggered by a child tab
71
73
  */
72
74
  onTabSelected(event) {
@@ -82,11 +84,8 @@ export class ZNavigationTabs {
82
84
  * Scroll the navigation bar half of its size backward.
83
85
  */
84
86
  navigateBackwards() {
85
- const safeScrollAreaSize = parseFloat(getComputedStyle(this.host).getPropertyValue('--safe-scroll-area'));
86
87
  this.tabsNav.scrollBy({
87
- [this.direction.toLowerCase()]: 0 -
88
- (this.tabsNav[`client${this.dimension}`] / 2) -
89
- safeScrollAreaSize,
88
+ [this.direction.toLowerCase()]: 0 - (this.tabsNav[`client${this.dimension}`] / 2),
90
89
  behavior: 'smooth',
91
90
  });
92
91
  }
@@ -94,11 +93,9 @@ export class ZNavigationTabs {
94
93
  * Scroll the navigation bar half of its size forward.
95
94
  */
96
95
  navigateForward() {
97
- const safeScrollAreaSize = parseFloat(getComputedStyle(this.host).getPropertyValue('--safe-scroll-area'));
98
96
  this.tabsNav.scrollBy({
99
97
  [this.direction.toLowerCase()]: this.tabsNav[`scroll${this.direction}`] +
100
- (this.tabsNav[`client${this.dimension}`] / 2) +
101
- safeScrollAreaSize,
98
+ (this.tabsNav[`client${this.dimension}`] / 2),
102
99
  behavior: 'smooth',
103
100
  });
104
101
  }
@@ -1,13 +1,8 @@
1
1
  :host {
2
- --safe-scroll-area: 4px;
3
- --negative-safe-scroll-area: calc(-1 * var(--safe-scroll-area));
4
-
5
2
  position: relative;
6
3
  display: flex;
7
4
  flex-direction: row;
8
5
  z-index: 0;
9
- margin: var(--negative-safe-scroll-area);
10
- padding: var(--safe-scroll-area);
11
6
  font-family: var(--font-family-sans);
12
7
  font-weight: var(--font-rg);
13
8
  overflow: hidden;
@@ -37,11 +32,12 @@
37
32
  border-radius: var(--border-no-radius);
38
33
  cursor: pointer;
39
34
  z-index: 1;
35
+ box-shadow: 0px 0px 4px 1px rgb(66, 69, 72, 0.40);
40
36
  }
41
37
 
42
- .navigation-button:focus {
38
+ .navigation-button:focus:focus-visible {
43
39
  fill: var(--color-primary01);
44
- box-shadow: var(--shadow-focus-primary);
40
+ box-shadow: inset var(--shadow-focus-primary);
45
41
  }
46
42
 
47
43
  .navigation-button:disabled {
@@ -53,9 +49,7 @@ nav {
53
49
  align-items: center;
54
50
  justify-content: flex-start;
55
51
  overflow: auto;
56
- margin: var(--negative-safe-scroll-area);
57
- padding: var(--safe-scroll-area);
58
- scroll-padding: var(--safe-scroll-area);
52
+ scroll-behavior: smooth;
59
53
 
60
54
  /* hide scrollbar in Firefox */
61
55
  scrollbar-width: none;
@@ -68,19 +62,15 @@ nav {
68
62
  :host([orientation='horizontal']) .navigation-button {
69
63
  top: 0;
70
64
  height: 100%;
71
- width: calc((var(--space-unit) * 4) + var(--safe-scroll-area));
65
+ width: calc(var(--space-unit) * 4);
72
66
  }
73
67
 
74
68
  :host([orientation='horizontal']) .navigation-button:first-child {
75
69
  left: 0;
76
- padding-left: var(--safe-scroll-area);
77
- box-shadow: 5px 0px var(--safe-scroll-area) var(--negative-safe-scroll-area) rgba(66, 69, 72, 0.40);
78
70
  }
79
71
 
80
72
  :host([orientation='horizontal']) .navigation-button:last-child {
81
73
  right: 0;
82
- padding-right: 4px;
83
- box-shadow: -5px 0px var(--safe-scroll-area) var(--negative-safe-scroll-area) rgba(66, 69, 72, 0.40);
84
74
  }
85
75
 
86
76
  /* Orientation vertical */
@@ -98,19 +88,15 @@ nav {
98
88
  :host([orientation='vertical']) .navigation-button {
99
89
  left: 0;
100
90
  width: 100%;
101
- height: calc((var(--space-unit) * 4) + var(--safe-scroll-area));
91
+ height: calc(var(--space-unit) * 4);
102
92
  }
103
93
 
104
94
  :host([orientation='vertical']) .navigation-button:first-child {
105
95
  top: 0;
106
- padding-top: var(--safe-scroll-area);
107
- box-shadow: 0px 5px var(--safe-scroll-area) var(--negative-safe-scroll-area) rgba(66, 69, 72, 0.40);
108
96
  }
109
97
 
110
98
  :host([orientation='vertical']) .navigation-button:last-child {
111
99
  bottom: 0;
112
- padding-bottom: var(--safe-scroll-area);
113
- box-shadow: 0px -5px var(--safe-scroll-area) var(--negative-safe-scroll-area) rgba(66, 69, 72, 0.40);
114
100
  }
115
101
 
116
102
  :host([size='small'][orientation='vertical']) .navigation-button {
@@ -28,10 +28,10 @@ export class ZCookiebar {
28
28
  "Se continui a navigare ci permetti di farlo secondo le regole spiegate nella nostra informativa sulla privacy relativa ai \u00A0",
29
29
  h("a", { href: this.cookiepolicyurl, target: "_blank" }, "cookie"),
30
30
  "."))),
31
- h("z-button", { variant: ButtonVariantEnum.primary, onClick: (ev) => this.handleOkButtonClick(ev), onKeyUp: (ev) => this.handleOkButtonKeyUp(ev) }, "ACCETTA")));
31
+ h("z-button-deprecated", { variant: ButtonVariantEnum.primary, onClick: (ev) => this.handleOkButtonClick(ev), onKeyUp: (ev) => this.handleOkButtonKeyUp(ev) }, "ACCETTA")));
32
32
  }
33
33
  render() {
34
- return h("z-candybar", { class: `${this.hide ? "hidden" : ""}` }, this.renderContentSlot());
34
+ return (h("z-candybar", { class: `${this.hide ? "hidden" : ""}` }, this.renderContentSlot()));
35
35
  }
36
36
  static get is() { return "z-cookiebar"; }
37
37
  static get encapsulation() { return "shadow"; }
@@ -15,7 +15,7 @@ z-candybar.hidden {
15
15
  align-items: stretch;
16
16
  align-content: space-between;
17
17
  color: var(--text-grey-800);
18
- border-radius: calc(var(--space-unit) * .5);
18
+ border-radius: calc(var(--space-unit) * 0.5);
19
19
  font-size: 16px;
20
20
  letter-spacing: 0px;
21
21
  line-height: 24px;
@@ -58,7 +58,7 @@ z-candybar.hidden {
58
58
  z-index: 1000;
59
59
  }
60
60
 
61
- .content > z-button {
61
+ .content > z-button-deprecated {
62
62
  margin: 0;
63
63
  width: 100%;
64
64
  }
@@ -87,7 +87,7 @@ z-candybar.hidden {
87
87
  padding: 0;
88
88
  }
89
89
 
90
- .content > z-button {
90
+ .content > z-button-deprecated {
91
91
  margin: 0;
92
92
  width: initial;
93
93
  }
@@ -172,7 +172,10 @@
172
172
  font-weight: 600;
173
173
  }
174
174
 
175
- :host > #external-container.mobile-wrapped #button ::slotted(z-button) {
175
+ :host
176
+ > #external-container.mobile-wrapped
177
+ #button
178
+ ::slotted(z-button-deprecated) {
176
179
  margin-top: calc(var(--space-unit) * 2);
177
180
  }
178
181
 
@@ -219,7 +222,6 @@
219
222
 
220
223
  /* Tablet breakpoint */
221
224
  @media only screen and (min-width: 768px) {
222
-
223
225
  :host {
224
226
  width: unset;
225
227
  max-width: 50vw;
@@ -1,4 +1,4 @@
1
- import { Component, Prop, Element, h, Event, State, } from "@stencil/core";
1
+ import { Component, Prop, Element, h, Event, Listen, State, } from "@stencil/core";
2
2
  import flatpickr from "flatpickr";
3
3
  import { Italian } from "flatpickr/dist/l10n/it.js";
4
4
  import monthSelectPlugin from "flatpickr/dist/plugins/monthSelect";
@@ -13,16 +13,55 @@ export class ZDatePicker {
13
13
  emitDateSelect(date) {
14
14
  this.dateSelect.emit(date);
15
15
  }
16
+ handleKeyDown(ev) {
17
+ if (ev.key === "Enter" || ev.key === " ") {
18
+ let isPrevArrowEntered = document.activeElement.classList.contains("flatpickr-prev-month");
19
+ let isNextArrowEntered = document.activeElement.classList.contains("flatpickr-next-month");
20
+ let arrowPressed = isPrevArrowEntered || isNextArrowEntered;
21
+ arrowPressed && ev.key === " " && ev.preventDefault();
22
+ if (this.mode === ZDatePickerMode.months) {
23
+ isPrevArrowEntered &&
24
+ this.flatpickrInstance.changeYear(this.flatpickrInstance.currentYear - 1);
25
+ isNextArrowEntered &&
26
+ this.flatpickrInstance.changeYear(this.flatpickrInstance.currentYear + 1);
27
+ if (arrowPressed) {
28
+ let calendar = this.element.getElementsByClassName("flatpickr-calendar")[0];
29
+ let months = calendar.querySelectorAll(".flatpickr-monthSelect-month");
30
+ months.forEach((element) => {
31
+ element.setAttribute("aria-label", `${element.innerHTML} ${this.flatpickrInstance.currentYear}`);
32
+ });
33
+ //Force check of the current day
34
+ Array.from(months).forEach((element, index) => {
35
+ let curMonth = new Date().getMonth();
36
+ let curYear = new Date().getFullYear();
37
+ if (index === curMonth) {
38
+ if (this.flatpickrInstance.currentYear === curYear) {
39
+ element.setAttribute("class", "flatpickr-monthSelect-month today");
40
+ }
41
+ else {
42
+ element.setAttribute("class", "flatpickr-monthSelect-month");
43
+ }
44
+ }
45
+ });
46
+ }
47
+ }
48
+ else {
49
+ isPrevArrowEntered && this.flatpickrInstance.changeMonth(-1);
50
+ isNextArrowEntered && this.flatpickrInstance.changeMonth(1);
51
+ }
52
+ }
53
+ }
16
54
  componentWillLoad() {
17
55
  let customToggle = this.element.querySelector("[slot=toggle]");
18
56
  this.hasChildren = !!customToggle;
19
57
  this.hasChildren && customToggle.setAttribute("data-toggle", "data-toggle");
20
58
  }
21
59
  componentDidLoad() {
22
- flatpickr(`.${this.datepickerid}`, {
60
+ this.flatpickrInstance = flatpickr(`.${this.datepickerid}`, {
23
61
  appendTo: this.element.children[0],
24
62
  enableTime: this.mode === ZDatePickerMode.dateTime,
25
63
  locale: Italian,
64
+ allowInput: true,
26
65
  dateFormat: this.mode === ZDatePickerMode.dateTime ? "d-m-Y - H:i" : "d-m-Y",
27
66
  ariaDateFormat: this.mode === ZDatePickerMode.months ? "F Y" : "d F Y",
28
67
  minuteIncrement: 1,
@@ -30,6 +69,13 @@ export class ZDatePicker {
30
69
  onChange: (_selectedDates, dateStr) => {
31
70
  this.emitDateSelect(dateStr);
32
71
  },
72
+ onOpen: () => {
73
+ this.setAriaOptions();
74
+ this.setFlatpickrPosition();
75
+ },
76
+ onKeyDown: () => {
77
+ this.setAriaOptions();
78
+ },
33
79
  wrap: this.hasChildren,
34
80
  plugins: this.mode === ZDatePickerMode.months && [
35
81
  monthSelectPlugin({
@@ -42,6 +88,60 @@ export class ZDatePicker {
42
88
  element.innerHTML = element.innerHTML.trim().charAt(0);
43
89
  });
44
90
  }
91
+ setAriaOptions() {
92
+ let calendar = this.element.getElementsByClassName("flatpickr-calendar")[0];
93
+ let prevMonthArrow = calendar.getElementsByClassName("flatpickr-prev-month")[0];
94
+ let nextMonthArrow = calendar.getElementsByClassName("flatpickr-next-month")[0];
95
+ let tabindexElements = calendar.querySelectorAll('[tabindex = "-1"]');
96
+ tabindexElements.forEach((element) => element.setAttribute("tabindex", "0"));
97
+ prevMonthArrow.setAttribute("tabindex", "0");
98
+ nextMonthArrow.setAttribute("tabindex", "0");
99
+ prevMonthArrow.setAttribute("role", "button");
100
+ nextMonthArrow.setAttribute("role", "button");
101
+ calendar
102
+ .getElementsByClassName("cur-year")[0]
103
+ .setAttribute("aria-label", "Anno");
104
+ if (this.mode === ZDatePickerMode.months) {
105
+ this.setMonthsAriaOptions(calendar, prevMonthArrow, nextMonthArrow);
106
+ }
107
+ if (this.mode === ZDatePickerMode.date) {
108
+ this.setDateAriaOptions(calendar, prevMonthArrow, nextMonthArrow);
109
+ }
110
+ if (this.mode === ZDatePickerMode.dateTime) {
111
+ this.setDateTimeAriaOptions(calendar, prevMonthArrow, nextMonthArrow);
112
+ }
113
+ }
114
+ setMonthsAriaOptions(calendar, prevMonthArrow, nextMonthArrow) {
115
+ Array.from(calendar.getElementsByClassName("flatpickr-monthSelect-months")).forEach((element) => element.setAttribute("tabindex", "-1"));
116
+ Array.from(calendar.getElementsByClassName("flatpickr-monthSelect-month")).forEach((element) => element.setAttribute("role", "button"));
117
+ prevMonthArrow.setAttribute("aria-label", "Anno precedente");
118
+ nextMonthArrow.setAttribute("aria-label", "Anno successivo");
119
+ }
120
+ setDateAriaOptions(calendar, prevMonthArrow, nextMonthArrow) {
121
+ Array.from(calendar.getElementsByClassName("flatpickr-days")).forEach((element) => element.setAttribute("tabindex", "-1"));
122
+ Array.from(calendar.getElementsByClassName("flatpickr-day")).forEach((element) => element.setAttribute("role", "button"));
123
+ calendar
124
+ .getElementsByClassName("flatpickr-monthDropdown-months")[0]
125
+ .setAttribute("aria-label", "Mese");
126
+ prevMonthArrow.setAttribute("aria-label", "Mese precedente");
127
+ nextMonthArrow.setAttribute("aria-label", "Mese successivo");
128
+ }
129
+ setDateTimeAriaOptions(calendar, prevMonthArrow, nextMonthArrow) {
130
+ Array.from(calendar.getElementsByClassName("flatpickr-days")).forEach((element) => element.setAttribute("tabindex", "-1"));
131
+ Array.from(calendar.getElementsByClassName("flatpickr-day")).forEach((element) => element.setAttribute("role", "button"));
132
+ calendar
133
+ .getElementsByClassName("flatpickr-monthDropdown-months")[0]
134
+ .setAttribute("aria-label", "Mese");
135
+ prevMonthArrow.setAttribute("aria-label", "Mese precedente");
136
+ nextMonthArrow.setAttribute("aria-label", "Mese successivo");
137
+ Array.from(calendar.getElementsByClassName("time24hr")).forEach((element) => element.setAttribute("tabindex", "-1"));
138
+ calendar
139
+ .getElementsByClassName("flatpickr-hour")[0]
140
+ .setAttribute("aria-label", "Ora");
141
+ calendar
142
+ .getElementsByClassName("flatpickr-minute")[0]
143
+ .setAttribute("aria-label", "Minuti");
144
+ }
45
145
  setFlatpickrPosition() {
46
146
  const toggleHeight = this.element.children[0].clientHeight;
47
147
  this.element.style.setProperty("--toggle-height", `${toggleHeight}px`);
@@ -66,10 +166,10 @@ export class ZDatePicker {
66
166
  h("slot", { name: "toggle" })));
67
167
  }
68
168
  renderZInput() {
69
- return (h("z-input", { class: classNames(this.datepickerid), type: "text", name: "datepicker", icon: "event", hasmessage: false }));
169
+ return (h("z-input", { class: classNames(this.datepickerid), type: "text", icon: "event", hasmessage: false, tabindex: "0" }));
70
170
  }
71
171
  render() {
72
- return (h("div", { class: classNames("flatpickr-toggle-container", this.hasChildren && this.datepickerid, this.flatpickrPosition, this.mode), onClick: () => this.setFlatpickrPosition() }, this.hasChildren ? this.renderSlottedContent() : this.renderZInput()));
172
+ return (h("div", { class: classNames("flatpickr-toggle-container", this.hasChildren && this.datepickerid, this.flatpickrPosition, this.mode) }, this.hasChildren ? this.renderSlottedContent() : this.renderZInput()));
73
173
  }
74
174
  static get is() { return "z-date-picker"; }
75
175
  static get originalStyleUrls() { return {
@@ -140,4 +240,11 @@ export class ZDatePicker {
140
240
  }
141
241
  }]; }
142
242
  static get elementRef() { return "element"; }
243
+ static get listeners() { return [{
244
+ "name": "keydown",
245
+ "method": "handleKeyDown",
246
+ "target": "body",
247
+ "capture": true,
248
+ "passive": false
249
+ }]; }
143
250
  }
@@ -257,11 +257,15 @@ z-date-picker > div > * {
257
257
  }
258
258
 
259
259
  .flatpickr-next-month:hover,
260
- .flatpickr-prev-month:hover {
260
+ .flatpickr-prev-month:hover,
261
+ .flatpickr-next-month:focus,
262
+ .flatpickr-prev-month:focus {
261
263
  border-radius: var(--border-radius);
262
264
  background-color: var(--color-primary03) !important;
263
265
  border-color: var(--color-primary03) !important;
264
266
  color: var(--color-hover-primary) !important;
267
+ border: none !important;
268
+ outline: none !important;
265
269
  }
266
270
 
267
271
  .flatpickr-next-month:hover svg,
@@ -296,7 +300,8 @@ z-date-picker > div > * {
296
300
  padding-left: var(--space-unit) !important;
297
301
  }
298
302
 
299
- .flatpickr-monthDropdown-months:hover {
303
+ .flatpickr-monthDropdown-months:hover,
304
+ .flatpickr-monthDropdown-months:focus {
300
305
  outline: 1px solid var(--color-primary01) !important;
301
306
  }
302
307
 
@@ -311,7 +316,8 @@ z-date-picker > div > * {
311
316
  width: calc(var(--space-unit) * 10);
312
317
  }
313
318
 
314
- .flatpickr-current-month > .numInputWrapper:hover {
319
+ .flatpickr-current-month > .numInputWrapper:hover,
320
+ .flatpickr-current-month > .numInputWrapper:focus-within {
315
321
  outline: 1px solid var(--color-primary01) !important;
316
322
  }
317
323
 
@@ -368,7 +374,8 @@ z-date-picker > div > * {
368
374
  .flatpickr-day:hover,
369
375
  .flatpickr-day.prevMonthDay:hover,
370
376
  .flatpickr-day.selected:hover,
371
- .flatpickr-monthSelect-month:hover {
377
+ .flatpickr-monthSelect-month:hover,
378
+ .flatpickr-monthSelect-month:focus {
372
379
  background-color: var(--myz-blue-dark) !important;
373
380
  border-color: var(--myz-blue-dark) !important;
374
381
  color: var(--color-white) !important;
@@ -441,6 +448,9 @@ z-date-picker > div > * {
441
448
 
442
449
  .flatpickr-minute,
443
450
  .flatpickr-hour {
451
+ font-size: var(--font-size-3) !important;
452
+ font-weight: var(--font-rg) !important;
453
+
444
454
  outline: 1px solid black !important;
445
455
  }
446
456
 
@@ -66,15 +66,15 @@ export class ZTable {
66
66
  h("div", { class: tableContentClass },
67
67
  h("slot", { name: "table-body" }),
68
68
  h("z-table-empty-box", { class: this.bordered && "bordered", message: this.message, subtitle: this.subtitle },
69
- !!this.callToActionLabel && (h("z-button", { slot: "cta1", variant: ButtonVariantEnum.tertiary, onClick: () => this.callToAction.emit(), size: buttonSize }, this.callToActionLabel)),
70
- !!this.callToActionTwoLabel && (h("z-button", { slot: "cta2", variant: ButtonVariantEnum.tertiary, onClick: () => this.callToActionTwo.emit(), size: buttonSize }, this.callToActionTwoLabel)))))));
69
+ !!this.callToActionLabel && (h("z-button-deprecated", { slot: "cta1", variant: ButtonVariantEnum.tertiary, onClick: () => this.callToAction.emit(), size: buttonSize }, this.callToActionLabel)),
70
+ !!this.callToActionTwoLabel && (h("z-button-deprecated", { slot: "cta2", variant: ButtonVariantEnum.tertiary, onClick: () => this.callToActionTwo.emit(), size: buttonSize }, this.callToActionTwoLabel)))))));
71
71
  }
72
72
  return (h(Host, null,
73
73
  h("div", { class: tableClass },
74
74
  h("slot", { name: "table-header" })),
75
75
  h("z-table-empty-box", { class: this.bordered && "bordered", message: this.message, subtitle: this.subtitle },
76
- !!this.callToActionLabel && (h("z-button", { slot: "cta1", variant: ButtonVariantEnum.tertiary, onClick: () => this.callToAction.emit(), size: buttonSize }, this.callToActionLabel)),
77
- !!this.callToActionTwoLabel && (h("z-button", { slot: "cta2", variant: ButtonVariantEnum.tertiary, onClick: () => this.callToActionTwo.emit(), size: buttonSize }, this.callToActionTwoLabel)))));
76
+ !!this.callToActionLabel && (h("z-button-deprecated", { slot: "cta1", variant: ButtonVariantEnum.tertiary, onClick: () => this.callToAction.emit(), size: buttonSize }, this.callToActionLabel)),
77
+ !!this.callToActionTwoLabel && (h("z-button-deprecated", { slot: "cta2", variant: ButtonVariantEnum.tertiary, onClick: () => this.callToActionTwo.emit(), size: buttonSize }, this.callToActionTwoLabel)))));
78
78
  }
79
79
  render() {
80
80
  const tableClass = `table ${this.empty ? "table-empty" : ""} ${this.bordered ? "table-bordered" : ""}
@@ -19,7 +19,7 @@ export class ZTableCell {
19
19
  visible: this.isMenuOpened,
20
20
  }) },
21
21
  h("div", { class: "button-content" },
22
- h("z-button", { icon: "contextual-menu", variant: ButtonVariantEnum.tertiary, size: ButtonSizeEnum["x-small"], onClick: () => this.handleMenu(), square: true }),
22
+ h("z-button-deprecated", { icon: "contextual-menu", variant: ButtonVariantEnum.tertiary, size: ButtonSizeEnum["x-small"], onClick: () => this.handleMenu(), square: true }),
23
23
  h("div", { class: classNames("contextual-menu-container", {
24
24
  visible: this.isMenuOpened,
25
25
  }) },
@@ -74,7 +74,7 @@ export class ZTableHeader {
74
74
  visible: this.isMenuOpened,
75
75
  }) },
76
76
  h("z-popover", { position: PopoverPosition["below-center"], "background-color": "gray200" },
77
- h("z-button", { icon: "contextual-menu", variant: ButtonVariantEnum["tertiary"], size: ButtonSizeEnum["x-small"], square: true, slot: "trigger", onClick: () => this.handleMenuClick() }),
77
+ h("z-button-deprecated", { icon: "contextual-menu", variant: ButtonVariantEnum["tertiary"], size: ButtonSizeEnum["x-small"], square: true, slot: "trigger", onClick: () => this.handleMenuClick() }),
78
78
  h("div", { slot: "popover" },
79
79
  h("slot", { name: "contextual-menu" })))))));
80
80
  }