@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
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## 18.5.0 (2025-07-25)
6
+
7
+ ## 18.4.3 (2025-07-17)
8
+
5
9
  ## 18.4.2 (2025-07-17)
6
10
 
7
11
  ## [18.4.1](https://github.com/ZanichelliEditore/design-system/compare/v18.4.0...v18.4.1) (2025-06-30)
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
+
5
+ exports.commonjsGlobal = commonjsGlobal;
6
+
7
+ //# sourceMappingURL=_commonjsHelpers-68cdf74f.js.map
@@ -0,0 +1 @@
1
+ {"file":"_commonjsHelpers-68cdf74f.js","mappings":";;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index-96af6326.js');
4
+ const index$1 = require('./index-be0b8cf5.js');
5
+
6
+ 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}}";
7
+ const ZTdStyle0 = stylesCss;
8
+
9
+ const ZTd = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.colspanChange = index.createEvent(this, "colspanChange", 6);
13
+ this.colspan = undefined;
14
+ this.sticky = false;
15
+ this.showMenu = null;
16
+ this.popoverPosition = index$1.PopoverPosition.AUTO;
17
+ this.isMenuOpen = false;
18
+ }
19
+ updateColspan() {
20
+ if (this.colspan) {
21
+ this.host.style.gridColumn = `span ${this.colspan}`;
22
+ }
23
+ else {
24
+ this.host.style.removeProperty("grid-column");
25
+ }
26
+ this.colspanChange.emit(this.colspan || 1);
27
+ }
28
+ onMenuButtonClick(ev) {
29
+ ev.stopPropagation();
30
+ this.popoverEl.open = !this.popoverEl.open;
31
+ }
32
+ componentWillLoad() {
33
+ this.updateColspan();
34
+ }
35
+ render() {
36
+ return (index.h(index.Host, { key: '8c866902e986231a18c02c447bc390d14f55aecf', role: "cell", "menu-open": this.isMenuOpen, tabIndex: 0 }, index.h("div", { key: '83b6e697548f7fec6705e74111253564066005d8', class: "cell--content" }, index.h("slot", { key: '4129469503f265975bf5a28aa1ea576fa2e3311b' }), this.showMenu && (index.h("div", { key: 'd70b2bb104a891270515e7428593ce9cedbd882c', class: "cell--menu-container prevent-expand" }, index.h("z-button", { key: 'cacd10ac34bb695883c1e0d63dc96623fa3c59e9', variant: index$1.ButtonVariant.TERTIARY, icon: "contextual-menu", size: index$1.ControlSize.X_SMALL, ref: (el) => (this.menuTrigger = el), onClick: this.onMenuButtonClick.bind(this) }), index.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 }, index.h("slot", { key: 'e3e996e448fd49d4248d98d219a899ea254d7fd1', name: "contextual-menu" })))))));
37
+ }
38
+ get host() { return index.getElement(this); }
39
+ static get watchers() { return {
40
+ "colspan": ["updateColspan"]
41
+ }; }
42
+ };
43
+ ZTd.style = ZTdStyle0;
44
+
45
+ exports.ZTd = ZTd;
46
+
47
+ //# sourceMappingURL=index-299de208.js.map
@@ -0,0 +1 @@
1
+ {"file":"index-299de208.js","mappings":";;;;;AAAA,MAAM,SAAS,GAAG,wmCAAwmC,CAAC;AAC3nC,kBAAe,SAAS;;MCWX,GAAG;;;;;sBAaL,KAAK;wBAQkB,IAAI;+BAMAA,uBAAe,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,QACEC,QAACC,UAAI,qDACH,IAAI,EAAC,MAAM,eACA,IAAI,CAAC,UAAU,EAC1B,QAAQ,EAAE,CAAC,IAEXD,kEAAK,KAAK,EAAC,eAAe,IACxBA,oEAAa,EACZ,IAAI,CAAC,QAAQ,KACZA,kEAAK,KAAK,EAAC,qCAAqC,IAC9CA,uEACE,OAAO,EAAEE,qBAAa,CAAC,QAAQ,EAC/B,IAAI,EAAC,iBAAiB,EACtB,IAAI,EAAEC,mBAAW,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,EACFH,wEACE,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,IAE9BA,mEAAM,IAAI,EAAC,iBAAiB,GAAQ,CAC1B,CACR,CACP,CACG,CACD,EACP;KACH;;;;;;;;;;","names":["PopoverPosition","h","Host","ButtonVariant","ControlSize"],"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}
@@ -3,7 +3,7 @@
3
3
  const index = require('./index-96af6326.js');
4
4
  const index$1 = require('./index-be0b8cf5.js');
5
5
 
6
- 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)}";
6
+ 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:\"\"}";
7
7
  const ZThStyle0 = stylesCss;
