@zanichelli/albe-web-components 18.4.2 → 18.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/cjs/_commonjsHelpers-68cdf74f.js +7 -0
  3. package/dist/cjs/_commonjsHelpers-68cdf74f.js.map +1 -0
  4. package/dist/cjs/index-299de208.js +47 -0
  5. package/dist/cjs/index-299de208.js.map +1 -0
  6. package/dist/cjs/{index-443b084a.js → index-e1eead16.js} +2 -2
  7. package/dist/cjs/index-e1eead16.js.map +1 -0
  8. package/dist/cjs/{index-f67078cb.js → index-fb88ce4a.js} +5 -5
  9. package/dist/cjs/index-fb88ce4a.js.map +1 -0
  10. package/dist/cjs/{utils-021d5bc3.js → utils-eacc6b3a.js} +3 -5
  11. package/dist/cjs/utils-eacc6b3a.js.map +1 -0
  12. package/dist/cjs/z-date-picker.cjs.entry.js +3 -2
  13. package/dist/cjs/z-date-picker.cjs.entry.js.map +1 -1
  14. package/dist/cjs/z-range-picker.cjs.entry.js +2 -1
  15. package/dist/cjs/z-range-picker.cjs.entry.js.map +1 -1
  16. package/dist/cjs/z-table.cjs.entry.js +3 -3
  17. package/dist/cjs/z-td.cjs.entry.js +1 -1
  18. package/dist/cjs/z-th.cjs.entry.js +1 -1
  19. package/dist/cjs/z-toast-notification.cjs.entry.js +1386 -10
  20. package/dist/cjs/z-toast-notification.cjs.entry.js.map +1 -1
  21. package/dist/cjs/z-tr.cjs.entry.js +3 -3
  22. package/dist/collection/components/table/cells/z-td/index.js +1 -1
  23. package/dist/collection/components/table/cells/z-td/index.js.map +1 -1
  24. package/dist/collection/components/table/cells/z-td/styles.css +6 -0
  25. package/dist/collection/components/table/cells/z-th/styles.css +6 -5
  26. package/dist/collection/components/table/z-tr/index.js +1 -1
  27. package/dist/collection/components/table/z-tr/index.js.map +1 -1
  28. package/dist/collection/components/table/z-tr/styles.css +13 -0
  29. package/dist/collection/components/z-toast-notification/index.js +28 -10
  30. package/dist/collection/components/z-toast-notification/index.js.map +1 -1
  31. package/dist/collection/components/z-toast-notification/index.stories.js +10 -2
  32. package/dist/collection/components/z-toast-notification/index.stories.js.map +1 -1
  33. package/dist/components/_commonjsHelpers.js +5 -0
  34. package/dist/components/_commonjsHelpers.js.map +1 -0
  35. package/dist/components/utils2.js +2 -3
  36. package/dist/components/utils2.js.map +1 -1
  37. package/dist/components/z-date-picker.js +2 -1
  38. package/dist/components/z-date-picker.js.map +1 -1
  39. package/dist/components/z-td.js +2 -2
  40. package/dist/components/z-td.js.map +1 -1
  41. package/dist/components/z-th.js +1 -1
  42. package/dist/components/z-th.js.map +1 -1
  43. package/dist/components/z-toast-notification.js +1386 -10
  44. package/dist/components/z-toast-notification.js.map +1 -1
  45. package/dist/components/z-tr.js +2 -2
  46. package/dist/components/z-tr.js.map +1 -1
  47. package/dist/esm/_commonjsHelpers-1c8beb5f.js +5 -0
  48. package/dist/esm/_commonjsHelpers-1c8beb5f.js.map +1 -0
  49. package/dist/esm/{index-be3c8aaa.js → index-28b819c7.js} +5 -5
  50. package/dist/esm/index-28b819c7.js.map +1 -0
  51. package/dist/esm/index-49edcc7b.js +45 -0
  52. package/dist/esm/index-49edcc7b.js.map +1 -0
  53. package/dist/esm/{index-2a26d10b.js → index-bf02a37c.js} +2 -2
  54. package/dist/esm/index-bf02a37c.js.map +1 -0
  55. package/dist/esm/{utils-90416845.js → utils-50e4c211.js} +3 -4
  56. package/dist/esm/utils-50e4c211.js.map +1 -0
  57. package/dist/esm/z-date-picker.entry.js +2 -1
  58. package/dist/esm/z-date-picker.entry.js.map +1 -1
  59. package/dist/esm/z-range-picker.entry.js +2 -1
  60. package/dist/esm/z-range-picker.entry.js.map +1 -1
  61. package/dist/esm/z-table.entry.js +3 -3
  62. package/dist/esm/z-td.entry.js +1 -1
  63. package/dist/esm/z-th.entry.js +1 -1
  64. package/dist/esm/z-toast-notification.entry.js +1386 -10
  65. package/dist/esm/z-toast-notification.entry.js.map +1 -1
  66. package/dist/esm/z-tr.entry.js +3 -3
  67. package/dist/types/components/z-toast-notification/index.stories.d.ts +10 -2
  68. package/dist/web-components-library/p-04f21233.entry.js +2 -0
  69. package/dist/web-components-library/p-4573c419.js +2 -0
  70. package/dist/web-components-library/p-68ac9eba.js +2 -0
  71. package/dist/web-components-library/p-68ac9eba.js.map +1 -0
  72. package/dist/web-components-library/p-76fe2d00.entry.js +2 -0
  73. package/dist/web-components-library/p-97b78a20.js +2 -0
  74. package/dist/web-components-library/p-97b78a20.js.map +1 -0
  75. package/dist/web-components-library/p-a55dce3e.js +2 -0
  76. package/{www/build/p-f670c5ad.js.map → dist/web-components-library/p-a55dce3e.js.map} +1 -1
  77. package/dist/web-components-library/{p-aff88c50.entry.js → p-c2fc251c.entry.js} +3 -3
  78. package/{www/build/p-aff88c50.entry.js.map → dist/web-components-library/p-c2fc251c.entry.js.map} +1 -1
  79. package/dist/web-components-library/p-d9f9d864.entry.js +8 -0
  80. package/dist/web-components-library/p-d9f9d864.entry.js.map +1 -0
  81. package/dist/web-components-library/p-e0cf7f5e.js +2 -0
  82. package/dist/web-components-library/p-e0cf7f5e.js.map +1 -0
  83. package/dist/web-components-library/p-e90d3072.entry.js +2 -0
  84. package/dist/web-components-library/p-f7d3e1cc.entry.js +2 -0
  85. package/dist/web-components-library/{p-fb12af88.entry.js.map → p-f7d3e1cc.entry.js.map} +1 -1
  86. package/dist/web-components-library/p-f97b82aa.entry.js +2 -0
  87. package/dist/web-components-library/web-components-library.esm.js +1 -1
  88. package/package.json +3 -1
  89. package/www/build/p-04f21233.entry.js +2 -0
  90. package/www/build/{p-01619706.js → p-4020f8c5.js} +1 -1
  91. package/www/build/p-4573c419.js +2 -0
  92. package/www/build/p-68ac9eba.js +2 -0
  93. package/www/build/p-68ac9eba.js.map +1 -0
  94. package/www/build/p-76fe2d00.entry.js +2 -0
  95. package/www/build/p-76fe2d00.entry.js.map +1 -0
  96. package/www/build/p-97b78a20.js +2 -0
  97. package/www/build/p-97b78a20.js.map +1 -0
  98. package/www/build/p-a55dce3e.js +2 -0
  99. package/{dist/web-components-library/p-f670c5ad.js.map → www/build/p-a55dce3e.js.map} +1 -1
  100. package/www/build/{p-aff88c50.entry.js → p-c2fc251c.entry.js} +3 -3
  101. package/{dist/web-components-library/p-aff88c50.entry.js.map → www/build/p-c2fc251c.entry.js.map} +1 -1
  102. package/www/build/p-d9f9d864.entry.js +8 -0
  103. package/www/build/p-d9f9d864.entry.js.map +1 -0
  104. package/www/build/p-e0cf7f5e.js +2 -0
  105. package/www/build/p-e0cf7f5e.js.map +1 -0
  106. package/www/build/p-e90d3072.entry.js +2 -0
  107. package/www/build/p-e90d3072.entry.js.map +1 -0
  108. package/www/build/p-f7d3e1cc.entry.js +2 -0
  109. package/www/build/{p-fb12af88.entry.js.map → p-f7d3e1cc.entry.js.map} +1 -1
  110. package/www/build/p-f97b82aa.entry.js +2 -0
  111. package/www/build/web-components-library.esm.js +1 -1
  112. package/www/index.html +1 -1
  113. package/dist/cjs/index-443b084a.js.map +0 -1
  114. package/dist/cjs/index-e98b419e.js +0 -47
  115. package/dist/cjs/index-e98b419e.js.map +0 -1
  116. package/dist/cjs/index-f67078cb.js.map +0 -1
  117. package/dist/cjs/utils-021d5bc3.js.map +0 -1
  118. package/dist/esm/index-2a26d10b.js.map +0 -1
  119. package/dist/esm/index-406138db.js +0 -45
  120. package/dist/esm/index-406138db.js.map +0 -1
  121. package/dist/esm/index-be3c8aaa.js.map +0 -1
  122. package/dist/esm/utils-90416845.js.map +0 -1
  123. package/dist/web-components-library/p-06b31bf5.js +0 -2
  124. package/dist/web-components-library/p-06b31bf5.js.map +0 -1
  125. package/dist/web-components-library/p-36e71b13.js +0 -2
  126. package/dist/web-components-library/p-36e71b13.js.map +0 -1
  127. package/dist/web-components-library/p-37d31461.entry.js +0 -2
  128. package/dist/web-components-library/p-725b253d.entry.js +0 -2
  129. package/dist/web-components-library/p-84635654.js +0 -2
  130. package/dist/web-components-library/p-84635654.js.map +0 -1
  131. package/dist/web-components-library/p-a4e05ee2.entry.js +0 -2
  132. package/dist/web-components-library/p-e91ece0c.entry.js +0 -7
  133. package/dist/web-components-library/p-e91ece0c.entry.js.map +0 -1
  134. package/dist/web-components-library/p-f20f1ed3.entry.js +0 -2
  135. package/dist/web-components-library/p-f670c5ad.js +0 -2
  136. package/dist/web-components-library/p-fb12af88.entry.js +0 -2
  137. package/www/build/p-06b31bf5.js +0 -2
  138. package/www/build/p-06b31bf5.js.map +0 -1
  139. package/www/build/p-36e71b13.js +0 -2
  140. package/www/build/p-36e71b13.js.map +0 -1
  141. package/www/build/p-37d31461.entry.js +0 -2
  142. package/www/build/p-725b253d.entry.js +0 -2
  143. package/www/build/p-84635654.js +0 -2
  144. package/www/build/p-84635654.js.map +0 -1
  145. package/www/build/p-a4e05ee2.entry.js +0 -2
  146. package/www/build/p-e91ece0c.entry.js +0 -7
  147. package/www/build/p-e91ece0c.entry.js.map +0 -1
  148. package/www/build/p-f20f1ed3.entry.js +0 -2
  149. package/www/build/p-f670c5ad.js +0 -2
  150. package/www/build/p-fb12af88.entry.js +0 -2
  151. /package/dist/web-components-library/{p-725b253d.entry.js.map → p-04f21233.entry.js.map} +0 -0
  152. /package/dist/web-components-library/{p-a4e05ee2.entry.js.map → p-4573c419.js.map} +0 -0
  153. /package/dist/web-components-library/{p-f20f1ed3.entry.js.map → p-76fe2d00.entry.js.map} +0 -0
  154. /package/{www/build/p-725b253d.entry.js.map → dist/web-components-library/p-e90d3072.entry.js.map} +0 -0
  155. /package/dist/web-components-library/{p-37d31461.entry.js.map → p-f97b82aa.entry.js.map} +0 -0
  156. /package/www/build/{p-a4e05ee2.entry.js.map → p-04f21233.entry.js.map} +0 -0
  157. /package/www/build/{p-f20f1ed3.entry.js.map → p-4573c419.js.map} +0 -0
  158. /package/www/build/{p-37d31461.entry.js.map → p-f97b82aa.entry.js.map} +0 -0
