@zanichelli/albe-web-components 6.9.0 → 6.9.1

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 (241) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/index-e3299e0a.js +32 -4
  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-header_2.cjs.entry.js +153 -0
  6. package/dist/cjs/z-body.cjs.entry.js +18 -0
  7. package/dist/cjs/z-combobox.cjs.entry.js +3 -3
  8. package/dist/cjs/z-divider.cjs.entry.js +26 -0
  9. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +118 -0
  10. package/dist/cjs/z-file-upload.cjs.entry.js +11 -11
  11. package/dist/cjs/z-heading.cjs.entry.js +18 -0
  12. package/dist/cjs/z-input_2.cjs.entry.js +266 -0
  13. package/dist/cjs/z-list_3.cjs.entry.js +261 -0
  14. package/dist/cjs/z-select.cjs.entry.js +325 -0
  15. package/dist/cjs/z-table-empty-box.cjs.entry.js +1 -1
  16. package/dist/cjs/z-table.cjs.entry.js +1 -1
  17. package/dist/cjs/z-typography.cjs.entry.js +30 -0
  18. package/dist/collection/collection-manifest.json +3 -3
  19. package/dist/collection/components/file-upload/z-dragdrop-area/index.js +1 -1
  20. package/dist/collection/components/file-upload/z-file-upload/index.js +10 -10
  21. package/dist/collection/components/file-upload/z-file-upload/styles.css +2 -2
  22. package/dist/collection/components/inputs/z-combobox/index.js +2 -2
  23. package/dist/collection/components/inputs/z-combobox/styles.css +17 -7
  24. package/dist/collection/components/inputs/z-input/styles.css +19 -6
  25. package/dist/collection/components/inputs/z-select/index.js +29 -3
  26. package/dist/collection/components/inputs/z-select/styles.css +4 -0
  27. package/dist/collection/components/modal/z-modal/index.js +123 -6
  28. package/dist/collection/components/modal/z-modal/styles.css +9 -11
  29. package/dist/collection/components/z-table/z-table/index.js +1 -1
  30. package/dist/collection/components/z-table/z-table-empty-box/index.js +1 -1
  31. package/dist/collection/{components → deprecated}/typography/z-body/index.js +0 -0
  32. package/dist/collection/{components → deprecated}/typography/z-heading/index.js +0 -0
  33. package/dist/collection/{components → deprecated}/typography/z-typography/index.js +0 -0
  34. package/dist/collection/{components → deprecated}/typography/z-typography/styles.css +0 -0
  35. package/dist/esm/index-a2ca4b97.js +32 -4
  36. package/dist/esm/index.js +1 -1
  37. package/dist/esm/loader.js +1 -1
  38. package/dist/esm/polyfills/css-shim.js +0 -0
  39. package/dist/esm/{utils-5445d989.js → utils-6cf7efe2.js} +1 -1
  40. package/dist/esm/web-components-library.js +1 -1
  41. package/dist/esm/z-app-header_2.entry.js +148 -0
  42. package/dist/esm/z-body.entry.js +14 -0
  43. package/dist/esm/z-chip.entry.js +1 -1
  44. package/dist/esm/z-combobox.entry.js +4 -4
  45. package/dist/esm/z-divider.entry.js +22 -0
  46. package/dist/esm/z-dragdrop-area_2.entry.js +113 -0
  47. package/dist/esm/z-file-upload.entry.js +12 -12
  48. package/dist/esm/z-heading.entry.js +14 -0
  49. package/dist/esm/z-input_2.entry.js +261 -0
  50. package/dist/esm/z-list_3.entry.js +255 -0
  51. package/dist/esm/z-myz-card-info.entry.js +1 -1
  52. package/dist/esm/z-myz-list-item.entry.js +1 -1
  53. package/dist/esm/z-pocket_3.entry.js +1 -1
  54. package/dist/esm/z-searchbar.entry.js +1 -1
  55. package/dist/esm/z-select.entry.js +321 -0
  56. package/dist/esm/z-skip-to-content.entry.js +1 -1
  57. package/dist/esm/z-slideshow.entry.js +1 -1
  58. package/dist/esm/z-table-empty-box.entry.js +1 -1
  59. package/dist/esm/z-table-header.entry.js +1 -1
  60. package/dist/esm/z-table.entry.js +1 -1
  61. package/dist/esm/z-toggle-switch.entry.js +1 -1
  62. package/dist/esm/z-typography.entry.js +26 -0
  63. package/dist/types/beans/index.d.ts +0 -0
  64. package/dist/types/components/buttons/z-button/index.d.ts +0 -0
  65. package/dist/types/components/buttons/z-button-sort/index.d.ts +0 -0
  66. package/dist/types/components/buttons/z-chip/index.d.ts +0 -0
  67. package/dist/types/components/buttons/z-toggle-button/index.d.ts +0 -0
  68. package/dist/types/components/buttons/z-toggle-switch/index.d.ts +0 -0
  69. package/dist/types/components/date-picker/utils.d.ts +0 -0
  70. package/dist/types/components/date-picker/z-date-picker/index.d.ts +0 -0
  71. package/dist/types/components/date-picker/z-range-picker/index.d.ts +0 -0
  72. package/dist/types/components/file-upload/z-dragdrop-area/index.d.ts +0 -0
  73. package/dist/types/components/file-upload/z-file/index.d.ts +0 -0
  74. package/dist/types/components/file-upload/z-file-upload/index.d.ts +0 -0
  75. package/dist/types/components/icons/icons.d.ts +0 -0
  76. package/dist/types/components/icons/z-icon/index.d.ts +0 -0
  77. package/dist/types/components/index.d.ts +0 -0
  78. package/dist/types/components/indicators/z-stepper/index.d.ts +0 -0
  79. package/dist/types/components/indicators/z-stepper-item/index.d.ts +0 -0
  80. package/dist/types/components/inputs/z-combobox/index.d.ts +0 -0
  81. package/dist/types/components/inputs/z-input/index.d.ts +0 -0
  82. package/dist/types/components/inputs/z-input-message/index.d.ts +0 -0
  83. package/dist/types/components/inputs/z-searchbar/index.d.ts +0 -0
  84. package/dist/types/components/inputs/z-select/index.d.ts +2 -0
  85. package/dist/types/components/list/z-list/index.d.ts +0 -0
  86. package/dist/types/components/list/z-list-element/index.d.ts +0 -0
  87. package/dist/types/components/list/z-list-group/index.d.ts +0 -0
  88. package/dist/types/components/list/z-toast-notification-list/index.d.ts +0 -0
  89. package/dist/types/components/logo/z-logo/index.d.ts +0 -0
  90. package/dist/types/components/modal/z-modal/index.d.ts +20 -2
  91. package/dist/types/components/navigation/tabs/z-navigation-tab/index.d.ts +0 -0
  92. package/dist/types/components/navigation/tabs/z-navigation-tab-link/index.d.ts +0 -0
  93. package/dist/types/components/navigation/tabs/z-navigation-tabs/index.d.ts +0 -0
  94. package/dist/types/components/navigation/z-app-header/index.d.ts +0 -0
  95. package/dist/types/components/navigation/z-app-switcher/index.d.ts +0 -0
  96. package/dist/types/components/navigation/z-link/index.d.ts +0 -0
  97. package/dist/types/components/navigation/z-menu/index.d.ts +0 -0
  98. package/dist/types/components/navigation/z-menu-section/index.d.ts +0 -0
  99. package/dist/types/components/notification/z-info-box/index.d.ts +0 -0
  100. package/dist/types/components/notification/z-notification/index.d.ts +0 -0
  101. package/dist/types/components/notification/z-toast-notification/index.d.ts +0 -0
  102. package/dist/types/components/notification/z-tooltip/index.d.ts +0 -0
  103. package/dist/types/components/panel/z-panel-elem/index.d.ts +0 -0
  104. package/dist/types/components/z-anchor-navigation/index.d.ts +0 -0
  105. package/dist/types/components/z-aria-alert/index.d.ts +0 -0
  106. package/dist/types/components/z-avatar/index.d.ts +0 -0
  107. package/dist/types/components/z-card/index.d.ts +0 -0
  108. package/dist/types/components/z-carousel/index.d.ts +0 -0
  109. package/dist/types/components/z-contextual-menu/index.d.ts +0 -0
  110. package/dist/types/components/z-cover-hero/index.d.ts +0 -0
  111. package/dist/types/components/z-divider/index.d.ts +0 -0
  112. package/dist/types/components/z-ghost-loading/index.d.ts +0 -0
  113. package/dist/types/components/z-info-reveal/index.d.ts +0 -0
  114. package/dist/types/components/z-offcanvas/index.d.ts +0 -0
  115. package/dist/types/components/z-pagination/index.d.ts +0 -0
  116. package/dist/types/components/z-popover/index.d.ts +0 -0
  117. package/dist/types/components/z-section-title/index.d.ts +0 -0
  118. package/dist/types/components/z-skip-to-content/index.d.ts +0 -0
  119. package/dist/types/components/z-table/z-table/index.d.ts +0 -0
  120. package/dist/types/components/z-table/z-table-body/index.d.ts +0 -0
  121. package/dist/types/components/z-table/z-table-cell/index.d.ts +0 -0
  122. package/dist/types/components/z-table/z-table-empty-box/index.d.ts +0 -0
  123. package/dist/types/components/z-table/z-table-expanded-row/index.d.ts +0 -0
  124. package/dist/types/components/z-table/z-table-footer/index.d.ts +0 -0
  125. package/dist/types/components/z-table/z-table-head/index.d.ts +0 -0
  126. package/dist/types/components/z-table/z-table-header/index.d.ts +0 -0
  127. package/dist/types/components/z-table/z-table-header-row/index.d.ts +0 -0
  128. package/dist/types/components/z-table/z-table-row/index.d.ts +0 -0
  129. package/dist/types/components/z-table/z-table-sticky-footer/index.d.ts +0 -0
  130. package/dist/types/components/z-tag/index.d.ts +0 -0
  131. package/dist/types/components/z-visually-hidden/index.d.ts +0 -0
  132. package/dist/types/components.d.ts +26 -2
  133. package/dist/types/constants/breakpoints.d.ts +0 -0
  134. package/dist/types/constants/icons.d.ts +0 -0
  135. package/dist/types/{components → deprecated}/typography/z-body/index.d.ts +0 -0
  136. package/dist/types/{components → deprecated}/typography/z-heading/index.d.ts +0 -0
  137. package/dist/types/{components → deprecated}/typography/z-typography/index.d.ts +0 -0
  138. package/dist/types/index.d.ts +0 -0
  139. package/dist/types/snowflakes/myz/card/z-myz-card/index.d.ts +0 -0
  140. package/dist/types/snowflakes/myz/card/z-myz-card-alert/index.d.ts +0 -0
  141. package/dist/types/snowflakes/myz/card/z-myz-card-body/index.d.ts +0 -0
  142. package/dist/types/snowflakes/myz/card/z-myz-card-cover/index.d.ts +0 -0
  143. package/dist/types/snowflakes/myz/card/z-myz-card-dictionary/index.d.ts +0 -0
  144. package/dist/types/snowflakes/myz/card/z-myz-card-footer/index.d.ts +0 -0
  145. package/dist/types/snowflakes/myz/card/z-myz-card-footer-sections/index.d.ts +0 -0
  146. package/dist/types/snowflakes/myz/card/z-myz-card-header/index.d.ts +0 -0
  147. package/dist/types/snowflakes/myz/card/z-myz-card-icon/index.d.ts +0 -0
  148. package/dist/types/snowflakes/myz/card/z-myz-card-info/index.d.ts +0 -0
  149. package/dist/types/snowflakes/myz/card/z-myz-card-list/index.d.ts +0 -0
  150. package/dist/types/snowflakes/myz/list/z-myz-list/index.d.ts +0 -0
  151. package/dist/types/snowflakes/myz/list/z-myz-list-item/index.d.ts +0 -0
  152. package/dist/types/snowflakes/myz/pocket/z-messages-pocket/index.d.ts +0 -0
  153. package/dist/types/snowflakes/myz/pocket/z-pocket/index.d.ts +0 -0
  154. package/dist/types/snowflakes/myz/pocket/z-pocket-body/index.d.ts +0 -0
  155. package/dist/types/snowflakes/myz/pocket/z-pocket-header/index.d.ts +0 -0
  156. package/dist/types/snowflakes/myz/pocket/z-pocket-message/index.d.ts +0 -0
  157. package/dist/types/snowflakes/myz/z-alert/index.d.ts +0 -0
  158. package/dist/types/snowflakes/myz/z-otp/index.d.ts +0 -0
  159. package/dist/types/snowflakes/myz/z-slideshow/index.d.ts +0 -0
  160. package/dist/types/stencil-public-runtime.d.ts +0 -0
  161. package/dist/types/utils/utils.d.ts +0 -0
  162. package/dist/web-components-library/index.esm.js +1 -1
  163. package/dist/web-components-library/{p-48d3f650.entry.js → p-26033729.entry.js} +1 -1
  164. package/dist/web-components-library/p-33352f9e.entry.js +1 -0
  165. package/dist/web-components-library/p-3860061a.entry.js +1 -0
  166. package/dist/web-components-library/p-4367f978.entry.js +1 -0
  167. package/dist/web-components-library/p-52b084fb.entry.js +1 -0
  168. package/dist/web-components-library/{p-229e17af.entry.js → p-53065788.entry.js} +1 -1
  169. package/dist/web-components-library/{p-51333b32.entry.js → p-54b18f6e.entry.js} +1 -1
  170. package/dist/web-components-library/p-56cbd174.entry.js +1 -0
  171. package/dist/web-components-library/p-5ac6109d.entry.js +1 -0
  172. package/dist/web-components-library/{p-28b288a8.entry.js → p-5c62387a.entry.js} +1 -1
  173. package/dist/web-components-library/p-6acb48e3.entry.js +1 -0
  174. package/dist/web-components-library/{p-102d82ee.entry.js → p-6c163539.entry.js} +1 -1
  175. package/dist/web-components-library/p-6ea7428a.entry.js +1 -0
  176. package/dist/web-components-library/{p-00481c22.js → p-8ebe4adf.js} +1 -1
  177. package/dist/web-components-library/{p-db77ef4e.entry.js → p-93142fac.entry.js} +1 -1
  178. package/dist/web-components-library/p-9c338aeb.entry.js +1 -0
  179. package/dist/web-components-library/{p-669f14ae.entry.js → p-a05ce0a6.entry.js} +1 -1
  180. package/dist/web-components-library/{p-933efc27.entry.js → p-a6c0f149.entry.js} +1 -1
  181. package/dist/web-components-library/{p-169b9762.entry.js → p-d2127d84.entry.js} +1 -1
  182. package/dist/web-components-library/p-d6497e67.entry.js +1 -0
  183. package/dist/web-components-library/p-d9a6a204.entry.js +1 -0
  184. package/dist/web-components-library/p-e78ce8ec.entry.js +1 -0
  185. package/dist/web-components-library/p-edd53386.entry.js +1 -0
  186. package/dist/web-components-library/web-components-library.css +0 -0
  187. package/dist/web-components-library/web-components-library.esm.js +1 -1
  188. package/loader/cdn.js +0 -0
  189. package/loader/index.cjs.js +0 -0
  190. package/loader/index.d.ts +0 -0
  191. package/loader/index.es2017.js +0 -0
  192. package/loader/index.js +0 -0
  193. package/loader/package.json +0 -0
  194. package/package.json +1 -1
  195. package/www/build/index.esm.js +1 -1
  196. package/www/build/{p-48d3f650.entry.js → p-26033729.entry.js} +1 -1
  197. package/www/build/p-33352f9e.entry.js +1 -0
  198. package/www/build/p-3860061a.entry.js +1 -0
  199. package/www/build/p-4367f978.entry.js +1 -0
  200. package/www/build/p-52b084fb.entry.js +1 -0
  201. package/www/build/{p-229e17af.entry.js → p-53065788.entry.js} +1 -1
  202. package/www/build/{p-51333b32.entry.js → p-54b18f6e.entry.js} +1 -1
  203. package/www/build/p-56cbd174.entry.js +1 -0
  204. package/www/build/p-5ac6109d.entry.js +1 -0
  205. package/www/build/{p-28b288a8.entry.js → p-5c62387a.entry.js} +1 -1
  206. package/www/build/p-6acb48e3.entry.js +1 -0
  207. package/www/build/{p-102d82ee.entry.js → p-6c163539.entry.js} +1 -1
  208. package/www/build/p-6ea7428a.entry.js +1 -0
  209. package/www/build/{p-00481c22.js → p-8ebe4adf.js} +1 -1
  210. package/www/build/{p-db77ef4e.entry.js → p-93142fac.entry.js} +1 -1
  211. package/www/build/p-9c338aeb.entry.js +1 -0
  212. package/www/build/{p-669f14ae.entry.js → p-a05ce0a6.entry.js} +1 -1
  213. package/www/build/p-a240c0f4.js +1 -0
  214. package/www/build/{p-933efc27.entry.js → p-a6c0f149.entry.js} +1 -1
  215. package/www/build/{p-169b9762.entry.js → p-d2127d84.entry.js} +1 -1
  216. package/www/build/p-d6497e67.entry.js +1 -0
  217. package/www/build/p-d9a6a204.entry.js +1 -0
  218. package/www/build/p-e78ce8ec.entry.js +1 -0
  219. package/www/build/p-edd53386.entry.js +1 -0
  220. package/www/build/web-components-library.css +0 -0
  221. package/www/build/web-components-library.esm.js +1 -1
  222. package/www/build/web-components-library.js +0 -0
  223. package/www/host.config.json +0 -0
  224. package/www/index.html +1 -1
  225. package/dist/cjs/z-app-header_11.cjs.entry.js +0 -1030
  226. package/dist/cjs/z-dragdrop-area_3.cjs.entry.js +0 -76
  227. package/dist/esm/z-app-header_11.entry.js +0 -1016
  228. package/dist/esm/z-dragdrop-area_3.entry.js +0 -70
  229. package/dist/web-components-library/p-4bdf6a9b.entry.js +0 -1
  230. package/dist/web-components-library/p-5bbbda4e.entry.js +0 -1
  231. package/dist/web-components-library/p-735bdfa3.entry.js +0 -1
  232. package/dist/web-components-library/p-95b8f109.entry.js +0 -1
  233. package/dist/web-components-library/p-d0accfc5.entry.js +0 -1
  234. package/dist/web-components-library/p-de55c171.entry.js +0 -1
  235. package/www/build/p-4bdf6a9b.entry.js +0 -1
  236. package/www/build/p-5bbbda4e.entry.js +0 -1
  237. package/www/build/p-735bdfa3.entry.js +0 -1
  238. package/www/build/p-95b8f109.entry.js +0 -1
  239. package/www/build/p-d0accfc5.entry.js +0 -1
  240. package/www/build/p-de55c171.entry.js +0 -1
  241. package/www/build/p-e9b88186.js +0 -1