8
8
 
9
9
  const ZTh = class {
@@ -64,4 +64,4 @@ ZTh.style = ZThStyle0;
64
64
 
65
65
  exports.ZTh = ZTh;
66
66
 
67
- //# sourceMappingURL=index-443b084a.js.map
67
+ //# sourceMappingURL=index-e1eead16.js.map
@@ -0,0 +1 @@
1
+ {"file":"index-e1eead16.js","mappings":";;;;;AAAA,MAAM,SAAS,GAAG,gqEAAgqE,CAAC;AACnrE,kBAAe,SAAS;;MCYX,GAAG;;;;;wBAekB,IAAI;2BAQD,IAAI;sBAM9B,KAAK;;sBAYW,KAAK;+BAMZA,uBAAe,CAAC,IAAI;0BAMzB,KAAK;;;;;IAiBlB,IAAY,iBAAiB;QAC3B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACvB,OAAO,IAAI,CAAC;SACb;QAED,OAAO,IAAI,CAAC,aAAa,KAAKC,qBAAa,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,KAAKA,qBAAa,CAAC,GAAG,GAAGA,qBAAa,CAAC,IAAI,GAAGA,qBAAa,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,QACEC,QAACC,UAAI,qDACH,IAAI,EAAC,cAAc,eACR,IAAI,CAAC,UAAU,eACf,IAAI,CAAC,iBAAiB,EACjC,QAAQ,EAAE,IAAI,CAAC,WAAW,IAE1BD,kEAAK,KAAK,EAAC,eAAe,IACxBA,oEAAa,EACZ,IAAI,CAAC,WAAW,KACfA,qEACE,KAAK,EAAC,mBAAmB,EACzB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAEnCA,qEACE,IAAI,EAAE,IAAI,CAAC,aAAa,KAAKD,qBAAa,CAAC,IAAI,GAAG,iBAAiB,GAAG,mBAAmB,EACzF,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,GACV,CACK,CACV,EACA,IAAI,CAAC,QAAQ,KACZC,kEAAK,KAAK,EAAC,sBAAsB,IAC/BA,uEACE,OAAO,EAAEE,qBAAa,CAAC,QAAQ,EAC/B,IAAI,EAAC,iBAAiB,EACtB,IAAI,EAAEC,mBAAW,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,EACFH,wEACE,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,IAE9BA,mEAAM,IAAI,EAAC,iBAAiB,GAAQ,CAC1B,CACR,CACP,CACG,CACD,EACP;KACH;;;;;;;;;;","names":["PopoverPosition","SortDirection","h","Host","ButtonVariant","ControlSize"],"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}
@@ -2,10 +2,10 @@
2
2
 
3
3
  const index = require('./index-96af6326.js');
4
4
  const utils = require('./utils-714b7a92.js');
5
- require('./index-e98b419e.js');
6
- require('./index-443b084a.js');
5
+ require('./index-299de208.js');
6
+ require('./index-e1eead16.js');
7
7
 
8
- 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}";
8
+ 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}";
9
9
  const ZTrStyle0 = stylesCss;
10
10
 
