@zanichelli/albe-web-components 16.2.0 → 16.2.2
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.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/{index-5cc0f0ca.js → index-3a070c6b.js} +4 -3
- package/dist/cjs/index-3a070c6b.js.map +1 -0
- package/dist/cjs/{index-066b8da0.js → index-597156d1.js} +2 -2
- package/dist/cjs/{index-066b8da0.js.map → index-597156d1.js.map} +1 -1
- package/dist/cjs/{index-98822eac.js → index-f0159789.js} +3 -3
- package/dist/cjs/{index-98822eac.js.map → index-f0159789.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +62 -6
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
- package/dist/cjs/z-table.cjs.entry.js +3 -3
- package/dist/cjs/z-td.cjs.entry.js +1 -1
- package/dist/cjs/z-th.cjs.entry.js +1 -1
- package/dist/cjs/z-tr.cjs.entry.js +3 -3
- package/dist/collection/components/table/cells/z-td/index.js +27 -2
- package/dist/collection/components/table/cells/z-td/index.js.map +1 -1
- package/dist/collection/components/table/cells/z-td/styles.css +4 -0
- package/dist/collection/components/table/cells/z-th/styles.css +4 -0
- package/dist/collection/components/z-searchbar/index.js +63 -5
- package/dist/collection/components/z-searchbar/index.js.map +1 -1
- package/dist/collection/components/z-searchbar/index.spec.js +19 -19
- package/dist/collection/components/z-searchbar/index.spec.js.map +1 -1
- package/dist/collection/components/z-searchbar/styles.css +9 -0
- package/dist/components/index23.js +65 -8
- package/dist/components/index23.js.map +1 -1
- package/dist/components/z-td.js +5 -3
- package/dist/components/z-td.js.map +1 -1
- package/dist/components/z-th.js +1 -1
- package/dist/components/z-th.js.map +1 -1
- package/dist/esm/{index-292b4dd2.js → index-230d44a5.js} +5 -4
- package/dist/esm/index-230d44a5.js.map +1 -0
- package/dist/esm/{index-18018bb5.js → index-7a28ff39.js} +2 -2
- package/dist/esm/{index-18018bb5.js.map → index-7a28ff39.js.map} +1 -1
- package/dist/esm/{index-50bbb22e.js → index-fd7edd22.js} +3 -3
- package/dist/esm/{index-50bbb22e.js.map → index-fd7edd22.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header_12.entry.js +62 -6
- package/dist/esm/z-app-header_12.entry.js.map +1 -1
- package/dist/esm/z-table.entry.js +3 -3
- package/dist/esm/z-td.entry.js +1 -1
- package/dist/esm/z-th.entry.js +1 -1
- package/dist/esm/z-tr.entry.js +3 -3
- package/dist/types/components/table/cells/z-td/index.d.ts +5 -1
- package/dist/types/components/z-searchbar/index.d.ts +3 -0
- package/dist/types/components.d.ts +8 -0
- package/dist/web-components-library/p-0794ae16.entry.js +2 -0
- package/dist/web-components-library/p-26b5c84d.js +2 -0
- package/{www/build/p-8de7ea6e.js.map → dist/web-components-library/p-26b5c84d.js.map} +1 -1
- package/dist/web-components-library/{p-c6b269ce.entry.js → p-4f7dd068.entry.js} +2 -2
- package/dist/web-components-library/p-7d7c5344.js +2 -0
- package/dist/web-components-library/p-7d7c5344.js.map +1 -0
- package/dist/web-components-library/{p-999762b5.entry.js → p-862f5338.entry.js} +2 -2
- package/dist/web-components-library/p-862f5338.entry.js.map +1 -0
- package/dist/web-components-library/p-a7292e1c.entry.js +2 -0
- package/dist/web-components-library/{p-ae94e377.js → p-aa0f083b.js} +2 -2
- package/dist/web-components-library/p-ed2c8484.entry.js +2 -0
- package/dist/web-components-library/web-components-library.css +1 -1
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/dist/web-components-library/web-components-library.esm.js.map +1 -1
- package/package.json +1 -1
- package/www/build/p-0794ae16.entry.js +2 -0
- package/www/build/{p-82ff5b56.css → p-0cd14493.css} +1 -1
- package/www/build/p-1ad8ebce.js +2 -0
- package/www/build/p-26b5c84d.js +2 -0
- package/{dist/web-components-library/p-8de7ea6e.js.map → www/build/p-26b5c84d.js.map} +1 -1
- package/www/build/{p-c6b269ce.entry.js → p-4f7dd068.entry.js} +2 -2
- package/www/build/p-7d7c5344.js +2 -0
- package/www/build/p-7d7c5344.js.map +1 -0
- package/www/build/{p-999762b5.entry.js → p-862f5338.entry.js} +2 -2
- package/www/build/p-862f5338.entry.js.map +1 -0
- package/www/build/p-a7292e1c.entry.js +2 -0
- package/www/build/{p-ae94e377.js → p-aa0f083b.js} +2 -2
- package/www/build/p-ed2c8484.entry.js +2 -0
- package/www/build/web-components-library.css +1 -1
- package/www/build/web-components-library.esm.js +1 -1
- package/www/build/web-components-library.esm.js.map +1 -1
- package/www/index.html +1 -1
- package/dist/cjs/index-5cc0f0ca.js.map +0 -1
- package/dist/esm/index-292b4dd2.js.map +0 -1
- package/dist/web-components-library/p-1edbac5f.entry.js +0 -2
- package/dist/web-components-library/p-8de7ea6e.js +0 -2
- package/dist/web-components-library/p-999762b5.entry.js.map +0 -1
- package/dist/web-components-library/p-9f2a7cf0.js +0 -2
- package/dist/web-components-library/p-9f2a7cf0.js.map +0 -1
- package/dist/web-components-library/p-bf2a057d.entry.js +0 -2
- package/dist/web-components-library/p-e0323da3.entry.js +0 -2
- package/www/build/p-14fe85ba.js +0 -2
- package/www/build/p-1edbac5f.entry.js +0 -2
- package/www/build/p-8de7ea6e.js +0 -2
- package/www/build/p-999762b5.entry.js.map +0 -1
- package/www/build/p-9f2a7cf0.js +0 -2
- package/www/build/p-9f2a7cf0.js.map +0 -1
- package/www/build/p-bf2a057d.entry.js +0 -2
- package/www/build/p-e0323da3.entry.js +0 -2
- /package/dist/web-components-library/{p-1edbac5f.entry.js.map → p-0794ae16.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-c6b269ce.entry.js.map → p-4f7dd068.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-bf2a057d.entry.js.map → p-a7292e1c.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-ae94e377.js.map → p-aa0f083b.js.map} +0 -0
- /package/dist/web-components-library/{p-e0323da3.entry.js.map → p-ed2c8484.entry.js.map} +0 -0
- /package/www/build/{p-1edbac5f.entry.js.map → p-0794ae16.entry.js.map} +0 -0
- /package/www/build/{p-c6b269ce.entry.js.map → p-4f7dd068.entry.js.map} +0 -0
- /package/www/build/{p-bf2a057d.entry.js.map → p-a7292e1c.entry.js.map} +0 -0
- /package/www/build/{p-ae94e377.js.map → p-aa0f083b.js.map} +0 -0
- /package/www/build/{p-e0323da3.entry.js.map → p-ed2c8484.entry.js.map} +0 -0
|
@@ -2,12 +2,12 @@ import { r as registerInstance, h, a as Host, g as getElement } from './index-a2
|
|
|
2
2
|
import './index-175661e6.js';
|
|
3
3
|
import './index-b556b384.js';
|
|
4
4
|
import './index-a81f1558.js';
|
|
5
|
-
import './index-
|
|
5
|
+
import './index-fd7edd22.js';
|
|
6
6
|
import './utils-8ade9e2d.js';
|
|
7
7
|
import './index-b7dbacb4.js';
|
|
8
8
|
import './breakpoints-680e0e56.js';
|
|
9
|
-
import './index-
|
|
10
|
-
import './index-
|
|
9
|
+
import './index-230d44a5.js';
|
|
10
|
+
import './index-7a28ff39.js';
|
|
11
11
|
|
|
12
12
|
const stylesCss = ":host{--z-table--cells-padding:calc(var(--space-unit) * 2);position:relative;display:block;overflow:auto;max-width:100%;box-sizing:border-box;background-color:var(--color-surface01)}:host([expandable]){--z-table--expand-button-size:40px}:host([bordered]){--z-table--cell-left-border:1px solid var(--color-surface03)}.table{min-width:max-content}";
|
|
13
13
|
const ZTableStyle0 = stylesCss;
|
package/dist/esm/z-td.entry.js
CHANGED
package/dist/esm/z-th.entry.js
CHANGED
package/dist/esm/z-tr.entry.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { Z as z_tr } from './index-
|
|
1
|
+
export { Z as z_tr } from './index-fd7edd22.js';
|
|
2
2
|
import './index-a2130b6a.js';
|
|
3
3
|
import './utils-8ade9e2d.js';
|
|
4
4
|
import './index-b7dbacb4.js';
|
|
5
5
|
import './breakpoints-680e0e56.js';
|
|
6
|
-
import './index-
|
|
7
|
-
import './index-
|
|
6
|
+
import './index-230d44a5.js';
|
|
7
|
+
import './index-7a28ff39.js';
|
|
8
8
|
|
|
9
9
|
//# sourceMappingURL=z-tr.entry.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from "../../../../stencil-public-runtime";
|
|
2
|
-
import { VisibilityCondition } from "../../../../beans";
|
|
2
|
+
import { PopoverPosition, VisibilityCondition } from "../../../../beans";
|
|
3
3
|
/**
|
|
4
4
|
* ZTd component.
|
|
5
5
|
* @slot - ZTd content.
|
|
@@ -20,6 +20,10 @@ export declare class ZTd {
|
|
|
20
20
|
* Set a nullish value to hide the menu button.
|
|
21
21
|
*/
|
|
22
22
|
showMenu: VisibilityCondition;
|
|
23
|
+
/**
|
|
24
|
+
* Set the popover position, the default is "auto".
|
|
25
|
+
*/
|
|
26
|
+
popoverPosition?: PopoverPosition;
|
|
23
27
|
/**
|
|
24
28
|
* Store the open state of the menu.
|
|
25
29
|
*/
|
|
@@ -42,6 +42,7 @@ export declare class ZSearchbar {
|
|
|
42
42
|
private resultsItemsList;
|
|
43
43
|
private inputRef;
|
|
44
44
|
private resizeObserver;
|
|
45
|
+
private items;
|
|
45
46
|
/** Emitted on search submit, return search string */
|
|
46
47
|
searchSubmit: EventEmitter<string>;
|
|
47
48
|
private emitSearchSubmit;
|
|
@@ -55,6 +56,7 @@ export declare class ZSearchbar {
|
|
|
55
56
|
watchResultsCount(): void;
|
|
56
57
|
watchValue(): void;
|
|
57
58
|
watchSearchString(): void;
|
|
59
|
+
watchShowResults(): void;
|
|
58
60
|
disconnectedCallback(): void;
|
|
59
61
|
componentDidLoad(): void;
|
|
60
62
|
componentWillLoad(): void;
|
|
@@ -69,6 +71,7 @@ export declare class ZSearchbar {
|
|
|
69
71
|
private renderResults;
|
|
70
72
|
private renderResultsList;
|
|
71
73
|
private renderItems;
|
|
74
|
+
private handleArrowsNavigation;
|
|
72
75
|
private renderItem;
|
|
73
76
|
private renderItemLabel;
|
|
74
77
|
private renderItemCategory;
|
|
@@ -1814,6 +1814,10 @@ export namespace Components {
|
|
|
1814
1814
|
* Number of columns that the cell should span.
|
|
1815
1815
|
*/
|
|
1816
1816
|
"colspan": number;
|
|
1817
|
+
/**
|
|
1818
|
+
* Set the popover position, the default is "auto".
|
|
1819
|
+
*/
|
|
1820
|
+
"popoverPosition"?: PopoverPosition;
|
|
1817
1821
|
/**
|
|
1818
1822
|
* Enables the contextual menu. Can be set to "hover" or "always" to show the button only on cell hover or always. Set a nullish value to hide the menu button.
|
|
1819
1823
|
*/
|
|
@@ -5358,6 +5362,10 @@ declare namespace LocalJSX {
|
|
|
5358
5362
|
* Emitted when the value of the `colspan` changes.
|
|
5359
5363
|
*/
|
|
5360
5364
|
"onColspanChange"?: (event: ZTdCustomEvent<number>) => void;
|
|
5365
|
+
/**
|
|
5366
|
+
* Set the popover position, the default is "auto".
|
|
5367
|
+
*/
|
|
5368
|
+
"popoverPosition"?: PopoverPosition;
|
|
5361
5369
|
/**
|
|
5362
5370
|
* Enables the contextual menu. Can be set to "hover" or "always" to show the button only on cell hover or always. Set a nullish value to hide the menu button.
|
|
5363
5371
|
*/
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as e,h as n,a as o,g as s}from"./p-cfa39bd3.js";import{P as i,S as a,B as r,e as c}from"./p-6037cdf3.js";const h=':host{position:relative;display:flex;min-width:128px;box-sizing:border-box;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([sticky]){position:sticky;z-index:1;top:0;left:0;box-shadow:8px 0 16px -8px var(--shadow-color-base)}:host([show-menu])::after{display:inline-block;height:100%;margin-right:calc(var(--space-unit) * 4);background:transparent;content:"";user-select:none}.cell--menu-container{position:absolute;z-index:1;top:var(--space-unit);right:var(--space-unit)}: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{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{opacity:1;pointer-events:all}}:host{background-color:var(--color-surface02);font-weight:var(--font-sb)}:host([sortable]){cursor:pointer}.z-th--sort-button{display:flex;align-items:center;justify-content:center;padding:0;border:none;margin-top:auto;background-color:transparent;cursor:pointer}.z-th--sort-button:focus{box-shadow:var(--shadow-focus-primary);outline:none}';const d=h;const l=class{constructor(n){t(this,n);this.sort=e(this,"sort",7);this.colspan=undefined;this.showMenu=null;this.sticky=false;this.sortDirection=undefined;this.popoverPosition=i.AUTO;this.isMenuOpen=false}get ariaSortDirection(){if(!this.sortDirection){return null}return this.sortDirection===a.ASC?"ascending":"descending"}handleSort(){if(!this.sortDirection){return}this.sortDirection=this.sortDirection===a.ASC?a.DESC:a.ASC;this.sort.emit({sortDirection:this.sortDirection})}updateColspan(){if(this.colspan){this.host.style.gridColumn=`span ${this.colspan}`}else{this.host.style.removeProperty("grid-column")}}componentWillLoad(){this.updateColspan()}render(){return n(o,{key:"222509e3075cd7a6668301f8b54cebd3af7bd843",role:"columnheader","menu-open":this.isMenuOpen,"aria-sort":this.ariaSortDirection},n("slot",{key:"728dffd6851b3b9f6647a136c0d84d0da10c894b"}),this.sortDirection&&n("button",{key:"a75b468b0057f404fdfcafd77cf63f10999f274a",class:"z-th--sort-button",type:"button",onClick:this.handleSort.bind(this)},n("z-icon",{key:"9d4ac199ba40228afd8b4ac087effde4ae37f55b",name:this.sortDirection===a.ASC?"arrow-simple-up":"arrow-simple-down",width:14,height:14})),this.showMenu&&n("div",{key:"4769a6dfa1e6222448b1d409746dbe1f6420cc5d",class:"cell--menu-container"},n("z-button",{key:"90951859a7fdcaddec8769e95d8a65de5c7e5ff7",variant:r.TERTIARY,icon:"contextual-menu",size:c.X_SMALL,ref:t=>this.menuTrigger=t,onClick:()=>this.popoverEl.open=!this.popoverEl.open}),n("z-popover",{key:"3066d766feab4b810d41b78a5f3801cbffa5688d",ref:t=>this.popoverEl=t,bindTo:this.menuTrigger,onOpenChange:t=>this.isMenuOpen=t.detail.open,position:this.popoverPosition},n("slot",{key:"9bf90081ba6d5c82cdd9c69f0dd536bda756b8af",name:"contextual-menu"}))))}get host(){return s(this)}static get watchers(){return{colspan:["updateColspan"]}}};l.style=d;export{l as Z};
|
|
2
|
+
//# sourceMappingURL=p-26b5c84d.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stylesCss","ZThStyle0","ZTh","PopoverPosition","AUTO","ariaSortDirection","this","sortDirection","SortDirection","ASC","handleSort","DESC","sort","emit","updateColspan","colspan","host","style","gridColumn","removeProperty","componentWillLoad","render","h","Host","key","role","isMenuOpen","class","type","onClick","bind","name","width","height","showMenu","variant","ButtonVariant","TERTIARY","icon","size","ControlSize","X_SMALL","ref","el","menuTrigger","popoverEl","open","bindTo","onOpenChange","event","detail","position","popoverPosition"],"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 background-color: var(--color-surface02);\n font-weight: var(--font-sb);\n}\n\n/* :host([sticky]) {\n background-color: var(--color-surface02);\n} */\n\n:host([sortable]) {\n cursor: pointer;\n}\n\n.z-th--sort-button {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n margin-top: auto;\n background-color: transparent;\n cursor: pointer;\n}\n\n.z-th--sort-button:focus {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\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 * Whether the cell should stick.\n */\n @Prop({reflect: true})\n sticky = false;\n\n /**\n * Current sorting direction.\n * Set `SortDirection.ASC` or `SortDirection.DESC` to show the sort icon.\n */\n @Prop({mutable: true})\n sortDirection?: SortDirection;\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 return;\n }\n\n this.sortDirection = this.sortDirection === SortDirection.ASC ? SortDirection.DESC : SortDirection.ASC;\n this.sort.emit({\n sortDirection: this.sortDirection,\n });\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 >\n <slot></slot>\n {this.sortDirection && (\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.ASC ? \"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 </Host>\n );\n }\n}\n"],"mappings":"yHAAA,MAAMA,EAAY,
|
|
1
|
+
{"version":3,"names":["stylesCss","ZThStyle0","ZTh","PopoverPosition","AUTO","ariaSortDirection","this","sortDirection","SortDirection","ASC","handleSort","DESC","sort","emit","updateColspan","colspan","host","style","gridColumn","removeProperty","componentWillLoad","render","h","Host","key","role","isMenuOpen","class","type","onClick","bind","name","width","height","showMenu","variant","ButtonVariant","TERTIARY","icon","size","ControlSize","X_SMALL","ref","el","menuTrigger","popoverEl","open","bindTo","onOpenChange","event","detail","position","popoverPosition"],"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 background-color: var(--color-surface02);\n font-weight: var(--font-sb);\n}\n\n/* :host([sticky]) {\n background-color: var(--color-surface02);\n} */\n\n:host([sortable]) {\n cursor: pointer;\n}\n\n.z-th--sort-button {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n margin-top: auto;\n background-color: transparent;\n cursor: pointer;\n}\n\n.z-th--sort-button:focus {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\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 * Whether the cell should stick.\n */\n @Prop({reflect: true})\n sticky = false;\n\n /**\n * Current sorting direction.\n * Set `SortDirection.ASC` or `SortDirection.DESC` to show the sort icon.\n */\n @Prop({mutable: true})\n sortDirection?: SortDirection;\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 return;\n }\n\n this.sortDirection = this.sortDirection === SortDirection.ASC ? SortDirection.DESC : SortDirection.ASC;\n this.sort.emit({\n sortDirection: this.sortDirection,\n });\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 >\n <slot></slot>\n {this.sortDirection && (\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.ASC ? \"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 </Host>\n );\n }\n}\n"],"mappings":"yHAAA,MAAMA,EAAY,83CAClB,MAAAC,EAAeD,E,MCYFE,EAAG,M,yFAekB,K,YAMvB,M,kDAaSC,EAAgBC,K,gBAMrB,K,CAiBb,qBAAYC,GACV,IAAKC,KAAKC,cAAe,CACvB,OAAO,I,CAGT,OAAOD,KAAKC,gBAAkBC,EAAcC,IAAM,YAAc,Y,CAO1D,UAAAC,GACN,IAAKJ,KAAKC,cAAe,CACvB,M,CAGFD,KAAKC,cAAgBD,KAAKC,gBAAkBC,EAAcC,IAAMD,EAAcG,KAAOH,EAAcC,IACnGH,KAAKM,KAAKC,KAAK,CACbN,cAAeD,KAAKC,e,CAKd,aAAAO,GACR,GAAIR,KAAKS,QAAS,CAChBT,KAAKU,KAAKC,MAAMC,WAAa,QAAQZ,KAAKS,S,KACrC,CACLT,KAAKU,KAAKC,MAAME,eAAe,c,EAInC,iBAAAC,GACEd,KAAKQ,e,CAGP,MAAAO,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,2CACHC,KAAK,eAAc,YACRnB,KAAKoB,WAAU,YACfpB,KAAKD,mBAEhBiB,EAAA,QAAAE,IAAA,6CACClB,KAAKC,eACJe,EAAA,UAAAE,IAAA,2CACEG,MAAM,oBACNC,KAAK,SACLC,QAASvB,KAAKI,WAAWoB,KAAKxB,OAE9BgB,EAAA,UAAAE,IAAA,2CACEO,KAAMzB,KAAKC,gBAAkBC,EAAcC,IAAM,kBAAoB,oBACrEuB,MAAO,GACPC,OAAQ,MAIb3B,KAAK4B,UACJZ,EAAA,OAAAE,IAAA,2CAAKG,MAAM,wBACTL,EAAA,YAAAE,IAAA,2CACEW,QAASC,EAAcC,SACvBC,KAAK,kBACLC,KAAMC,EAAYC,QAClBC,IAAMC,GAAQrC,KAAKsC,YAAcD,EACjCd,QAAS,IAAOvB,KAAKuC,UAAUC,MAAQxC,KAAKuC,UAAUC,OAExDxB,EAAA,aAAAE,IAAA,2CACEkB,IAAMC,GAAQrC,KAAKuC,UAAYF,EAC/BI,OAAQzC,KAAKsC,YACbI,aAAeC,GAAW3C,KAAKoB,WAAauB,EAAMC,OAAOJ,KACzDK,SAAU7C,KAAK8C,iBAEf9B,EAAA,QAAAE,IAAA,2CAAMO,KAAK,sB","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as e,a,g as s}from"./p-cfa39bd3.js";import"./p-7d827c11.js";import"./p-304eeab0.js";import"./p-d9e1d8c7.js";import"./p-aa0f083b.js";import"./p-2c184714.js";import"./p-6037cdf3.js";import"./p-2c886e8b.js";import"./p-7d7c5344.js";import"./p-26b5c84d.js";const o=":host{--z-table--cells-padding:calc(var(--space-unit) * 2);position:relative;display:block;overflow:auto;max-width:100%;box-sizing:border-box;background-color:var(--color-surface01)}:host([expandable]){--z-table--expand-button-size:40px}:host([bordered]){--z-table--cell-left-border:1px solid var(--color-surface03)}.table{min-width:max-content}";const r=o;const i=class{constructor(e){t(this,e);this.bordered=false;this.expandable=false}updateExpandable(){this.expandable=this.host.querySelectorAll("z-tr[expandable]").length>0}componentWillLoad(){this.expandableMutationObserver=new MutationObserver((()=>{this.updateExpandable()}));this.expandableMutationObserver.observe(this.host,{childList:true,subtree:true,attributes:true,attributeFilter:["expandable"],attributeOldValue:false})}disconnectedCallback(){var t;(t=this.expandableMutationObserver)===null||t===void 0?void 0:t.disconnect()}render(){return e(a,{key:"2d8e50a74ff7ccf3c6dc4f5324a512177ad52f45",expandable:this.expandable},e("div",{key:"5e1d9d44dc90ac06683bf5306f7eecadffe807fe",class:"table",role:"table"},e("slot",{key:"12a615e336a4ad50390a2ab0b12b2d20b3503f06"})))}get host(){return s(this)}};i.style=r;export{i as z_table};
|
|
2
|
+
//# sourceMappingURL=p-4f7dd068.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as t,h as n,a as s,g as o}from"./p-cfa39bd3.js";import{P as a,B as i,e as c}from"./p-6037cdf3.js";const r=':host{position:relative;display:flex;min-width:128px;box-sizing:border-box;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([sticky]){position:sticky;z-index:1;top:0;left:0;box-shadow:8px 0 16px -8px var(--shadow-color-base)}:host([show-menu])::after{display:inline-block;height:100%;margin-right:calc(var(--space-unit) * 4);background:transparent;content:"";user-select:none}.cell--menu-container{position:absolute;z-index:1;top:var(--space-unit);right:var(--space-unit)}: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{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{opacity:1;pointer-events:all}}';const l=r;const h=class{constructor(n){e(this,n);this.colspanChange=t(this,"colspanChange",6);this.colspan=undefined;this.sticky=false;this.showMenu=null;this.popoverPosition=a.AUTO;this.isMenuOpen=false}updateColspan(){if(this.colspan){this.host.style.gridColumn=`span ${this.colspan}`}else{this.host.style.removeProperty("grid-column")}this.colspanChange.emit(this.colspan||1)}onMenuButtonClick(e){e.stopPropagation();this.popoverEl.open=!this.popoverEl.open}componentWillLoad(){this.updateColspan()}render(){return n(s,{key:"36a62d2c751b3b889c7f69280418e95ff02192d5",role:"cell","menu-open":this.isMenuOpen},n("slot",{key:"6d593df3a5d84033f5ec055a00dc972d113ac4cb"}),this.showMenu&&n("div",{key:"77fbfdd8dc31fcfb6694461c8c0ed430323c3926",class:"cell--menu-container prevent-expand"},n("z-button",{key:"caf153b8ba5861b3dc7eabf966cdfdd9d3b197da",variant:i.TERTIARY,icon:"contextual-menu",size:c.X_SMALL,ref:e=>this.menuTrigger=e,onClick:this.onMenuButtonClick.bind(this)}),n("z-popover",{key:"d89b8e0e5b8e622a6e9a08640bff28d64ff0eb07",class:"cell-popover",ref:e=>this.popoverEl=e,bindTo:this.menuTrigger,onOpenChange:e=>this.isMenuOpen=e.detail.open,position:this.popoverPosition},n("slot",{key:"339066d4dd0d6d57ac2358e6a8105aa690b2ca06",name:"contextual-menu"}))))}get host(){return o(this)}static get watchers(){return{colspan:["updateColspan"]}}};h.style=l;export{h as Z};
|
|
2
|
+
//# sourceMappingURL=p-7d7c5344.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["stylesCss","ZTdStyle0","ZTd","PopoverPosition","AUTO","updateColspan","this","colspan","host","style","gridColumn","removeProperty","colspanChange","emit","onMenuButtonClick","ev","stopPropagation","popoverEl","open","componentWillLoad","render","h","Host","key","role","isMenuOpen","showMenu","class","variant","ButtonVariant","TERTIARY","icon","size","ControlSize","X_SMALL","ref","el","menuTrigger","onClick","bind","bindTo","onOpenChange","event","detail","position","popoverPosition","name"],"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 >\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 </Host>\n );\n }\n}\n"],"mappings":"kHAAA,MAAMA,EAAY,2iCAClB,MAAAC,EAAeD,E,MCWFE,EAAG,M,yGAaL,M,cAQuB,K,qBAMIC,EAAgBC,K,gBAMvC,K,CAgBH,aAAAC,GACR,GAAIC,KAAKC,QAAS,CAChBD,KAAKE,KAAKC,MAAMC,WAAa,QAAQJ,KAAKC,S,KACrC,CACLD,KAAKE,KAAKC,MAAME,eAAe,c,CAGjCL,KAAKM,cAAcC,KAAKP,KAAKC,SAAW,E,CAGlC,iBAAAO,CAAkBC,GACxBA,EAAGC,kBACHV,KAAKW,UAAUC,MAAQZ,KAAKW,UAAUC,I,CAGxC,iBAAAC,GACEb,KAAKD,e,CAGP,MAAAe,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,2CACHC,KAAK,OAAM,YACAlB,KAAKmB,YAEhBJ,EAAA,QAAAE,IAAA,6CACCjB,KAAKoB,UACJL,EAAA,OAAAE,IAAA,2CAAKI,MAAM,uCACTN,EAAA,YAAAE,IAAA,2CACEK,QAASC,EAAcC,SACvBC,KAAK,kBACLC,KAAMC,EAAYC,QAClBC,IAAMC,GAAQ9B,KAAK+B,YAAcD,EACjCE,QAAShC,KAAKQ,kBAAkByB,KAAKjC,QAEvCe,EAAA,aAAAE,IAAA,2CACEI,MAAM,eACNQ,IAAMC,GAAQ9B,KAAKW,UAAYmB,EAC/BI,OAAQlC,KAAK+B,YACbI,aAAeC,GAAWpC,KAAKmB,WAAaiB,EAAMC,OAAOzB,KACzD0B,SAAUtC,KAAKuC,iBAEfxB,EAAA,QAAAE,IAAA,2CAAMuB,KAAK,sB","ignoreList":[]}
|