@zanichelli/albe-web-components 7.3.2 → 7.3.3

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 (121) hide show
  1. package/dist/cjs/index-e3299e0a.js +6 -30
  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-header_11.cjs.entry.js +1052 -0
  5. package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +865 -2
  6. package/dist/cjs/z-menu-section.cjs.entry.js +1 -1
  7. package/dist/cjs/z-menu.cjs.entry.js +1 -1
  8. package/dist/collection/components/inputs/z-searchbar/index.js +6 -17
  9. package/dist/collection/components/inputs/z-searchbar/styles.css +46 -95
  10. package/dist/collection/components/modal/z-modal/index.js +8 -1
  11. package/dist/collection/components/modal/z-modal/styles.css +13 -0
  12. package/dist/collection/components/navigation/z-app-header/index.js +171 -47
  13. package/dist/collection/components/navigation/z-app-header/index.stories.js +393 -0
  14. package/dist/collection/components/navigation/z-app-header/styles.css +167 -166
  15. package/dist/collection/components/navigation/z-menu/index.js +1 -0
  16. package/dist/collection/components/navigation/z-menu/styles.css +7 -7
  17. package/dist/collection/components/navigation/z-menu-section/styles.css +8 -9
  18. package/dist/collection/components/z-offcanvas/index.js +34 -50
  19. package/dist/esm/index-a2ca4b97.js +6 -30
  20. package/dist/esm/index.js +1 -1
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/esm/{utils-970ac457.js → utils-a52a81ba.js} +1 -1
  23. package/dist/esm/web-components-library.js +1 -1
  24. package/dist/esm/z-app-header_11.entry.js +1038 -0
  25. package/dist/esm/z-chip.entry.js +1 -1
  26. package/dist/esm/z-combobox.entry.js +1 -1
  27. package/dist/esm/z-dragdrop-area_2.entry.js +865 -2
  28. package/dist/esm/z-file-upload.entry.js +1 -1
  29. package/dist/esm/z-menu-section.entry.js +1 -1
  30. package/dist/esm/z-menu.entry.js +1 -1
  31. package/dist/esm/z-myz-card-info.entry.js +1 -1
  32. package/dist/esm/z-myz-list-item.entry.js +1 -1
  33. package/dist/esm/z-pocket_3.entry.js +1 -1
  34. package/dist/esm/z-select.entry.js +1 -1
  35. package/dist/esm/z-skip-to-content.entry.js +1 -1
  36. package/dist/esm/z-slideshow.entry.js +1 -1
  37. package/dist/esm/z-table-header.entry.js +1 -1
  38. package/dist/esm/z-toggle-switch.entry.js +1 -1
  39. package/dist/types/components/inputs/z-searchbar/index.d.ts +0 -2
  40. package/dist/types/components/navigation/z-app-header/index.d.ts +49 -17
  41. package/dist/types/components/navigation/z-menu/index.d.ts +1 -0
  42. package/dist/types/components/z-offcanvas/index.d.ts +10 -12
  43. package/dist/types/components.d.ts +41 -13
  44. package/dist/web-components-library/index.esm.js +1 -1
  45. package/dist/web-components-library/{p-1f259ec0.entry.js → p-0bf3a704.entry.js} +1 -1
  46. package/{www/build/p-d982fc4c.entry.js → dist/web-components-library/p-10e036e4.entry.js} +1 -1
  47. package/dist/web-components-library/p-161a4e84.entry.js +1 -0
  48. package/dist/web-components-library/{p-dfc69cc3.js → p-1c6b0e09.js} +1 -1
  49. package/dist/web-components-library/{p-10625725.entry.js → p-1e71778f.entry.js} +1 -1
  50. package/dist/web-components-library/{p-068951a7.entry.js → p-1eaef57d.entry.js} +1 -1
  51. package/dist/web-components-library/p-27441384.entry.js +1 -0
  52. package/dist/web-components-library/{p-779c8d20.entry.js → p-378e3fd3.entry.js} +1 -1
  53. package/dist/web-components-library/{p-e2758870.entry.js → p-5c5a2680.entry.js} +1 -1
  54. package/dist/web-components-library/p-6d377fcb.entry.js +1 -0
  55. package/{www/build/p-191c9901.entry.js → dist/web-components-library/p-84b23d4b.entry.js} +1 -1
  56. package/dist/web-components-library/p-8ff45f5f.entry.js +1 -0
  57. package/dist/web-components-library/p-b36fc3db.entry.js +1 -0
  58. package/dist/web-components-library/{p-bca446ef.entry.js → p-c9bb584c.entry.js} +1 -1
  59. package/dist/web-components-library/{p-59b1f1e9.entry.js → p-d986024a.entry.js} +1 -1
  60. package/dist/web-components-library/p-eefde77a.entry.js +1 -0
  61. package/dist/web-components-library/web-components-library.esm.js +1 -1
  62. package/package.json +3 -2
  63. package/www/build/index.esm.js +1 -1
  64. package/www/build/{p-1f259ec0.entry.js → p-0bf3a704.entry.js} +1 -1
  65. package/{dist/web-components-library/p-d982fc4c.entry.js → www/build/p-10e036e4.entry.js} +1 -1
  66. package/www/build/p-161a4e84.entry.js +1 -0
  67. package/www/build/{p-dfc69cc3.js → p-1c6b0e09.js} +1 -1
  68. package/www/build/{p-10625725.entry.js → p-1e71778f.entry.js} +1 -1
  69. package/www/build/{p-068951a7.entry.js → p-1eaef57d.entry.js} +1 -1
  70. package/www/build/p-27441384.entry.js +1 -0
  71. package/www/build/{p-779c8d20.entry.js → p-378e3fd3.entry.js} +1 -1
  72. package/www/build/{p-e2758870.entry.js → p-5c5a2680.entry.js} +1 -1
  73. package/www/build/p-6d377fcb.entry.js +1 -0
  74. package/www/build/p-70021fac.js +1 -0
  75. package/{dist/web-components-library/p-191c9901.entry.js → www/build/p-84b23d4b.entry.js} +1 -1
  76. package/www/build/p-8ff45f5f.entry.js +1 -0
  77. package/www/build/p-b36fc3db.entry.js +1 -0
  78. package/www/build/{p-bca446ef.entry.js → p-c9bb584c.entry.js} +1 -1
  79. package/www/build/{p-59b1f1e9.entry.js → p-d986024a.entry.js} +1 -1
  80. package/www/build/p-eefde77a.entry.js +1 -0
  81. package/www/build/web-components-library.esm.js +1 -1
  82. package/www/index.html +1 -1
  83. package/dist/cjs/z-app-header_2.cjs.entry.js +0 -152
  84. package/dist/cjs/z-button.cjs.entry.js +0 -43
  85. package/dist/cjs/z-divider.cjs.entry.js +0 -26
  86. package/dist/cjs/z-input_2.cjs.entry.js +0 -273
  87. package/dist/cjs/z-list_3.cjs.entry.js +0 -261
  88. package/dist/cjs/z-offcanvas.cjs.entry.js +0 -57
  89. package/dist/cjs/z-searchbar.cjs.entry.js +0 -248
  90. package/dist/esm/z-app-header_2.entry.js +0 -147
  91. package/dist/esm/z-button.entry.js +0 -39
  92. package/dist/esm/z-divider.entry.js +0 -22
  93. package/dist/esm/z-input_2.entry.js +0 -268
  94. package/dist/esm/z-list_3.entry.js +0 -255
  95. package/dist/esm/z-offcanvas.entry.js +0 -53
  96. package/dist/esm/z-searchbar.entry.js +0 -244
  97. package/dist/web-components-library/p-1570917d.entry.js +0 -1
  98. package/dist/web-components-library/p-157aea3b.entry.js +0 -1
  99. package/dist/web-components-library/p-1c8e7c24.entry.js +0 -1
  100. package/dist/web-components-library/p-20682781.entry.js +0 -1
  101. package/dist/web-components-library/p-3d0f5e36.entry.js +0 -1
  102. package/dist/web-components-library/p-4f266607.entry.js +0 -1
  103. package/dist/web-components-library/p-51c946a5.entry.js +0 -1
  104. package/dist/web-components-library/p-af283478.entry.js +0 -1
  105. package/dist/web-components-library/p-bae1911e.entry.js +0 -1
  106. package/dist/web-components-library/p-d0760bb1.entry.js +0 -1
  107. package/dist/web-components-library/p-deda8776.entry.js +0 -1
  108. package/dist/web-components-library/p-f3a8cc14.entry.js +0 -1
  109. package/www/build/p-1570917d.entry.js +0 -1
  110. package/www/build/p-157aea3b.entry.js +0 -1
  111. package/www/build/p-1c8e7c24.entry.js +0 -1
  112. package/www/build/p-20682781.entry.js +0 -1
  113. package/www/build/p-3d0f5e36.entry.js +0 -1
  114. package/www/build/p-4b0934c2.js +0 -1
  115. package/www/build/p-4f266607.entry.js +0 -1
  116. package/www/build/p-51c946a5.entry.js +0 -1
  117. package/www/build/p-af283478.entry.js +0 -1
  118. package/www/build/p-bae1911e.entry.js +0 -1
  119. package/www/build/p-d0760bb1.entry.js +0 -1
  120. package/www/build/p-deda8776.entry.js +0 -1
  121. package/www/build/p-f3a8cc14.entry.js +0 -1