@@ -4,7 +4,7 @@ import './index2.js';
4
4
  import { d as defineCustomElement$2 } from './index9.js';
5
5
  import './index23.js';
6
6
 
7
- const stylesCss = ":host{--columns:1;display:grid;box-sizing:border-box;grid-auto-flow:column;grid-template-columns:var(--z-table--expand-button-size, 0) repeat(var(--columns), minmax(128px, 1fr))}*{box-sizing:border-box}.z-tr--expand-button-container,::slotted(*){border-bottom:var(--z-table--cells-bottom-border-size, var(--border-size-small)) solid var(--color-surface03)}::slotted(*:not(:last-child)){border-right:var(--z-table--cell-left-border, none)}:host([expandable]){--show-expandable-button:visible;cursor:pointer}:host([expandable]) ::slotted(*){grid-row:1}:host([expandable]) ::slotted(:nth-last-child(2)){border-right:none}:host([expandable]) ::slotted(*:last-child){border-left:0;grid-column:1 / span calc(var(--columns) + 1);grid-row:2}:host([expandable]:not([expanded])) ::slotted(*:last-child){display:none}:host([expanded]){margin-bottom:4px;box-shadow:0 4px 4px -2px var(--shadow-color-base)}:host([expanded]) .z-tr--expand-button-container,:host([expanded]) ::slotted(*){background-color:var(--color-background)}.z-tr--expand-button-container{display:flex;align-items:center;justify-content:center;background-color:var(--z-table--cells-background, var(--color-surface01))}.z-tr--expand-button-container button{display:flex;align-items:center;justify-content:center;padding:0;border:none;margin:auto;appearance:none;background:transparent;cursor:pointer;visibility:var(--show-expandable-button, hidden)}.z-tr--expand-button-container button:focus{box-shadow:var(--shadow-focus-primary);outline:none}.z-tr--expand-button-container button z-icon{--z-icon-width:16px;--z-icon-height:16px}";
7
+ const stylesCss = ":host{--columns:1;display:grid;box-sizing:border-box;grid-auto-flow:column;grid-template-columns:var(--z-table--expand-button-size, 0) repeat(var(--columns), minmax(128px, 1fr))}*{box-sizing:border-box}.z-tr--expand-button-container,::slotted(*){border-bottom:var(--z-table--cells-bottom-border-size, var(--border-size-small)) solid var(--color-surface03)}::slotted(*:not(:last-child)){border-right:var(--z-table--cell-left-border, none)}:host([expandable]){--show-expandable-button:visible;cursor:pointer}:host([expandable]) ::slotted(*){grid-row:1}:host([expandable]) ::slotted(:nth-last-child(2)){border-right:none}:host([expandable]) ::slotted(*:last-child){border-left:0;grid-column:1 / span calc(var(--columns) + 1);grid-row:2}:host([expandable]:not([expanded])) ::slotted(*:last-child){display:none}:host([expanded]){margin-bottom:4px;box-shadow:0 4px 4px -2px var(--shadow-color-base)}:host([expanded]) .z-tr--expand-button-container,:host([expanded]) ::slotted(*){background-color:var(--color-background)}:host(:focus){position:relative;z-index:20;box-shadow:var(--shadow-focus-primary);outline:none}:host(:hover){position:relative;z-index:10;box-shadow:0 4px 4px -2px var(--shadow-color-base, rgb(0 0 0 / 20%))}.z-tr--expand-button-container{display:flex;align-items:center;justify-content:center;background-color:var(--z-table--cells-background, var(--color-surface01))}.z-tr--expand-button-container button{display:flex;align-items:center;justify-content:center;padding:0;border:none;margin:auto;appearance:none;background:transparent;cursor:pointer;visibility:var(--show-expandable-button, hidden)}.z-tr--expand-button-container button:focus{box-shadow:var(--shadow-focus-primary);outline:none}.z-tr--expand-button-container button z-icon{--z-icon-width:16px;--z-icon-height:16px}";
8
8
  const ZTrStyle0 = stylesCss;
9
9
 
