@kubex/zinc 1.1.86 → 1.1.87

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.
@@ -37128,6 +37128,16 @@
37128
37128
  "name": "reposition",
37129
37129
  "description": "Recalculates the panel's position against its anchor."
37130
37130
  },
37131
+ {
37132
+ "kind": "method",
37133
+ "name": "showPanelPopover",
37134
+ "privacy": "private"
37135
+ },
37136
+ {
37137
+ "kind": "method",
37138
+ "name": "hidePanelPopover",
37139
+ "privacy": "private"
37140
+ },
37131
37141
  {
37132
37142
  "kind": "method",
37133
37143
  "name": "startPositioner",
@@ -39338,6 +39348,114 @@
39338
39348
  }
39339
39349
  ]
39340
39350
  },
39351
+ {
39352
+ "kind": "javascript-module",
39353
+ "path": "components/tab/tab.js",
39354
+ "declarations": [
39355
+ {
39356
+ "kind": "class",
39357
+ "description": "",
39358
+ "name": "ZnTab",
39359
+ "slots": [
39360
+ {
39361
+ "description": "The tab panel content.",
39362
+ "name": ""
39363
+ }
39364
+ ],
39365
+ "members": [
39366
+ {
39367
+ "kind": "field",
39368
+ "name": "caption",
39369
+ "type": {
39370
+ "text": "string"
39371
+ },
39372
+ "attribute": "caption"
39373
+ },
39374
+ {
39375
+ "kind": "field",
39376
+ "name": "priority",
39377
+ "type": {
39378
+ "text": "number"
39379
+ },
39380
+ "attribute": "priority"
39381
+ },
39382
+ {
39383
+ "kind": "field",
39384
+ "name": "uri",
39385
+ "type": {
39386
+ "text": "string"
39387
+ },
39388
+ "attribute": "uri"
39389
+ },
39390
+ {
39391
+ "kind": "field",
39392
+ "name": "selected",
39393
+ "type": {
39394
+ "text": "boolean"
39395
+ },
39396
+ "default": "false",
39397
+ "description": "When present, zn-page opens this tab on load instead of the first tab.",
39398
+ "attribute": "selected",
39399
+ "reflects": true
39400
+ }
39401
+ ],
39402
+ "attributes": [
39403
+ {
39404
+ "name": "caption",
39405
+ "type": {
39406
+ "text": "string"
39407
+ },
39408
+ "fieldName": "caption"
39409
+ },
39410
+ {
39411
+ "name": "priority",
39412
+ "type": {
39413
+ "text": "number"
39414
+ },
39415
+ "fieldName": "priority"
39416
+ },
39417
+ {
39418
+ "name": "uri",
39419
+ "type": {
39420
+ "text": "string"
39421
+ },
39422
+ "fieldName": "uri"
39423
+ },
39424
+ {
39425
+ "name": "selected",
39426
+ "type": {
39427
+ "text": "boolean"
39428
+ },
39429
+ "default": "false",
39430
+ "description": "When present, zn-page opens this tab on load instead of the first tab.",
39431
+ "fieldName": "selected"
39432
+ }
39433
+ ],
39434
+ "superclass": {
39435
+ "name": "ZincElement",
39436
+ "module": "/src/internal/zinc-element"
39437
+ },
39438
+ "summary": "Defines a tab panel for use inside zn-page.",
39439
+ "tagNameWithoutPrefix": "tab",
39440
+ "tagName": "zn-tab",
39441
+ "customElement": true,
39442
+ "jsDoc": "/**\n * @summary Defines a tab panel for use inside zn-page.\n * @documentation https://zinc.style/components/tab\n * @status experimental\n * @since 1.0\n *\n * @slot - The tab panel content.\n */",
39443
+ "documentation": "https://zinc.style/components/tab",
39444
+ "status": "experimental",
39445
+ "since": "1.0"
39446
+ }
39447
+ ],
39448
+ "exports": [
39449
+ {
39450
+ "kind": "js",
39451
+ "name": "default",
39452
+ "declaration": {
39453
+ "name": "ZnTab",
39454
+ "module": "components/tab/tab.js"
39455
+ }
39456
+ }
39457
+ ]
39458
+ },
39341
39459
  {
39342
39460
  "kind": "javascript-module",
39343
39461
  "path": "components/style/style.js",
@@ -39708,114 +39826,6 @@
39708
39826
  }
39709
39827
  ]
39710
39828
  },