11
11
  const ZTr = class {
@@ -45,7 +45,7 @@ const ZTr = class {
45
45
  this.updateColumns();
46
46
  }
47
47
  render() {
48
- return (index.h(index.Host, { key: 'c7aef75dce7ad486aa08145e3df1a9a4fbc0a086', role: "row", onClick: this.onRowClick.bind(this), expanded: this.expanded }, index.h("div", { key: '474efb8147efb3045b2d671081674330209674ae', class: "z-tr--expand-button-container" }, this.expandable && (index.h("button", { key: 'd4f77c52514979ee1e52483d1031d222f8b60dfd', "aria-expanded": this.expanded ? "true" : "false", "aria-label": this.expanded ? "Comprimi riga" : "Espandi riga", "aria-controls": this.expandableContentId, type: "button" }, index.h("z-icon", { key: 'a488e44b2b9119f2b96aeb42c2880f16650685a6', name: this.expanded ? "minus-circled" : "plus-circled" })))), index.h("slot", { key: '03ec3ec33b29e7ec504282289fa0daf8990deef5', onSlotchange: this.updateColumns.bind(this) })));
48
+ return (index.h(index.Host, { key: '6b028d12da65adf37eb6637ddf9bfd06d9f0db24', role: "row", tabIndex: 0, expanded: this.expanded, onClick: this.onRowClick.bind(this) }, index.h("div", { key: '598c2865ff6df8c8b6335e08a559407c6074bc6a', class: "z-tr--expand-button-container" }, this.expandable && (index.h("button", { key: 'b6b1ec7c8817f0a2494b509f536d640d54012620', "aria-expanded": this.expanded ? "true" : "false", "aria-label": this.expanded ? "Comprimi riga" : "Espandi riga", "aria-controls": this.expandableContentId, type: "button" }, index.h("z-icon", { key: 'ed1dee7ce70dfee25497d7ba33ce3655217f6d0f', name: this.expanded ? "minus-circled" : "plus-circled" })))), index.h("slot", { key: '13d5eea11840b0a28dff58fe144791d8e9cfaca5', onSlotchange: this.updateColumns.bind(this) })));
49
49
  }
50
50
  get host() { return index.getElement(this); }
51
51
  static get watchers() { return {
@@ -56,4 +56,4 @@ ZTr.style = ZTrStyle0;
56
56
 
57
57
  exports.ZTr = ZTr;
58
58
 
59
- //# sourceMappingURL=index-f67078cb.js.map
59
+ //# sourceMappingURL=index-fb88ce4a.js.map
@@ -0,0 +1 @@
1
+ {"file":"index-fb88ce4a.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,2BAA2BA,cAAQ,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,QACEC,QAACC,UAAI,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,IAEnCD,kEAAK,KAAK,EAAC,+BAA+B,IACvC,IAAI,CAAC,UAAU,KACdA,sFACiB,IAAI,CAAC,QAAQ,GAAG,MAAM,GAAG,OAAO,gBACnC,IAAI,CAAC,QAAQ,GAAG,eAAe,GAAG,cAAc,mBAC7C,IAAI,CAAC,mBAAmB,EACvC,IAAI,EAAC,QAAQ,IAEbA,qEAAQ,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAG,eAAe,GAAG,cAAc,GAAW,CAClE,CACV,CACG,EACNA,mEAAM,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAS,CACrD,EACP;KACH;;;;;;;;;;","names":["randomId","h","Host"],"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}
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const _commonjsHelpers = require('./_commonjsHelpers-68cdf74f.js');
3
4
  const index = require('./index-be0b8cf5.js');
4
5
 
5
6
  var HOOKS = [
@@ -2551,14 +2552,12 @@ if (typeof window !== "undefined") {
2551
2552
  window.flatpickr = flatpickr;
2552
2553
  }
2553
2554
 
2554
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2555
-
2556
2555
  var it = {exports: {}};
2557
2556
 
2558
2557
  (function (module, exports) {
2559
2558
  (function (global, factory) {
2560
2559
  factory(exports) ;
2561
- }(commonjsGlobal, (function (exports) {
2560
+ }(_commonjsHelpers.commonjsGlobal, (function (exports) {
2562
2561
  var fp = typeof window !== "undefined" && window.flatpickr !== undefined
2563
2562
  ? window.flatpickr
2564
2563
  : {
@@ -2702,11 +2701,10 @@ function setMonthsAriaOptions(calendar, prevMonthArrow, nextMonthArrow) {
2702
2701
  nextMonthArrow.setAttribute("aria-label", "Anno successivo");
2703
2702
  }
2704
2703
 
2705
- exports.commonjsGlobal = commonjsGlobal;
2706
2704
  exports.flatpickr = flatpickr;
2707
2705
  exports.it = it;
2708
2706
  exports.setAriaOptions = setAriaOptions;
2709
2707
  exports.setFlatpickrPosition = setFlatpickrPosition;
2710
2708
  exports.validateDate = validateDate;
2711
2709
 
2712
- //# sourceMappingURL=utils-021d5bc3.js.map
2710
+ //# sourceMappingURL=utils-eacc6b3a.js.map