10
10
  const ZTr$1 = /*@__PURE__*/ proxyCustomElement(class ZTr extends HTMLElement {
@@ -46,7 +46,7 @@ const ZTr$1 = /*@__PURE__*/ proxyCustomElement(class ZTr extends HTMLElement {
46
46
  this.updateColumns();
47
47
  }
48
48
  render() {
49
- return (h(Host, { key: 'c7aef75dce7ad486aa08145e3df1a9a4fbc0a086', role: "row", onClick: this.onRowClick.bind(this), expanded: this.expanded }, h("div", { key: '474efb8147efb3045b2d671081674330209674ae', class: "z-tr--expand-button-container" }, this.expandable && (h("button", { key: 'd4f77c52514979ee1e52483d1031d222f8b60dfd', "aria-expanded": this.expanded ? "true" : "false", "aria-label": this.expanded ? "Comprimi riga" : "Espandi riga", "aria-controls": this.expandableContentId, type: "button" }, h("z-icon", { key: 'a488e44b2b9119f2b96aeb42c2880f16650685a6', name: this.expanded ? "minus-circled" : "plus-circled" })))), h("slot", { key: '03ec3ec33b29e7ec504282289fa0daf8990deef5', onSlotchange: this.updateColumns.bind(this) })));
49
+ return (h(Host, { key: '6b028d12da65adf37eb6637ddf9bfd06d9f0db24', role: "row", tabIndex: 0, expanded: this.expanded, onClick: this.onRowClick.bind(this) }, h("div", { key: '598c2865ff6df8c8b6335e08a559407c6074bc6a', class: "z-tr--expand-button-container" }, this.expandable && (h("button", { key: 'b6b1ec7c8817f0a2494b509f536d640d54012620', "aria-expanded": this.expanded ? "true" : "false", "aria-label": this.expanded ? "Comprimi riga" : "Espandi riga", "aria-controls": this.expandableContentId, type: "button" }, h("z-icon", { key: 'ed1dee7ce70dfee25497d7ba33ce3655217f6d0f', name: this.expanded ? "minus-circled" : "plus-circled" })))), h("slot", { key: '13d5eea11840b0a28dff58fe144791d8e9cfaca5', onSlotchange: this.updateColumns.bind(this) })));
50
50
  }
51
51
  get host() { return this; }
52
52
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"z-tr.js","mappings":";;;;;;AAAA,MAAM,SAAS,GAAG,ojDAAojD,CAAC;AACvkD,kBAAe,SAAS;;MCeXA,KAAG;;;;;;0BAaD,KAAK;wBAMP,KAAK;;;IAeN,aAAa;QACrB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAkC,YAAY,CAAC,CAAC,CAAC;QACpG,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,KAAK,CAAC,GAAG,EAAE,CAAC;SACb;QAED,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAEvD,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,MAAM,iBAAiB,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;YACtC,iBAAiB,CAAC,EAAE,GAAG,iBAAiB,CAAC,EAAE,IAAI,2BAA2B,QAAQ,EAAE,EAAE,CAAC;YACvF,IAAI,CAAC,mBAAmB,GAAG,iBAAiB,CAAC,EAAE,CAAC;SACjD;KACF;;;;;IAMO,UAAU,CAAC,KAAiB;QAClC,MAAM,aAAa,GAAI,KAAK,CAAC,MAAsB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAC/E,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,aAAa,EAAE;YACrC,OAAO;SACR;QAED,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAC,CAAC,CAAC;KAC7C;IAED,iBAAiB;QACf,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDACH,IAAI,EAAC,KAAK,EACV,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAEvB,4DAAK,KAAK,EAAC,+BAA+B,IACvC,IAAI,CAAC,UAAU,KACd,gFACiB,IAAI,CAAC,QAAQ,GAAG,MAAM,GAAG,OAAO,gBACnC,IAAI,CAAC,QAAQ,GAAG,eAAe,GAAG,cAAc,mBAC7C,IAAI,CAAC,mBAAmB,EACvC,IAAI,EAAC,QAAQ,IAEb,+DAAQ,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAG,eAAe,GAAG,cAAc,GAAW,CAClE,CACV,CACG,EACN,6DAAM,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAS,CACrD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ZTr"],"sources":["src/components/table/z-tr/styles.css?tag=z-tr&encapsulation=shadow","src/components/table/z-tr/index.tsx"],"sourcesContent":[":host {\n /* number of columns of the row. will be set in component's ts code */\n --columns: 1;\n\n display: grid;\n box-sizing: border-box;\n grid-auto-flow: column;\n grid-template-columns: var(--z-table--expand-button-size, 0) repeat(var(--columns), minmax(128px, 1fr));\n}\n\n* {\n box-sizing: border-box;\n}\n\n.z-tr--expand-button-container,\n::slotted(*) {\n border-bottom: var(--z-table--cells-bottom-border-size, var(--border-size-small)) solid var(--color-surface03);\n}\n\n::slotted(*:not(:last-child)) {\n border-right: var(--z-table--cell-left-border, none);\n}\n\n:host([expandable]) {\n --show-expandable-button: visible;\n\n cursor: pointer;\n}\n\n:host([expandable]) ::slotted(*) {\n grid-row: 1;\n}\n\n:host([expandable]) ::slotted(:nth-last-child(2)) {\n border-right: none;\n}\n\n:host([expandable]) ::slotted(*:last-child) {\n border-left: 0;\n grid-column: 1 / span calc(var(--columns) + 1);\n grid-row: 2;\n}\n\n:host([expandable]:not([expanded])) ::slotted(*:last-child) {\n display: none;\n}\n\n:host([expanded]) {\n margin-bottom: 4px; /* prevents shadow to be cut by the next element */\n box-shadow: 0 4px 4px -2px var(--shadow-color-base);\n}\n\n:host([expanded]) .z-tr--expand-button-container,\n:host([expanded]) ::slotted(*) {\n background-color: var(--color-background);\n}\n\n.z-tr--expand-button-container {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--z-table--cells-background, var(--color-surface01));\n}\n\n.z-tr--expand-button-container button {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n margin: auto;\n appearance: none;\n background: transparent;\n cursor: pointer;\n visibility: var(--show-expandable-button, hidden);\n}\n\n.z-tr--expand-button-container button:focus {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n.z-tr--expand-button-container button z-icon {\n --z-icon-width: 16px;\n --z-icon-height: 16px;\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {randomId} from \"../../../utils/utils\";\nimport \"../cells/z-td/index\";\nimport \"../cells/z-th/index\";\n\n/**\n * ZTr component.\n * When the row is `expandable`, you can set the `prevent-expand` css class on an interactive element inside the row\n * to prevent the row from expanding.\n * @slot - ZTr content (`z-td` or `z-th`).\n */\n@Component({\n tag: \"z-tr\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTr {\n @Element() host: HTMLZTrElement;\n\n /**\n * Whether the row is expandable.\n * Use a `z-td` as the last cell of the row for the additional content.\n * It will show a button to expand/collapse the row.\n * The last cell will be hidden until the button or row is clicked.\n *\n * If some element inside the expandable row contains the `prevent-expand` css class,\n * the row will not expand by clicking that element.\n */\n @Prop({reflect: true})\n expandable = false;\n\n /**\n * Whether the row is currently expanded.\n */\n @State()\n expanded = false;\n\n /**\n * HTML Id of the expandable content.\n * It is used to link the button to the content through the `aria-controls` attribute.\n */\n @State()\n expandableContentId: string;\n\n /** Row has been expanded */\n @Event()\n expand: EventEmitter;\n\n @Watch(\"expandable\")\n @Listen(\"colspanchange\")\n protected updateColumns(): void {\n const cells = Array.from(this.host.querySelectorAll<HTMLZTdElement | HTMLZThElement>(\"z-td, z-th\"));\n if (this.expandable) {\n cells.pop();\n }\n\n const columns = cells.map((cell) => cell.colspan || 1).reduce((a, b) => a + b, 0);\n this.host.style.setProperty(\"--columns\", `${columns}`);\n\n if (this.expandable) {\n const expandableContent = cells.pop();\n expandableContent.id = expandableContent.id || `z-tr-expandable-content-${randomId()}`;\n this.expandableContentId = expandableContent.id;\n }\n }\n\n /**\n * Handle click on row.\n * Skip expansion if the click is on a element with `prevent-expand` css class.\n */\n private onRowClick(event: MouseEvent): void {\n const preventExpand = (event.target as HTMLElement).closest(\".prevent-expand\");\n if (!this.expandable || preventExpand) {\n return;\n }\n\n this.expanded = !this.expanded;\n this.expand.emit({expanded: this.expanded});\n }\n\n componentWillLoad(): void {\n this.updateColumns();\n }\n\n render(): HTMLZTrElement {\n return (\n <Host\n role=\"row\"\n onClick={this.onRowClick.bind(this)}\n expanded={this.expanded}\n >\n <div class=\"z-tr--expand-button-container\">\n {this.expandable && (\n <button\n aria-expanded={this.expanded ? \"true\" : \"false\"}\n aria-label={this.expanded ? \"Comprimi riga\" : \"Espandi riga\"}\n aria-controls={this.expandableContentId}\n type=\"button\"\n >\n <z-icon name={this.expanded ? \"minus-circled\" : \"plus-circled\"}></z-icon>\n </button>\n )}\n </div>\n <slot onSlotchange={this.updateColumns.bind(this)}></slot>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"z-tr.js","mappings":";;;;;;AAAA,MAAM,SAAS,GAAG,mwDAAmwD,CAAC;AACtxD,kBAAe,SAAS;;MCeXA,KAAG;;;;;;0BAaD,KAAK;wBAMP,KAAK;;;IAeN,aAAa;QACrB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAkC,YAAY,CAAC,CAAC,CAAC;QACpG,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,KAAK,CAAC,GAAG,EAAE,CAAC;SACb;QAED,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAEvD,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,MAAM,iBAAiB,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;YACtC,iBAAiB,CAAC,EAAE,GAAG,iBAAiB,CAAC,EAAE,IAAI,2BAA2B,QAAQ,EAAE,EAAE,CAAC;YACvF,IAAI,CAAC,mBAAmB,GAAG,iBAAiB,CAAC,EAAE,CAAC;SACjD;KACF;;;;;IAMO,UAAU,CAAC,KAAiB;QAClC,MAAM,aAAa,GAAI,KAAK,CAAC,MAAsB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAC/E,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,aAAa,EAAE;YACrC,OAAO;SACR;QAED,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAC,CAAC,CAAC;KAC7C;IAED,iBAAiB;QACf,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDACH,IAAI,EAAC,KAAK,EACV,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAEnC,4DAAK,KAAK,EAAC,+BAA+B,IACvC,IAAI,CAAC,UAAU,KACd,gFACiB,IAAI,CAAC,QAAQ,GAAG,MAAM,GAAG,OAAO,gBACnC,IAAI,CAAC,QAAQ,GAAG,eAAe,GAAG,cAAc,mBAC7C,IAAI,CAAC,mBAAmB,EACvC,IAAI,EAAC,QAAQ,IAEb,+DAAQ,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAG,eAAe,GAAG,cAAc,GAAW,CAClE,CACV,CACG,EACN,6DAAM,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAS,CACrD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ZTr"],"sources":["src/components/table/z-tr/styles.css?tag=z-tr&encapsulation=shadow","src/components/table/z-tr/index.tsx"],"sourcesContent":[":host {\n /* number of columns of the row. will be set in component's ts code */\n --columns: 1;\n\n display: grid;\n box-sizing: border-box;\n grid-auto-flow: column;\n grid-template-columns: var(--z-table--expand-button-size, 0) repeat(var(--columns), minmax(128px, 1fr));\n}\n\n* {\n box-sizing: border-box;\n}\n\n.z-tr--expand-button-container,\n::slotted(*) {\n border-bottom: var(--z-table--cells-bottom-border-size, var(--border-size-small)) solid var(--color-surface03);\n}\n\n::slotted(*:not(:last-child)) {\n border-right: var(--z-table--cell-left-border, none);\n}\n\n:host([expandable]) {\n --show-expandable-button: visible;\n\n cursor: pointer;\n}\n\n:host([expandable]) ::slotted(*) {\n grid-row: 1;\n}\n\n:host([expandable]) ::slotted(:nth-last-child(2)) {\n border-right: none;\n}\n\n:host([expandable]) ::slotted(*:last-child) {\n border-left: 0;\n grid-column: 1 / span calc(var(--columns) + 1);\n grid-row: 2;\n}\n\n:host([expandable]:not([expanded])) ::slotted(*:last-child) {\n display: none;\n}\n\n:host([expanded]) {\n margin-bottom: 4px; /* prevents shadow to be cut by the next element */\n box-shadow: 0 4px 4px -2px var(--shadow-color-base);\n}\n\n:host([expanded]) .z-tr--expand-button-container,\n:host([expanded]) ::slotted(*) {\n background-color: var(--color-background);\n}\n\n:host(:focus) {\n position: relative;\n z-index: 20;\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n:host(:hover) {\n position: relative;\n z-index: 10;\n box-shadow: 0 4px 4px -2px var(--shadow-color-base, rgb(0 0 0 / 20%));\n}\n\n.z-tr--expand-button-container {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--z-table--cells-background, var(--color-surface01));\n}\n\n.z-tr--expand-button-container button {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n margin: auto;\n appearance: none;\n background: transparent;\n cursor: pointer;\n visibility: var(--show-expandable-button, hidden);\n}\n\n.z-tr--expand-button-container button:focus {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n.z-tr--expand-button-container button z-icon {\n --z-icon-width: 16px;\n --z-icon-height: 16px;\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {randomId} from \"../../../utils/utils\";\nimport \"../cells/z-td/index\";\nimport \"../cells/z-th/index\";\n\n/**\n * ZTr component.\n * When the row is `expandable`, you can set the `prevent-expand` css class on an interactive element inside the row\n * to prevent the row from expanding.\n * @slot - ZTr content (`z-td` or `z-th`).\n */\n@Component({\n tag: \"z-tr\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTr {\n @Element() host: HTMLZTrElement;\n\n /**\n * Whether the row is expandable.\n * Use a `z-td` as the last cell of the row for the additional content.\n * It will show a button to expand/collapse the row.\n * The last cell will be hidden until the button or row is clicked.\n *\n * If some element inside the expandable row contains the `prevent-expand` css class,\n * the row will not expand by clicking that element.\n */\n @Prop({reflect: true})\n expandable = false;\n\n /**\n * Whether the row is currently expanded.\n */\n @State()\n expanded = false;\n\n /**\n * HTML Id of the expandable content.\n * It is used to link the button to the content through the `aria-controls` attribute.\n */\n @State()\n expandableContentId: string;\n\n /** Row has been expanded */\n @Event()\n expand: EventEmitter;\n\n @Watch(\"expandable\")\n @Listen(\"colspanchange\")\n protected updateColumns(): void {\n const cells = Array.from(this.host.querySelectorAll<HTMLZTdElement | HTMLZThElement>(\"z-td, z-th\"));\n if (this.expandable) {\n cells.pop();\n }\n\n const columns = cells.map((cell) => cell.colspan || 1).reduce((a, b) => a + b, 0);\n this.host.style.setProperty(\"--columns\", `${columns}`);\n\n if (this.expandable) {\n const expandableContent = cells.pop();\n expandableContent.id = expandableContent.id || `z-tr-expandable-content-${randomId()}`;\n this.expandableContentId = expandableContent.id;\n }\n }\n\n /**\n * Handle click on row.\n * Skip expansion if the click is on a element with `prevent-expand` css class.\n */\n private onRowClick(event: MouseEvent): void {\n const preventExpand = (event.target as HTMLElement).closest(\".prevent-expand\");\n if (!this.expandable || preventExpand) {\n return;\n }\n\n this.expanded = !this.expanded;\n this.expand.emit({expanded: this.expanded});\n }\n\n componentWillLoad(): void {\n this.updateColumns();\n }\n\n render(): HTMLZTrElement {\n return (\n <Host\n role=\"row\"\n tabIndex={0}\n expanded={this.expanded}\n onClick={this.onRowClick.bind(this)}\n >\n <div class=\"z-tr--expand-button-container\">\n {this.expandable && (\n <button\n aria-expanded={this.expanded ? \"true\" : \"false\"}\n aria-label={this.expanded ? \"Comprimi riga\" : \"Espandi riga\"}\n aria-controls={this.expandableContentId}\n type=\"button\"\n >\n <z-icon name={this.expanded ? \"minus-circled\" : \"plus-circled\"}></z-icon>\n </button>\n )}\n </div>\n <slot onSlotchange={this.updateColumns.bind(this)}></slot>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,5 @@
1
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
+
3
+ export { commonjsGlobal as c };
4
+
5
+ //# sourceMappingURL=_commonjsHelpers-1c8beb5f.js.map
@@ -0,0 +1 @@
1
+ {"file":"_commonjsHelpers-1c8beb5f.js","mappings":";;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1,9 +1,9 @@
1
1
  import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-c8ceadeb.js';
2
2
  import { r as randomId } from './utils-6e83ba99.js';
3
- import './index-406138db.js';
4
- import './index-2a26d10b.js';
3
+ import './index-49edcc7b.js';
4
+ import './index-bf02a37c.js';
5
5
 
6
- const stylesCss = ":host{--columns:1;display:grid;box-sizing:border-box;grid-auto-flow:column;grid-template-columns:var(--z-table--expand-button-size, 0) repeat(var(--columns), minmax(128px, 1fr))}*{box-sizing:border-box}.z-tr--expand-button-container,::slotted(*){border-bottom:var(--z-table--cells-bottom-border-size, var(--border-size-small)) solid var(--color-surface03)}::slotted(*:not(:last-child)){border-right:var(--z-table--cell-left-border, none)}:host([expandable]){--show-expandable-button:visible;cursor:pointer}:host([expandable]) ::slotted(*){grid-row:1}:host([expandable]) ::slotted(:nth-last-child(2)){border-right:none}:host([expandable]) ::slotted(*:last-child){border-left:0;grid-column:1 / span calc(var(--columns) + 1);grid-row:2}:host([expandable]:not([expanded])) ::slotted(*:last-child){display:none}:host([expanded]){margin-bottom:4px;box-shadow:0 4px 4px -2px var(--shadow-color-base)}:host([expanded]) .z-tr--expand-button-container,:host([expanded]) ::slotted(*){background-color:var(--color-background)}.z-tr--expand-button-container{display:flex;align-items:center;justify-content:center;background-color:var(--z-table--cells-background, var(--color-surface01))}.z-tr--expand-button-container button{display:flex;align-items:center;justify-content:center;padding:0;border:none;margin:auto;appearance:none;background:transparent;cursor:pointer;visibility:var(--show-expandable-button, hidden)}.z-tr--expand-button-container button:focus{box-shadow:var(--shadow-focus-primary);outline:none}.z-tr--expand-button-container button z-icon{--z-icon-width:16px;--z-icon-height:16px}";
6
+ const stylesCss = ":host{--columns:1;display:grid;box-sizing:border-box;grid-auto-flow:column;grid-template-columns:var(--z-table--expand-button-size, 0) repeat(var(--columns), minmax(128px, 1fr))}*{box-sizing:border-box}.z-tr--expand-button-container,::slotted(*){border-bottom:var(--z-table--cells-bottom-border-size, var(--border-size-small)) solid var(--color-surface03)}::slotted(*:not(:last-child)){border-right:var(--z-table--cell-left-border, none)}:host([expandable]){--show-expandable-button:visible;cursor:pointer}:host([expandable]) ::slotted(*){grid-row:1}:host([expandable]) ::slotted(:nth-last-child(2)){border-right:none}:host([expandable]) ::slotted(*:last-child){border-left:0;grid-column:1 / span calc(var(--columns) + 1);grid-row:2}:host([expandable]:not([expanded])) ::slotted(*:last-child){display:none}:host([expanded]){margin-bottom:4px;box-shadow:0 4px 4px -2px var(--shadow-color-base)}:host([expanded]) .z-tr--expand-button-container,:host([expanded]) ::slotted(*){background-color:var(--color-background)}:host(:focus){position:relative;z-index:20;box-shadow:var(--shadow-focus-primary);outline:none}:host(:hover){position:relative;z-index:10;box-shadow:0 4px 4px -2px var(--shadow-color-base, rgb(0 0 0 / 20%))}.z-tr--expand-button-container{display:flex;align-items:center;justify-content:center;background-color:var(--z-table--cells-background, var(--color-surface01))}.z-tr--expand-button-container button{display:flex;align-items:center;justify-content:center;padding:0;border:none;margin:auto;appearance:none;background:transparent;cursor:pointer;visibility:var(--show-expandable-button, hidden)}.z-tr--expand-button-container button:focus{box-shadow:var(--shadow-focus-primary);outline:none}.z-tr--expand-button-container button z-icon{--z-icon-width:16px;--z-icon-height:16px}";
7
7
  const ZTrStyle0 = stylesCss;
8
8
 
9
9
  const ZTr = class {
@@ -43,7 +43,7 @@ const ZTr = class {
43
43
  this.updateColumns();
44
44
  }
45
45
  render() {
46
- return (h(Host, { key: 'c7aef75dce7ad486aa08145e3df1a9a4fbc0a086', role: "row", onClick: this.onRowClick.bind(this), expanded: this.expanded }, h("div", { key: '474efb8147efb3045b2d671081674330209674ae', class: "z-tr--expand-button-container" }, this.expandable && (h("button", { key: 'd4f77c52514979ee1e52483d1031d222f8b60dfd', "aria-expanded": this.expanded ? "true" : "false", "aria-label": this.expanded ? "Comprimi riga" : "Espandi riga", "aria-controls": this.expandableContentId, type: "button" }, h("z-icon", { key: 'a488e44b2b9119f2b96aeb42c2880f16650685a6', name: this.expanded ? "minus-circled" : "plus-circled" })))), h("slot", { key: '03ec3ec33b29e7ec504282289fa0daf8990deef5', onSlotchange: this.updateColumns.bind(this) })));
46
+ return (h(Host, { key: '6b028d12da65adf37eb6637ddf9bfd06d9f0db24', role: "row", tabIndex: 0, expanded: this.expanded, onClick: this.onRowClick.bind(this) }, h("div", { key: '598c2865ff6df8c8b6335e08a559407c6074bc6a', class: "z-tr--expand-button-container" }, this.expandable && (h("button", { key: 'b6b1ec7c8817f0a2494b509f536d640d54012620', "aria-expanded": this.expanded ? "true" : "false", "aria-label": this.expanded ? "Comprimi riga" : "Espandi riga", "aria-controls": this.expandableContentId, type: "button" }, h("z-icon", { key: 'ed1dee7ce70dfee25497d7ba33ce3655217f6d0f', name: this.expanded ? "minus-circled" : "plus-circled" })))), h("slot", { key: '13d5eea11840b0a28dff58fe144791d8e9cfaca5', onSlotchange: this.updateColumns.bind(this) })));
47
47
  }
48
48
  get host() { return getElement(this); }
49
49
  static get watchers() { return {
@@ -54,4 +54,4 @@ ZTr.style = ZTrStyle0;
54
54
 
55
55
  export { ZTr as Z };
56
56
 
57
- //# sourceMappingURL=index-be3c8aaa.js.map
57
+ //# sourceMappingURL=index-28b819c7.js.map
@@ -0,0 +1 @@
1
+ {"file":"index-28b819c7.js","mappings":";;;;;AAAA,MAAM,SAAS,GAAG,mwDAAmwD,CAAC;AACtxD,kBAAe,SAAS;;MCeX,GAAG;;;;0BAaD,KAAK;wBAMP,KAAK;;;IAeN,aAAa;QACrB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAkC,YAAY,CAAC,CAAC,CAAC;QACpG,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,KAAK,CAAC,GAAG,EAAE,CAAC;SACb;QAED,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAEvD,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,MAAM,iBAAiB,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;YACtC,iBAAiB,CAAC,EAAE,GAAG,iBAAiB,CAAC,EAAE,IAAI,2BAA2B,QAAQ,EAAE,EAAE,CAAC;YACvF,IAAI,CAAC,mBAAmB,GAAG,iBAAiB,CAAC,EAAE,CAAC;SACjD;KACF;;;;;IAMO,UAAU,CAAC,KAAiB;QAClC,MAAM,aAAa,GAAI,KAAK,CAAC,MAAsB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAC/E,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,aAAa,EAAE;YACrC,OAAO;SACR;QAED,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAC,CAAC,CAAC;KAC7C;IAED,iBAAiB;QACf,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDACH,IAAI,EAAC,KAAK,EACV,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAEnC,4DAAK,KAAK,EAAC,+BAA+B,IACvC,IAAI,CAAC,UAAU,KACd,gFACiB,IAAI,CAAC,QAAQ,GAAG,MAAM,GAAG,OAAO,gBACnC,IAAI,CAAC,QAAQ,GAAG,eAAe,GAAG,cAAc,mBAC7C,IAAI,CAAC,mBAAmB,EACvC,IAAI,EAAC,QAAQ,IAEb,+DAAQ,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAG,eAAe,GAAG,cAAc,GAAW,CAClE,CACV,CACG,EACN,6DAAM,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAS,CACrD,EACP;KACH;;;;;;;;;;","names":[],"sources":["src/components/table/z-tr/styles.css?tag=z-tr&encapsulation=shadow","src/components/table/z-tr/index.tsx"],"sourcesContent":[":host {\n /* number of columns of the row. will be set in component's ts code */\n --columns: 1;\n\n display: grid;\n box-sizing: border-box;\n grid-auto-flow: column;\n grid-template-columns: var(--z-table--expand-button-size, 0) repeat(var(--columns), minmax(128px, 1fr));\n}\n\n* {\n box-sizing: border-box;\n}\n\n.z-tr--expand-button-container,\n::slotted(*) {\n border-bottom: var(--z-table--cells-bottom-border-size, var(--border-size-small)) solid var(--color-surface03);\n}\n\n::slotted(*:not(:last-child)) {\n border-right: var(--z-table--cell-left-border, none);\n}\n\n:host([expandable]) {\n --show-expandable-button: visible;\n\n cursor: pointer;\n}\n\n:host([expandable]) ::slotted(*) {\n grid-row: 1;\n}\n\n:host([expandable]) ::slotted(:nth-last-child(2)) {\n border-right: none;\n}\n\n:host([expandable]) ::slotted(*:last-child) {\n border-left: 0;\n grid-column: 1 / span calc(var(--columns) + 1);\n grid-row: 2;\n}\n\n:host([expandable]:not([expanded])) ::slotted(*:last-child) {\n display: none;\n}\n\n:host([expanded]) {\n margin-bottom: 4px; /* prevents shadow to be cut by the next element */\n box-shadow: 0 4px 4px -2px var(--shadow-color-base);\n}\n\n:host([expanded]) .z-tr--expand-button-container,\n:host([expanded]) ::slotted(*) {\n background-color: var(--color-background);\n}\n\n:host(:focus) {\n position: relative;\n z-index: 20;\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n:host(:hover) {\n position: relative;\n z-index: 10;\n box-shadow: 0 4px 4px -2px var(--shadow-color-base, rgb(0 0 0 / 20%));\n}\n\n.z-tr--expand-button-container {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--z-table--cells-background, var(--color-surface01));\n}\n\n.z-tr--expand-button-container button {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n margin: auto;\n appearance: none;\n background: transparent;\n cursor: pointer;\n visibility: var(--show-expandable-button, hidden);\n}\n\n.z-tr--expand-button-container button:focus {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\n.z-tr--expand-button-container button z-icon {\n --z-icon-width: 16px;\n --z-icon-height: 16px;\n}\n","import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {randomId} from \"../../../utils/utils\";\nimport \"../cells/z-td/index\";\nimport \"../cells/z-th/index\";\n\n/**\n * ZTr component.\n * When the row is `expandable`, you can set the `prevent-expand` css class on an interactive element inside the row\n * to prevent the row from expanding.\n * @slot - ZTr content (`z-td` or `z-th`).\n */\n@Component({\n tag: \"z-tr\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTr {\n @Element() host: HTMLZTrElement;\n\n /**\n * Whether the row is expandable.\n * Use a `z-td` as the last cell of the row for the additional content.\n * It will show a button to expand/collapse the row.\n * The last cell will be hidden until the button or row is clicked.\n *\n * If some element inside the expandable row contains the `prevent-expand` css class,\n * the row will not expand by clicking that element.\n */\n @Prop({reflect: true})\n expandable = false;\n\n /**\n * Whether the row is currently expanded.\n */\n @State()\n expanded = false;\n\n /**\n * HTML Id of the expandable content.\n * It is used to link the button to the content through the `aria-controls` attribute.\n */\n @State()\n expandableContentId: string;\n\n /** Row has been expanded */\n @Event()\n expand: EventEmitter;\n\n @Watch(\"expandable\")\n @Listen(\"colspanchange\")\n protected updateColumns(): void {\n const cells = Array.from(this.host.querySelectorAll<HTMLZTdElement | HTMLZThElement>(\"z-td, z-th\"));\n if (this.expandable) {\n cells.pop();\n }\n\n const columns = cells.map((cell) => cell.colspan || 1).reduce((a, b) => a + b, 0);\n this.host.style.setProperty(\"--columns\", `${columns}`);\n\n if (this.expandable) {\n const expandableContent = cells.pop();\n expandableContent.id = expandableContent.id || `z-tr-expandable-content-${randomId()}`;\n this.expandableContentId = expandableContent.id;\n }\n }\n\n /**\n * Handle click on row.\n * Skip expansion if the click is on a element with `prevent-expand` css class.\n */\n private onRowClick(event: MouseEvent): void {\n const preventExpand = (event.target as HTMLElement).closest(\".prevent-expand\");\n if (!this.expandable || preventExpand) {\n return;\n }\n\n this.expanded = !this.expanded;\n this.expand.emit({expanded: this.expanded});\n }\n\n componentWillLoad(): void {\n this.updateColumns();\n }\n\n render(): HTMLZTrElement {\n return (\n <Host\n role=\"row\"\n tabIndex={0}\n expanded={this.expanded}\n onClick={this.onRowClick.bind(this)}\n >\n <div class=\"z-tr--expand-button-container\">\n {this.expandable && (\n <button\n aria-expanded={this.expanded ? \"true\" : \"false\"}\n aria-label={this.expanded ? \"Comprimi riga\" : \"Espandi riga\"}\n aria-controls={this.expandableContentId}\n type=\"button\"\n >\n <z-icon name={this.expanded ? \"minus-circled\" : \"plus-circled\"}></z-icon>\n </button>\n )}\n </div>\n <slot onSlotchange={this.updateColumns.bind(this)}></slot>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,45 @@
1
+ import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-c8ceadeb.js';
2
+ import { P as PopoverPosition, B as ButtonVariant, e as ControlSize } from './index-9f584e0a.js';
3
+
4
+ const stylesCss = ":host{position:relative;display:flex;max-width:100%;align-items:center;padding:var(--z-table--cells-padding, calc(var(--space-unit) * 2));background-color:var(--color-surface01);gap:calc(var(--space-unit) * 2) var(--space-unit)}:host,*{box-sizing:border-box}:host([sticky]){position:sticky;z-index:1;top:0;left:0;box-shadow:8px 0 16px -8px var(--shadow-color-base)}:host([menu-open]){z-index:2}:host(:focus){z-index:20;box-shadow:var(--shadow-focus-primary);outline:none}.cell--content{display:flex;width:100%;height:100%;align-items:center}:host([show-menu]) .cell--content{column-gap:var(--space-unit)}.cell--menu-container{margin-left:auto}:host(:not([show-menu])) .cell--menu-container{opacity:0;pointer-events:none}:host(:is([show-menu],[menu-open])) .cell--menu-container,:host([show-menu]) .cell--menu-container:focus-within{z-index:1;opacity:1;pointer-events:all}:host .cell-popover{z-index:100}@media (min-width: 768px) and (hover: hover){:host([show-menu=\"hover\"]) .cell--menu-container{opacity:0;pointer-events:none}:host([show-menu=\"hover\"]:hover) .cell--menu-container{z-index:1;opacity:1;pointer-events:all}}";
5
+ const ZTdStyle0 = stylesCss;
6
+
7
+ const ZTd = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.colspanChange = createEvent(this, "colspanChange", 6);
11
+ this.colspan = undefined;
12
+ this.sticky = false;
13
+ this.showMenu = null;
14
+ this.popoverPosition = PopoverPosition.AUTO;
15
+ this.isMenuOpen = false;
16
+ }
17
+ updateColspan() {
18
+ if (this.colspan) {
19
+ this.host.style.gridColumn = `span ${this.colspan}`;
20
+ }
21
+ else {
22
+ this.host.style.removeProperty("grid-column");
23
+ }
24
+ this.colspanChange.emit(this.colspan || 1);
25
+ }
26
+ onMenuButtonClick(ev) {
27
+ ev.stopPropagation();
28
+ this.popoverEl.open = !this.popoverEl.open;
29
+ }
30
+ componentWillLoad() {
31
+ this.updateColspan();
32
+ }
33
+ render() {
34
+ return (h(Host, { key: '8c866902e986231a18c02c447bc390d14f55aecf', role: "cell", "menu-open": this.isMenuOpen, tabIndex: 0 }, h("div", { key: '83b6e697548f7fec6705e74111253564066005d8', class: "cell--content" }, h("slot", { key: '4129469503f265975bf5a28aa1ea576fa2e3311b' }), this.showMenu && (h("div", { key: 'd70b2bb104a891270515e7428593ce9cedbd882c', class: "cell--menu-container prevent-expand" }, h("z-button", { key: 'cacd10ac34bb695883c1e0d63dc96623fa3c59e9', variant: ButtonVariant.TERTIARY, icon: "contextual-menu", size: ControlSize.X_SMALL, ref: (el) => (this.menuTrigger = el), onClick: this.onMenuButtonClick.bind(this) }), h("z-popover", { key: 'e6fdca5d2ba1047264c0703a222c3c5a5c30480b', class: "cell-popover", ref: (el) => (this.popoverEl = el), bindTo: this.menuTrigger, onOpenChange: (event) => (this.isMenuOpen = event.detail.open), position: this.popoverPosition }, h("slot", { key: 'e3e996e448fd49d4248d98d219a899ea254d7fd1', name: "contextual-menu" })))))));
35
+ }
36
+ get host() { return getElement(this); }
37
+ static get watchers() { return {
38
+ "colspan": ["updateColspan"]
39
+ }; }
40
+ };
41
+ ZTd.style = ZTdStyle0;
42
+
43
+ export { ZTd as Z };
44
+
45
+ //# sourceMappingURL=index-49edcc7b.js.map
@@ -0,0 +1 @@
1
+ {"file":"index-49edcc7b.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,wmCAAwmC,CAAC;AAC3nC,kBAAe,SAAS;;MCWX,GAAG;;;;;sBAaL,KAAK;wBAQkB,IAAI;+BAMA,eAAe,CAAC,IAAI;0BAM3C,KAAK;;IAgBR,aAAa;QACrB,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC;SACrD;aAAM;YACL,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;SAC/C;QAED,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;KAC5C;IAEO,iBAAiB,CAAC,EAAc;QACtC,EAAE,CAAC,eAAe,EAAE,CAAC;QACrB,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC5C;IAED,iBAAiB;QACf,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDACH,IAAI,EAAC,MAAM,eACA,IAAI,CAAC,UAAU,EAC1B,QAAQ,EAAE,CAAC,IAEX,4DAAK,KAAK,EAAC,eAAe,IACxB,8DAAa,EACZ,IAAI,CAAC,QAAQ,KACZ,4DAAK,KAAK,EAAC,qCAAqC,IAC9C,iEACE,OAAO,EAAE,aAAa,CAAC,QAAQ,EAC/B,IAAI,EAAC,iBAAiB,EACtB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,WAAW,GAAG,EAAwB,CAAC,EAC1D,OAAO,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,GAC1C,EACF,kEACE,KAAK,EAAC,cAAc,EACpB,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,SAAS,GAAG,EAAyB,CAAC,EACzD,MAAM,EAAE,IAAI,CAAC,WAA0B,EACvC,YAAY,EAAE,CAAC,KAAK,MAAM,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAC9D,QAAQ,EAAE,IAAI,CAAC,eAAe,IAE9B,6DAAM,IAAI,EAAC,iBAAiB,GAAQ,CAC1B,CACR,CACP,CACG,CACD,EACP;KACH;;;;;;;;;;","names":[],"sources":["src/components/table/cells/z-td/styles.css?tag=z-td&encapsulation=shadow","src/components/table/cells/z-td/index.tsx"],"sourcesContent":["@import \"../z-table-cells.css\";\n","import {Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ButtonVariant, ControlSize, PopoverPosition, VisibilityCondition} from \"../../../../beans\";\n\n/**\n * ZTd component.\n * @slot - ZTd content.\n */\n@Component({\n tag: \"z-td\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTd {\n @Element() host: HTMLZTdElement;\n\n /**\n * Number of columns that the cell should span.\n */\n @Prop()\n colspan: number;\n\n /**\n * Whether the cell should stick.\n */\n @Prop({reflect: true})\n sticky = false;\n\n /**\n * Enables the contextual menu.\n * Can be set to \"hover\" or \"always\" to show the button only on cell hover or always.\n * Set a nullish value to hide the menu button.\n */\n @Prop({reflect: true})\n showMenu: VisibilityCondition = null;\n\n /**\n * Set the popover position, the default is \"auto\".\n */\n @Prop()\n popoverPosition?: PopoverPosition = PopoverPosition.AUTO;\n\n /**\n * Store the open state of the menu.\n */\n @State()\n isMenuOpen = false;\n\n private menuTrigger: HTMLZButtonElement;\n\n private popoverEl: HTMLZPopoverElement;\n\n /**\n * Emitted when the value of the `colspan` changes.\n */\n @Event({\n bubbles: true,\n cancelable: false,\n })\n colspanChange: EventEmitter<number>;\n\n @Watch(\"colspan\")\n protected updateColspan(): void {\n if (this.colspan) {\n this.host.style.gridColumn = `span ${this.colspan}`;\n } else {\n this.host.style.removeProperty(\"grid-column\");\n }\n\n this.colspanChange.emit(this.colspan || 1);\n }\n\n private onMenuButtonClick(ev: MouseEvent): void {\n ev.stopPropagation();\n this.popoverEl.open = !this.popoverEl.open;\n }\n\n componentWillLoad(): void {\n this.updateColspan();\n }\n\n render(): HTMLZTdElement {\n return (\n <Host\n role=\"cell\"\n menu-open={this.isMenuOpen}\n tabIndex={0}\n >\n <div class=\"cell--content\">\n <slot></slot>\n {this.showMenu && (\n <div class=\"cell--menu-container prevent-expand\">\n <z-button\n variant={ButtonVariant.TERTIARY}\n icon=\"contextual-menu\"\n size={ControlSize.X_SMALL}\n ref={(el) => (this.menuTrigger = el as HTMLZButtonElement)}\n onClick={this.onMenuButtonClick.bind(this)}\n />\n <z-popover\n class=\"cell-popover\"\n ref={(el) => (this.popoverEl = el as HTMLZPopoverElement)}\n bindTo={this.menuTrigger as HTMLElement}\n onOpenChange={(event) => (this.isMenuOpen = event.detail.open)}\n position={this.popoverPosition}\n >\n <slot name=\"contextual-menu\"></slot>\n </z-popover>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-c8ceadeb.js';
2
2
  import { P as PopoverPosition, S as SortDirection, B as ButtonVariant, e as ControlSize } from './index-9f584e0a.js';
3
3
 
4
- const stylesCss = ":host{position:relative;display:flex;max-width:100%;align-items:center;padding:var(--z-table--cells-padding, calc(var(--space-unit) * 2));background-color:var(--color-surface01);gap:calc(var(--space-unit) * 2) var(--space-unit)}:host,*{box-sizing:border-box}:host([sticky]){position:sticky;z-index:1;top:0;left:0;box-shadow:8px 0 16px -8px var(--shadow-color-base)}:host([menu-open]){z-index:2}.cell--content{display:flex;width:100%;height:100%;align-items:center}:host([show-menu]) .cell--content{column-gap:var(--space-unit)}.cell--menu-container{margin-left:auto}:host(:not([show-menu])) .cell--menu-container{opacity:0;pointer-events:none}:host(:is([show-menu],[menu-open])) .cell--menu-container,:host([show-menu]) .cell--menu-container:focus-within{z-index:1;opacity:1;pointer-events:all}:host .cell-popover{z-index:100}@media (min-width: 768px) and (hover: hover){:host([show-menu=\"hover\"]) .cell--menu-container{opacity:0;pointer-events:none}:host([show-menu=\"hover\"]:hover) .cell--menu-container{z-index:1;opacity:1;pointer-events:all}}:host{z-index:1;padding:0;background-color:var(--color-background);font-weight:var(--font-sb)}.cell--content{padding:var(--z-table--cells-padding, calc(var(--space-unit) * 2))}:host([show-sorting]) .cell--content{column-gap:var(--space-unit)}.z-th--sort-button{padding:0;border:none;background-color:transparent;cursor:pointer;outline:none}@media (min-width: 768px) and (hover: hover){:host([show-sorting=\"hover\"]) .z-th--sort-button{opacity:0;pointer-events:none}:host([show-sorting=\"hover\"]:hover) .z-th--sort-button,:host([show-sorting=\"hover\"]) .z-th--sort-button:focus:focus-visible,:host([show-sorting=\"always\"]) .z-th--sort-button,:host([sorted]) .z-th--sort-button{opacity:1;pointer-events:all}}:host([show-sorting=\"hover\"]:hover) .z-th--sort-button::after,:host([show-sorting=\"hover\"]) .z-th--sort-button:focus:focus-visible::after,:host([show-sorting=\"always\"]) .z-th--sort-button::after,:host([sorted]) .z-th--sort-button::after{position:absolute;top:6px;left:6px;width:calc(100% - 12px);height:calc(100% - 10px);background-color:transparent;content:\"\"}:host([sorted]) .z-th--sort-button::after,.z-th--sort-button:focus:focus-visible::after{box-shadow:var(--shadow-focus-primary)}";
4
+ const stylesCss = ":host{position:relative;display:flex;max-width:100%;align-items:center;padding:var(--z-table--cells-padding, calc(var(--space-unit) * 2));background-color:var(--color-surface01);gap:calc(var(--space-unit) * 2) var(--space-unit)}:host,*{box-sizing:border-box}:host([sticky]){position:sticky;z-index:1;top:0;left:0;box-shadow:8px 0 16px -8px var(--shadow-color-base)}:host([menu-open]){z-index:2}:host(:focus){z-index:20;box-shadow:var(--shadow-focus-primary);outline:none}.cell--content{display:flex;width:100%;height:100%;align-items:center}:host([show-menu]) .cell--content{column-gap:var(--space-unit)}.cell--menu-container{margin-left:auto}:host(:not([show-menu])) .cell--menu-container{opacity:0;pointer-events:none}:host(:is([show-menu],[menu-open])) .cell--menu-container,:host([show-menu]) .cell--menu-container:focus-within{z-index:1;opacity:1;pointer-events:all}:host .cell-popover{z-index:100}@media (min-width: 768px) and (hover: hover){:host([show-menu=\"hover\"]) .cell--menu-container{opacity:0;pointer-events:none}:host([show-menu=\"hover\"]:hover) .cell--menu-container{z-index:1;opacity:1;pointer-events:all}}:host{z-index:1;padding:0;background-color:var(--color-background);font-weight:var(--font-sb)}.cell--content{padding:var(--z-table--cells-padding, calc(var(--space-unit) * 2))}:host([show-sorting]) .cell--content{column-gap:var(--space-unit)}.z-th--sort-button{padding:0;border:none;background-color:transparent;cursor:pointer;outline:none}@media (min-width: 768px) and (hover: hover){:host([show-sorting=\"hover\"]) .z-th--sort-button{opacity:0;pointer-events:none}:host([show-sorting=\"hover\"]:hover) .z-th--sort-button,:host([show-sorting=\"hover\"]) .z-th--sort-button:focus:focus-visible,:host([show-sorting=\"always\"]) .z-th--sort-button,:host([sorted]) .z-th--sort-button{opacity:1;pointer-events:all}}:host([show-sorting=\"hover\"]:hover) .z-th--sort-button::after,:host([show-sorting=\"hover\"]) .z-th--sort-button:focus:focus-visible::after,:host([show-sorting=\"always\"]) .z-th--sort-button::after,:host([sorted]) .z-th--sort-button::after{position:absolute;top:6px;left:6px;width:calc(100% - 12px);height:calc(100% - 10px);background-color:transparent;content:\"\"}";
5
5
  const ZThStyle0 = stylesCss;
6
6
 
7
7
  const ZTh = class {
@@ -62,4 +62,4 @@ ZTh.style = ZThStyle0;
62
62
 
63
63
  export { ZTh as Z };
64
64
 
65
- //# sourceMappingURL=index-2a26d10b.js.map
65
+ //# sourceMappingURL=index-bf02a37c.js.map
@@ -0,0 +1 @@
1
+ {"file":"index-bf02a37c.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,gqEAAgqE,CAAC;AACnrE,kBAAe,SAAS;;MCYX,GAAG;;;;;wBAekB,IAAI;2BAQD,IAAI;sBAM9B,KAAK;;sBAYW,KAAK;+BAMZ,eAAe,CAAC,IAAI;0BAMzB,KAAK;;;;;IAiBlB,IAAY,iBAAiB;QAC3B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACvB,OAAO,IAAI,CAAC;SACb;QAED,OAAO,IAAI,CAAC,aAAa,KAAK,aAAa,CAAC,GAAG,GAAG,WAAW,GAAG,YAAY,CAAC;KAC9E;;;;;IAMO,UAAU;QAChB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACvB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;YAEpB,OAAO;SACR;QAED,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,KAAK,aAAa,CAAC,GAAG,GAAG,aAAa,CAAC,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC;QACvG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QAEnB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,aAAa,EAAE,IAAI,CAAC,aAAa,EAAC,CAAC,CAAC;KACrD;IAGS,aAAa;QACrB,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC;SACrD;aAAM;YACL,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;SAC/C;KACF;IAED,iBAAiB;QACf,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDACH,IAAI,EAAC,cAAc,eACR,IAAI,CAAC,UAAU,eACf,IAAI,CAAC,iBAAiB,EACjC,QAAQ,EAAE,IAAI,CAAC,WAAW,IAE1B,4DAAK,KAAK,EAAC,eAAe,IACxB,8DAAa,EACZ,IAAI,CAAC,WAAW,KACf,+DACE,KAAK,EAAC,mBAAmB,EACzB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAEnC,+DACE,IAAI,EAAE,IAAI,CAAC,aAAa,KAAK,aAAa,CAAC,IAAI,GAAG,iBAAiB,GAAG,mBAAmB,EACzF,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,GACV,CACK,CACV,EACA,IAAI,CAAC,QAAQ,KACZ,4DAAK,KAAK,EAAC,sBAAsB,IAC/B,iEACE,OAAO,EAAE,aAAa,CAAC,QAAQ,EAC/B,IAAI,EAAC,iBAAiB,EACtB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,WAAW,GAAG,EAAiB,CAAC,EACnD,OAAO,EAAE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAC3D,EACF,kEACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,SAAS,GAAG,EAAyB,CAAC,EACzD,MAAM,EAAE,IAAI,CAAC,WAAW,EACxB,YAAY,EAAE,CAAC,KAAK,MAAM,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAC9D,QAAQ,EAAE,IAAI,CAAC,eAAe,IAE9B,6DAAM,IAAI,EAAC,iBAAiB,GAAQ,CAC1B,CACR,CACP,CACG,CACD,EACP;KACH;;;;;;;;;;","names":[],"sources":["src/components/table/cells/z-th/styles.css?tag=z-th&encapsulation=shadow","src/components/table/cells/z-th/index.tsx"],"sourcesContent":["@import \"../z-table-cells.css\";\n\n:host {\n z-index: 1;\n padding: 0;\n background-color: var(--color-background);\n font-weight: var(--font-sb);\n}\n\n.cell--content {\n padding: var(--z-table--cells-padding, calc(var(--space-unit) * 2));\n}\n\n:host([show-sorting]) .cell--content {\n column-gap: var(--space-unit);\n}\n\n.z-th--sort-button {\n padding: 0;\n border: none;\n background-color: transparent;\n cursor: pointer;\n outline: none;\n}\n\n@media (min-width: 768px) and (hover: hover) {\n :host([show-sorting=\"hover\"]) .z-th--sort-button {\n opacity: 0;\n pointer-events: none;\n }\n\n :host([show-sorting=\"hover\"]:hover) .z-th--sort-button,\n :host([show-sorting=\"hover\"]) .z-th--sort-button:focus:focus-visible,\n :host([show-sorting=\"always\"]) .z-th--sort-button,\n :host([sorted]) .z-th--sort-button {\n opacity: 1;\n pointer-events: all;\n }\n}\n\n:host([show-sorting=\"hover\"]:hover) .z-th--sort-button::after,\n:host([show-sorting=\"hover\"]) .z-th--sort-button:focus:focus-visible::after,\n:host([show-sorting=\"always\"]) .z-th--sort-button::after,\n:host([sorted]) .z-th--sort-button::after {\n position: absolute;\n top: 6px;\n left: 6px;\n width: calc(100% - 12px);\n height: calc(100% - 10px);\n background-color: transparent;\n content: \"\";\n}\n","import {Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ButtonVariant, ControlSize, PopoverPosition, SortDirection, VisibilityCondition} from \"../../../../beans\";\n\n/**\n * ZTh component.\n * @slot - ZTh content.\n * @slot contextual-menu - Contextual menu content. Only visible when `showMenu` is true.\n */\n@Component({\n tag: \"z-th\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTh {\n @Element() host: HTMLZThElement;\n\n /**\n * Number of columns that the cell should span.\n */\n @Prop()\n colspan: number;\n\n /**\n * Enables the contextual menu.\n * Can be set to \"hover\" or \"always\" to show the button only on cell hover or always.\n * Set a nullish value to hide the menu button.\n */\n @Prop({reflect: true})\n showMenu: VisibilityCondition = null;\n\n /**\n * Enables the sorting button.\n * Can be set to \"hover\" or \"always\" to show the button only on cell hover or always.\n * Set a nullish value to hide the sort button.\n */\n @Prop({reflect: true})\n showSorting: VisibilityCondition = null;\n\n /**\n * Whether the cell should stick.\n */\n @Prop({reflect: true})\n sticky = false;\n\n /**\n * Current sorting direction.\n */\n @Prop({mutable: true})\n sortDirection?: SortDirection;\n\n /**\n * Sorted state of the column.\n */\n @Prop({reflect: true, mutable: true})\n sorted: boolean | null = false;\n\n /**\n * Set popover position.\n */\n @Prop()\n popoverPosition = PopoverPosition.AUTO;\n\n /**\n * Store the open state of the menu.\n */\n @State()\n isMenuOpen = false;\n\n /**\n * Sort event fired when the user clicks on the sort button.\n * The sorting logic must be implemented by the app.\n * You can set an `id` on the `z-th` to easly identify the column in the event listener.\n */\n @Event()\n private sort: EventEmitter;\n\n private menuTrigger: HTMLElement;\n\n private popoverEl: HTMLZPopoverElement;\n\n /**\n * Get the value to set to the `aria-sort` attribute based on the current sort direction.\n */\n private get ariaSortDirection(): string {\n if (!this.sortDirection) {\n return null;\n }\n\n return this.sortDirection === SortDirection.ASC ? \"ascending\" : \"descending\";\n }\n\n /**\n * Handle the click on the sort button.\n * @fires sort\n */\n private handleSort(): void {\n if (!this.sortDirection) {\n this.sorted = false;\n\n return;\n }\n\n this.sortDirection = this.sortDirection === SortDirection.ASC ? SortDirection.DESC : SortDirection.ASC;\n this.sorted = true;\n\n this.sort.emit({sortDirection: this.sortDirection});\n }\n\n @Watch(\"colspan\")\n protected updateColspan(): void {\n if (this.colspan) {\n this.host.style.gridColumn = `span ${this.colspan}`;\n } else {\n this.host.style.removeProperty(\"grid-column\");\n }\n }\n\n componentWillLoad(): void {\n this.updateColspan();\n }\n\n render(): HTMLZThElement {\n return (\n <Host\n role=\"columnheader\"\n menu-open={this.isMenuOpen}\n aria-sort={this.ariaSortDirection}\n sortable={this.showSorting}\n >\n <div class=\"cell--content\">\n <slot></slot>\n {this.showSorting && (\n <button\n class=\"z-th--sort-button\"\n type=\"button\"\n onClick={this.handleSort.bind(this)}\n >\n <z-icon\n name={this.sortDirection === SortDirection.DESC ? \"arrow-simple-up\" : \"arrow-simple-down\"}\n width={14}\n height={14}\n />\n </button>\n )}\n {this.showMenu && (\n <div class=\"cell--menu-container\">\n <z-button\n variant={ButtonVariant.TERTIARY}\n icon=\"contextual-menu\"\n size={ControlSize.X_SMALL}\n ref={(el) => (this.menuTrigger = el as HTMLElement)}\n onClick={() => (this.popoverEl.open = !this.popoverEl.open)}\n />\n <z-popover\n ref={(el) => (this.popoverEl = el as HTMLZPopoverElement)}\n bindTo={this.menuTrigger}\n onOpenChange={(event) => (this.isMenuOpen = event.detail.open)}\n position={this.popoverPosition}\n >\n <slot name=\"contextual-menu\"></slot>\n </z-popover>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,3 +1,4 @@
1
+ import { c as commonjsGlobal } from './_commonjsHelpers-1c8beb5f.js';
1
2
  import { F as ZDatePickerPosition, y as ZDatePickerMode, z as ZDatePickerModeValue } from './index-9f584e0a.js';
2
3
 
3
4
  var HOOKS = [
@@ -2549,8 +2550,6 @@ if (typeof window !== "undefined") {
2549
2550
  window.flatpickr = flatpickr;
2550
2551
  }
2551
2552
 
2552
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2553
-
2554
2553
  var it = {exports: {}};
2555
2554
 
2556
2555
  (function (module, exports) {
@@ -2700,6 +2699,6 @@ function setMonthsAriaOptions(calendar, prevMonthArrow, nextMonthArrow) {
2700
2699
  nextMonthArrow.setAttribute("aria-label", "Anno successivo");
2701
2700
  }
2702
2701
 
2703
- export { setFlatpickrPosition as a, commonjsGlobal as c, flatpickr as f, it as i, setAriaOptions as s, validateDate as v };
2702
+ export { setFlatpickrPosition as a, flatpickr as f, it as i, setAriaOptions as s, validateDate as v };
2704
2703
 
2705
- //# sourceMappingURL=utils-90416845.js.map
2704
+ //# sourceMappingURL=utils-50e4c211.js.map