39711
- {
39712
- "kind": "javascript-module",
39713
- "path": "components/tab/tab.js",
39714
- "declarations": [
39715
- {
39716
- "kind": "class",
39717
- "description": "",
39718
- "name": "ZnTab",
39719
- "slots": [
39720
- {
39721
- "description": "The tab panel content.",
39722
- "name": ""
39723
- }
39724
- ],
39725
- "members": [
39726
- {
39727
- "kind": "field",
39728
- "name": "caption",
39729
- "type": {
39730
- "text": "string"
39731
- },
39732
- "attribute": "caption"
39733
- },
39734
- {
39735
- "kind": "field",
39736
- "name": "priority",
39737
- "type": {
39738
- "text": "number"
39739
- },
39740
- "attribute": "priority"
39741
- },
39742
- {
39743
- "kind": "field",
39744
- "name": "uri",
39745
- "type": {
39746
- "text": "string"
39747
- },
39748
- "attribute": "uri"
39749
- },
39750
- {
39751
- "kind": "field",
39752
- "name": "selected",
39753
- "type": {
39754
- "text": "boolean"
39755
- },
39756
- "default": "false",
39757
- "description": "When present, zn-page opens this tab on load instead of the first tab.",
39758
- "attribute": "selected",
39759
- "reflects": true
39760
- }
39761
- ],
39762
- "attributes": [
39763
- {
39764
- "name": "caption",
39765
- "type": {
39766
- "text": "string"
39767
- },
39768
- "fieldName": "caption"
39769
- },
39770
- {
39771
- "name": "priority",
39772
- "type": {
39773
- "text": "number"
39774
- },
39775
- "fieldName": "priority"
39776
- },
39777
- {
39778
- "name": "uri",
39779
- "type": {
39780
- "text": "string"
39781
- },
39782
- "fieldName": "uri"
39783
- },
39784
- {
39785
- "name": "selected",
39786
- "type": {
39787
- "text": "boolean"
39788
- },
39789
- "default": "false",
39790
- "description": "When present, zn-page opens this tab on load instead of the first tab.",
39791
- "fieldName": "selected"
39792
- }
39793
- ],
39794
- "superclass": {
39795
- "name": "ZincElement",
39796
- "module": "/src/internal/zinc-element"
39797
- },
39798
- "summary": "Defines a tab panel for use inside zn-page.",
39799
- "tagNameWithoutPrefix": "tab",
39800
- "tagName": "zn-tab",
39801
- "customElement": true,
39802
- "jsDoc": "/**\n * @summary Defines a tab panel for use inside zn-page.\n * @documentation https://zinc.style/components/tab\n * @status experimental\n * @since 1.0\n *\n * @slot - The tab panel content.\n */",
39803
- "documentation": "https://zinc.style/components/tab",
39804
- "status": "experimental",
39805
- "since": "1.0"
39806
- }
39807
- ],
39808
- "exports": [
39809
- {
39810
- "kind": "js",
39811
- "name": "default",
39812
- "declaration": {
39813
- "name": "ZnTab",
39814
- "module": "components/tab/tab.js"
39815
- }
39816
- }
39817
- ]
39818
- },
39819
39829
  {
39820
39830
  "kind": "javascript-module",
39821
39831
  "path": "components/table/table.js",
@@ -45861,7 +45871,7 @@
45861
45871
  "package": {
45862
45872
  "name": "@kubex/zinc",
45863
45873
  "description": "A collection of web components for building web applications based off of @shoelace-style/Shoelace",
45864
- "version": "1.1.86",
45874
+ "version": "1.1.87",
45865
45875
  "author": "",
45866
45876
  "license": "MIT"
45867
45877
  }
@@ -4069,6 +4069,23 @@
4069
4069
  }
4070
4070
  ]
4071
4071
  },
4072
+ {
4073
+ "name": "zn-tab",
4074
+ "description": "Defines a tab panel for use inside zn-page.\n---\n\n\n### **Slots:**\n - _default_ - The tab panel content.",
4075
+ "attributes": [
4076
+ { "name": "caption", "values": [] },
4077
+ { "name": "priority", "values": [] },
4078
+ { "name": "uri", "values": [] },
4079
+ {
4080
+ "name": "selected",
4081
+ "description": "When present, zn-page opens this tab on load instead of the first tab.",
4082
+ "values": []
4083
+ }
4084
+ ],
4085
+ "references": [
4086
+ { "name": "Documentation", "url": "https://zinc.style/components/tab" }
4087
+ ]
4088
+ },
4072
4089
  {
4073
4090
  "name": "zn-style",
4074
4091
  "description": "\n---\n",
@@ -4100,23 +4117,6 @@
4100
4117
  }
4101
4118
  ]
4102
4119
  },
4103
- {
4104
- "name": "zn-tab",
4105
- "description": "Defines a tab panel for use inside zn-page.\n---\n\n\n### **Slots:**\n - _default_ - The tab panel content.",
4106
- "attributes": [
4107
- { "name": "caption", "values": [] },
4108
- { "name": "priority", "values": [] },
4109
- { "name": "uri", "values": [] },
4110
- {
4111
- "name": "selected",
4112
- "description": "When present, zn-page opens this tab on load instead of the first tab.",
4113
- "values": []
4114
- }
4115
- ],
4116
- "references": [
4117
- { "name": "Documentation", "url": "https://zinc.style/components/tab" }
4118
- ]
4119
- },
4120
4120
  {
4121
4121
  "name": "zn-table",
4122
4122
  "description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@kubex/zinc",
4
- "version": "1.1.86",
4
+ "version": "1.1.87",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -9584,6 +9584,36 @@
9584
9584
  "events": []
9585
9585
  }
9586
9586
  },
9587
+ {
9588
+ "name": "zn-tab",
9589
+ "description": "Defines a tab panel for use inside zn-page.\n---\n\n\n### **Slots:**\n - _default_ - The tab panel content.",
9590
+ "doc-url": "",
9591
+ "attributes": [
9592
+ { "name": "caption", "value": { "type": "string" } },
9593
+ { "name": "priority", "value": { "type": "number" } },
9594
+ { "name": "uri", "value": { "type": "string" } },
9595
+ {
9596
+ "name": "selected",
9597
+ "description": "When present, zn-page opens this tab on load instead of the first tab.",
9598
+ "value": { "type": "boolean", "default": "false" }
9599
+ }
9600
+ ],
9601
+ "slots": [{ "name": "", "description": "The tab panel content." }],
9602
+ "events": [],
9603
+ "js": {
9604
+ "properties": [
9605
+ { "name": "caption", "type": "string" },
9606
+ { "name": "priority", "type": "number" },
9607
+ { "name": "uri", "type": "string" },
9608
+ {
9609
+ "name": "selected",
9610
+ "description": "When present, zn-page opens this tab on load instead of the first tab.",
9611
+ "type": "boolean"
9612
+ }
9613
+ ],
9614
+ "events": []
9615
+ }
9616
+ },
9587
9617
  {
9588
9618
  "name": "zn-style",
9589
9619
  "description": "\n---\n",
@@ -9677,36 +9707,6 @@
9677
9707
  "events": []
9678
9708
  }