@@ -1,1016 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a2ca4b97.js';
2
- import { D as DividerSize, f as DividerOrientation, j as LabelPosition, I as InputType, g as ListSize, l as ListType, i as ExpandableListButtonAlign, k as ListDividerType, E as ExpandableListStyle, e as KeyboardCode } from './index-968a240f.js';
3
- import { I as ICONS } from './icons-85e529a3.js';
4
- import { r as randomId, b as boolean, g as getElementTree, h as handleKeyboardSubmit, a as getClickedElement } from './utils-5445d989.js';
5
- import './breakpoints-c386984e.js';
6
-
7
- const stylesCss$9 = ":host{--app-header-content-max-width:100%;--app-header-height:auto;--app-header-typography-1-size:24px;--app-header-typography-2-size:28px;--app-header-typography-3-size:32px;--app-header-typography-4-size:36px;--app-header-typography-5-size:42px;--app-header-typography-6-size:48px;--app-header-typography-7-size:54px;--app-header-typography-8-size:60px;--app-header-typography-9-size:68px;--app-header-typography-10-size:76px;--app-header-typography-11-size:84px;--app-header-typography-12-size:92px;--app-header-typography-1-lineheight:1.33;--app-header-typography-2-lineheight:1.29;--app-header-typography-3-lineheight:1.25;--app-header-typography-4-lineheight:1.24;--app-header-typography-5-lineheight:1.24;--app-header-typography-6-lineheight:1.25;--app-header-typography-7-lineheight:1.2;--app-header-typography-8-lineheight:1.26;--app-header-typography-9-lineheight:1.24;--app-header-typography-10-lineheight:1.26;--app-header-typography-11-lineheight:1.2;--app-header-typography-12-lineheight:1.2;--app-header-typography-1-tracking:calc(-0.2 / 1em);--app-header-typography-2-tracking:calc(-0.4 / 1em);--app-header-typography-3-tracking:calc(-0.6 / 1em);--app-header-typography-4-tracking:calc(-0.8 / 1em);--app-header-typography-5-tracking:calc(-1 / 1em);--app-header-typography-6-tracking:calc(-1.2 / 1em);--app-header-typography-7-tracking:calc(-1.4 / 1em);--app-header-typography-8-tracking:calc(-1.6 / 1em);--app-header-typography-9-tracking:calc(-1.8 / 1em);--app-header-typography-10-tracking:calc(-2 / 1em);--app-header-typography-11-tracking:calc(-2.2 / 1em);--app-header-typography-12-tracking:calc(-2.4 / 1em);--app-header-top-offset:48px;--app-header-drawer-trigger-size:calc(var(--space-unit) * 4);--app-header-bg:var(--color-white);--app-header-stucked-bg:var(--color-white);--app-header-text-color:var(--gray800);--app-header-stucked-text-color:var(--gray800);display:block;color:var(--app-header-text-color)}:host,*{box-sizing:border-box}.heading-panel{position:relative;display:flex;width:100%;max-width:var(--app-header-content-max-width);height:var(--app-header-height);flex-direction:column;flex-grow:0;flex-shrink:0;align-items:baseline;justify-content:flex-start;padding:var(--grid-margin);margin:0 auto;background:var(--app-header-bg)}:host(:empty) .heading-panel{padding:0}.heading-title{display:flex;max-width:100%;flex-direction:row;align-items:center}:host(:not([menu-length=\"0\"])) .heading-subtitle{padding-left:calc(var(--app-header-drawer-trigger-size) + (var(--space-unit) * 1.5))}.heading-stuck{position:fixed;z-index:20;top:var(--app-header-top-offset);left:0;width:100%;max-width:100%;animation:slide-stuck-heading-in 250ms ease-out;background:var(--app-header-stucked-bg);box-shadow:var(--shadow-2);color:var(--app-header-stucked-text-color)}.heading-stuck-content{display:flex;max-width:var(--app-header-content-max-width);padding:var(--space-unit) var(--grid-margin);margin:0 auto}.heading-stuck .heading-title,.heading-stuck .heading-title>*,.heading-stuck .heading-title ::slotted([slot=\"stucked-title\"]){display:block;overflow:hidden;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}.heading-stuck .heading-title>*,::slotted([slot=\"title\"]),::slotted([slot=\"stucked-title\"]){margin:0;font-family:\"IBM Plex Serif\", serif;font-size:var(--app-header-typography-3-size);font-weight:700;letter-spacing:var(--app-header-typography-3-tracking)}::slotted([slot=\"title\"]){line-height:1}::slotted([slot=\"subtitle\"]){margin:var(--space-unit) 0 0;font-family:var(--font-family-sans);font-size:20px;font-style:italic;font-weight:500;line-height:1.2}.heading-container{position:relative;z-index:1;display:flex;max-width:100%;flex-direction:column;align-items:flex-start;justify-content:flex-start;margin-right:auto}.menu-container{display:none;flex-flow:row wrap;align-items:baseline}.menu-container ::slotted([open]){position:relative;z-index:3}.menu-container ::slotted(*:not(:last-of-type)){margin-right:calc(var(--space-unit) * 4.5)}.drawer-trigger{padding:0;border:0;margin:0 calc(var(--space-unit) * 1.5) 0 0;appearance:none;background:none;border-radius:0;color:inherit;cursor:pointer}.drawer-trigger z-icon{--z-icon-width:var(--app-header-drawer-trigger-size);--z-icon-height:var(--app-header-drawer-trigger-size);fill:currentcolor}.drawer-container{position:fixed;z-index:100;top:var(--app-header-top-offset);left:0;width:100%;height:100%;pointer-events:none}.drawer-container .drawer-overlay{position:absolute;z-index:1;top:0;left:0;display:block;width:100%;height:100%;background:var(--gray900);opacity:0;pointer-events:none;transition:opacity 400ms ease-out}.drawer-panel{position:absolute;z-index:2;top:0;left:0;display:flex;width:375px;max-width:100%;height:100%;flex-direction:column;align-items:flex-start;padding:calc(var(--space-unit) * 2) var(--space-unit);background:var(--color-white);color:var(--gray800);pointer-events:none;transform:translate3d(-100%, 0, 0);transition:transform 400ms ease-out}.drawer-content{display:flex;overflow:auto;width:100%;flex:1 auto;flex-direction:column;padding:calc(var(--space-unit) * 0.5) var(--space-unit)}.drawer-content::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.drawer-content::-webkit-scrollbar-track{background-color:transparent}.drawer-content::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.drawer-content::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.drawer-content ::slotted(z-menu){width:100%}.drawer-content ::slotted(z-menu:not(:last-of-type)){margin-bottom:calc(var(--space-unit) * 2.5)}.drawer-close{--z-icon-width:var(--app-header-drawer-trigger-size);--z-icon-height:var(--app-header-drawer-trigger-size);padding:0;border:0;margin:0 0 calc(var(--space-unit) * 2.5) var(--space-unit);appearance:none;background:transparent;border-radius:0;color:inherit;cursor:pointer;fill:currentcolor;font-size:inherit;outline:none}.drawer-close:focus-visible{box-shadow:var(--shadow-focus-primary)}:host([drawer-open]) .drawer-container .drawer-overlay{opacity:0.7;pointer-events:all}:host([drawer-open]) .drawer-container .drawer-panel{pointer-events:all;transform:none}.hero-container{position:absolute;z-index:0;top:0;left:0;width:100%;height:100%}:host([overlay]) .heading-panel .drawer-trigger z-icon,:host([overlay]) .heading-panel .heading-container,:host([overlay]) .heading-panel .menu-container{color:var(--color-white);fill:var(--color-white)}:host([overlay]) .heading-panel .menu-container ::slotted(z-menu:not([open])){--color-surface05:var(--color-white)}:host([overlay]) .hero-container::after{position:absolute;z-index:0;top:0;left:0;width:100%;height:100%;background:var(--color-black);content:\"\";opacity:0.5}.hero-container img,.hero-container ::slotted(*){position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;object-position:top center;-webkit-user-drag:none}@media (min-width: 768px){:host(:not([flow=\"offcanvas\"])) .heading-subtitle{padding-left:0}:host(:not([flow=\"offcanvas\"])) .menu-container{display:flex}:host(:not([flow=\"offcanvas\"])) .heading-container .drawer-trigger{display:none}:host(:not([flow=\"offcanvas\"],[menu-length=\"0\"])) .heading-container:not(:last-child){margin-bottom:calc(var(--space-unit) * 3)}::slotted([slot=\"title\"]){font-size:var(--app-header-typography-6-size);letter-spacing:var(--app-header-typography-6-tracking)}::slotted([slot=\"subtitle\"]){margin-top:calc(var(--space-unit) * 1.5)}}@media (min-width: 1152px){:host(:not([flow=\"stack\"])) .heading-panel{flex-flow:row wrap}::slotted([slot=\"title\"]){margin-right:var(--grid-gutter);font-size:var(--app-header-typography-7-size);letter-spacing:var(--app-header-typography-7-tracking)}:host(:not([flow=\"offcanvas\"],[menu-length=\"0\"])) .heading-container:not(:last-child){margin-bottom:calc(var(--space-unit) * 2)}.menu-container{margin-top:var(--space-unit)}}@media (min-width: 1366px){::slotted([slot=\"title\"]){font-size:var(--app-header-typography-9-size);letter-spacing:var(--app-header-typography-9-tracking)}:host(:not([flow=\"offcanvas\"],[menu-length=\"0\"])) .heading-container:not(:last-child){margin-bottom:0}}@keyframes slide-stuck-heading-in{0%{transform:translate3d(0, -100%, 0)}100%{transform:none}}";
8
-
9
- const SUPPORT_INTERSECTION_OBSERVER = typeof IntersectionObserver !== "undefined";
10
- const ZAppHeader = class {
11
- constructor(hostRef) {
12
- registerInstance(this, hostRef);
13
- this.sticking = createEvent(this, "sticking", 7);
14
- /**
15
- * Stuck mode for the header.
16
- * You can programmatically set it using an IntersectionObserver.
17
- * **Optional**
18
- */
19
- this.stuck = false;
20
- /**
21
- * Should place an overlay over the hero image.
22
- * Useful for legibility purpose.
23
- * **Optional**
24
- */
25
- this.overlay = false;
26
- /**
27
- * Control menu bar position in the header.
28
- * - auto: the menu bar is positioned near the title
29
- * - stack: the menu bar is positioned below the title
30
- * - offcanvas: the menu bar is not displayed and a burger icon appears to open the offcanvas menu
31
- *
32
- * **Optional**
33
- */
34
- this.flow = "auto";
35
- /**
36
- * The opening state of the drawer.
37
- */
38
- this.drawerOpen = false;
39
- /**
40
- * The stuck state of the bar.
41
- */
42
- this._stuck = false;
43
- this.observer = SUPPORT_INTERSECTION_OBSERVER &&
44
- new IntersectionObserver(([entry]) => {
45
- this._stuck = !entry.isIntersecting;
46
- }, {
47
- threshold: 0.5,
48
- });
49
- this.openDrawer = this.openDrawer.bind(this);
50
- this.closeDrawer = this.closeDrawer.bind(this);
51
- this.collectMenuElements.bind(this);
52
- }
53
- emitStickingEvent() {
54
- this.sticking.emit(this._stuck);
55
- }
56
- componentDidLoad() {
57
- this.collectMenuElements();
58
- this.onStuckMode();
59
- }
60
- get title() {
61
- const titleElement = this.hostElement.querySelector('[slot="title"]');
62
- if (titleElement === null) {
63
- return "";
64
- }
65
- return titleElement.textContent.trim();
66
- }
67
- get scrollParent() {
68
- const parent = this.hostElement.offsetParent;
69
- if (parent === document.body || parent === document.documentElement) {
70
- return window;
71
- }
72
- return parent;
73
- }
74
- collectMenuElements() {
75
- const menuElements = (this.menuElements = this.hostElement.querySelectorAll('[slot="menu"]'));
76
- this.menuLength = menuElements.length;
77
- this.setMenuFloatingMode();
78
- }
79
- onStuckMode() {
80
- if (this.stuck) {
81
- this.enableStuckObserver();
82
- }
83
- else {
84
- this.disableStuckMode();
85
- }
86
- }
87
- enableStuckObserver() {
88
- if (this.observer) {
89
- this.observer.observe(this.container);
90
- }
91
- }
92
- disableStuckMode() {
93
- this._stuck = false;
94
- if (this.observer) {
95
- this.observer.unobserve(this.container);
96
- }
97
- }
98
- onStuck() {
99
- const scrollParent = this.scrollParent;
100
- if (!scrollParent) {
101
- return;
102
- }
103
- this.emitStickingEvent();
104
- }
105
- setMenuFloatingMode() {
106
- if (this.menuElements.length === 0) {
107
- return;
108
- }
109
- const elements = this.menuElements;
110
- for (let i = 0, len = elements.length; i < len; i++) {
111
- elements[i].open = false;
112
- elements[i].floating = !this.drawerOpen;
113
- }
114
- }
115
- render() {
116
- return (h(Host, { "menu-length": this.menuLength }, h("div", { class: "heading-panel", ref: (el) => (this.container = el) }, h("div", { class: "hero-container" }, h("slot", { name: "hero" }, this.hero && (h("img", { alt: "", src: this.hero })))), h("div", { class: "heading-container" }, h("div", { class: "heading-title" }, this.menuLength > 0 && (h("button", { class: "drawer-trigger", "aria-label": "Apri menu", onClick: this.openDrawer }, h("z-icon", { name: "burger-menu" }))), h("slot", { name: "title" })), h("div", { class: "heading-subtitle" }, h("slot", { name: "subtitle" }))), h("div", { class: "menu-container" }, !this.drawerOpen && this.flow !== "offcanvas" && (h("slot", { name: "menu", onSlotchange: () => this.collectMenuElements() })))), h("div", { class: "drawer-container" }, h("div", { class: "drawer-overlay", onClick: this.closeDrawer }), h("div", { class: "drawer-panel" }, h("button", { class: "drawer-close", "aria-label": "Chiudi menu", onClick: this.closeDrawer }, h("z-icon", { name: "close" })), h("div", { class: "drawer-content" }, this.drawerOpen && (h("slot", { name: "menu", onSlotchange: () => this.collectMenuElements() }))))), this._stuck && (h("div", { class: "heading-stuck" }, h("div", { class: "heading-stuck-content" }, this.menuLength > 0 && (h("button", { class: "drawer-trigger", "aria-label": "Apri menu", onClick: this.openDrawer }, h("z-icon", { name: "burger-menu" }))), h("div", { class: "heading-title" }, h("slot", { name: "stucked-title" }, this.title)))))));
117
- }
118
- openDrawer() {
119
- this.drawerOpen = true;
120
- }
121
- closeDrawer() {
122
- this.drawerOpen = false;
123
- }
124
- get hostElement() { return getElement(this); }
125
- static get watchers() { return {
126
- "stuck": ["onStuckMode"],
127
- "_stuck": ["onStuck"],
128
- "drawerOpen": ["setMenuFloatingMode"]
129
- }; }
130
- };
131
- ZAppHeader.style = stylesCss$9;
132
-
133
- const ZBody = class {
134
- constructor(hostRef) {
135
- registerInstance(this, hostRef);
136
- /** Font weight variant */
137
- this.variant = "regular";
138
- }
139
- render() {
140
- return (h("z-typography", { tabIndex: 0, component: this.component || "span", level: `b${this.level}`, variant: this.variant }, h("slot", null)));
141
- }
142
- };
143
-
144
- const stylesCss$8 = ".sc-z-divider-h{display:block;padding:0;margin:0}.divider-horizontal.sc-z-divider-h{width:100%}.divider-vertical.sc-z-divider-h{height:100%}.divider-small.divider-horizontal.sc-z-divider-h{height:var(--border-size-small)}.divider-medium.divider-horizontal.sc-z-divider-h{height:var(--border-size-medium)}.divider-large.divider-horizontal.sc-z-divider-h{height:var(--border-size-large)}.divider-small.divider-vertical.sc-z-divider-h{width:var(--border-size-small)}.divider-medium.divider-vertical.sc-z-divider-h{width:var(--border-size-medium)}.divider-large.divider-vertical.sc-z-divider-h{width:var(--border-size-large)}";
145
-
146
- const ZDivider = class {
147
- constructor(hostRef) {
148
- registerInstance(this, hostRef);
149
- /** [optional] Divider size */
150
- this.size = DividerSize.SMALL;
151
- /** [optional] Divider color */
152
- this.color = "gray200";
153
- /** [optional] Divider orintation */
154
- this.orientation = DividerOrientation.HORIZONTAL;
155
- }
156
- render() {
157
- return (h(Host, { class: `divider-${this.size} divider-${this.orientation}`, style: { backgroundColor: `var(--${this.color})` } }));
158
- }
159
- };
160
- ZDivider.style = stylesCss$8;
161
-
162
- const stylesCss$7 = ":host{margin-right:var(--z-icon-right-margin, 0);margin-left:var(--z-icon-left-margin, 0);line-height:0;vertical-align:middle}:host svg:not([width]){width:var(--z-icon-width, 18px)}:host svg:not([height]){height:var(--z-icon-height, 18px)}";
163
-
164
- const ZIcon = class {
165
- constructor(hostRef) {
166
- registerInstance(this, hostRef);
167
- }
168
- selectPathOrPolygon(iconValue) {
169
- if (iconValue === null || iconValue === void 0 ? void 0 : iconValue.startsWith("M")) {
170
- return h("path", { d: ICONS[this.name] });
171
- }
172
- return h("polygon", { points: ICONS[this.name] });
173
- }
174
- render() {
175
- return (h(Host, { "aria-hidden": "true" }, h("svg", { viewBox: "0 0 1000 1000", width: this.width, height: this.height, id: this.iconid, fill: this.fill ? `var(--${this.fill})` : "" }, this.selectPathOrPolygon(ICONS[this.name]))));
176
- }
177
- };
178
- ZIcon.style = stylesCss$7;
179
-
180
- const stylesCss$6 = ".sc-z-input-h{display:inline-block;width:inherit}input.sc-z-input::-ms-clear,input.sc-z-input::-ms-reveal{display:none}.sc-z-input-h input.sc-z-input::-ms-clear,.sc-z-input-h input.sc-z-input::-ms-reveal{display:none}input.sc-z-input,textarea.sc-z-input,.textarea-wrapper.sc-z-input{box-sizing:border-box;border:var(--border-size-small) solid var(--color-surface04);background:var(--color-input-field01);border-radius:var(--border-radius-small);color:var(--color-text01);fill:var(--color-icon02);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg);outline:none}input.sc-z-input:focus:focus-visible,.textarea-wrapper.sc-z-input:focus-within{box-shadow:var(--shadow-focus-primary)}input.sc-z-input:focus:focus-visible,textarea.sc-z-input:focus:focus-visible{color:var(--color-primary02)}.filled.sc-z-input{border-color:var(--color-surface05)}.input-success.sc-z-input{border-color:var(--color-success01);background:var(--color-success-inverse);fill:var(--color-success01)}.input-error.sc-z-input{border-color:var(--color-error01);background:var(--color-error-inverse);fill:var(--color-error01)}.input-warning.sc-z-input{border-color:var(--color-warning01);background:var(--color-warning-inverse);fill:var(--color-warning01)}input.sc-z-input:hover,.textarea-wrapper.sc-z-input:hover{outline:var(--border-size-medium) solid var(--color-surface04);outline-offset:-2px}input[readonly].sc-z-input,.readonly.sc-z-input{border-color:var(--color-disabled01);fill:var(--color-disabled01);pointer-events:none}[disabled].sc-z-input-h:not([disabled=\"false\"]) input.sc-z-input,[disabled].sc-z-input-h:not([disabled=\"false\"]) .textarea-wrapper.sc-z-input,[disabled].sc-z-input-h:not([disabled=\"false\"]) z-icon.sc-z-input{border-color:var(--color-disabled01);box-shadow:none;color:var(--color-disabled02);fill:var(--color-disabled01);pointer-events:none}[disabled].sc-z-input-h:not([disabled=\"false\"]) input.sc-z-input:hover{border-width:var(--border-size-small)}input.sc-z-input::placeholder,textarea.sc-z-input::placeholder{color:var(--color-text05)}.sc-z-input::-webkit-textarea-placeholder{color:var(--color-text05)}.sc-z-input:-ms-textarea-placeholder{color:var(--color-text05)}.sc-z-input::placeholder{color:var(--color-text05)}.sc-z-input:placeholder{color:var(--color-text05)}label.input-label.sc-z-input{display:block;padding-bottom:var(--space-unit);color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-1);font-weight:var(--font-sb);text-align:left;text-transform:uppercase}[disabled].sc-z-input-h:not([disabled=\"false\"]) label.input-label.sc-z-input{color:var(--color-disabled02)}.text-wrapper.sc-z-input>div.sc-z-input{position:relative;z-index:1;fill:var(--color-icon02)}.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{width:100%;height:calc(var(--space-unit) * 5.5);box-sizing:border-box;padding:0 calc(var(--space-unit) * 1.5);margin:0}.text-wrapper.sc-z-input>div.sc-z-input>input.has-icon.sc-z-input,.text-wrapper.sc-z-input>div.sc-z-input>input.has-clear-icon.sc-z-input{padding-right:calc(var(--space-unit) * 5.25)}.text-wrapper.sc-z-input>div.sc-z-input>input.has-icon.has-clear-icon.sc-z-input{padding-right:calc(var(--space-unit) * 8)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input{position:absolute;z-index:2;top:50%;right:calc(var(--space-unit) * 1.5);display:flex;pointer-events:none;transform:translateY(-50%)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input{padding:0;border:0;background:none;color:inherit;font:inherit;pointer-events:initial}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input+button.icon-button.sc-z-input{margin-left:calc(var(--space-unit) * 0.5)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.reset-icon.sc-z-input,.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.toggle-password-icon.sc-z-input{cursor:pointer}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input>z-icon.sc-z-input{--z-icon-width:18px;--z-icon-height:18px;display:block}.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:hover,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:focus,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:active{background:var(--color-white) !important;background-clip:text !important;-webkit-transition-delay:99999s !important}.textarea-wrapper.sc-z-input{padding:calc(var(--space-unit) * 1.5);scrollbar-color:var(--color-primary01) transparent}textarea.sc-z-input::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}textarea.sc-z-input::-webkit-scrollbar-track{background-color:transparent}textarea.sc-z-input::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}textarea.sc-z-input::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}textarea.sc-z-input{width:100%;min-height:132px;padding:0;border:none;margin:0;resize:none}.radio-wrapper.sc-z-input,.checkbox-wrapper.sc-z-input{position:relative;display:inline-flex;flex-direction:row;align-items:center;color:var(--color-text01);fill:var(--color-primary01);font-family:var(--font-family-sans)}.radio-wrapper.sc-z-input:hover,.checkbox-wrapper.sc-z-input:hover{color:var(--color-hover-primary);fill:currentcolor}.radio-wrapper.sc-z-input>input.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input{position:absolute;z-index:-1;opacity:0;pointer-events:none}.radio-wrapper.sc-z-input .radio-label.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{display:inline-flex;align-items:center;margin:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1;text-transform:inherit}.radio-wrapper.sc-z-input input.sc-z-input:not(:disabled)+.radio-label.sc-z-input,.checkbox-wrapper.sc-z-input input.sc-z-input:not(:disabled)+.checkbox-label.sc-z-input{cursor:pointer}.radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{cursor:pointer;fill:inherit}.radio-wrapper.sc-z-input .radio-label.after.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input{flex-direction:row}.radio-wrapper.sc-z-input .radio-label.before.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input{flex-direction:row-reverse}.radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input{margin-left:var(--space-unit)}.radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input{margin-right:var(--space-unit)}.radio-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.radio-label.sc-z-input>z-icon.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.checkbox-label.sc-z-input>z-icon.sc-z-input{border-radius:var(--border-radius-small);box-shadow:var(--shadow-focus-primary)}.radio-wrapper.sc-z-input>input.sc-z-input:disabled+.radio-label.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:disabled+.checkbox-label.sc-z-input{color:var(--color-disabled02)}.radio-wrapper.sc-z-input>input.sc-z-input:disabled+.radio-label.sc-z-input>z-icon.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:disabled+.checkbox-label.sc-z-input>z-icon.sc-z-input{cursor:default;fill:var(--color-disabled01)}";
181
-
182
- const ZInput = class {
183
- constructor(hostRef) {
184
- registerInstance(this, hostRef);
185
- this.inputChange = createEvent(this, "inputChange", 7);
186
- this.startTyping = createEvent(this, "startTyping", 7);
187
- this.stopTyping = createEvent(this, "stopTyping", 7);
188
- this.inputCheck = createEvent(this, "inputCheck", 7);
189
- /** the id of the input element */
190
- this.htmlid = `id-${randomId()}`;
191
- /** the input aria-label */
192
- this.ariaLabel = "";
193
- /** the input is disabled */
194
- this.disabled = false;
195
- /** the input is readonly */
196
- this.readonly = false;
197
- /** the input is required (optional): available for text, password, number, email, textarea, checkbox */
198
- this.required = false;
199
- /** checked: available for checkbox, radio */
200
- this.checked = false;
201
- /** input helper message (optional): available for text, password, number, email, textarea - if set to `false` message won't be displayed */
202
- this.message = true;
203
- /** the input label position: available for checkbox, radio */
204
- this.labelPosition = LabelPosition.RIGHT;
205
- /** render clear icon when typing (optional): available for text */
206
- this.hasclearicon = true;
207
- this.isTyping = false;
208
- this.passwordHidden = true;
209
- this.typingtimeout = 300;
210
- }
211
- inputCheckListener(e) {
212
- const data = e.detail;
213
- switch (this.type) {
214
- case InputType.RADIO:
215
- if (data.type === InputType.RADIO && data.name === this.name && data.id !== this.htmlid) {
216
- this.checked = false;
217
- }
218
- break;
219
- }
220
- }
221
- /** get checked status */
222
- async isChecked() {
223
- switch (this.type) {
224
- case InputType.CHECKBOX:
225
- case InputType.RADIO:
226
- return this.checked;
227
- default:
228
- console.warn("`isChecked` method is only available for type `checkbox` and `radio`");
229
- return false;
230
- }
231
- }
232
- emitInputChange(value) {
233
- if (!this.isTyping) {
234
- this.emitStartTyping();
235
- }
236
- let validity;
237
- if (this.type === InputType.TEXTAREA) {
238
- validity = this.getValidity("textarea");
239
- }
240
- else {
241
- validity = this.getValidity("input");
242
- }
243
- this.value = value;
244
- this.inputChange.emit({ value, validity });
245
- clearTimeout(this.timer);
246
- this.timer = setTimeout(() => {
247
- this.emitStopTyping(this.value, validity);
248
- }, this.typingtimeout);
249
- }
250
- emitStartTyping() {
251
- this.isTyping = true;
252
- this.startTyping.emit();
253
- }
254
- emitStopTyping(value, validity) {
255
- this.isTyping = false;
256
- this.stopTyping.emit({
257
- value: value,
258
- validity: validity,
259
- });
260
- }
261
- emitInputCheck(checked) {
262
- this.inputCheck.emit({
263
- id: this.htmlid,
264
- checked: checked,
265
- type: this.type,
266
- name: this.name,
267
- value: this.value,
268
- validity: this.getValidity("input"),
269
- });
270
- }
271
- getValidity(type) {
272
- const input = this.hostElement.querySelector(type);
273
- return input.validity;
274
- }
275
- /* START text/password/email/number */
276
- getTextAttributes() {
277
- return {
278
- id: this.htmlid,
279
- name: this.name,
280
- placeholder: this.placeholder,
281
- value: this.value,
282
- disabled: this.disabled,
283
- readonly: this.readonly,
284
- required: this.required,
285
- title: this.htmltitle,
286
- class: {
287
- [`input-${this.status}`]: !!this.status,
288
- filled: !!this.value,
289
- },
290
- autocomplete: this.autocomplete,
291
- onInput: (e) => this.emitInputChange(e.target.value),
292
- };
293
- }
294
- getNumberAttributes(type) {
295
- if (type != InputType.NUMBER) {
296
- return;
297
- }
298
- return {
299
- min: this.min,
300
- max: this.max,
301
- step: this.step,
302
- };
303
- }
304
- getPatternAttribute(type) {
305
- if (type != InputType.PASSWORD &&
306
- type != InputType.TEXT &&
307
- type != InputType.TEL &&
308
- type != InputType.SEARCH &&
309
- type != InputType.URL &&
310
- type != InputType.EMAIL) {
311
- return;
312
- }
313
- return {
314
- pattern: this.pattern,
315
- };
316
- }
317
- renderInputText(type = InputType.TEXT) {
318
- const ariaLabel = this.ariaLabel ? { "aria-label": this.ariaLabel } : {};
319
- const attr = Object.assign(Object.assign(Object.assign(Object.assign({}, this.getTextAttributes()), this.getNumberAttributes(type)), this.getPatternAttribute(type)), ariaLabel);
320
- if (this.icon || type === InputType.PASSWORD) {
321
- Object.assign(attr.class, { "has-icon": true });
322
- }
323
- if (this.hasclearicon && type != InputType.NUMBER) {
324
- Object.assign(attr.class, { "has-clear-icon": true });
325
- }
326
- return (h("div", { class: "text-wrapper" }, this.renderLabel(), h("div", null, h("input", Object.assign({ type: type === InputType.PASSWORD && !this.passwordHidden ? InputType.TEXT : type }, attr)), this.renderIcons()), this.renderMessage()));
327
- }
328
- renderLabel() {
329
- if (!this.label) {
330
- return;
331
- }
332
- return (h("label", { class: "input-label body-5-sb", id: `${this.htmlid}_label`, htmlFor: this.htmlid }, this.label));
333
- }
334
- renderIcons() {
335
- return (h("span", { class: "icons-wrapper" }, this.renderResetIcon(), this.renderIcon()));
336
- }
337
- renderIcon() {
338
- if (this.type === InputType.PASSWORD) {
339
- return this.renderShowHidePassword();
340
- }
341
- if (!this.icon) {
342
- return;
343
- }
344
- return (h("button", { type: "button", class: "icon-button input-icon", tabIndex: -1 }, h("z-icon", { name: this.icon })));
345
- }
346
- renderResetIcon() {
347
- if (!this.hasclearicon || !this.value || this.disabled || this.readonly || this.type == InputType.NUMBER) {
348
- return;
349
- }
350
- return (h("button", { type: "button", class: "icon-button reset-icon", "aria-label": "cancella il contenuto dell'input", onClick: () => this.emitInputChange("") }, h("z-icon", { name: "multiply" })));
351
- }
352
- renderShowHidePassword() {
353
- return (h("button", { type: "button", class: "icon-button toggle-password-icon", disabled: this.disabled, "aria-label": this.passwordHidden ? "mostra password" : "nascondi password", onClick: () => (this.passwordHidden = !this.passwordHidden) }, h("z-icon", { name: this.passwordHidden ? "view-filled" : "view-off-filled" })));
354
- }
355
- renderMessage() {
356
- if (boolean(this.message) === false) {
357
- return;
358
- }
359
- return (h("z-input-message", { message: boolean(this.message) === true ? undefined : this.message, status: this.status }));
360
- }
361
- /* END text/password/email/number */
362
- /* START textarea */
363
- renderTextarea() {
364
- const attributes = this.getTextAttributes();
365
- const ariaLabel = this.ariaLabel ? { "aria-label": this.ariaLabel } : {};
366
- return (h("div", { class: "text-wrapper" }, this.renderLabel(), h("div", { class: Object.assign(Object.assign({}, attributes.class), { "textarea-wrapper": true, "readonly": attributes.readonly }) }, h("textarea", Object.assign({}, attributes, ariaLabel))), this.renderMessage()));
367
- }
368
- /* END textarea */
369
- handleCheck(ev) {
370
- this.checked = ev.target.checked;
371
- this.emitInputCheck(this.checked);
372
- }
373
- /* START checkbox */
374
- renderCheckbox() {
375
- return (h("div", { class: "checkbox-wrapper" }, h("input", { id: this.htmlid, type: "checkbox", name: this.name, checked: this.checked, disabled: this.disabled, readonly: this.readonly, required: this.required, onChange: this.handleCheck.bind(this), value: this.value }), h("label", { htmlFor: this.htmlid, class: {
376
- "checkbox-label": true,
377
- "after": this.labelPosition === LabelPosition.RIGHT,
378
- "before": this.labelPosition === LabelPosition.LEFT,
379
- } }, h("z-icon", { name: this.checked ? "checkbox-checked" : "checkbox", "aria-hidden": "true" }), this.label && h("span", { innerHTML: this.label }))));
380
- }
381
- /* END checkbox */
382
- /* START radio */
383
- renderRadio() {
384
- return (h("div", { class: "radio-wrapper" }, h("input", { id: this.htmlid, type: "radio", name: this.name, checked: this.checked, disabled: this.disabled, readonly: this.readonly, onChange: this.handleCheck.bind(this), value: this.value }), h("label", { htmlFor: this.htmlid, class: {
385
- "radio-label": true,
386
- "after": this.labelPosition === LabelPosition.RIGHT,
387
- "before": this.labelPosition === LabelPosition.LEFT,
388
- } }, h("z-icon", { name: this.checked ? "radio-button-checked" : "radio-button", "aria-hidden": "true" }), this.label && h("span", { innerHTML: this.label }))));
389
- }
390
- /* END radio */
391
- render() {
392
- switch (this.type) {
393
- case InputType.TEXTAREA:
394
- return this.renderTextarea();
395
- case InputType.CHECKBOX:
396
- return this.renderCheckbox();
397
- case InputType.RADIO:
398
- return this.renderRadio();
399
- default:
400
- return this.renderInputText(this.type);
401
- }
402
- }
403
- get hostElement() { return getElement(this); }
404
- };
405
- ZInput.style = stylesCss$6;
406
-
407
- const stylesCss$5 = ":host{display:flex;min-height:calc(var(--space-unit) * 2.5);align-items:start;margin-top:var(--space-unit);color:var(--color-text05);fill:currentcolor;font-family:var(--font-family-sans);font-size:var(--font-size-2);letter-spacing:0.16px}:host([status=\"success\"]){color:var(--color-text-success)}:host([status=\"error\"]){color:var(--color-text-error)}:host([status=\"warning\"]){color:var(--color-warning02)}:host(:focus){outline:none}:host>z-icon{--z-icon-width:calc(var(--space-unit) * 2);--z-icon-height:calc(var(--space-unit) * 2);--z-icon-right-margin:var(--space-unit)}";
408
-
409
- const ZInputMessage = class {
410
- constructor(hostRef) {
411
- registerInstance(this, hostRef);
412
- this.statusIcons = {
413
- success: "checkmark-circle",
414
- error: "multiply-circled",
415
- warning: "exclamation-circle",
416
- };
417
- this.statusRole = {};
418
- }
419
- onMessageChange() {
420
- this.statusRole = this.message && this.status ? { role: "alert" } : {};
421
- }
422
- componentWillLoad() {
423
- this.onMessageChange();
424
- }
425
- render() {
426
- return (h(Host, Object.assign({}, this.statusRole, { "aria-label": this.message }), this.statusIcons[this.status] && this.message && h("z-icon", { name: this.statusIcons[this.status] }), h("span", { innerHTML: this.message })));
427
- }
428
- static get watchers() { return {
429
- "message": ["onMessageChange"],
430
- "status": ["onMessageChange"]
431
- }; }
432
- };
433
- ZInputMessage.style = stylesCss$5;
434
-
435
- const stylesCss$4 = ":host{display:flex;flex-direction:column;font-family:var(--font-family-sans);font-weight:var(--font-rg)}";
436
-
437
- const ZList = class {
438
- constructor(hostRef) {
439
- registerInstance(this, hostRef);
440
- /**
441
- * [optional] Sets size of inside elements.
442
- */
443
- this.size = ListSize.MEDIUM;
444
- /**
445
- * [optional] type of the list marker for each element
446
- */
447
- this.listType = ListType.NONE;
448
- }
449
- setChildrenSizeType() {
450
- const children = this.host.children;
451
- for (let i = 0; i < children.length; i++) {
452
- children[i].setAttribute("size", this.size);
453
- children[i].setAttribute("list-type", this.listType);
454
- children[i].setAttribute("list-element-position", (i + 1).toString());
455
- }
456
- }
457
- componentDidLoad() {
458
- this.setChildrenSizeType();
459
- }
460
- render() {
461
- return (h(Host, { role: "list" }, h("slot", null)));
462
- }
463
- get host() { return getElement(this); }
464
- };
465
- ZList.style = stylesCss$4;
466
-
467
- const stylesCss$3 = ":host{outline:none}:host>.container,:host>.container-contextual-menu{--background-color-list-element:var(--bg-white);--background-hover-color-list-element:var(--color-surface02);--background-active-color-list-element:var(--color-surface02);display:flex;box-sizing:border-box;flex-direction:column;justify-content:center;font-family:var(--font-family-sans);font-weight:var(--font-rg);outline:none}:host([size=\"small\"])>.container{min-height:calc(var(--space-unit) * 4);padding:calc(var(--space-unit) / 2) 0}:host([size=\"medium\"])>.container{min-height:calc(var(--space-unit) * 5);padding:var(--space-unit) 0}:host([size=\"large\"])>.container{min-height:calc(var(--space-unit) * 7);padding:calc(var(--space-unit) * 2) 0}:host([size=\"x-large\"])>.container{min-height:calc(var(--space-unit) * 9);padding:calc(var(--space-unit) * 3) 0}:host([expandable])>.container,:host([expandable])>.container-contextual-menu,:host([clickable])>.container,:host([clickable])>.container-contextual-menu{cursor:pointer}:host([expandable]:hover)>.container,:host([expandable]:hover)>.container-contextual-menu,:host([clickable]:hover)>.container,:host([clickable]:hover)>.container-contextual-menu{background-color:var(--background-hover-color-list-element)}:host([expandable]:focus:focus-visible)>.container,:host([expandable]:focus:focus-visible)>.container-contextual-menu,:host([clickable]:focus:focus-visible)>.container,:host([clickable]:focus:focus-visible)>.container-contextual-menu{box-shadow:var(--shadow-focus-primary)}:host([clickable]:not([expandable]))>.container.clicked,:host([clickable]:not([expandable]))>.container-contextual-menu.clicked{box-shadow:var(--shadow-focus-primary)}:host([expandable]:active)>.container,:host([expandable]:active)>.container-contextual-menu,:host([clickable]:active)>.container,:host([clickable]:active)>.container-contextual-menu{background-color:var(--background-active-color-list-element)}:host([align-button=\"left\"][expandable])>.container>.z-list-element-container,:host([align-button=\"left\"][expandable])>.container-contextual-menu>.z-list-element-container{display:flex}:host([align-button=\"right\"][expandable])>.container>.z-list-element-container,:host([align-button=\"right\"][expandable])>.container-contextual-menu>.z-list-element-container{display:flex;flex-direction:row-reverse;justify-content:space-between}:host([align-button=\"left\"][expandable])>.container>.z-list-element-container>z-icon,:host([align-button=\"left\"][expandable])>.container-contextual-menu>.z-list-element-container>z-icon{margin-right:var(--space-unit)}:host([align-button=\"right\"][expandable])>.container>.z-list-element-container>z-icon,:host([align-button=\"right\"][expandable])>.container-contextual-menu>.z-list-element-container>z-icon{margin-left:var(--space-unit)}:host>.container>.z-list-element-inner-container,:host>.container-contextual-menu>.z-list-element-inner-container{display:none}:host>.container>.z-list-element-inner-container.expanded,:host>.container-contextual-menu>.z-list-element-inner-container.expanded{display:block}:host([clickable]:hover)>.container-contextual-menu{background-color:var(--color-surface03)}.container-contextual-menu:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}.z-list-content-container{display:flex;align-items:center}";
468
-
469
- const ZListElement = class {
470
- /**
471
- * Constructor.
472
- */
473
- constructor(hostRef) {
474
- registerInstance(this, hostRef);
475
- this.accessibleFocus = createEvent(this, "accessibleFocus", 7);
476
- this.clickItem = createEvent(this, "clickItem", 7);
477
- /**
478
- * [optional] Align expandable button left or right.
479
- */
480
- this.alignButton = ExpandableListButtonAlign.LEFT;
481
- /**
482
- * [optional] Sets element clickable.
483
- */
484
- this.clickable = false;
485
- /**
486
- * [optional] Sets the divider color.
487
- */
488
- this.dividerColor = "color-surface03";
489
- /**
490
- * [optional] Sets the position where to insert the divider.
491
- */
492
- this.dividerType = ListDividerType.NONE;
493
- /**
494
- * [optional] Sets the divider size.
495
- */
496
- this.dividerSize = DividerSize.SMALL;
497
- /**
498
- * [optional] Sets element as expandable.
499
- */
500
- this.expandable = false;
501
- /**
502
- * [optional] Sets expandable style to element.
503
- */
504
- this.expandableStyle = ExpandableListStyle.ACCORDION;
505
- /**
506
- * [optional] Sets size of inside elements.
507
- */
508
- this.size = ListSize.MEDIUM;
509
- /**
510
- * [optional] Sets text color of the element.
511
- */
512
- this.color = "none";
513
- /**
514
- * [optional] Sets disabled style of the element.
515
- */
516
- this.disabled = false;
517
- /**
518
- * [optional] If is used in ZContextualMenu component
519
- */
520
- this.isContextualMenu = false;
521
- /**
522
- * [optional] position of the list element inside the list or the group
523
- */
524
- this.listElementPosition = "0";
525
- /**
526
- * [optional] type of the list marker for each element
527
- */
528
- this.listType = ListType.NONE;
529
- this.showInnerContent = false;
530
- this.openElementConfig = {
531
- accordion: {
532
- open: "minus-circled",
533
- close: "plus-circled",
534
- },
535
- menu: {
536
- open: "chevron-up",
537
- close: "chevron-down",
538
- },
539
- };
540
- this.handleClick = this.handleClick.bind(this);
541
- this.handleKeyDown = this.handleKeyDown.bind(this);
542
- }
543
- accessibleFocusHandler(e) {
544
- if (this.listElementId === e.detail) {
545
- const toFocus = this.host.shadowRoot.getElementById(`z-list-element-id-${e.detail}`);
546
- toFocus.focus();
547
- }
548
- }
549
- /**
550
- * Handler for click on element. If element is expandable, change state.
551
- * @returns void
552
- */
553
- handleClick() {
554
- this.clickItem.emit(this.listElementId);
555
- if (!this.expandable) {
556
- return;
557
- }
558
- this.showInnerContent = !this.showInnerContent;
559
- }
560
- calculateClass() {
561
- if (this.isContextualMenu) {
562
- return "container-contextual-menu";
563
- }
564
- return "container";
565
- }
566
- handleKeyDown(event) {
567
- const expandByKey = event.code === KeyboardCode.ENTER;
568
- switch (event.code) {
569
- case KeyboardCode.ARROW_DOWN:
570
- event.preventDefault();
571
- this.accessibleFocus.emit(this.listElementId + 1);
572
- break;
573
- case KeyboardCode.ARROW_UP:
574
- event.preventDefault();
575
- this.accessibleFocus.emit(this.listElementId - 1);
576
- break;
577
- case KeyboardCode.ENTER:
578
- event.preventDefault();
579
- this.clickItem.emit(this.listElementId);
580
- break;
581
- }
582
- if (!this.expandable || !expandByKey) {
583
- return;
584
- }
585
- this.showInnerContent = !this.showInnerContent;
586
- }
587
- /**
588
- * Renders button to expand element.
589
- * @returns expadable button
590
- */
591
- renderExpandableButton() {
592
- if (!this.expandable) {
593
- return null;
594
- }
595
- return (h("z-icon", { name: this.showInnerContent
596
- ? this.openElementConfig[this.expandableStyle].open
597
- : this.openElementConfig[this.expandableStyle].close }));
598
- }
599
- /**
600
- * Renders expanded content if element is expandable.
601
- * @returns expanded content
602
- */
603
- renderExpandedContent() {
604
- if (!this.expandable) {
605
- return null;
606
- }
607
- return (h("div", { class: {
608
- "z-list-element-inner-container": true,
609
- "expanded": this.showInnerContent,
610
- } }, h("slot", { name: "inner-content" })));
611
- }
612
- /**
613
- * Renders content of the z-list-element
614
- * @returns list content
615
- */
616
- renderContent() {
617
- if (this.listType === ListType.NONE) {
618
- return h("slot", null);
619
- }
620
- if (this.listType === ListType.ORDERED) {
621
- return (h("div", { class: "z-list-content-container" }, h("div", null, this.listElementPosition, ".\u2003"), h("slot", null)));
622
- }
623
- if (this.listType === ListType.UNORDERED) {
624
- return (h("div", { class: "z-list-content-container" }, h("span", null, "\u2022\u2003"), h("slot", null)));
625
- }
626
- }
627
- render() {
628
- return (h(Host, { role: "listitem", "aria-expanded": this.expandable ? this.showInnerContent : null, onClick: this.handleClick, onKeyDown: this.handleKeyDown, clickable: this.clickable && !this.disabled, tabIndex: !this.isContextualMenu ? "0" : null }, h("div", { class: `${this.calculateClass()}`, style: { color: `var(--${this.color})` }, tabindex: this.isContextualMenu ? "0" : "-1", id: `z-list-element-id-${this.listElementId}` }, h("div", { class: "z-list-element-container" }, this.renderExpandableButton(), this.renderContent()), this.renderExpandedContent()), this.dividerType === ListDividerType.ELEMENT && (h("z-divider", { color: this.dividerColor, size: this.dividerSize }))));
629
- }
630
- get host() { return getElement(this); }
631
- };
632
- ZListElement.style = stylesCss$3;
633
-
634
- const stylesCss$2 = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.z-list-group-header-container{color:var(--gray700);font-size:var(--font-size-2);font-weight:var(--font-sb) !important;letter-spacing:0.16px;line-height:1.4}:host>.z-list-group-header-container.has-header{padding-top:var(--space-unit);padding-bottom:var(--space-unit)}:host>.z-list-group-header-container.has-header>z-divider{margin-top:var(--space-unit)}";
635
-
636
- const ZListGroup = class {
637
- constructor(hostRef) {
638
- registerInstance(this, hostRef);
639
- /**
640
- * [optional] Sets size of inside elements.
641
- */
642
- this.size = ListSize.MEDIUM;
643
- /**
644
- * [optional] Sets the position where to insert the divider.
645
- */
646
- this.dividerType = ListDividerType.NONE;
647
- /**
648
- * [optional] Sets the divider size.
649
- */
650
- this.dividerSize = DividerSize.SMALL;
651
- /**
652
- * [optional] Sets the divider color.
653
- */
654
- this.dividerColor = "gray200";
655
- /**
656
- * [optional] type of the list marker for each element
657
- */
658
- this.listType = ListType.NONE;
659
- }
660
- componentDidLoad() {
661
- const children = this.host.children;
662
- for (let i = 0; i < children.length; i++) {
663
- if (children.length - 1 > i) {
664
- children[i].setAttribute("divider-type", this.dividerType);
665
- children[i].setAttribute("divider-size", this.dividerSize);
666
- children[i].setAttribute("divider-color", this.dividerColor);
667
- }
668
- children[i].setAttribute("size", this.size);
669
- children[i].setAttribute("list-type", this.listType);
670
- children[i].setAttribute("list-element-position", i.toString());
671
- }
672
- }
673
- componentWillLoad() {
674
- this.hasHeader = !!this.host.querySelector('[slot="header-title"]');
675
- }
676
- render() {
677
- return (h(Host, { role: "group" }, h("div", { class: {
678
- "z-list-group-header-container": true,
679
- "has-header": this.hasHeader,
680
- } }, h("slot", { name: "header-title" }), this.dividerType === ListDividerType.HEADER && (h("z-divider", { color: this.dividerColor, size: this.dividerSize }))), h("slot", null)));
681
- }
682
- get host() { return getElement(this); }
683
- };
684
- ZListGroup.style = stylesCss$2;
685
-
686
- const stylesCss$1 = ".sc-z-select-h{display:inline-block;width:inherit;color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg)}.select-wrapper.sc-z-select>z-input.sc-z-select{width:100%}.select-wrapper.sc-z-select>div.sc-z-select{position:relative}.select-wrapper.sc-z-select>div.closed.sc-z-select{overflow:hidden;height:0}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select{position:absolute;width:100%;box-sizing:border-box;padding:calc(var(--space-unit) * 0.5) var(--space-unit);border:var(--border-size-small) solid var(--gray200);border-top:none;background:var(--color-surface01);outline:none}.select-wrapper.sc-z-select .closed.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:10}.select-wrapper.sc-z-select .open.sc-z-select .ul-scroll-wrapper.sc-z-select{z-index:20}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select{position:relative;overflow:auto;max-height:240px;padding:calc(var(--space-unit) * 0.5);outline:none;scrollbar-color:var(--color-primary01) transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-track{background-color:transparent}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select>z-list.sc-z-select::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-content.sc-z-select{display:block;padding:0 calc(var(--space-unit) * 1.5)}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select z-list.sc-z-select z-list-element.sc-z-select .list-element-content.selected.sc-z-select{font-weight:bold}.select-wrapper.sc-z-select .ul-scroll-wrapper.sc-z-select .no-results.sc-z-select z-icon.sc-z-select{margin-right:var(--space-unit)}.z-list-group-title.sc-z-select{color:var(--gray800)}.reset-item.sc-z-select{color:var(--color-primary01);fill:var(--color-primary01)}.reset-item-content.sc-z-select{display:flex;align-items:center}.reset-item.reset-item-margin.sc-z-select .reset-item-content.sc-z-select{margin-left:calc(var(--space-unit))}.reset-item.sc-z-select .reset-item-content.sc-z-select>z-icon.sc-z-select{margin-right:var(--space-unit)}.reset-item.hide.sc-z-select{display:none}";
687
-
688
- const ZSelect = class {
689
- constructor(hostRef) {
690
- registerInstance(this, hostRef);
691
- this.optionSelect = createEvent(this, "optionSelect", 7);
692
- this.resetSelect = createEvent(this, "resetSelect", 7);
693
- /** the id of the input element */
694
- this.htmlid = `id-${randomId()}`;
695
- /** the input aria-label */
696
- this.ariaLabel = "";
697
- /** the input is disabled */
698
- this.disabled = false;
699
- /** the input is readonly */
700
- this.readonly = false;
701
- /** input helper message (optional) - if set to `false` message won't be displayed */
702
- this.message = true;
703
- /** the input has autocomplete option */
704
- this.autocomplete = false;
705
- /** no result text message */
706
- this.noresultslabel = "Nessun risultato";
707
- this.isOpen = false;
708
- this.selectedItem = null;
709
- this.itemsList = [];
710
- this.toggleSelectUl = this.toggleSelectUl.bind(this);
711
- this.selectItem = this.selectItem.bind(this);
712
- this.handleSelectFocus = this.handleSelectFocus.bind(this);
713
- }
714
- watchItems() {
715
- this.itemsList = this.getInitialItemsArray();
716
- this.selectedItem = this.itemsList.find((item) => item.selected);
717
- }
718
- /** get the input selected options */
719
- async getSelectedItem() {
720
- return this.selectedItem;
721
- }
722
- /** get the input value */
723
- async getValue() {
724
- return this.getSelectedValue();
725
- }
726
- /** set the input value */
727
- async setValue(value) {
728
- let values = [];
729
- if (typeof value === "string") {
730
- values.push(value);
731
- }
732
- else {
733
- values = value;
734
- }
735
- this.selectedItem = this.itemsList.find((item) => values.includes(item.id));
736
- }
737
- emitOptionSelect() {
738
- this.optionSelect.emit({
739
- id: this.htmlid,
740
- selected: this.getSelectedValue(),
741
- });
742
- }
743
- emitResetSelect() {
744
- this.resetSelect.emit({
745
- id: this.htmlid,
746
- });
747
- }
748
- componentWillLoad() {
749
- this.watchItems();
750
- }
751
- componentWillRender() {
752
- this.filterItems(this.searchString);
753
- }
754
- getInitialItemsArray() {
755
- return typeof this.items === "string" ? JSON.parse(this.items) : this.items;
756
- }
757
- mapSelectedItemToItemsArray() {
758
- const initialItemsList = this.getInitialItemsArray();
759
- return initialItemsList.map((item) => {
760
- var _a;
761
- item.selected = item.id === ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id);
762
- return item;
763
- });
764
- }
765
- getSelectedValue() {
766
- var _a;
767
- return (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id;
768
- }
769
- filterItems(searchString) {
770
- const prevList = this.mapSelectedItemToItemsArray();
771
- if (!(searchString === null || searchString === void 0 ? void 0 : searchString.length)) {
772
- this.itemsList = prevList;
773
- }
774
- else {
775
- this.itemsList = prevList
776
- .filter((item) => {
777
- return item.name.toUpperCase().includes(searchString.toUpperCase());
778
- })
779
- .map((item) => {
780
- const start = item.name.toUpperCase().indexOf(searchString.toUpperCase());
781
- const end = start + searchString.length;
782
- const newName = item.name.substring(0, start) +
783
- `<strong>${item.name.substring(start, end)}</strong>` +
784
- item.name.substring(end, item.name.length);
785
- item.name = newName;
786
- return item;
787
- });
788
- }
789
- }
790
- hasAutocomplete() {
791
- return boolean(this.autocomplete) === true;
792
- }
793
- handleInputChange(e) {
794
- this.searchString = e.detail.value;
795
- if (!this.isOpen) {
796
- this.toggleSelectUl();
797
- }
798
- }
799
- selectItem(item, selected) {
800
- if (item && item.disabled) {
801
- return;
802
- }
803
- this.itemsList = this.mapSelectedItemToItemsArray();
804
- this.itemsList = this.itemsList.map((i) => {
805
- i.selected = false;
806
- if (i.id === (item === null || item === void 0 ? void 0 : item.id)) {
807
- i.selected = selected;
808
- }
809
- return i;
810
- });
811
- this.selectedItem = this.itemsList.find((item) => item.selected);
812
- this.emitOptionSelect();
813
- if (this.searchString) {
814
- this.searchString = null;
815
- }
816
- }
817
- arrowsSelectNav(e, key) {
818
- const showResetIcon = this.resetItem && !!this.selectedItem;
819
- const arrows = [KeyboardCode.ARROW_DOWN, KeyboardCode.ARROW_UP];
820
- if (!arrows.includes(e.key)) {
821
- return;
822
- }
823
- e.preventDefault();
824
- e.stopPropagation();
825
- if (!this.isOpen) {
826
- this.toggleSelectUl();
827
- }
828
- let index;
829
- if (this.resetItem) {
830
- if (e.key === KeyboardCode.ARROW_DOWN) {
831
- index = key + 1 === this.itemsList.length + 1 ? +!showResetIcon : key + 1;
832
- }
833
- else if (e.key === KeyboardCode.ARROW_UP) {
834
- index = key <= +!showResetIcon ? this.itemsList.length : key - 1;
835
- }
836
- }
837
- if (!this.resetItem) {
838
- if (e.key === KeyboardCode.ARROW_DOWN) {
839
- index = key + 1 === this.itemsList.length ? 0 : key + 1;
840
- }
841
- else if (e.key === KeyboardCode.ARROW_UP) {
842
- index = key <= 0 ? this.itemsList.length - 1 : key - 1;
843
- }
844
- }
845
- this.focusSelectItem(index);
846
- }
847
- focusSelectItem(index) {
848
- const focusElem = this.element.querySelector(`#${this.htmlid}_${index}`);
849
- if (focusElem) {
850
- focusElem.focus();
851
- }
852
- }
853
- toggleSelectUl(selfFocusOnClose = false) {
854
- if (this.disabled || this.readonly) {
855
- return;
856
- }
857
- if (!this.isOpen) {
858
- document.addEventListener("click", this.handleSelectFocus);
859
- document.addEventListener("keyup", this.handleSelectFocus);
860
- }
861
- else {
862
- document.removeEventListener("click", this.handleSelectFocus);
863
- document.removeEventListener("keyup", this.handleSelectFocus);
864
- if (selfFocusOnClose) {
865
- this.element.querySelector(`#${this.htmlid}_input`).focus();
866
- }
867
- }
868
- this.isOpen = !this.isOpen;
869
- }
870
- handleInputClick(e) {
871
- const cp = e.composedPath();
872
- const clearIcon = cp.find((item) => item.classList && item.classList.contains("reset-icon"));
873
- if (clearIcon) {
874
- e.stopPropagation();
875
- return;
876
- }
877
- this.toggleSelectUl();
878
- }
879
- handleSelectFocus(e) {
880
- if (e instanceof KeyboardEvent && e.key === KeyboardCode.ESC) {
881
- e.stopPropagation();
882
- return this.toggleSelectUl(true);
883
- }
884
- if (e instanceof KeyboardEvent && e.key !== KeyboardCode.TAB && e.key !== KeyboardCode.ENTER) {
885
- return;
886
- }
887
- const tree = getElementTree(getClickedElement());
888
- const parent = tree.find((elem) => {
889
- return elem.nodeName.toLowerCase() === "z-input" && elem.id === `${this.htmlid}_input`;
890
- });
891
- if (!parent) {
892
- this.toggleSelectUl(e instanceof MouseEvent ? true : false);
893
- }
894
- }
895
- scrollToLetter(letter) {
896
- const foundItem = this.itemsList.find((item) => item.name.charAt(0) === letter);
897
- if (foundItem) {
898
- this.focusSelectItem(this.itemsList.indexOf(foundItem));
899
- }
900
- }
901
- renderInput() {
902
- return (h("z-input", { id: `${this.htmlid}_input`, htmlid: `${this.htmlid}_input`, placeholder: this.placeholder, value: !this.isOpen && this.selectedItem ? this.selectedItem.name.replace(/<[^>]+>/g, "") : null, label: this.label, "aria-label": this.ariaLabel, icon: this.isOpen ? "caret-up" : "caret-down", hasclearicon: this.hasAutocomplete(), message: false, disabled: this.disabled, readonly: this.readonly || (!this.hasAutocomplete() && this.isOpen), status: this.isOpen ? undefined : this.status, autocomplete: "off", onClick: (e) => {
903
- this.handleInputClick(e);
904
- }, onKeyUp: (e) => {
905
- if (e.keyCode !== 13) {
906
- e.preventDefault();
907
- }
908
- handleKeyboardSubmit(e, this.toggleSelectUl);
909
- }, onKeyDown: (e) => {
910
- return this.arrowsSelectNav(e, this.selectedItem ? this.itemsList.indexOf(this.selectedItem) : this.resetItem ? 0 : -1);
911
- }, onInputChange: (e) => {
912
- this.handleInputChange(e);
913
- }, onKeyPress: (e) => {
914
- if (!this.hasAutocomplete()) {
915
- e.preventDefault();
916
- this.scrollToLetter(String.fromCharCode(e.keyCode));
917
- }
918
- } }));
919
- }
920
- renderSelectUl() {
921
- var _a;
922
- return (h("div", { class: this.isOpen ? "open" : "closed", tabindex: "-1" }, h("div", { class: "ul-scroll-wrapper", tabindex: "-1" }, h("z-list", { role: "listbox", tabindex: this.disabled || this.readonly || !this.isOpen ? -1 : 0, id: this.htmlid, "aria-activedescendant": (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id, "aria-multiselectable": false, class: {
923
- disabled: this.disabled,
924
- readonly: this.readonly,
925
- filled: !!this.selectedItem,
926
- [`input-${this.status}`]: !this.isOpen && !!this.status,
927
- } }, this.resetItem && this.renderResetItem(), this.renderSelectUlItems()))));
928
- }
929
- renderResetItem() {
930
- return (h("z-list-element", { class: {
931
- "hide": !this.selectedItem || !this.resetItem,
932
- "reset-item": true,
933
- "reset-item-margin": !this.hasGroupItems,
934
- }, clickable: true, disabled: false, dividerType: ListDividerType.ELEMENT, role: "option", tabindex: "0", "aria-selected": "false", id: `${this.htmlid}_${this.resetItem ? "0" : "none"}`, onClickItem: () => {
935
- this.selectedItem = null;
936
- this.searchString = null;
937
- this.emitResetSelect();
938
- }, onKeyDown: (e) => this.arrowsSelectNav(e, 0) }, h("div", { class: "reset-item-content" }, h("z-icon", { name: "multiply-circled" }), h("span", null, this.resetItem))));
939
- }
940
- renderItem(item, key, lastItem) {
941
- return (h("z-list-element", { clickable: !item.disabled, disabled: item.disabled, dividerType: lastItem ? ListDividerType.HEADER : ListDividerType.ELEMENT, role: "option", tabindex: item.disabled || !this.isOpen ? -1 : 0, "aria-selected": !!item.selected, id: `${this.htmlid}_${key}`, onClickItem: () => this.selectItem(item, true), onKeyDown: (e) => this.arrowsSelectNav(e, key) }, h("span", { class: {
942
- "selected": !!item.selected,
943
- "list-element-content": true,
944
- }, innerHTML: item.name })));
945
- }
946
- renderSelectUlItems() {
947
- if (!this.itemsList.length) {
948
- return this.renderNoSearchResults();
949
- }
950
- if (this.hasGroupItems) {
951
- return this.renderSelectGroupItems();
952
- }
953
- return this.itemsList.map((item, key, array) => {
954
- const lastItem = array.length === key + 1;
955
- const itemKey = this.resetItem ? key + 1 : key;
956
- return this.renderItem(item, itemKey, lastItem);
957
- });
958
- }
959
- renderSelectGroupItems() {
960
- const newData = this.itemsList.reduce((group, item, index, array) => {
961
- var _a;
962
- const { category } = item;
963
- const lastItem = array.length === index + 1;
964
- const itemKey = this.resetItem ? index + 1 : index;
965
- const zListItem = this.renderItem(item, itemKey, lastItem);
966
- group[category] = (_a = group[category]) !== null && _a !== void 0 ? _a : [];
967
- group[category].push(zListItem);
968
- return group;
969
- }, {});
970
- return Object.entries(newData).map(([key, value]) => {
971
- return (h("z-list-group", { "divider-type": ListDividerType.ELEMENT }, h("z-body", { class: "z-list-group-title", level: 3, slot: "header-title", variant: "semibold" }, key), value.map((item) => item)));
972
- });
973
- }
974
- renderNoSearchResults() {
975
- return (h("z-list-element", { color: "blue500", class: "no-results" }, h("z-icon", { name: "multiply-circle", fill: "blue500" }), this.noresultslabel));
976
- }
977
- renderMessage() {
978
- if (boolean(this.message) === false) {
979
- return;
980
- }
981
- return (h("z-input-message", { message: boolean(this.message) === true ? undefined : this.message, status: this.status }));
982
- }
983
- render() {
984
- return (h("div", { class: "select-wrapper" }, this.renderInput(), this.renderSelectUl(), this.renderMessage()));
985
- }
986
- get element() { return getElement(this); }
987
- static get watchers() { return {
988
- "items": ["watchItems"]
989
- }; }
990
- };
991
- ZSelect.style = stylesCss$1;
992
-
993
- const stylesCss = ":host>*{margin:0;font-family:var(--dashboard-font)}:host(.regular)>*{font-weight:var(--font-rg)}:host(.semibold)>*{font-weight:600}:host(.light)>*{font-weight:300}:host(.h1)>*{font-size:32px;line-height:40px}:host(.h2)>*{font-size:28px;line-height:36px}:host(.h3)>*{font-size:24px;line-height:32px}:host(.h4)>*{font-size:20px;line-height:28px}:host(.b1)>*{font-size:20px;line-height:28px}:host(.b2)>*{font-size:18px;line-height:28px}:host(.b3)>*{font-size:16px;line-height:24px}:host(.b4)>*{font-size:14px;line-height:20px}:host(.b5)>*{font-size:12px;line-height:16px}:host(:focus-visible){outline:none}";
994
-
995
- const ZTypography = class {
996
- constructor(hostRef) {
997
- registerInstance(this, hostRef);
998
- /** Font weight variant */
999
- this.variant = "regular";
1000
- }
1001
- render() {
1002
- const el = document.createElement(this.component || "span");
1003
- el.innerHTML = `<slot />`;
1004
- this.hostElement.shadowRoot.appendChild(el);
1005
- return (h(Host, { class: {
1006
- [this.level]: Boolean(this.level),
1007
- regular: this.variant === "regular",
1008
- semibold: this.variant === "semibold",
1009
- light: this.variant === "light",
1010
- } }));
1011
- }
1012
- get hostElement() { return getElement(this); }
1013
- };
1014
- ZTypography.style = stylesCss;
1015
-
1016
- export { ZAppHeader as z_app_header, ZBody as z_body, ZDivider as z_divider, ZIcon as z_icon, ZInput as z_input, ZInputMessage as z_input_message, ZList as z_list, ZListElement as z_list_element, ZListGroup as z_list_group, ZSelect as z_select, ZTypography as z_typography };