@@ -1,268 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-a2ca4b97.js';
2
- import { k as LabelPosition, d as ControlSize, I as InputType } from './index-e36ec4a4.js';
3
- import { r as randomId, b as boolean } from './utils-970ac457.js';
4
- import './breakpoints-c386984e.js';
5
-
6
- const stylesCss$1 = ".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}[size=\"small\"].sc-z-input-h input.sc-z-input,[size=\"small\"].sc-z-input-h textarea.sc-z-input,[size=\"small\"].sc-z-input-h .textarea-wrapper.sc-z-input,[size=\"x-small\"].sc-z-input-h input.sc-z-input,[size=\"x-small\"].sc-z-input-h textarea.sc-z-input,[size=\"x-small\"].sc-z-input-h .textarea-wrapper.sc-z-input{font-size:var(--font-size-2)}.cursor-select.sc-z-input-h input.sc-z-input{cursor:pointer}.sc-z-input-h:not(.active-select) 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)}.active-select.sc-z-input-h input.sc-z-input{border:var(--border-size-small) solid var(--blue500)}.cursor-select.sc-z-input-h input.sc-z-input:focus:focus-visible{box-shadow:var(--shadow-focus-primary)}.sc-z-input-h input[readonly].sc-z-input:focus:focus-visible{box-shadow:none}.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}.sc-z-input-h:not(.active-select) 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)}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}[size=\"small\"].sc-z-input-h .text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{height:calc(var(--space-unit) * 4.5)}[size=\"x-small\"].sc-z-input-h .text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{height:calc(var(--space-unit) * 4)}.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 .icons-wrapper.sc-z-input>button.icon-button.sc-z-input>z-icon.small.sc-z-input,.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input>z-icon.x-small.sc-z-input{--z-icon-width:16px;--z-icon-height:16px}.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}[size=\"small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,[size=\"small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{--z-icon-width:16px;--z-icon-height:16px}[size=\"small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input,[size=\"small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{font-size:var(--font-size-2)}[size=\"x-small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,[size=\"x-small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{--z-icon-width:14px;--z-icon-height:14px}[size=\"x-small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input,[size=\"x-small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{font-size:var(--font-size-1)}.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)}[size=\"small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,[size=\"small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input,[size=\"x-small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,[size=\"x-small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input{margin-left:calc(var(--space-unit) * 0.5)}[size=\"small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,[size=\"small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input,[size=\"x-small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,[size=\"x-small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input{margin-right:calc(var(--space-unit) * 0.5)}.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)}";
7
-
8
- const ZInput = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.inputChange = createEvent(this, "inputChange", 7);
12
- this.startTyping = createEvent(this, "startTyping", 7);
13
- this.stopTyping = createEvent(this, "stopTyping", 7);
14
- this.inputCheck = createEvent(this, "inputCheck", 7);
15
- /** the id of the input element */
16
- this.htmlid = `id-${randomId()}`;
17
- /** the input aria-label */
18
- this.ariaLabel = "";
19
- /** the input is disabled */
20
- this.disabled = false;
21
- /** the input is readonly */
22
- this.readonly = false;
23
- /** the input is required (optional): available for text, password, number, email, textarea, checkbox */
24
- this.required = false;
25
- /** checked: available for checkbox, radio */
26
- this.checked = false;
27
- /** input helper message (optional): available for text, password, number, email, textarea - if set to `false` message won't be displayed */
28
- this.message = true;
29
- /** the input label position: available for checkbox, radio */
30
- this.labelPosition = LabelPosition.RIGHT;
31
- /** render clear icon when typing (optional): available for text */
32
- this.hasclearicon = true;
33
- /** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */
34
- this.size = ControlSize.BIG;
35
- this.isTyping = false;
36
- this.passwordHidden = true;
37
- this.typingtimeout = 300;
38
- }
39
- inputCheckListener(e) {
40
- const data = e.detail;
41
- switch (this.type) {
42
- case InputType.RADIO:
43
- if (data.type === InputType.RADIO && data.name === this.name && data.id !== this.htmlid) {
44
- this.checked = false;
45
- }
46
- break;
47
- }
48
- }
49
- /** get checked status */
50
- async isChecked() {
51
- switch (this.type) {
52
- case InputType.CHECKBOX:
53
- case InputType.RADIO:
54
- return this.checked;
55
- default:
56
- console.warn("`isChecked` method is only available for type `checkbox` and `radio`");
57
- return false;
58
- }
59
- }
60
- emitInputChange(value) {
61
- if (!this.isTyping) {
62
- this.emitStartTyping();
63
- }
64
- let validity;
65
- if (this.type === InputType.TEXTAREA) {
66
- validity = this.getValidity("textarea");
67
- }
68
- else {
69
- validity = this.getValidity("input");
70
- }
71
- this.value = value;
72
- this.inputChange.emit({ value, validity });
73
- clearTimeout(this.timer);
74
- this.timer = setTimeout(() => {
75
- this.emitStopTyping(this.value, validity);
76
- }, this.typingtimeout);
77
- }
78
- emitStartTyping() {
79
- this.isTyping = true;
80
- this.startTyping.emit();
81
- }
82
- emitStopTyping(value, validity) {
83
- this.isTyping = false;
84
- this.stopTyping.emit({
85
- value: value,
86
- validity: validity,
87
- });
88
- }
89
- emitInputCheck(checked) {
90
- this.inputCheck.emit({
91
- id: this.htmlid,
92
- checked: checked,
93
- type: this.type,
94
- name: this.name,
95
- value: this.value,
96
- validity: this.getValidity("input"),
97
- });
98
- }
99
- getValidity(type) {
100
- const input = this.hostElement.querySelector(type);
101
- return input.validity;
102
- }
103
- /* START text/password/email/number */
104
- getTextAttributes() {
105
- return {
106
- id: this.htmlid,
107
- name: this.name,
108
- placeholder: this.placeholder,
109
- value: this.value,
110
- disabled: this.disabled,
111
- readonly: this.readonly,
112
- required: this.required,
113
- title: this.htmltitle,
114
- class: {
115
- [`input-${this.status}`]: !!this.status,
116
- filled: !!this.value,
117
- },
118
- autocomplete: this.autocomplete,
119
- onInput: (e) => this.emitInputChange(e.target.value),
120
- };
121
- }
122
- getNumberAttributes(type) {
123
- if (type != InputType.NUMBER) {
124
- return;
125
- }
126
- return {
127
- min: this.min,
128
- max: this.max,
129
- step: this.step,
130
- };
131
- }
132
- getPatternAttribute(type) {
133
- if (type != InputType.PASSWORD &&
134
- type != InputType.TEXT &&
135
- type != InputType.TEL &&
136
- type != InputType.SEARCH &&
137
- type != InputType.URL &&
138
- type != InputType.EMAIL) {
139
- return;
140
- }
141
- return {
142
- pattern: this.pattern,
143
- };
144
- }
145
- renderInputText(type = InputType.TEXT) {
146
- const ariaLabel = this.ariaLabel ? { "aria-label": this.ariaLabel } : {};
147
- const attr = Object.assign(Object.assign(Object.assign(Object.assign({}, this.getTextAttributes()), this.getNumberAttributes(type)), this.getPatternAttribute(type)), ariaLabel);
148
- if (this.icon || type === InputType.PASSWORD) {
149
- Object.assign(attr.class, { "has-icon": true });
150
- }
151
- if (this.hasclearicon && type != InputType.NUMBER) {
152
- Object.assign(attr.class, { "has-clear-icon": true });
153
- }
154
- 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()));
155
- }
156
- renderLabel() {
157
- if (!this.label) {
158
- return;
159
- }
160
- return (h("label", { class: "input-label body-5-sb", id: `${this.htmlid}_label`, htmlFor: this.htmlid }, this.label));
161
- }
162
- renderIcons() {
163
- return (h("span", { class: "icons-wrapper" }, this.renderResetIcon(), this.renderIcon()));
164
- }
165
- renderIcon() {
166
- if (this.type === InputType.PASSWORD) {
167
- return this.renderShowHidePassword();
168
- }
169
- if (!this.icon) {
170
- return;
171
- }
172
- return (h("button", { type: "button", class: "icon-button input-icon", tabIndex: -1 }, h("z-icon", { name: this.icon, class: this.size })));
173
- }
174
- renderResetIcon() {
175
- if (!this.hasclearicon || !this.value || this.disabled || this.readonly || this.type == InputType.NUMBER) {
176
- return;
177
- }
178
- 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", class: this.size })));
179
- }
180
- renderShowHidePassword() {
181
- 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", class: this.size })));
182
- }
183
- renderMessage() {
184
- if (boolean(this.message) === false) {
185
- return;
186
- }
187
- return (h("z-input-message", { message: boolean(this.message) === true ? undefined : this.message, status: this.status, class: this.size }));
188
- }
189
- /* END text/password/email/number */
190
- /* START textarea */
191
- renderTextarea() {
192
- const attributes = this.getTextAttributes();
193
- const ariaLabel = this.ariaLabel ? { "aria-label": this.ariaLabel } : {};
194
- 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()));
195
- }
196
- /* END textarea */
197
- handleCheck(ev) {
198
- this.checked = ev.target.checked;
199
- this.emitInputCheck(this.checked);
200
- }
201
- /* START checkbox */
202
- renderCheckbox() {
203
- 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: {
204
- "checkbox-label": true,
205
- "after": this.labelPosition === LabelPosition.RIGHT,
206
- "before": this.labelPosition === LabelPosition.LEFT,
207
- } }, h("z-icon", { name: this.checked ? "checkbox-checked" : "checkbox", "aria-hidden": "true", class: this.size }), this.label && h("span", { innerHTML: this.label }))));
208
- }
209
- /* END checkbox */
210
- /* START radio */
211
- renderRadio() {
212
- 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: {
213
- "radio-label": true,
214
- "after": this.labelPosition === LabelPosition.RIGHT,
215
- "before": this.labelPosition === LabelPosition.LEFT,
216
- } }, h("z-icon", { name: this.checked ? "radio-button-checked" : "radio-button", "aria-hidden": "true", class: this.size }), this.label && h("span", { innerHTML: this.label }))));
217
- }
218
- /* END radio */
219
- render() {
220
- let input;
221
- switch (this.type) {
222
- case InputType.TEXTAREA:
223
- input = this.renderTextarea();
224
- break;
225
- case InputType.CHECKBOX:
226
- input = this.renderCheckbox();
227
- break;
228
- case InputType.RADIO:
229
- input = this.renderRadio();
230
- break;
231
- default:
232
- input = this.renderInputText(this.type);
233
- }
234
- return h(Host, null, input);
235
- }
236
- get hostElement() { return getElement(this); }
237
- };
238
- ZInput.style = stylesCss$1;
239
-
240
- const stylesCss = ":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(.small),:host(.x-small){margin-top:calc(var(--space-unit) * 0.5);font-size:var(--font-size-1)}: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);margin-top:calc(var(--space-unit) * 0.25)}:host(.small)>z-icon,:host(.x-small)>z-icon{--z-icon-width:14px;--z-icon-height:14px;--z-icon-right-margin:calc(var(--space-unit) * 0.5)}";
241
-
242
- const ZInputMessage = class {
243
- constructor(hostRef) {
244
- registerInstance(this, hostRef);
245
- this.statusIcons = {
246
- success: "checkmark-circle",
247
- error: "multiply-circled",
248
- warning: "exclamation-circle",
249
- };
250
- this.statusRole = {};
251
- }
252
- onMessageChange() {
253
- this.statusRole = this.message && this.status ? { role: "alert" } : {};
254
- }
255
- componentWillLoad() {
256
- this.onMessageChange();
257
- }
258
- render() {
259
- 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 })));
260
- }
261
- static get watchers() { return {
262
- "message": ["onMessageChange"],
263
- "status": ["onMessageChange"]
264
- }; }
265
- };
266
- ZInputMessage.style = stylesCss;
267
-
268
- export { ZInput as z_input, ZInputMessage as z_input_message };
@@ -1,255 +0,0 @@
1
- import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-a2ca4b97.js';
2
- import { h as ListSize, m as ListType, j as ExpandableListButtonAlign, l as ListDividerType, D as DividerSize, E as ExpandableListStyle, f as KeyboardCode } from './index-e36ec4a4.js';
3
-
4
- const stylesCss$2 = ":host{display:flex;flex-direction:column;font-family:var(--font-family-sans);font-weight:var(--font-rg)}";
5
-
6
- const ZList = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- /**
10
- * [optional] Sets size of inside elements.
11
- */
12
- this.size = ListSize.MEDIUM;
13
- /**
14
- * [optional] type of the list marker for each element
15
- */
16
- this.listType = ListType.NONE;
17
- }
18
- setChildrenSizeType() {
19
- const children = this.host.children;
20
- for (let i = 0; i < children.length; i++) {
21
- children[i].setAttribute("size", this.size);
22
- children[i].setAttribute("list-type", this.listType);
23
- children[i].setAttribute("list-element-position", (i + 1).toString());
24
- }
25
- }
26
- componentDidLoad() {
27
- this.setChildrenSizeType();
28
- }
29
- render() {
30
- return (h(Host, { role: "list" }, h("slot", null)));
31
- }
32
- get host() { return getElement(this); }
33
- };
34
- ZList.style = stylesCss$2;
35
-
36
- const stylesCss$1 = ":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}";
37
-
38
- const ZListElement = class {
39
- /**
40
- * Constructor.
41
- */
42
- constructor(hostRef) {
43
- registerInstance(this, hostRef);
44
- this.accessibleFocus = createEvent(this, "accessibleFocus", 7);
45
- this.clickItem = createEvent(this, "clickItem", 7);
46
- /**
47
- * [optional] Align expandable button left or right.
48
- */
49
- this.alignButton = ExpandableListButtonAlign.LEFT;
50
- /**
51
- * [optional] Sets element clickable.
52
- */
53
- this.clickable = false;
54
- /**
55
- * [optional] Sets the divider color.
56
- */
57
- this.dividerColor = "color-surface03";
58
- /**
59
- * [optional] Sets the position where to insert the divider.
60
- */
61
- this.dividerType = ListDividerType.NONE;
62
- /**
63
- * [optional] Sets the divider size.
64
- */
65
- this.dividerSize = DividerSize.SMALL;
66
- /**
67
- * [optional] Sets element as expandable.
68
- */
69
- this.expandable = false;
70
- /**
71
- * [optional] Sets expandable style to element.
72
- */
73
- this.expandableStyle = ExpandableListStyle.ACCORDION;
74
- /**
75
- * [optional] Sets size of inside elements.
76
- */
77
- this.size = ListSize.MEDIUM;
78
- /**
79
- * [optional] Sets text color of the element.
80
- */
81
- this.color = "none";
82
- /**
83
- * [optional] Sets disabled style of the element.
84
- */
85
- this.disabled = false;
86
- /**
87
- * [optional] If is used in ZContextualMenu component
88
- */
89
- this.isContextualMenu = false;
90
- /**
91
- * [optional] position of the list element inside the list or the group
92
- */
93
- this.listElementPosition = "0";
94
- /**
95
- * [optional] type of the list marker for each element
96
- */
97
- this.listType = ListType.NONE;
98
- this.showInnerContent = false;
99
- this.openElementConfig = {
100
- accordion: {
101
- open: "minus-circled",
102
- close: "plus-circled",
103
- },
104
- menu: {
105
- open: "chevron-up",
106
- close: "chevron-down",
107
- },
108
- };
109
- this.handleClick = this.handleClick.bind(this);
110
- this.handleKeyDown = this.handleKeyDown.bind(this);
111
- }
112
- accessibleFocusHandler(e) {
113
- if (this.listElementId === e.detail) {
114
- const toFocus = this.host.shadowRoot.getElementById(`z-list-element-id-${e.detail}`);
115
- toFocus.focus();
116
- }
117
- }
118
- /**
119
- * Handler for click on element. If element is expandable, change state.
120
- * @returns void
121
- */
122
- handleClick() {
123
- this.clickItem.emit(this.listElementId);
124
- if (!this.expandable) {
125
- return;
126
- }
127
- this.showInnerContent = !this.showInnerContent;
128
- }
129
- calculateClass() {
130
- if (this.isContextualMenu) {
131
- return "container-contextual-menu";
132
- }
133
- return "container";
134
- }
135
- handleKeyDown(event) {
136
- const expandByKey = event.code === KeyboardCode.ENTER;
137
- switch (event.code) {
138
- case KeyboardCode.ARROW_DOWN:
139
- event.preventDefault();
140
- this.accessibleFocus.emit(this.listElementId + 1);
141
- break;
142
- case KeyboardCode.ARROW_UP:
143
- event.preventDefault();
144
- this.accessibleFocus.emit(this.listElementId - 1);
145
- break;
146
- case KeyboardCode.ENTER:
147
- event.preventDefault();
148
- this.clickItem.emit(this.listElementId);
149
- break;
150
- }
151
- if (!this.expandable || !expandByKey) {
152
- return;
153
- }
154
- this.showInnerContent = !this.showInnerContent;
155
- }
156
- /**
157
- * Renders button to expand element.
158
- * @returns expadable button
159
- */
160
- renderExpandableButton() {
161
- if (!this.expandable) {
162
- return null;
163
- }
164
- return (h("z-icon", { name: this.showInnerContent
165
- ? this.openElementConfig[this.expandableStyle].open
166
- : this.openElementConfig[this.expandableStyle].close }));
167
- }
168
- /**
169
- * Renders expanded content if element is expandable.
170
- * @returns expanded content
171
- */
172
- renderExpandedContent() {
173
- if (!this.expandable) {
174
- return null;
175
- }
176
- return (h("div", { class: {
177
- "z-list-element-inner-container": true,
178
- "expanded": this.showInnerContent,
179
- } }, h("slot", { name: "inner-content" })));
180
- }
181
- /**
182
- * Renders content of the z-list-element
183
- * @returns list content
184
- */
185
- renderContent() {
186
- if (this.listType === ListType.NONE) {
187
- return h("slot", null);
188
- }
189
- if (this.listType === ListType.ORDERED) {
190
- return (h("div", { class: "z-list-content-container" }, h("div", null, this.listElementPosition, ".\u2003"), h("slot", null)));
191
- }
192
- if (this.listType === ListType.UNORDERED) {
193
- return (h("div", { class: "z-list-content-container" }, h("span", null, "\u2022\u2003"), h("slot", null)));
194
- }
195
- }
196
- render() {
197
- 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}`, part: "list-item-container" }, 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 }))));
198
- }
199
- get host() { return getElement(this); }
200
- };
201
- ZListElement.style = stylesCss$1;
202
-
203
- const stylesCss = ":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)}";
204
-
205
- const ZListGroup = class {
206
- constructor(hostRef) {
207
- registerInstance(this, hostRef);
208
- /**
209
- * [optional] Sets size of inside elements.
210
- */
211
- this.size = ListSize.MEDIUM;
212
- /**
213
- * [optional] Sets the position where to insert the divider.
214
- */
215
- this.dividerType = ListDividerType.NONE;
216
- /**
217
- * [optional] Sets the divider size.
218
- */
219
- this.dividerSize = DividerSize.SMALL;
220
- /**
221
- * [optional] Sets the divider color.
222
- */
223
- this.dividerColor = "gray200";
224
- /**
225
- * [optional] type of the list marker for each element
226
- */
227
- this.listType = ListType.NONE;
228
- }
229
- componentDidLoad() {
230
- const children = this.host.children;
231
- for (let i = 0; i < children.length; i++) {
232
- if (children.length - 1 > i) {
233
- children[i].setAttribute("divider-type", this.dividerType);
234
- children[i].setAttribute("divider-size", this.dividerSize);
235
- children[i].setAttribute("divider-color", this.dividerColor);
236
- }
237
- children[i].setAttribute("size", this.size);
238
- children[i].setAttribute("list-type", this.listType);
239
- children[i].setAttribute("list-element-position", i.toString());
240
- }
241
- }
242
- componentWillLoad() {
243
- this.hasHeader = !!this.host.querySelector('[slot="header-title"]');
244
- }
245
- render() {
246
- return (h(Host, { role: "group" }, h("div", { class: {
247
- "z-list-group-header-container": true,
248
- "has-header": this.hasHeader,
249
- } }, h("slot", { name: "header-title" }), this.dividerType === ListDividerType.HEADER && (h("z-divider", { color: this.dividerColor, size: this.dividerSize }))), h("slot", null)));
250
- }
251
- get host() { return getElement(this); }
252
- };
253
- ZListGroup.style = stylesCss;
254
-
255
- export { ZList as z_list, ZListElement as z_list_element, ZListGroup as z_list_group };
@@ -1,53 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a2ca4b97.js';
2
- import { O as OffCanvasVariant, v as TransitionDirection } from './index-e36ec4a4.js';
3
-
4
- const stylesCss = ".sc-z-offcanvas-h{--z-offcanvas--container-width:375px;--z-offcanvas--top-space:0;min-width:100%;height:100%;font-family:var(--font-family-sans);font-weight:var(--font-rg);visibility:hidden}.canvas-container.sc-z-offcanvas{display:flex;overflow:-moz-scrollbars-none;overflow:hidden;min-width:100%;height:100%;flex-direction:column;background:var(--color-surface01)}[variant=\"pushcontent\"].sc-z-offcanvas-h{display:none}[open].sc-z-offcanvas-h{display:flex;visibility:visible}[variant=\"overlay\"].sc-z-offcanvas-h{position:fixed;z-index:1000;top:var(--z-offcanvas--top-space);right:0;bottom:0;left:0;display:flex;height:calc(100% - var(--z-offcanvas--top-space))}[variant=\"overlay\"][transitiondirection=\"left\"].sc-z-offcanvas-h{justify-content:end}[variant=\"overlay\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{z-index:1010}[variant=\"overlay\"].sc-z-offcanvas-h .canvas-background.sc-z-offcanvas{position:absolute;left:0;width:100%;height:100%;background-color:var(--gray900);opacity:0.7}.canvas-container.sc-z-offcanvas>.canvas-content.sc-z-offcanvas{overflow:auto;flex:1 auto;padding:0 calc(var(--space-unit) * 2);margin:calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) calc(var(--space-unit) * 2) 0;overflow-x:hidden}[variant=\"overlay\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas>.canvas-content.sc-z-offcanvas{padding:0 calc(var(--space-unit) * 2) calc(var(--space-unit) * 2) calc(var(--space-unit) * 2);margin:calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) 0 0}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-track{background-color:transparent}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas{scrollbar-color:var(--color-primary01) transparent}@media only screen and (max-width: 768px){[open][transitiondirection=\"left\"].sc-z-offcanvas-h:not(.skip-animation)>.canvas-container.sc-z-offcanvas{animation:enter-right 0.4s ease-out}[open][transitiondirection=\"right\"].sc-z-offcanvas-h:not(.skip-animation)>.canvas-container.sc-z-offcanvas{animation:enter-left 0.4s ease-out}}@media only screen and (min-width: 768px){.sc-z-offcanvas-h{min-width:auto}.canvas-container.sc-z-offcanvas{width:auto;min-width:max(var(--z-offcanvas--container-width), 375px);max-width:max(var(--z-offcanvas--container-width), 375px);height:auto;min-height:calc(var(--space-unit) * 40)}.sc-z-offcanvas-h:not([variant=\"overlay\"])[open]:not(.skip-animation){width:auto;animation:grow 0.4s ease-out}}@keyframes grow{from{width:0}to{width:max(var(--z-offcanvas--container-width), 375px)}}@keyframes enter-left{from{transform:translateX(-100%)}to{transform:translateX(0)}}@keyframes enter-right{from{transform:translateX(100%)}to{transform:translateX(0)}}[open][variant=\"overlay\"][transitiondirection=\"left\"].sc-z-offcanvas-h:not(.skip-animation)>.canvas-container.sc-z-offcanvas{animation:enter-right 0.4s ease-out}[open][transitiondirection=\"right\"].sc-z-offcanvas-h:not(.skip-animation)>.canvas-container.sc-z-offcanvas{animation:enter-left 0.4s ease-out}.sc-z-offcanvas-h:not([open])[variant=\"overlay\"][transitiondirection=\"right\"]>.canvas-container.sc-z-offcanvas{transform:translateX(-100%);transition:visibility 0.4s ease-out, transform 0.4s ease-out}.sc-z-offcanvas-h:not([open])[variant=\"overlay\"][transitiondirection=\"left\"]>.canvas-container.sc-z-offcanvas{transform:translateX(100%);transition:visibility 0.4s ease-out, transform 0.4s ease-out}.sc-z-offcanvas-h:not([open])[variant=\"overlay\"] .canvas-background.sc-z-offcanvas{transition:visibility 0.4s ease-out;visibility:hidden}";
5
-
6
- const ZOffcanvas = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.canvasOpenStatusChanged = createEvent(this, "canvasOpenStatusChanged", 7);
10
- /**
11
- * Offcanvas variant.
12
- * Can be one of "overlay", "pushcontent"
13
- * Default variant: pushcontent
14
- */
15
- this.variant = OffCanvasVariant.PUSHCONTENT;
16
- /** open component. Default: false */
17
- this.open = false;
18
- /** open content transitioning in a specified direction left | right. Default: left */
19
- this.transitiondirection = TransitionDirection.LEFT;
20
- /** manages the skip for the entry animation*/
21
- this.skipanimationonload = false;
22
- }
23
- /** this method allows you to skip the page loading animation, to be used with the prop set to true */
24
- async setSkipAanimationOnLoad(value) {
25
- this.skipanimationonload = value;
26
- }
27
- onOpenChanged() {
28
- if (!this.open && this.skipanimationonload) {
29
- this.skipanimationonload = false;
30
- }
31
- if (this.open) {
32
- this.handleOverflowProperty();
33
- }
34
- this.canvasOpenStatusChanged.emit(this.open);
35
- }
36
- handleOverflowProperty() {
37
- const overflow = this.variant === OffCanvasVariant.OVERLAY ? "overflow-y" : "overflow-x";
38
- document.body.style[overflow] = this.open ? "hidden" : "";
39
- }
40
- handledTransitionEnd() {
41
- this.handleOverflowProperty();
42
- }
43
- render() {
44
- return (h(Host, { class: { "skip-animation": this.skipanimationonload } }, h("div", { role: "presentation", class: "canvas-container", onTransitionEnd: () => this.handledTransitionEnd() }, h("div", { role: "presentation", class: "canvas-content" }, h("slot", { name: "canvasContent" }))), this.variant == OffCanvasVariant.OVERLAY && (h("div", { class: "canvas-background", "data-action": "canvasBackground", onClick: () => (this.open = false) }))));
45
- }
46
- get hostElement() { return getElement(this); }
47
- static get watchers() { return {
48
- "open": ["onOpenChanged"]
49
- }; }
50
- };
51
- ZOffcanvas.style = stylesCss;
52
-
53
- export { ZOffcanvas as z_offcanvas };