9679
9709
  },
9680
- {
9681
- "name": "zn-tab",
9682
- "description": "Defines a tab panel for use inside zn-page.\n---\n\n\n### **Slots:**\n - _default_ - The tab panel content.",
9683
- "doc-url": "",
9684
- "attributes": [
9685
- { "name": "caption", "value": { "type": "string" } },
9686
- { "name": "priority", "value": { "type": "number" } },
9687
- { "name": "uri", "value": { "type": "string" } },
9688
- {
9689
- "name": "selected",
9690
- "description": "When present, zn-page opens this tab on load instead of the first tab.",
9691
- "value": { "type": "boolean", "default": "false" }
9692
- }
9693
- ],
9694
- "slots": [{ "name": "", "description": "The tab panel content." }],
9695
- "events": [],
9696
- "js": {
9697
- "properties": [
9698
- { "name": "caption", "type": "string" },
9699
- { "name": "priority", "type": "number" },
9700
- { "name": "uri", "type": "string" },
9701
- {
9702
- "name": "selected",
9703
- "description": "When present, zn-page opens this tab on load instead of the first tab.",
9704
- "type": "boolean"
9705
- }
9706
- ],
9707
- "events": []
9708
- }
9709
- },
9710
9710
  {
9711
9711
  "name": "zn-table",
9712
9712
  "description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
package/dist/zn.d.ts CHANGED
@@ -1989,6 +1989,8 @@ declare module "components/slash-menu/slash-menu.component" {
1989
1989
  reposition(): void;
1990
1990
  connectedCallback(): void;
1991
1991
  disconnectedCallback(): void;
1992
+ private showPanelPopover;
1993
+ private hidePanelPopover;
1992
1994
  private startPositioner;
1993
1995
  private stopPositioner;
1994
1996
  private position;
package/dist/zn.min.js CHANGED
@@ -377,7 +377,7 @@ import{a as $n,b as F_,c as ur,d as c,e as B}from"./chunks/zn.UBLZO6CI.js";var L
377
377
  <zn-button color="default" slot="footer" @click=${this.handleQBUpdate}>Show Results</zn-button>
378
378
  </div>
379
379
  </zn-slideout>
380
- `}};dn.styles=T(nv),c([p()],dn.prototype,"filters",2),c([p()],dn.prototype,"name",2),c([p()],dn.prototype,"value",2);var Qh=dn;dn.define("zn-data-table-filter");var re=(i="value")=>(o,t)=>{let r=o.constructor,n=r.prototype.attributeChangedCallback;r.prototype.attributeChangedCallback=function(a,s,l){let d=r.getPropertyOptions(i),h=typeof d.attribute=="string"?d.attribute:i;if(a===h){let m=d.converter||ii,b=(typeof m=="function"?m:m?.fromAttribute??ii.fromAttribute)(l,d.type);this[i]!==b&&(this[t]=b)}n.call(this,a,s,l)}};var q3=new Map;function hd(i){return(Array.isArray(i)?i:i.split(",")).reduce((t,r)=>{let n=q3.get(r.trim());return n?[...t,...n]:t},[])}function I3(i){return typeof i=="object"&&i!==null&&typeof i.label=="string"}function hi(i){let o=i?.trim();if(!o)return[];if(o.startsWith("["))try{let t=JSON.parse(o);return Array.isArray(t)?t.filter(I3):[]}catch{return console.warn("slash-items could not be parsed as JSON",o),[]}return o.split(",").map(t=>t.trim()).filter(t=>t!=="").map(t=>{let r=t.indexOf("=");if(r===-1)return{label:t,value:t};let n=t.slice(0,r).trim(),a=t.slice(r+1).trim();return{label:n||a,value:a}}).filter(t=>t.label!=="")}function D3(i){return i.keywords?(Array.isArray(i.keywords)?i.keywords:i.keywords.split(",")).map(t=>t.trim().toLowerCase()).filter(t=>t!==""):[]}function N3(i,o){let t=i.label.toLowerCase();return t.startsWith(o)?0:t.split(/\s+/).some(r=>r.startsWith(o))?1:t.includes(o)?2:D3(i).some(r=>r.includes(o))?3:i.value?.toLowerCase().includes(o)?4:i.description?.toLowerCase().includes(o)?5:-1}function iv(i,o){let t=o.trim().toLowerCase();return i.map((r,n)=>({item:r,index:n,score:t?N3(r,t):0})).filter(r=>r.score!==-1).sort((r,n)=>r.score-n.score||(r.item.order??r.index)-(n.item.order??n.index)||r.index-n.index).map(r=>r.item)}var Tr=se(class extends Xe{constructor(i){if(super(i),i.type!==or.PROPERTY&&i.type!==or.ATTRIBUTE&&i.type!==or.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Kc(i))throw Error("`live` bindings can only contain a single expression")}render(i){return i}update(i,[o]){if(o===ae||o===V)return o;let t=i.element,r=i.name;if(i.type===or.PROPERTY){if(o===t[r])return ae}else if(i.type===or.BOOLEAN_ATTRIBUTE){if(!!o===t.hasAttribute(r))return ae}else if(i.type===or.ATTRIBUTE&&t.getAttribute(r)===o+"")return ae;return Ba(i),o}});var Jh=new Set,Xa=new Map,Nn,Zh="ltr",tu="en",av=typeof MutationObserver<"u"&&typeof document<"u"&&typeof document.documentElement<"u";if(av){let i=new MutationObserver(sv);Zh=document.documentElement.dir||"ltr",tu=document.documentElement.lang||navigator.language,i.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function vl(...i){i.map(o=>{let t=o.$code.toLowerCase();Xa.has(t)?Xa.set(t,Object.assign(Object.assign({},Xa.get(t)),o)):Xa.set(t,o),Nn||(Nn=o)}),sv()}function sv(){av&&(Zh=document.documentElement.dir||"ltr",tu=document.documentElement.lang||navigator.language),[...Jh.keys()].map(i=>{typeof i.requestUpdate=="function"&&i.requestUpdate()})}var ud=class{constructor(o){this.host=o,this.host.addController(this)}hostConnected(){Jh.add(this.host)}hostDisconnected(){Jh.delete(this.host)}dir(){return`${this.host.dir||Zh}`.toLowerCase()}lang(){let o=`${this.host.lang||tu}`.toLowerCase().replace(/_/g,"-");try{return new Intl.Locale(o),o}catch{return Nn?Nn.$code.toLowerCase():"en"}}getTranslationData(o){var t,r;let n;try{n=new Intl.Locale(o.replace(/_/g,"-"))}catch{return{locale:void 0,language:"",region:"",primary:void 0,secondary:void 0}}let a=n.language.toLowerCase(),s=(r=(t=n.region)===null||t===void 0?void 0:t.toLowerCase())!==null&&r!==void 0?r:"",l=Xa.get(`${a}-${s}`),d=Xa.get(a);return{locale:n,language:a,region:s,primary:l,secondary:d}}exists(o,t){var r;let{primary:n,secondary:a}=this.getTranslationData((r=t.lang)!==null&&r!==void 0?r:this.lang());return t=Object.assign({includeFallback:!1},t),!!(n&&n[o]||a&&a[o]||t.includeFallback&&Nn&&Nn[o])}term(o,...t){let{primary:r,secondary:n}=this.getTranslationData(this.lang()),a;if(r&&r[o])a=r[o];else if(n&&n[o])a=n[o];else if(Nn&&Nn[o])a=Nn[o];else return console.error(`No translation found for: ${String(o)}`),String(o);return typeof a=="function"?a(...t):a}date(o,t){return o=new Date(o),new Intl.DateTimeFormat(this.lang(),t).format(o)}number(o,t){return o=Number(o),isNaN(o)?"":new Intl.NumberFormat(this.lang(),t).format(o)}relativeTime(o,t,r){return new Intl.RelativeTimeFormat(this.lang(),r).format(o,t)}};var lv={$code:"en",$name:"English",$dir:"ltr",onChange:"onChange",showPassword:"Show password",hidePassword:"Hide password",clearEntry:"Clear entry",numOptionsSelected:i=>i===0?"No options selected":i===1?"1 option selected":`${i} options selected`,fileButtonText:"Choose a file",fileButtonTextMultiple:"Choose files",folderButtonText:"Choose a folder",fileDragDrop:"Drop files here to upload",folderDragDrop:"Drop folder here to upload",numFilesSelected:i=>i===0?"No files selected":i===1?"1 file selected":`${i} files selected`};vl(lv);var cv=lv;var tr=class extends ud{};vl(cv);var R3=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize"];function O3(i){let o=parseFloat(i.lineHeight);if(!Number.isNaN(o))return o;let t=parseFloat(i.fontSize);return Number.isNaN(t)?16:t*1.2}function eu(i,o){let t=i.ownerDocument,r=getComputedStyle(i),n=i.nodeName==="INPUT",a=t.createElement("div"),s=a.style,l=r;s.position="absolute",s.visibility="hidden",s.top="0",s.left="-9999px",s.whiteSpace=n?"pre":"pre-wrap",s.overflow="hidden",n||(s.wordWrap="break-word"),R3.forEach(f=>{let b=l[f];typeof b=="string"&&(s[f]=b)}),n&&(s.height="auto");let d=i.value.slice(0,o);a.textContent=n?d.replace(/\s/g,"\xA0"):d;let h=t.createElement("span");h.textContent=i.value.slice(o)||".",a.appendChild(h),t.body.appendChild(a);let m={top:h.offsetTop+(parseFloat(r.borderTopWidth)||0),left:h.offsetLeft+(parseFloat(r.borderLeftWidth)||0),height:O3(r)};return a.remove(),m}function ru(i,{top:o,left:t,height:r}){let n=i.getBoundingClientRect(),a=Math.max(n.top,n.bottom-r),s=Math.min(Math.max(n.top+o-i.scrollTop,n.top),a),l=Math.min(Math.max(n.left+t-i.scrollLeft,n.left),n.right);return new DOMRect(l,s,1,r)}function HH(i,o){return ru(i,eu(i,o))}var dv=E`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}:host *,:host *::before,:host *::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{--slash-menu-width:320px;--slash-menu-max-height:260px;display:contents}:host(:not([open])) .slash-menu__panel{display:none}.slash-menu__panel{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:var(--slash-menu-width);max-width:var(--auto-size-available-width,none);max-height:min(var(--slash-menu-max-height),var(--auto-size-available-height,100vh));overflow-y:auto;overscroll-behavior:none;z-index:var(--zn-z-index-dropdown);padding:var(--zn-spacing-2x-small,4px) 0;background:var(--zn-panel-background-color);border:solid var(--zn-panel-border-width,1px) var(--zn-panel-border-color);border-radius:var(--zn-border-radius,6px);box-shadow:var(--zn-shadow-medium);font-family:var(--zn-font-sans);font-size:var(--zn-font-size-medium);color:rgb(var(--zn-text))}.slash-menu__heading,.slash-menu__group-heading,.slash-menu__footer,.slash-menu__empty{padding:var(--zn-spacing-2x-small,4px) var(--zn-spacing-small,12px);font-size:var(--zn-font-size-x-small);color:var(--zn-color-neutral-500);-moz-user-select:none;user-select:none;-webkit-user-select:none}.slash-menu__group-heading{font-weight:var(--zn-font-weight-semibold);text-transform:uppercase;letter-spacing:0.04em}.slash-menu__footer{border-top:solid var(--zn-panel-border-width,1px) var(--zn-panel-border-color);margin-top:var(--zn-spacing-2x-small,4px)}.slash-menu__item{display:flex;align-items:center;gap:var(--zn-spacing-x-small,8px);width:100%;padding:var(--zn-spacing-x-small,8px) var(--zn-spacing-small,12px);border:none;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.slash-menu__item--active,.slash-menu__item:hover:not(.slash-menu__item--disabled){background:var(--zn-input-background-color-hover)}.slash-menu__item--disabled{opacity:0.5;cursor:not-allowed}.slash-menu__icon{display:flex;align-items:center;justify-content:center;flex:0 0 16px;color:var(--zn-color-neutral-500)}.slash-menu__text{display:flex;flex-direction:column;min-width:0;flex:1 1 auto}.slash-menu__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slash-menu__description{font-size:var(--zn-font-size-x-small);color:var(--zn-color-neutral-500);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slash-menu__token{flex:0 1 auto;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--zn-font-mono);font-size:var(--zn-font-size-x-small);color:var(--zn-color-neutral-600)}`;var md="zn-slash-item-select";function P3(i,o){return!!i&&i.length===o.length&&i.every((t,r)=>t.label===o[r].label&&t.value===o[r].value&&t.disabled===o[r].disabled)}var Re=class extends k{constructor(){super(...arguments);this.open=!1;this.items=[];this.query="";this.heading="Insert";this.emptyText="No matches";this.maxItems=25;this.anchor=null;this.placement="bottom-start";this.distance=4;this.activeIndex=0;this.handleItemMouseDown=t=>{t.preventDefault();let r=Number(t.currentTarget.dataset.index),n=this.visibleItems[r];n&&(this.activeIndex=r,this.selectItem(n))}}get visibleItems(){return this.maxItems>0?this.items.slice(0,this.maxItems):this.items}get activeItem(){return this.visibleItems[this.activeIndex]}show(){this.open=!0}hide(){this.open=!1}setActiveIndex(t){let r=this.visibleItems;if(!r.filter(l=>!l.disabled).length){this.activeIndex=-1;return}let a=(t+r.length)%r.length,s=t<this.activeIndex?-1:1;for(;r[a]?.disabled;)a=(a+s+r.length)%r.length;this.activeIndex=a,this.updateComplete.then(()=>this.scrollActiveIntoView())}moveActive(t){this.setActiveIndex(this.activeIndex+t)}selectActive(){let t=this.activeItem;t&&this.selectItem(t)}reposition(){this.position()}connectedCallback(){super.connectedCallback(),this.open&&this.updateComplete.then(()=>this.startPositioner())}disconnectedCallback(){super.disconnectedCallback(),this.stopPositioner()}startPositioner(){this.stopPositioner(),!(!this.anchor||!this.panel)&&(this.stopAutoUpdate=ad(this.anchor,this.panel,()=>{this.position()}))}stopPositioner(){this.stopAutoUpdate?.(),this.stopAutoUpdate=void 0}async position(){let{anchor:t,panel:r}=this;if(!this.open||!t||!r)return;let{x:n,y:a}=await dd(t,r,{placement:this.placement,strategy:"fixed",middleware:[sd(this.distance),cd({padding:8}),ld({padding:8}),hl({padding:8,apply:({availableHeight:s})=>{r.style.setProperty("--auto-size-available-height",`${Math.max(s,0)}px`)}})]});Object.assign(r.style,{left:`${n}px`,top:`${a}px`})}selectItem(t){t.disabled||this.dispatchEvent(new CustomEvent(md,{bubbles:!0,cancelable:!0,composed:!1,detail:{item:t,query:this.query}}))}scrollActiveIntoView(){let t=this.renderRoot.querySelector('[data-slash-item][aria-selected="true"]');if(!t)return;let r=this.visibleItems,n=this.panel;if(n&&r.slice(0,this.activeIndex).every(a=>a.disabled)){n.scrollTop=0;return}if(n&&r.slice(this.activeIndex+1).every(a=>a.disabled)){n.scrollTop=n.scrollHeight;return}t.scrollIntoView({block:"nearest"})}willUpdate(t){super.willUpdate(t),t.has("items")&&!P3(t.get("items"),this.items)&&(this.activeIndex=this.visibleItems.findIndex(r=>!r.disabled))}updated(t){super.updated(t),(t.has("items")||t.has("open")&&this.open)&&this.scrollActiveIntoView(),(t.has("open")||t.has("anchor"))&&(this.open?this.startPositioner():this.stopPositioner()),this.open&&this.position()}renderItem(t,r,n){let a=r===this.activeIndex,s=t.value&&t.value!==t.label&&!t.value.includes(`
380
+ `}};dn.styles=T(nv),c([p()],dn.prototype,"filters",2),c([p()],dn.prototype,"name",2),c([p()],dn.prototype,"value",2);var Qh=dn;dn.define("zn-data-table-filter");var re=(i="value")=>(o,t)=>{let r=o.constructor,n=r.prototype.attributeChangedCallback;r.prototype.attributeChangedCallback=function(a,s,l){let d=r.getPropertyOptions(i),h=typeof d.attribute=="string"?d.attribute:i;if(a===h){let m=d.converter||ii,b=(typeof m=="function"?m:m?.fromAttribute??ii.fromAttribute)(l,d.type);this[i]!==b&&(this[t]=b)}n.call(this,a,s,l)}};var q3=new Map;function hd(i){return(Array.isArray(i)?i:i.split(",")).reduce((t,r)=>{let n=q3.get(r.trim());return n?[...t,...n]:t},[])}function I3(i){return typeof i=="object"&&i!==null&&typeof i.label=="string"}function hi(i){let o=i?.trim();if(!o)return[];if(o.startsWith("["))try{let t=JSON.parse(o);return Array.isArray(t)?t.filter(I3):[]}catch{return console.warn("slash-items could not be parsed as JSON",o),[]}return o.split(",").map(t=>t.trim()).filter(t=>t!=="").map(t=>{let r=t.indexOf("=");if(r===-1)return{label:t,value:t};let n=t.slice(0,r).trim(),a=t.slice(r+1).trim();return{label:n||a,value:a}}).filter(t=>t.label!=="")}function D3(i){return i.keywords?(Array.isArray(i.keywords)?i.keywords:i.keywords.split(",")).map(t=>t.trim().toLowerCase()).filter(t=>t!==""):[]}function N3(i,o){let t=i.label.toLowerCase();return t.startsWith(o)?0:t.split(/\s+/).some(r=>r.startsWith(o))?1:t.includes(o)?2:D3(i).some(r=>r.includes(o))?3:i.value?.toLowerCase().includes(o)?4:i.description?.toLowerCase().includes(o)?5:-1}function iv(i,o){let t=o.trim().toLowerCase();return i.map((r,n)=>({item:r,index:n,score:t?N3(r,t):0})).filter(r=>r.score!==-1).sort((r,n)=>r.score-n.score||(r.item.order??r.index)-(n.item.order??n.index)||r.index-n.index).map(r=>r.item)}var Tr=se(class extends Xe{constructor(i){if(super(i),i.type!==or.PROPERTY&&i.type!==or.ATTRIBUTE&&i.type!==or.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Kc(i))throw Error("`live` bindings can only contain a single expression")}render(i){return i}update(i,[o]){if(o===ae||o===V)return o;let t=i.element,r=i.name;if(i.type===or.PROPERTY){if(o===t[r])return ae}else if(i.type===or.BOOLEAN_ATTRIBUTE){if(!!o===t.hasAttribute(r))return ae}else if(i.type===or.ATTRIBUTE&&t.getAttribute(r)===o+"")return ae;return Ba(i),o}});var Jh=new Set,Xa=new Map,Nn,Zh="ltr",tu="en",av=typeof MutationObserver<"u"&&typeof document<"u"&&typeof document.documentElement<"u";if(av){let i=new MutationObserver(sv);Zh=document.documentElement.dir||"ltr",tu=document.documentElement.lang||navigator.language,i.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function vl(...i){i.map(o=>{let t=o.$code.toLowerCase();Xa.has(t)?Xa.set(t,Object.assign(Object.assign({},Xa.get(t)),o)):Xa.set(t,o),Nn||(Nn=o)}),sv()}function sv(){av&&(Zh=document.documentElement.dir||"ltr",tu=document.documentElement.lang||navigator.language),[...Jh.keys()].map(i=>{typeof i.requestUpdate=="function"&&i.requestUpdate()})}var ud=class{constructor(o){this.host=o,this.host.addController(this)}hostConnected(){Jh.add(this.host)}hostDisconnected(){Jh.delete(this.host)}dir(){return`${this.host.dir||Zh}`.toLowerCase()}lang(){let o=`${this.host.lang||tu}`.toLowerCase().replace(/_/g,"-");try{return new Intl.Locale(o),o}catch{return Nn?Nn.$code.toLowerCase():"en"}}getTranslationData(o){var t,r;let n;try{n=new Intl.Locale(o.replace(/_/g,"-"))}catch{return{locale:void 0,language:"",region:"",primary:void 0,secondary:void 0}}let a=n.language.toLowerCase(),s=(r=(t=n.region)===null||t===void 0?void 0:t.toLowerCase())!==null&&r!==void 0?r:"",l=Xa.get(`${a}-${s}`),d=Xa.get(a);return{locale:n,language:a,region:s,primary:l,secondary:d}}exists(o,t){var r;let{primary:n,secondary:a}=this.getTranslationData((r=t.lang)!==null&&r!==void 0?r:this.lang());return t=Object.assign({includeFallback:!1},t),!!(n&&n[o]||a&&a[o]||t.includeFallback&&Nn&&Nn[o])}term(o,...t){let{primary:r,secondary:n}=this.getTranslationData(this.lang()),a;if(r&&r[o])a=r[o];else if(n&&n[o])a=n[o];else if(Nn&&Nn[o])a=Nn[o];else return console.error(`No translation found for: ${String(o)}`),String(o);return typeof a=="function"?a(...t):a}date(o,t){return o=new Date(o),new Intl.DateTimeFormat(this.lang(),t).format(o)}number(o,t){return o=Number(o),isNaN(o)?"":new Intl.NumberFormat(this.lang(),t).format(o)}relativeTime(o,t,r){return new Intl.RelativeTimeFormat(this.lang(),r).format(o,t)}};var lv={$code:"en",$name:"English",$dir:"ltr",onChange:"onChange",showPassword:"Show password",hidePassword:"Hide password",clearEntry:"Clear entry",numOptionsSelected:i=>i===0?"No options selected":i===1?"1 option selected":`${i} options selected`,fileButtonText:"Choose a file",fileButtonTextMultiple:"Choose files",folderButtonText:"Choose a folder",fileDragDrop:"Drop files here to upload",folderDragDrop:"Drop folder here to upload",numFilesSelected:i=>i===0?"No files selected":i===1?"1 file selected":`${i} files selected`};vl(lv);var cv=lv;var tr=class extends ud{};vl(cv);var R3=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize"];function O3(i){let o=parseFloat(i.lineHeight);if(!Number.isNaN(o))return o;let t=parseFloat(i.fontSize);return Number.isNaN(t)?16:t*1.2}function eu(i,o){let t=i.ownerDocument,r=getComputedStyle(i),n=i.nodeName==="INPUT",a=t.createElement("div"),s=a.style,l=r;s.position="absolute",s.visibility="hidden",s.top="0",s.left="-9999px",s.whiteSpace=n?"pre":"pre-wrap",s.overflow="hidden",n||(s.wordWrap="break-word"),R3.forEach(f=>{let b=l[f];typeof b=="string"&&(s[f]=b)}),n&&(s.height="auto");let d=i.value.slice(0,o);a.textContent=n?d.replace(/\s/g,"\xA0"):d;let h=t.createElement("span");h.textContent=i.value.slice(o)||".",a.appendChild(h),t.body.appendChild(a);let m={top:h.offsetTop+(parseFloat(r.borderTopWidth)||0),left:h.offsetLeft+(parseFloat(r.borderLeftWidth)||0),height:O3(r)};return a.remove(),m}function ru(i,{top:o,left:t,height:r}){let n=i.getBoundingClientRect(),a=Math.max(n.top,n.bottom-r),s=Math.min(Math.max(n.top+o-i.scrollTop,n.top),a),l=Math.min(Math.max(n.left+t-i.scrollLeft,n.left),n.right);return new DOMRect(l,s,1,r)}function HH(i,o){return ru(i,eu(i,o))}var dv=E`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}:host *,:host *::before,:host *::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{--slash-menu-width:320px;--slash-menu-max-height:260px;display:contents}:host(:not([open])) .slash-menu__panel{display:none}.slash-menu__panel{display:flex;flex-direction:column;position:fixed;inset:0 auto auto 0;margin:0;width:var(--slash-menu-width);max-width:var(--auto-size-available-width,none);max-height:min(var(--slash-menu-max-height),var(--auto-size-available-height,100vh));overflow-y:auto;overscroll-behavior:none;z-index:var(--zn-z-index-dropdown);padding:var(--zn-spacing-2x-small,4px) 0;background:var(--zn-panel-background-color);border:solid var(--zn-panel-border-width,1px) var(--zn-panel-border-color);border-radius:var(--zn-border-radius,6px);box-shadow:var(--zn-shadow-medium);font-family:var(--zn-font-sans);font-size:var(--zn-font-size-medium);color:rgb(var(--zn-text))}.slash-menu__heading,.slash-menu__group-heading,.slash-menu__footer,.slash-menu__empty{padding:var(--zn-spacing-2x-small,4px) var(--zn-spacing-small,12px);font-size:var(--zn-font-size-x-small);color:var(--zn-color-neutral-500);-moz-user-select:none;user-select:none;-webkit-user-select:none}.slash-menu__group-heading{font-weight:var(--zn-font-weight-semibold);text-transform:uppercase;letter-spacing:0.04em}.slash-menu__footer{border-top:solid var(--zn-panel-border-width,1px) var(--zn-panel-border-color);margin-top:var(--zn-spacing-2x-small,4px)}.slash-menu__item{display:flex;align-items:center;gap:var(--zn-spacing-x-small,8px);width:100%;padding:var(--zn-spacing-x-small,8px) var(--zn-spacing-small,12px);border:none;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.slash-menu__item--active,.slash-menu__item:hover:not(.slash-menu__item--disabled){background:var(--zn-input-background-color-hover)}.slash-menu__item--disabled{opacity:0.5;cursor:not-allowed}.slash-menu__icon{display:flex;align-items:center;justify-content:center;flex:0 0 16px;color:var(--zn-color-neutral-500)}.slash-menu__text{display:flex;flex-direction:column;min-width:0;flex:1 1 auto}.slash-menu__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slash-menu__description{font-size:var(--zn-font-size-x-small);color:var(--zn-color-neutral-500);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slash-menu__token{flex:0 1 auto;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--zn-font-mono);font-size:var(--zn-font-size-x-small);color:var(--zn-color-neutral-600)}`;var md="zn-slash-item-select";function P3(i,o){return!!i&&i.length===o.length&&i.every((t,r)=>t.label===o[r].label&&t.value===o[r].value&&t.disabled===o[r].disabled)}var Re=class extends k{constructor(){super(...arguments);this.open=!1;this.items=[];this.query="";this.heading="Insert";this.emptyText="No matches";this.maxItems=25;this.anchor=null;this.placement="bottom-start";this.distance=4;this.activeIndex=0;this.handleItemMouseDown=t=>{t.preventDefault();let r=Number(t.currentTarget.dataset.index),n=this.visibleItems[r];n&&(this.activeIndex=r,this.selectItem(n))}}get visibleItems(){return this.maxItems>0?this.items.slice(0,this.maxItems):this.items}get activeItem(){return this.visibleItems[this.activeIndex]}show(){this.open=!0}hide(){this.open=!1}setActiveIndex(t){let r=this.visibleItems;if(!r.filter(l=>!l.disabled).length){this.activeIndex=-1;return}let a=(t+r.length)%r.length,s=t<this.activeIndex?-1:1;for(;r[a]?.disabled;)a=(a+s+r.length)%r.length;this.activeIndex=a,this.updateComplete.then(()=>this.scrollActiveIntoView())}moveActive(t){this.setActiveIndex(this.activeIndex+t)}selectActive(){let t=this.activeItem;t&&this.selectItem(t)}reposition(){this.position()}connectedCallback(){super.connectedCallback(),this.open&&this.updateComplete.then(()=>this.startPositioner())}disconnectedCallback(){super.disconnectedCallback(),this.stopPositioner(),this.hidePanelPopover()}showPanelPopover(){let t=this.panel;typeof t?.showPopover=="function"&&!t.matches(":popover-open")&&t.showPopover()}hidePanelPopover(){let t=this.panel;typeof t?.hidePopover=="function"&&t.matches(":popover-open")&&t.hidePopover()}startPositioner(){this.stopPositioner(),!(!this.anchor||!this.panel)&&(this.stopAutoUpdate=ad(this.anchor,this.panel,()=>{this.position()}))}stopPositioner(){this.stopAutoUpdate?.(),this.stopAutoUpdate=void 0}async position(){let{anchor:t,panel:r}=this;if(!this.open||!t||!r)return;this.showPanelPopover();let{x:n,y:a}=await dd(t,r,{placement:this.placement,strategy:"fixed",middleware:[sd(this.distance),cd({padding:8}),ld({padding:8}),hl({padding:8,apply:({availableHeight:s})=>{r.style.setProperty("--auto-size-available-height",`${Math.max(s,0)}px`)}})]});Object.assign(r.style,{left:`${n}px`,top:`${a}px`})}selectItem(t){t.disabled||this.dispatchEvent(new CustomEvent(md,{bubbles:!0,cancelable:!0,composed:!1,detail:{item:t,query:this.query}}))}scrollActiveIntoView(){let t=this.renderRoot.querySelector('[data-slash-item][aria-selected="true"]');if(!t)return;let r=this.visibleItems,n=this.panel;if(n&&r.slice(0,this.activeIndex).every(a=>a.disabled)){n.scrollTop=0;return}if(n&&r.slice(this.activeIndex+1).every(a=>a.disabled)){n.scrollTop=n.scrollHeight;return}t.scrollIntoView({block:"nearest"})}willUpdate(t){super.willUpdate(t),t.has("items")&&!P3(t.get("items"),this.items)&&(this.activeIndex=this.visibleItems.findIndex(r=>!r.disabled))}updated(t){super.updated(t),(t.has("open")||t.has("anchor"))&&(this.open?this.startPositioner():(this.stopPositioner(),this.hidePanelPopover())),this.open&&this.position(),(t.has("items")||t.has("open")&&this.open)&&this.scrollActiveIntoView()}renderItem(t,r,n){let a=r===this.activeIndex,s=t.value&&t.value!==t.label&&!t.value.includes(`
381
381
  `)?t.value:"";return u`
382
382
  <button
383
383
  type="button"
@@ -407,6 +407,7 @@ import{a as $n,b as F_,c as ur,d as c,e as B}from"./chunks/zn.UBLZO6CI.js";var L
407
407
  <div
408
408
  part="panel"
409
409
  class="slash-menu__panel"
410
+ popover="manual"
410
411
  role="listbox"
411
412
  aria-hidden=${this.open?"false":"true"}
412
413
  aria-label=${this.query?`Matches for ${this.query}`:this.heading}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubex/zinc",
3
- "version": "1.1.86",
3
+ "version": "1.1.87",
4
4
  "description": "A collection of web components for building web applications based off of @shoelace-style/Shoelace",
5
5
  "keywords": [
6
6
  "web components",
@@ -137,6 +137,21 @@ export default class ZnSlashMenu extends ZincElement {
137
137
  disconnectedCallback() {
138
138
  super.disconnectedCallback();
139
139
  this.stopPositioner();
140
+ this.hidePanelPopover();
141
+ }
142
+
143
+ private showPanelPopover() {
144
+ const panel = this.panel;
145
+ if (typeof panel?.showPopover === 'function' && !panel.matches(':popover-open')) {
146
+ panel.showPopover();
147
+ }
148
+ }
149
+
150
+ private hidePanelPopover() {
151
+ const panel = this.panel;
152
+ if (typeof panel?.hidePopover === 'function' && panel.matches(':popover-open')) {
153
+ panel.hidePopover();
154
+ }
140
155
  }
141
156
 
142
157
  private startPositioner() {
@@ -156,6 +171,8 @@ export default class ZnSlashMenu extends ZincElement {
156
171
  const {anchor, panel} = this;
157
172
  if (!this.open || !anchor || !panel) return;
158
173
 
174
+ this.showPanelPopover();
175
+
159
176
  const {x, y} = await computePosition(anchor, panel, {
160
177
  placement: this.placement,
161
178
  strategy: 'fixed',
@@ -233,20 +250,20 @@ export default class ZnSlashMenu extends ZincElement {
233
250
  protected updated(changed: PropertyValues) {
234
251
  super.updated(changed);
235
252
 
236
- // A new list, or a reopen, starts at the top rather than wherever the last one was scrolled to
237
- if (changed.has('items') || (changed.has('open') && this.open)) {
238
- this.scrollActiveIntoView();
239
- }
240
-
241
253
  if (changed.has('open') || changed.has('anchor')) {
242
254
  if (this.open) {
243
255
  this.startPositioner();
244
256
  } else {
245
257
  this.stopPositioner();
258
+ this.hidePanelPopover();
246
259
  }
247
260
  }
248
261
 
249
262
  if (this.open) void this.position();
263
+
264
+ if (changed.has('items') || (changed.has('open') && this.open)) {
265
+ this.scrollActiveIntoView();
266
+ }
250
267
  }
251
268
 
252
269
  private renderItem(item: SlashMenuItem, index: number, showIcons: boolean) {
@@ -310,6 +327,7 @@ export default class ZnSlashMenu extends ZincElement {
310
327
  <div
311
328
  part="panel"
312
329
  class="slash-menu__panel"
330
+ popover="manual"
313
331
  role="listbox"
314
332
  aria-hidden=${this.open ? 'false' : 'true'}
315
333
  aria-label=${this.query ? `Matches for ${this.query}` : this.heading}>
@@ -15,8 +15,8 @@
15
15
  display: flex;
16
16
  flex-direction: column;
17
17
  position: fixed;
18
- top: 0;
19
- left: 0;
18
+ inset: 0 auto auto 0;
19
+ margin: 0;
20
20
  width: var(--slash-menu-width);
21
21
  max-width: var(--auto-size-available-width, none);
22
22
  max-height: min(var(--slash-menu-max-height), var(--auto-size-available-height, 100vh));