@nanoporetech-digital/components 4.4.1 → 4.5.1

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 (161) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/cjs/index-71f899a7.js +4 -4
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/nano-alert.cjs.entry.js +12 -4
  5. package/dist/cjs/nano-alert.cjs.entry.js.map +1 -1
  6. package/dist/cjs/nano-checkbox.cjs.entry.js +2 -2
  7. package/dist/cjs/nano-checkbox.cjs.entry.js.map +1 -1
  8. package/dist/cjs/nano-components.cjs.js +1 -1
  9. package/dist/cjs/nano-datalist_3.cjs.entry.js +1 -1
  10. package/dist/cjs/nano-details.cjs.entry.js.map +1 -1
  11. package/dist/cjs/nano-dialog.cjs.entry.js +1 -1
  12. package/dist/cjs/nano-field-validator.cjs.entry.js +38 -46
  13. package/dist/cjs/nano-field-validator.cjs.entry.js.map +1 -1
  14. package/dist/cjs/nano-global-nav.cjs.entry.js +4 -4
  15. package/dist/cjs/nano-global-nav.cjs.entry.js.map +1 -1
  16. package/dist/cjs/{nano-progress-bar_2.cjs.entry.js → nano-icon-button_2.cjs.entry.js} +56 -33
  17. package/dist/cjs/nano-icon-button_2.cjs.entry.js.map +1 -0
  18. package/dist/cjs/nano-progress-bar.cjs.entry.js +33 -0
  19. package/dist/cjs/nano-progress-bar.cjs.entry.js.map +1 -0
  20. package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
  21. package/dist/cjs/{nano-table-0ec23172.js → nano-table-4cfc1ea8.js} +2 -2
  22. package/dist/cjs/{nano-table-0ec23172.js.map → nano-table-4cfc1ea8.js.map} +1 -1
  23. package/dist/cjs/nano-table.cjs.entry.js +1 -1
  24. package/dist/cjs/{slot-6c6864a6.js → slot-a448c1a7.js} +3 -5
  25. package/dist/cjs/slot-a448c1a7.js.map +1 -0
  26. package/dist/cjs/{table.worker-39f003e7.js → table.worker-4a894304.js} +2 -2
  27. package/dist/cjs/table.worker-4a894304.js.map +1 -0
  28. package/dist/collection/components/alert/alert.js +33 -3
  29. package/dist/collection/components/alert/alert.js.map +1 -1
  30. package/dist/collection/components/checkbox/checkbox.css +36 -2
  31. package/dist/collection/components/checkbox/checkbox.js +3 -3
  32. package/dist/collection/components/checkbox/checkbox.js.map +1 -1
  33. package/dist/collection/components/details/details.js +5 -2
  34. package/dist/collection/components/details/details.js.map +1 -1
  35. package/dist/collection/components/field-validator/field-validator.js +65 -46
  36. package/dist/collection/components/field-validator/field-validator.js.map +1 -1
  37. package/dist/collection/components/global-nav/global-nav.js +8 -6
  38. package/dist/collection/components/global-nav/global-nav.js.map +1 -1
  39. package/dist/collection/components/global-nav/style/global-nav.css +6 -4
  40. package/dist/collection/components/icon-button/icon-button.js +34 -3
  41. package/dist/collection/components/icon-button/icon-button.js.map +1 -1
  42. package/dist/collection/components/tabs/tab-group.js +2 -2
  43. package/dist/collection/components/tabs/tab-group.js.map +1 -1
  44. package/dist/collection/components/tooltip/tooltip.js +17 -18
  45. package/dist/collection/components/tooltip/tooltip.js.map +1 -1
  46. package/dist/collection/utils/slot.js +2 -4
  47. package/dist/collection/utils/slot.js.map +1 -1
  48. package/dist/components/icon-button.js +18 -4
  49. package/dist/components/icon-button.js.map +1 -1
  50. package/dist/components/nano-alert.js +23 -8
  51. package/dist/components/nano-alert.js.map +1 -1
  52. package/dist/components/nano-checkbox.js +2 -2
  53. package/dist/components/nano-checkbox.js.map +1 -1
  54. package/dist/components/nano-details.js +5 -2
  55. package/dist/components/nano-details.js.map +1 -1
  56. package/dist/components/nano-dialog.js +12 -6
  57. package/dist/components/nano-dialog.js.map +1 -1
  58. package/dist/components/nano-field-validator.js +39 -47
  59. package/dist/components/nano-field-validator.js.map +1 -1
  60. package/dist/components/nano-global-nav.js +6 -6
  61. package/dist/components/nano-global-nav.js.map +1 -1
  62. package/dist/components/nano-overflow-nav.js +10 -4
  63. package/dist/components/nano-overflow-nav.js.map +1 -1
  64. package/dist/components/nano-tab-group.js.map +1 -1
  65. package/dist/components/nano-tab.js +10 -4
  66. package/dist/components/nano-tab.js.map +1 -1
  67. package/dist/components/slot.js +2 -4
  68. package/dist/components/slot.js.map +1 -1
  69. package/dist/components/tooltip.js +15 -18
  70. package/dist/components/tooltip.js.map +1 -1
  71. package/dist/esm/index-dad5627b.js +4 -4
  72. package/dist/esm/loader.js +1 -1
  73. package/dist/esm/nano-alert.entry.js +12 -4
  74. package/dist/esm/nano-alert.entry.js.map +1 -1
  75. package/dist/esm/nano-checkbox.entry.js +2 -2
  76. package/dist/esm/nano-checkbox.entry.js.map +1 -1
  77. package/dist/esm/nano-components.js +1 -1
  78. package/dist/esm/nano-datalist_3.entry.js +1 -1
  79. package/dist/esm/nano-details.entry.js.map +1 -1
  80. package/dist/esm/nano-dialog.entry.js +1 -1
  81. package/dist/esm/nano-field-validator.entry.js +38 -46
  82. package/dist/esm/nano-field-validator.entry.js.map +1 -1
  83. package/dist/esm/nano-global-nav.entry.js +4 -4
  84. package/dist/esm/nano-global-nav.entry.js.map +1 -1
  85. package/dist/esm/{nano-progress-bar_2.entry.js → nano-icon-button_2.entry.js} +57 -34
  86. package/dist/esm/nano-icon-button_2.entry.js.map +1 -0
  87. package/dist/esm/nano-progress-bar.entry.js +29 -0
  88. package/dist/esm/nano-progress-bar.entry.js.map +1 -0
  89. package/dist/esm/nano-tab-group.entry.js.map +1 -1
  90. package/dist/esm/{nano-table-2eaa51e4.js → nano-table-94a6e169.js} +2 -2
  91. package/dist/esm/{nano-table-2eaa51e4.js.map → nano-table-94a6e169.js.map} +1 -1
  92. package/dist/esm/nano-table.entry.js +1 -1
  93. package/dist/esm/{slot-c38a2b92.js → slot-a4f6e2af.js} +3 -5
  94. package/dist/esm/slot-a4f6e2af.js.map +1 -0
  95. package/dist/esm/{table.worker-7866e519.js → table.worker-5d3c7463.js} +2 -2
  96. package/dist/esm/table.worker-5d3c7463.js.map +1 -0
  97. package/dist/nano-components/nano-components.css +1 -1
  98. package/dist/nano-components/nano-components.esm.js +1 -1
  99. package/dist/nano-components/nano-components.esm.js.map +1 -1
  100. package/dist/nano-components/p-119d8899.entry.js +5 -0
  101. package/dist/nano-components/p-119d8899.entry.js.map +1 -0
  102. package/dist/nano-components/p-125d4ca8.entry.js +5 -0
  103. package/dist/nano-components/p-125d4ca8.entry.js.map +1 -0
  104. package/dist/nano-components/p-20038e9c.entry.js +5 -0
  105. package/dist/nano-components/p-20038e9c.entry.js.map +1 -0
  106. package/dist/nano-components/p-25cb3889.entry.js +5 -0
  107. package/dist/nano-components/p-25cb3889.entry.js.map +1 -0
  108. package/dist/nano-components/{p-053eb1df.entry.js → p-27eb26ef.entry.js} +2 -2
  109. package/dist/nano-components/{p-ac0ac58f.entry.js → p-2ad0d9a3.entry.js} +2 -2
  110. package/dist/nano-components/p-357a0a3f.entry.js +5 -0
  111. package/dist/nano-components/p-357a0a3f.entry.js.map +1 -0
  112. package/dist/nano-components/p-58cf5446.js +5 -0
  113. package/dist/nano-components/p-58cf5446.js.map +1 -0
  114. package/dist/nano-components/{p-d4e26ef4.entry.js → p-6b232629.entry.js} +2 -2
  115. package/dist/nano-components/p-76a650b1.entry.js.map +1 -1
  116. package/dist/nano-components/p-95651bcb.entry.js +5 -0
  117. package/dist/nano-components/p-95651bcb.entry.js.map +1 -0
  118. package/dist/nano-components/p-a5a560e7.entry.js.map +1 -1
  119. package/dist/nano-components/{p-3fe0ff90.js → p-b2b29eaf.js} +2 -2
  120. package/dist/nano-components/{p-cdf0aeb7.js → p-e68a4e16.js} +2 -2
  121. package/dist/types/components/alert/alert.d.ts +7 -0
  122. package/dist/types/components/checkbox/checkbox.d.ts +1 -1
  123. package/dist/types/components/field-validator/field-validator.d.ts +4 -4
  124. package/dist/types/components/global-nav/global-nav.d.ts +4 -2
  125. package/dist/types/components/icon-button/icon-button.d.ts +8 -1
  126. package/dist/types/components/tabs/tab-group.d.ts +2 -2
  127. package/dist/types/components/tooltip/tooltip.d.ts +2 -2
  128. package/dist/types/components.d.ts +26 -8
  129. package/docs-json.json +127 -14
  130. package/docs-vscode.json +12 -1
  131. package/hydrate/index.js +107 -100
  132. package/package.json +2 -2
  133. package/dist/cjs/nano-icon-button.cjs.entry.js +0 -52
  134. package/dist/cjs/nano-icon-button.cjs.entry.js.map +0 -1
  135. package/dist/cjs/nano-progress-bar_2.cjs.entry.js.map +0 -1
  136. package/dist/cjs/slot-6c6864a6.js.map +0 -1
  137. package/dist/cjs/table.worker-39f003e7.js.map +0 -1
  138. package/dist/esm/nano-icon-button.entry.js +0 -48
  139. package/dist/esm/nano-icon-button.entry.js.map +0 -1
  140. package/dist/esm/nano-progress-bar_2.entry.js.map +0 -1
  141. package/dist/esm/slot-c38a2b92.js.map +0 -1
  142. package/dist/esm/table.worker-7866e519.js.map +0 -1
  143. package/dist/nano-components/p-104b7e3a.entry.js +0 -5
  144. package/dist/nano-components/p-104b7e3a.entry.js.map +0 -1
  145. package/dist/nano-components/p-62052277.entry.js +0 -5
  146. package/dist/nano-components/p-62052277.entry.js.map +0 -1
  147. package/dist/nano-components/p-9dfe2c55.entry.js +0 -5
  148. package/dist/nano-components/p-9dfe2c55.entry.js.map +0 -1
  149. package/dist/nano-components/p-b933f3c8.js +0 -5
  150. package/dist/nano-components/p-b933f3c8.js.map +0 -1
  151. package/dist/nano-components/p-dc8fd62d.entry.js +0 -5
  152. package/dist/nano-components/p-dc8fd62d.entry.js.map +0 -1
  153. package/dist/nano-components/p-e41baa11.entry.js +0 -5
  154. package/dist/nano-components/p-e41baa11.entry.js.map +0 -1
  155. package/dist/nano-components/p-eab09335.entry.js +0 -5
  156. package/dist/nano-components/p-eab09335.entry.js.map +0 -1
  157. /package/dist/nano-components/{p-053eb1df.entry.js.map → p-27eb26ef.entry.js.map} +0 -0
  158. /package/dist/nano-components/{p-ac0ac58f.entry.js.map → p-2ad0d9a3.entry.js.map} +0 -0
  159. /package/dist/nano-components/{p-cdf0aeb7.js.map → p-6b232629.entry.js.map} +0 -0
  160. /package/dist/nano-components/{p-3fe0ff90.js.map → p-b2b29eaf.js.map} +0 -0
  161. /package/dist/nano-components/{p-d4e26ef4.entry.js.map → p-e68a4e16.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import{j as t,g as n,e,h as o,F as i,r,c as s,d as a,a as l}from"./p-f6a8467a.js";import{a as d}from"./p-ee045579.js";import{d as c}from"./p-9746b0a5.js";import{c as h}from"./p-9ebbb814.js";const b="nano-tbl";const p=(t,n)=>{const e=globalThis[n];return e!=null&&t instanceof e};const _=t=>{if(t!=null){if(p(t,"ArrayBuffer")||p(t,"MessagePort")||p(t,"ImageBitmap")||p(t,"OffscreenCanvas")){return[t]}if(typeof t==="object"){if(t.constructor===Object){t=Object.values(t)}if(Array.isArray(t)){return t.flatMap(_)}return _(t.buffer)}}return[]};let f=0;let u=0;const g=new Map;const m=new Map;const v=(n,e,o)=>{const i=new Worker(n,{name:e});i.addEventListener("message",(({data:n})=>{if(n){const e=n[0];const i=n[1];const r=n[2];if(e===o){const e=n[3];const[o,s,a]=g.get(i);g.delete(i);if(e){const n=e.isError?Object.assign(new Error(e.value.message),e.value):e.value;t(n);s(n)}else{if(a){a.forEach((t=>m.delete(t)))}o(r)}}else if(e===o+".cb"){try{m.get(i)(...r)}catch(n){t(n)}}}}));return i};const w=(t,n,e)=>(...o)=>new Promise(((i,r)=>{let s=f++;let a=0;let l=o.length;let d=[i,r];g.set(s,d);for(;a<l;a++){if(typeof o[a]==="function"){const t=u++;m.set(t,o[a]);o[a]=[n+".cb",t];(d[2]=d[2]||[]).push(t)}}const c=t=>t.postMessage([n,s,e,o],_(o));if(t.then){t.then(c)}else{c(t)}}));const y=import("./p-cdf0aeb7.js").then((t=>t.worker));const k=w(y,"stencil.table.worker","createWorkerStore");const x=w(y,"stencil.table.worker","syncConfigToWorker");const $=w(y,"stencil.table.worker","syncDataToWorker");const j=w(y,"stencil.table.worker","workerFilter");const O=w(y,"stencil.table.worker","workerSearch");const C=w(y,"stencil.table.worker","workerSort");function z(t){const n=JSON.parse(JSON.stringify(t));t.forEach((t=>{if(!!t.sortCompareFn){const e=n.find((n=>n.prop===t.prop));e.sortCompareFn=t.sortCompareFn.toString()}}));return n}const S=new WeakMap;async function I(t,n,e){const o={data:h({rows:[]}),config:h({columns:n}),general:h({workerId:null,scrollParent:e,host:t})};const i=await k(o.data.state.rows,z(o.config.state.columns));o.general.state.workerId=i;S.set(t,o);o.data.use({reset:()=>{if(o.general.state.workerId)$(o.general.state.workerId,null)},dispose:()=>{if(o.general.state.workerId)$(o.general.state.workerId,null)}});o.config.use({reset:()=>{if(o.general.state.workerId)x(o.general.state.workerId,null)},dispose:()=>{if(o.general.state.workerId)x(o.general.state.workerId,null)}});return o}function D(t){return S.get(t)}function T(t){if(t instanceof Date){return"date"}if(["number","string"].includes(typeof t)){return typeof t}return"unknown"}function R(t,n){const e=S.get(t);if(!e)return;const o=e.config.state.columns;const i=o.filter((t=>t.type==="date")).reduce(((t,n)=>[...t,n.prop]),[]);const r=o.filter((t=>!t.type));n=n.map(((t,n)=>{if(r.length&&n===0){e.config.state.columns=o.map((n=>{if(r.includes(n)&&t[n.prop]&&!n.type){n.type=T(t[n.prop]);if(n.type==="date")i.push(n.prop)}return n}))}i.forEach((n=>{var e;const o=(e=new Date(t[n]))!==null&&e!==void 0?e:null;if(!!o&&Number(o))t[n]=Number(o)}));t["__index"]=n;t["__uuid"]=d(o.map((n=>t[n.prop])).join());return t}));e.data.state.rows=n;if(e.general.state.workerId)return $(e.general.state.workerId,n)}function M(t,n){const e=S.get(t);if(!e)return;e.config.state.columns=n;if(e.general.state.workerId)return x(e.general.state.workerId,z(n))}async function N(t,n){const e=S.get(t);if(!e||!e.general.state.workerId)return;try{e.data.state.rows=await O(e.general.state.workerId,n)}catch(t){console.warn(t)}}async function B(t,n){const e=S.get(t);if(!e||!e.general.state.workerId)return;try{e.data.state.rows=await j(e.general.state.workerId,n)}catch(t){console.warn(t)}}async function F(t,n,e){const o=S.get(t);if(!o||!o.general.state.workerId)return;try{o.data.state.rows=await C(o.general.state.workerId,n,e)}catch(t){console.warn(t)}}function P(t,n){const e=E();const o=e.config.state.columns;const i=e.data.state.rows;const r=o[n];const s=r===null||r===void 0?void 0:r.prop;const a=i[t];const l=a?a[o[n].prop]:"";return{prop:s,cellModel:l,column:r,rowIndex:t,rowModel:a}}function A(t){const n=E();const e=n.data.state.rows;const o=e[t];return{rowModel:o,rowIndex:t}}function W(t,n){if(!n)return t;const e=Object.assign(Object.assign({},n),t);if(n.class){if(typeof n.class==="object"&&typeof e.class==="object"){e.class=Object.assign(Object.assign({},n.class),e.class)}else if(typeof n.class==="string"&&typeof e.class==="object"){e.class[n.class]=true}else if(typeof e.class==="string"){e.class+=" "+n.class}}if(n.style){e.style=Object.assign(Object.assign({},n.style),e.style)}return e}function E(){return D(n(e()))}function H(t,n,e){var o;const i=Object.assign({},e);const r=(o=E().config.state.columns[n])===null||o===void 0?void 0:o.cellProperties;if(!r)return i;const s=P(t,n);const a=r(s);if(!a)return i;return W(i,a)}function q(t){const n=t===null||t===void 0?void 0:t.columnTemplate;return n?n(o,t):o(i,null,t.title)}const J=new WeakMap;const L=new WeakMap;function Z(t,n,e){if(J.get(t))return;const o=E();const i=o.general.state.scrollParent;const r=new IntersectionObserver((([t])=>{const o=t.rootBounds||document.scrollingElement.getBoundingClientRect();const r={};if(n==="start"){r.start=t.boundingClientRect.x-(o.x+i.scrollLeft)<0&&!t.isIntersecting}if(n==="end"){r.end=t.boundingClientRect.right>t.boundingClientRect.width&&!t.isIntersecting}if(!!e)e(r)}),{threshold:[1],rootMargin:"1px 0px 100px 0px",root:i===document.scrollingElement?null:i});J.set(t,r);setTimeout((()=>r.observe(t)),300)}function U(t,n,e){if(L.get(t))return;const o=E();const i=o.general.state.scrollParent;const r=new IntersectionObserver((([t])=>{const o=t.rootBounds||document.scrollingElement.getBoundingClientRect();const r={};if(n==="top"){r.top=t.boundingClientRect.y-(o.y+i.scrollTop)<0&&!t.isIntersecting}if(n==="bottom"){const n=t.target.getBoundingClientRect();r.bottom=n.height+n.y>o.height&&!t.isIntersecting}if(!!e)e(r)}),{threshold:[1],rootMargin:"0px 100px 0px 100px",root:i===document.scrollingElement?null:i});L.set(t,r);requestAnimationFrame((()=>r.observe(t)))}function G(t,n,e=false){const o={[`${b}__${t}`]:true,[`${b}__pin`]:!!n,[`${b}__pin--top`]:n==="top",[`${b}__pin--bottom`]:n==="bottom"};if(e)return K(o);return o}function K(t){let n="";Object.entries(t).forEach((([t,e])=>{if(e)n+=t+" "}));return n}function Q(t){let n=getComputedStyle(t);const e=n.position==="absolute";const o=/(auto|scroll)/;if(n.position==="fixed")return document.documentElement;for(let i=t;i=i.parentElement;){n=getComputedStyle(i);if(e&&n.position==="static"){continue}if(o.test(n.overflow+n.overflowY+n.overflowX))return i}return document.documentElement}function V(t,n=100){const e=t.getBoundingClientRect();const o=window.innerHeight||document.documentElement.clientHeight;if(!e.bottom&&!e.top&&!e.left&&!e.right&&!e.height&&!e.width&&!e.x&&!e.y)return false;return!(Math.floor(100-(e.top>=0?0:e.top)/+-e.height*100)<n||Math.floor(100-(e.bottom-o)/e.height*100)<n)}function X(t,n,e){const o=[...e];const i=o.splice(t,1)[0];o.splice(n,0,i);return o}let Y;let tt;let nt;let et;const ot=({column:t,headRenderer:n,onColumnSortClick:e,onColumnPinned:r,onColumnDrag:s,onColumnDrop:a,defaults:l})=>{const d=E();function c(t,n){Y=n;tt=nt=t.target;et=tt.closest("."+`${b}__tr`);et.classList.add(`${b}__dragging`);tt.classList.add(`${b}__drag--start`);t.dataTransfer.effectAllowed="move";t.dataTransfer.setData("text/html",tt.innerHTML);s(n.prop,tt)}function h(){et.classList.remove(`${b}__dragging`);tt.classList.remove(`${b}__drag--start`);et.querySelectorAll(`.${b}__drag-mask--active`).forEach((t=>{t.classList.remove(`${b}__drag-mask--active`)}));tt=null;Y=null;et=null;nt=null}function p(t){if(nt===t.target)return;t.preventDefault();t.stopImmediatePropagation();t.dataTransfer.dropEffect="move";et.querySelectorAll(`.${b}__drag-mask--active`).forEach((t=>{t.classList.remove(`${b}__drag-mask--active`)}));nt=t.target;if(!nt.classList.contains(`${b}__drag-mask`)){t.dataTransfer.dropEffect="none";return}nt.classList.add(`${b}__drag-mask--active`)}function _(t){t.stopPropagation();const{colName:n}=this.dataset;if(n===Y.prop)return;const e=d.config.state.columns;let o=e.findIndex((t=>t.prop===n));const i=e.findIndex((t=>t===Y));if(o<i&&this.classList.contains(`${b}__drag-mask--end`))o++;if(o>i&&this.classList.contains(`${b}__drag-mask--start`))o--;if(o===i)return;a(Y.prop,d.config.state.columns[o].prop,tt)}function f(n){let o;switch(t.order){case"asc":o="desc";break;case"desc":o=null;break;default:o="asc"}e(o,t.prop,n.target.closest("th"))}function u(){return!!l.sortable&&t.sortable!==false||!l.sortable&&t.sortable===true}function g(){return!!l.draggable&&t.draggable!==false||!l.draggable&&t.draggable===true}let m={};if(t.columnProperties){m=t.columnProperties(t)||m}const v={class:Object.assign(Object.assign({},G("th",n===null||n===void 0?void 0:n.pinned)),{[`${b}__pin--start`]:t.pinned==="start",[`${b}__pin--end`]:t.pinned==="end",[`${b}__ordered`]:!!t.order,[`${b}__filtered`]:!!t.filter})};let w=m?W(v,m):v;const y=q(t);if(!y)return o(i,null);w=Number(w.colSpan)>1?Object.assign(Object.assign({},w),{scope:"colgroup"}):Object.assign(Object.assign({},w),{scope:"col"});if(u()){const n=t.order?t.order==="asc"?"ascending":"descending":"none";w=Object.assign(Object.assign({},w),{"aria-sort":n})}if(g()){w=Object.assign(Object.assign({},w),{draggable:true,onDragStart:n=>c(n,t),onDragOver:t=>t.preventDefault(),onDragEnd:()=>h()})}return o("th",Object.assign({},w,{ref:e=>{if(["end","start"].includes(t.pinned))Z(e,t.pinned,r);if(["top","bottom"].includes(n.pinned))U(e,n.pinned,r)},key:t.prop}),g()&&[o("div",{class:{[`${b}__drag-mask`]:true,[`${b}__drag-mask--start`]:true},"data-col-name":t.prop,onDragEnter:p,onDrop:_,onDragOver:t=>t.preventDefault()}),o("div",{class:{[`${b}__drag-mask`]:true,[`${b}__drag-mask--end`]:true},"data-col-name":t.prop,onDragEnter:p,onDrop:_,onDragOver:t=>t.preventDefault()})],u()?o("button",{class:{[`${b}__order-btn`]:true,[`${b}__cell-content`]:true},onClick:f},q(t),!!t.filter&&o("nano-icon",{name:"light/filter"}),!!t.order&&(t.order==="desc"?o("nano-icon",{name:"solid/long-arrow-down"}):o("nano-icon",{name:"solid/long-arrow-up"})),o("div",{class:`${b}__status-icons`},o("nano-icon",{name:"light/chevron-down"}))):o("div",{class:`${b}__cell-content`},q(t),!!t.filter&&o("nano-icon",{name:"light/bars-filter"})))};function it(t,n){var e,r;const s=E();const a=s.config.state.columns;const l=(e=a[n])===null||e===void 0?void 0:e.cellTemplate;const d=P(t,n);if(!!d.cellModel&&a[n].type==="date"){const t=new Date(d.cellModel);if(t instanceof Date&&!isNaN(t)){d.cellModel=!l?`${new Date(d.cellModel).toLocaleDateString()} ${new Date(d.cellModel).toLocaleTimeString()}`:t}}return l?l(o,d):d.cellModel?o(i,null,(r=d.cellModel)===null||r===void 0?void 0:r.toString()):""}const rt=(t,n=false)=>{const e=E();const o=e.config.state.columns[t];const i={[`${b}__td`]:true,[`${b}__ordered`]:!!o.order,[`${b}__pin`]:!!o.pinned,[`${b}__pin--start`]:o.pinned==="start",[`${b}__pin--end`]:o.pinned==="end"};if(n)return K(i);return i};const st=({rowIndex:t,colIndex:n,nestedContent:e})=>{const i=()=>e?e():it(t,n)||o("span",{class:"placeholder"}," ");let r="td";const s=E();const a=s.config.state.columns[n];let l=H(t,n,{class:rt(n)});if(a.rowHeader){l=Number(l.rowSpan)>1?Object.assign(Object.assign({},l),{scope:"rowgroup"}):Object.assign(Object.assign({},l),{scope:"row"});r="th"}const d=t=>o("div",Object.assign({},t,{class:{[`${b}__cell-content`]:true,[`${b}__cell-content--wrap`]:!!a.wrap}}),o(i,null));return o(r,Object.assign({},l),a.autoTooltip&&!a.wrap?o("nano-resize-observe",{notifyContentFit:"x",onNanoResizeContentFitChange:t=>t.target.firstElementChild.disabled=t.detail.x},o("nano-tooltip",{disabled:true,placement:"top",onNanoShow:t=>t.target.closest(r).style.zIndex="100",onNanoHide:t=>t.target.closest(r).style.zIndex=""},o(d,null),o("span",{slot:"content"},o(i,null)))):o(d,null))};const at=({rowRenderer:t,rowIndex:n,rowModel:e,onColumnPinned:i},r,s)=>{let a={};const l=({header:t,wrap:n},e)=>{const i=o("div",{class:{[`${b}__cell-content`]:true,[`${b}__cell-content--wrap`]:n}},e);return t?o("th",{scope:"row"},i):o("td",null,i)};if(!e){const t=A(n);e=t.rowModel}if(t===null||t===void 0?void 0:t.rowProperties){a=t.rowProperties({rowModel:e,rowIndex:n})||a}let d;if((t===null||t===void 0?void 0:t.pinned)&&typeof t.pinned==="function"){d=t.pinned()}const c={class:G("tr",d)};const h=a?W(c,a):c;const p=t===null||t===void 0?void 0:t.template;if(p){let t=p(o,{renderedRow:o("tr",Object.assign({},h,{key:e.__uuid}),r),rowModel:e,rowIndex:n},l);if(Array.isArray(t)){t=s.map(t,((t,n)=>{if(t.vtag==="tr"){if(!t.vkey)t.vkey=`${e.__uuid}_${n}`;t.vattrs=W({class:G("tr",d,true)},t.vattrs);if(!!t.vchildren){t.vchildren=s.map(t.vchildren,((t,n)=>{if(["td","th"].includes(t.vtag.toString())){t.vattrs=W({class:G(t.vtag.toString(),d,true)+rt(n,true),ref:t=>{if(!!t&&d==="top"||d==="bottom")U(t,d,i);if(!!t&&t.classList.contains("nano-tbl__pin--end"))Z(t,"end",i);if(!!t&&t.classList.contains("nano-tbl__pin--start"))Z(t,"start",i)}},t.vattrs)}return t}))}}return t}))}return t}return o("tr",Object.assign({},h,{key:e.__uuid}),r)};const lt=({rowRenderer:t,onColumnPinned:n},e,i)=>{let r={};if(t.rowProperties){r=t.rowProperties()||{}}const s=({header:t,wrap:n},e)=>{const i=o("div",{class:{[`${b}__cell-content`]:true,[`${b}__cell-content--wrap`]:n}},e);return t!==false?o("th",{scope:"col"},i):o("td",null,i)};const a=t.pinned||null;const l={class:G("tr",null)};const d=r?W(l,r):l;const c=t===null||t===void 0?void 0:t.template;if(c){let t=c(o,{renderedRow:o("tr",Object.assign({},d),e)},s);if(Array.isArray(t)){t=i.map(t,(t=>{if(t.vtag==="tr"){t.vattrs=W({class:G("tr",a,true)},t.vattrs);if(!!t.vchildren){t.vchildren=i.map(t.vchildren,(t=>{if(["td","th"].includes(t.vtag.toString())){t.vattrs=W({class:G(t.vtag.toString(),a,true),ref:t=>{if(!!t&&a==="top"||a==="bottom")U(t,a,n);if(!!t&&t.classList.contains("nano-tbl__pin--end"))Z(t,"end",n);if(!!t&&t.classList.contains("nano-tbl__pin--start"))Z(t,"start",n)}},t.vattrs)}return t}))}}return t}))}return t}return o("tr",Object.assign({},d),e)};const dt=':host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}nano-table{display:block;width:100%;--max-col-width:clamp(200px, 500px, 50vw);--color:var(--nano-color-mediumgrey, #68767e);--font-size:0.87rem;--cell-line-height:1.5;--thead-font-size:0.95rem;--thead-color:#455560;--tfoot-color:#455560;--border-color:#dddbda;--border-style:thin solid var(--border-color);--border-tint-color:#0084a9;--border-tint-style:3px solid var(--border-tint-color);--cell-bg-rgb:var(--nano-color-white-rgb, 255 255 255);--head-bg-rgb:250 250 249;--foot-bg-rgb:var(--head-bg-rgb);--th-row-bg-rgb:var(--cell-bg-rgb);--ordered-bg-rgb:var(--nano-color-offwhite-rgb, 249 249 251);--td-padding-start:0.625rem;--td-padding-end:0.625rem;--td-padding-top:0.5rem;--td-padding-bottom:0.4125rem;--th-padding-start:0.625rem;--th-padding-end:0.625rem;--th-padding-top:0.875rem;--th-padding-bottom:0.6875rem;--td-padding-v:var(--td-padding-top) var(--td-padding-bottom);--td-padding-h:var(--td-padding-start) var(--td-padding-end);--th-padding-v:var(--th-padding-top) var(--th-padding-bottom);--th-padding-h:var(--th-padding-start) var(--th-padding-end);--foot-th-padding-v:var(--td-padding-top) var(--td-padding-bottom);--foot-th-padding-h:var(--td-padding-start) var(--td-padding-end);--head-th-padding-v:var(--th-padding-top) var(--th-padding-bottom);--head-th-padding-h:var(--th-padding-start) var(--th-padding-end);--bookend-col-padding:2rem}.nano-tbl{color:var(--color);text-align:start;width:100%;font-size:var(--font-size);border-spacing:0 0;border-collapse:separate;background:rgb(var(--cell-bg-rgb));-webkit-border-end:1px solid transparent;border-inline-end:1px solid transparent;-webkit-border-before:1px solid transparent;border-block-start:1px solid transparent;position:relative;z-index:1}.nano-tbl__wrap{display:table;min-width:100%}.nano-tbl__top-anchor{clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);block-size:1px;inline-size:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;position:relative}.nano-tbl__ordered{background-color:var(--ordered-bg);-webkit-border-start:var(--border-style);border-inline-start:var(--border-style);-webkit-border-end:var(--border-style);border-inline-end:var(--border-style)}.nano-tbl__drag-mask{display:none;position:absolute;inset-block:-2px -2px;z-index:10;opacity:0;transition:0.2s ease opacity}.nano-tbl__drag-mask--start{width:calc(50% + 2px);inset-inline-start:-2px;-webkit-border-start:2px dashed var(--border-tint-color);border-inline-start:2px dashed var(--border-tint-color)}.nano-tbl__drag-mask--end{width:50%;inset-inline-end:0;-webkit-border-end:2px dashed var(--border-tint-color);border-inline-end:2px dashed var(--border-tint-color)}.nano-tbl__drag-mask--active{opacity:1}.nano-tbl__dragging .nano-tbl__drag-mask{display:block}.nano-tbl__drag--start{opacity:0.4}.nano-tbl__dragging .nano-tbl__td,.nano-tbl__dragging .nano-tbl__th{cursor:no-drop}.nano-tbl__dragging .nano-tbl__td .nano-tbl__cell-content,.nano-tbl__dragging .nano-tbl__th .nano-tbl__cell-content{pointer-events:none}.nano-tbl__order-btn{padding:0;border:none;outline:none;font:inherit;background:none;-webkit-appearance:none;appearance:none;color:inherit;display:flex;gap:10px;align-items:center;width:100%}.nano-tbl__status-icons{margin-inline:auto 10px;display:flex;gap:10px}.nano-tbl__progress-bar{font-size:0.2rem;position:sticky;inset-block-start:0;inset-inline:0;z-index:10;transition:scale 0.25s;transform:scale(0);width:100%;height:0}.nano-tbl__progress-bar--show{transform:scale(1);height:auto}.nano-tbl__caption--hide{clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);block-size:1px;inline-size:1px;margin:-1px;overflow:hidden;padding:0;position:absolute}.nano-tbl__td,.nano-tbl__th{line-height:var(--cell-line-height);text-align:start;-webkit-border-before:var(--border-style);border-block-start:var(--border-style);max-width:var(--max-col-width);background-color:rgb(var(--cell-bg-rgb))}tbody:first-of-type tr:first-child .nano-tbl__td,tbody:first-of-type tr:first-child .nano-tbl__th{-webkit-border-before:none;border-block-start:none}tbody:last-of-type tr:last-child .nano-tbl__td,tbody:last-of-type tr:last-child .nano-tbl__th{-webkit-border-after:var(--border-style);border-block-end:var(--border-style)}.md .nano-tbl__td:first-child .nano-tbl__cell-content,.md .nano-tbl__th:first-child .nano-tbl__cell-content{-webkit-padding-start:var(--bookend-col-padding);padding-inline-start:var(--bookend-col-padding)}.md .nano-tbl__td:last-child .nano-tbl__cell-content,.md .nano-tbl__th:last-child .nano-tbl__cell-content{-webkit-padding-end:var(--bookend-col-padding);padding-inline-end:var(--bookend-col-padding)}@media (max-width: 768px){.nano-tbl__td:first-child .nano-tbl__cell-content,.nano-tbl__th:first-child .nano-tbl__cell-content{-webkit-padding-start:var(--td-padding-start) !important;padding-inline-start:var(--td-padding-start) !important}.nano-tbl__td:last-child .nano-tbl__cell-content,.nano-tbl__th:last-child .nano-tbl__cell-content{-webkit-padding-end:var(--td-padding-end) !important;padding-inline-end:var(--td-padding-end) !important}}thead .nano-tbl__td,thead .nano-tbl__th{color:var(--thead-color);font-weight:800;background:rgb(var(--head-bg-rgb)/90%);font-size:var(--thead-font-size);-webkit-border-before:none !important;border-block-start:none !important;transition:all 0.2s ease}thead .nano-tbl__td .nano-tbl__cell-content,thead .nano-tbl__th .nano-tbl__cell-content{padding-block:var(--head-th-padding-v);padding-inline:var(--head-th-padding-h)}tfoot .nano-tbl__td,tfoot .nano-tbl__th{color:var(--tfoot-color);font-weight:800;-webkit-border-before:none;border-block-start:none;background:rgb(var(--foot-bg-rgb)/90%);font-size:var(--thead-font-size)}tfoot .nano-tbl__td .nano-tbl__cell-content,tfoot .nano-tbl__th .nano-tbl__cell-content{padding-block:var(--foot-th-padding-v);padding-inline:var(--foot-th-padding-h)}.nano-tbl__td.nano-tbl__ordered,.nano-tbl__th.nano-tbl__ordered{background-color:rgb(var(--ordered-bg-rgb)/80%) !important}.nano-tbl__cell-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:var(--td-padding-v);padding-inline:var(--td-padding-h)}.nano-tbl__cell-content--no-result{padding-block:2rem}.nano-tbl__cell-content--wrap{white-space:normal;overflow:visible}.nano-tbl tbody{will-change:scroll-position;opacity:1;transition:0.1s ease opacity;transform:translateZ(0)}.nano-tbl tbody.nano-tbl__inactive{opacity:0}.nano-tbl th[scope=row]{font-weight:800;margin:0}.nano-tbl__pin{position:sticky;transform:translateZ(0)}.nano-tbl__pin--start{inset-inline:-1px auto;transition:max-width 0.25s ease}.nano-tbl__pin--start::after{content:"";position:absolute;inset:0;box-shadow:5px 1px 4px 0 rgba(0, 0, 0, 0.2);opacity:0;z-index:-1}.nano-tbl__pinned--start .nano-tbl__pin--start{z-index:2;max-width:125px !important}.sm .nano-tbl__pinned--start .nano-tbl__pin--start{max-width:var(--max-col-width) !important}.nano-tbl__pinned--start .nano-tbl__pin--start::after{opacity:1}.nano-tbl__pin--end{}.nano-tbl__pin--start+.nano-tbl__pin--end{inset-inline:auto auto}.nano-tbl__pin--start+.nano-tbl__pin--end::after{display:none}.sm .nano-tbl__pin--end{inset-inline:auto -1px !important;max-width:min(50vw, 200px)}.sm .nano-tbl__pin--end::after{display:block !important;content:"";position:absolute;inset:0;box-shadow:-5px 1px 4px 0 rgba(0, 0, 0, 0.2);opacity:0;z-index:-1}.sm .nano-tbl__pinned--end .nano-tbl__pin--end::after{opacity:1}.nano-tbl__pin--top{inset-block:-1px auto}.nano-tbl__pinned--top .nano-tbl__pin--top{z-index:4 !important}.nano-tbl__pin--bottom{inset-block:auto -1px}.nano-tbl__pinned--bottom .nano-tbl__pin--bottom{z-index:5 !important}.nano-tbl__pinned--start .nano-tbl__pin--top.nano-tbl__pin--start{z-index:5 !important}.nano-tbl__pinned--top.nano-tbl__pinned--start .nano-tbl__pin--top.nano-tbl__pin--start{z-index:6 !important}.nano-tbl__pinned--end .nano-tbl__pin--top.nano-tbl__pin--end{z-index:5 !important}.nano-tbl__pinned--top.nano-tbl__pinned--end .nano-tbl__pin--top.nano-tbl__pin--end{z-index:6 !important}.nano-tbl__pinned--start .nano-tbl__pin--bottom.nano-tbl__pin--start{z-index:5 !important}.nano-tbl__pinned--bottom.nano-tbl__pinned--start .nano-tbl__pin--bottom.nano-tbl__pin--start{z-index:6 !important}.nano-tbl__pinned--end .nano-tbl__pin--bottom.nano-tbl__pin--end{z-index:5 !important}.nano-tbl__pinned--bottom.nano-tbl__pinned--end .nano-tbl__pin--bottom.nano-tbl__pin--end{z-index:6 !important}.nano-tbl thead tr:last-of-type td,.nano-tbl thead tr:last-of-type th{-webkit-border-after:var(--border-tint-style);border-block-end:var(--border-tint-style)}.nano-tbl tfoot tr:first-of-type td,.nano-tbl tfoot tr:first-of-type th{-webkit-border-before:none;border-block-start:none}.nano-tbl tfoot tr:last-of-type td,.nano-tbl tfoot tr:last-of-type th{-webkit-border-after:var(--border-tint-style);border-block-end:var(--border-tint-style)}.nano-tbl__pinned--bottom .nano-tbl tfoot tr.nano-tbl__pin--bottom:first-of-type td,.nano-tbl__pinned--bottom .nano-tbl tfoot tr.nano-tbl__pin--bottom:first-of-type th{-webkit-border-before:var(--border-tint-style) !important;border-block-start:var(--border-tint-style) !important}.nano-tbl__pinned--bottom .nano-tbl tfoot tr.nano-tbl__pin--bottom:last-of-type td,.nano-tbl__pinned--bottom .nano-tbl tfoot tr.nano-tbl__pin--bottom:last-of-type th{-webkit-border-after:none !important;border-block-end:none !important}.nano-tbl .unlimited-width{max-width:none}.nano-tbl__spinner{font-size:1.5rem;transition:scale 0.25s;scale:0;padding:0.5rem;position:absolute;inset-block-end:0;inset-inline-start:calc(50% - 0.75rem);z-index:0}.nano-tbl__spinner--show{scale:1;position:sticky}.nano-tbl nano-skeleton{line-height:var(--cell-line-height)}';let ct=0;const ht=class{constructor(t){r(this,t);this.nanoTblReady=s(this,"nanoTblReady",7);this.nanoTblBlockRendered=s(this,"nanoTblBlockRendered",7);this.nanoTblBeforeSort=s(this,"nanoTblBeforeSort",7);this.nanoTblAfterSort=s(this,"nanoTblAfterSort",7);this.nanoTblColDrag=s(this,"nanoTblColDrag",7);this.nanoTblColDrop=s(this,"nanoTblColDrop",7);this.nanoTblBeforeFilter=s(this,"nanoTblBeforeFilter",7);this.nanoTblAfterFilter=s(this,"nanoTblAfterFilter",7);this.nanoTblBeforeSearch=s(this,"nanoTblBeforeSearch",7);this.nanoTblAfterSearch=s(this,"nanoTblAfterSearch",7);this.nanoTblBeforeEdit=s(this,"nanoTblBeforeEdit",7);this.renderId="tbl-"+ct++;this.filters=[];this.currentFilters="[]";this.currentSort="";this.cacheScrollPosition=0;this.measureHeight=0;this.blockHeights=[];this.unitHeight=0;this._isReady=false;this.colDrag=t=>{this.nanoTblColDrag.emit({column:t})};this.colDrop=(t,n)=>{const e=this.store.config.state.columns;const o=e.findIndex((t=>t.prop===n));const i=e.findIndex((n=>n.prop===t));const r=this.nanoTblColDrop.emit({fromCol:t,toCol:n,fromIndex:i,toIndex:o});if(r.defaultPrevented)return;this.columns=X(i,o,e)};this.sortStart=async(t,n,e)=>{if(this.currentSort===t+":"+n)return;this._loading=true;const o=this.nanoTblBeforeSort.emit({column:n,order:t});if(o.defaultPrevented)return;this.currentSort=t+":"+n;this.scrollToTop(e);if(this.customSortFn){try{const e=await this.customSortFn(n,t);if(e===true){this.sortComplete(t,n);this._loading=false;return}}catch(t){console.warn("custom sort failed",t);this.currentSort="";this._loading=false;return}}try{await F(this.host,n,t);this.sortComplete(t,n)}catch(t){console.warn("sort failed",t);this.currentSort=""}finally{if(this.blocks.length)this._loading=false}};this.scrollHandler=()=>{this.cacheScrollPosition=this.scrollParent.scrollTop||window.scrollY;requestAnimationFrame((()=>{let t=0;let n=0;const e=this.blocks.length;while(n<e&&this.cacheScrollPosition>=t){t+=this.getBlockHeight(n);if(this.cacheScrollPosition<t){const t=[n,n+1,Math.max(0,n-1)];if(t.toString()!==this.activeBlocks.toString()){this.activeBlocks=t;this.setBlockHeight()}this.primaryBlockIndex=n}n++}}))};this.handleColumnPinned=t=>{Object.entries(t).forEach((([t,n])=>{this.tableEle.classList.toggle(`${b}__pinned--${t}`,n)}))};this.handleResizeChange=t=>{var n;this.tableWrapperEle.className="";let e=[`${b}__wrap`];if((n=t.target)===null||n===void 0?void 0:n.className)e=[...t.target.className.split(" "),...e];this.tableWrapperEle.classList.add(...e.filter((t=>!!t)))};this.type="table";this.caption=undefined;this.showCaption=false;this.loading=undefined;this.internalLoading=false;this.placeholderSize=5;this.rows=undefined;this.columns=[];this.headRender={pinned:"top"};this.rowRender=undefined;this.footRender={pinned:"bottom"};this.showFooter=false;this.perBlock=40;this.searchTerm=undefined;this.customFilterFn=undefined;this.customSortFn=undefined;this.defaultSort=true;this.defaultColDraggable=false;this.virtualTotalItems=0;this.blocks=[];this.activeBlocks=[0,1,2];this.debounceSetLoading=c(this.debounceSetLoading.bind(this),50)}get _loading(){return this.loading!==undefined?this.loading:this.internalLoading}set _loading(t){if(this.loading!==undefined)return;this.debounceSetLoading(t)}debounceSetLoading(t){this.internalLoading=t}handleRowsChange(){if(!this.rows){this._loading=true;return}this._loading=true;Promise.resolve(this.rows).then((async t=>{await R(this.host,t);this.currentFilters="";this.currentSort="";await this.columnInit();if(!this.isReady)this.setInitialBlockDimension();this._loading=false}))}async handleColsChange(){await M(this.host,this.columns);if(this.isReady)this.columnInit()}get blocksLength(){return this.blocks.length}handleSearchTermChange(){this.searchStart()}virtualTotalItemsChangeHandler(){this.setBlocks()}async resetSorting(){const t=this.columns.find((t=>!!t.order));if(!t)return;return this.sortStart(null,t.prop)}async addSort(t,n){const e=this.columns.find((n=>n.prop===t));if(!e)throw"Cannot find column with "+t;return this.sortStart(n,e.prop)}async resetFilters(){this.filters=[];return this.filterStart()}async addFilters(t,n=true){if(!n)this.filters=[];return this.filterStart(t,n)}async removeFilters(t){this.filters=this.filters.filter((n=>!t.includes(n.prop)));return this.filterStart()}async updateRow(t,n){this.rows.splice(n,1,t);this.handleRowsChange()}set measureEle(t){var n;if(!t)return;const e=t.getBoundingClientRect().height;this.measureHeight=Math.abs(this.measureHeight-e)<5?this.measureHeight:e;this.unitHeight=((n=t.querySelector("tr"))===null||n===void 0?void 0:n.getBoundingClientRect().height)||this.unitHeight}get scrollParent(){return this._scrollParent}set scrollParent(t){if(t===this._scrollParent)return;if(this._scrollParent){(this._scrollParent===document.documentElement?document:this._scrollParent).removeEventListener("scroll",this.scrollHandler)}(t===document.documentElement?document:t).addEventListener("scroll",this.scrollHandler);this._scrollParent=t}get primaryBlockIndex(){return this._primaryBlockIndex}set primaryBlockIndex(t){if(this._primaryBlockIndex===t)return;this._primaryBlockIndex=t;this.nanoTblBlockRendered.emit({block:t,totalBlocks:this.blockElements.length})}get isReady(){return this._isReady}set isReady(t){if(t===this._isReady)return;this._isReady=t;if(this.isReady)requestAnimationFrame((()=>this.handleReady()))}handleReady(){const t=window.location.hash;if(t.length>1){try{const n=document.querySelector(t);if(n)n.scrollIntoView()}catch(t){}}this.nanoTblReady.emit()}sortComplete(t,n){this.columns=this.columns.map((e=>{if(e.prop===n)return Object.assign(Object.assign({},e),{order:t});return Object.assign(Object.assign({},e),{order:null})}));this.nanoTblAfterSort.emit({column:n,order:t})}async searchStart(){this._loading=true;const t=this.nanoTblBeforeSearch.emit({term:this.searchTerm});if(t.defaultPrevented)return;this.scrollToTop();try{await N(this.host,this.searchTerm);this.nanoTblAfterSearch.emit({term:this.searchTerm})}catch(t){console.warn("search failed",t)}finally{this._loading=false}}async filterStart(t,n=true){if(t){if(n){this.filters=[...this.filters.filter((n=>!t.find((t=>t.prop===n.prop)))),...t]}else{this.filters=t}}if(this.currentFilters===JSON.stringify(this.filters))return;this._loading=true;const e=this.nanoTblBeforeFilter.emit({filters:this.filters});if(e.defaultPrevented)return;this.currentFilters=JSON.stringify(this.filters);this.scrollToTop();if(this.customFilterFn){try{const t=await this.customFilterFn(this.filters);if(t===true){this.filterComplete();this._loading=false}}catch(t){console.warn("custom filter failed",t);this.currentFilters="";this._loading=false}return}try{await B(this.host,this.filters);this.filterComplete()}catch(t){console.warn("filter failed",t)}finally{this._loading=false}}filterComplete(){this.columns=this.columns.map((t=>{const n=this.filters.find((n=>n.prop===t.prop));if(n)t.filter=n.filter;return t}));this.nanoTblAfterFilter.emit({filters:this.filters})}scrollToTop(t){var n;const e=(n=this.scrollParent.style)===null||n===void 0?void 0:n.scrollBehavior;const o=this.scrollParent.scrollLeft;this.scrollParent.style.scrollBehavior="auto";if(this.topAnchorEle&&!V(this.topAnchorEle,.1)){this.host.scrollIntoView()}if(t&&!V(t,1))setTimeout((()=>t.scrollIntoView({block:"start"})),500);if(o)this.scrollParent.scrollLeft=o;if(e)this.scrollParent.style.scrollBehavior=e;this.scrollHandler()}setMeasureElement(){a((()=>{this.measureEle=this.blockElements.find((t=>{var n;return!((n=t===null||t===void 0?void 0:t.classList)===null||n===void 0?void 0:n.contains(`${b}__inactive`))}))}))}setInitialBlockDimension(){var t;if(!((t=this.blockElements)===null||t===void 0?void 0:t.length))return;const n=new Promise((t=>{a((()=>{this.setMeasureElement();if(!this.measureEle&&!this.unitHeight)t();this.blockElements.forEach(((n,e)=>{var o;if(!n||!((o=n.classList)===null||o===void 0?void 0:o.contains(`${b}__inactive`))){if(e===this.blockElements.length-1)t();return}if(e===this.blockElements.length-1)t()}))}))}));n.then((()=>{requestAnimationFrame((()=>{this.isReady=true}))}))}async columnInit(){this.filters=this.columns.filter((t=>!!t.filter)).map((t=>{const{filter:n,prop:e}=t;return{filter:n,prop:e}}));if(this.searchTerm){await this.searchStart()}if(this.filters.length){await this.filterStart()}const t=this.columns.find((t=>!!t.order));if(!!t){await this.sortStart(t.order,t.prop)}}setBlocks(){const t=this.store.data.state.rows;if(!t.length){this.blocks=[];return}let n=1;const e=this.virtualTotalItems>t.length?this.virtualTotalItems:t.length;let o=[];const i=[];this.blockHeights=[];for(n;n<=e;n++){o.push(this.store.data.state.rows[n-1]||{__uuid:""});if(n%this.perBlock===0){i.push({rows:o,__uuid:d(o.map((t=>t.__uuid)).join())});o=[]}}if(o.length){i.push({rows:o,__uuid:d(o.map((t=>t.__uuid)).join())})}this.blocks=i}getBlockHeight(t){if(this.blockHeights.length){const n=this.blockHeights.find((n=>n.blockIndex===t));if(n)return n.height}const n=this.blocks[t].rows.length;if(n===this.perBlock&&this.measureHeight){return this.measureHeight}return this.unitHeight?this.unitHeight*n:undefined}setBlockHeight(){this.activeBlocks.forEach((t=>{const n=this.blockElements[t];if(!n)return;a((()=>{const e=n.getBoundingClientRect().height;const o=this.blockHeights.findIndex((n=>n.blockIndex===t));if(o>0){this.blockHeights[o]={height:e,blockIndex:t}}else this.blockHeights.push({height:e,blockIndex:t})}))}))}processSlots(){if(!this.caption&&!this.host.querySelector('[slot="caption"]')){console.error("For accessibility you must set a `caption` prop or use the `caption` slot")}}async componentWillLoad(){this.scrollParent=Q(this.host);this.store=await I(this.host,this.columns,this.scrollParent);await this.handleRowsChange();this.processSlots();this.store.data.onChange("rows",(()=>this.setBlocks()));this.setBlocks()}connectedCallback(){this.scrollParent=Q(this.host)}componentDidLoad(){this.setInitialBlockDimension()}componentShouldUpdate(t,n,e){if(["rows","columns"].includes(e))return false}componentWillRender(){}componentDidRender(){this.setMeasureElement()}render(){this.blockElements=[];return o(l,null,o("div",{class:`${b}__top-anchor`,ref:t=>this.topAnchorEle=t}," "),o("nano-resize-observe",{"aria-labelledby":"table-caption-"+this.renderId,tabindex:this.type==="grid"?"0":undefined,states:"576w sm, 768w md",class:"sm md",onNanoResizeStateChange:this.handleResizeChange}),o("div",{class:`${b}__wrap sm md`,ref:t=>this.tableWrapperEle=t},o("nano-progress-bar",{indeterminate:true,class:{[`${b}__progress-bar`]:true,[`${b}__progress-bar--show`]:this._loading}}),o("table",{role:this.type==="grid"?"grid":undefined,"aria-readonly":this.type==="table"?"true":undefined,"aria-rowcount":this.store.data.state.rows.length,"aria-colcount":this.store.config.state.columns.length,class:`${b}`,ref:t=>this.tableEle=t},o("caption",{class:{[`${b}__caption`]:true,[`${b}__caption--hide`]:!this.showCaption},id:"table-caption-"+this.renderId},o("slot",{name:"caption"},this.caption)),o("thead",null,o(lt,{rowRenderer:this.headRender,onColumnPinned:this.handleColumnPinned},this.store.config.state.columns.map((t=>[o(ot,{column:t,headRenderer:this.headRender,onColumnSortClick:this.sortStart,onColumnPinned:this.handleColumnPinned,onColumnDrag:this.colDrag,onColumnDrop:this.colDrop,defaults:{sortable:this.defaultSort,draggable:this.defaultColDraggable}})])))),this._loading&&!this.blocks.length&&o("tbody",{class:`${b}__active`},[...Array(10).keys()].map((t=>o("tr",null,this.store.config.state.columns.map(((n,e)=>o(st,{rowIndex:t,colIndex:e,nestedContent:()=>o("nano-skeleton",null)}))))))),!this._loading&&!this.blocks.length&&o("tr",null,o("th",{class:`${b}__th`,colSpan:this.store.config.state.columns.length},o("div",{class:"nano-tbl__cell-content nano-tbl__cell-content--no-result"},o("slot",{name:"no-results"},"No results found")))),this.blocks.map(((t,n)=>o("tbody",{key:t.__uuid,id:`tbody-${this.renderId}-${n}`,ref:t=>{this.blockElements.push(t)},class:{[`${b}__inactive`]:!this.activeBlocks.includes(n),[`${b}__active`]:this.activeBlocks.includes(n)}},this.activeBlocks.includes(n)?t.rows.map(((t,e)=>{const i=n>0?n*this.perBlock+e:e;return o(at,{rowRenderer:this.rowRender,rowModel:t,rowIndex:i},this.store.config.state.columns.map(((t,n)=>o(st,{rowIndex:i,colIndex:n}))))})):o("tr",null,o("td",{colSpan:this.store.config.state.columns.length,style:{height:this.getBlockHeight(n)+"px"}}))))),this.showFooter&&o("tfoot",null,o(lt,{rowRenderer:this.footRender,onColumnPinned:this.handleColumnPinned},this.store.config.state.columns.map((t=>[o(ot,{column:t,headRenderer:this.footRender,onColumnPinned:this.handleColumnPinned,onColumnSortClick:this.sortStart,defaults:{sortable:this.defaultSort,draggable:this.defaultColDraggable}})]))))),!!this.blocks.length&&o("nano-spinner",{type:"circle",class:{[`${b}__spinner`]:true,[`${b}__spinner--show`]:this._loading}})))}get host(){return n(this)}static get watchers(){return{rows:["handleRowsChange"],columns:["handleColsChange"],searchTerm:["handleSearchTermChange"],virtualTotalItems:["virtualTotalItemsChangeHandler"]}}};ht.style=dt;export{ht as T,v as c};
5
- //# sourceMappingURL=p-3fe0ff90.js.map
4
+ import{j as t,g as n,e,h as o,F as i,r,c as s,d as a,a as l}from"./p-f6a8467a.js";import{a as d}from"./p-ee045579.js";import{d as c}from"./p-9746b0a5.js";import{c as h}from"./p-9ebbb814.js";const b="nano-tbl";const p=(t,n)=>{const e=globalThis[n];return e!=null&&t instanceof e};const _=t=>{if(t!=null){if(p(t,"ArrayBuffer")||p(t,"MessagePort")||p(t,"ImageBitmap")||p(t,"OffscreenCanvas")){return[t]}if(typeof t==="object"){if(t.constructor===Object){t=Object.values(t)}if(Array.isArray(t)){return t.flatMap(_)}return _(t.buffer)}}return[]};let f=0;let u=0;const g=new Map;const m=new Map;const v=(n,e,o)=>{const i=new Worker(n,{name:e});i.addEventListener("message",(({data:n})=>{if(n){const e=n[0];const i=n[1];const r=n[2];if(e===o){const e=n[3];const[o,s,a]=g.get(i);g.delete(i);if(e){const n=e.isError?Object.assign(new Error(e.value.message),e.value):e.value;t(n);s(n)}else{if(a){a.forEach((t=>m.delete(t)))}o(r)}}else if(e===o+".cb"){try{m.get(i)(...r)}catch(n){t(n)}}}}));return i};const w=(t,n,e)=>(...o)=>new Promise(((i,r)=>{let s=f++;let a=0;let l=o.length;let d=[i,r];g.set(s,d);for(;a<l;a++){if(typeof o[a]==="function"){const t=u++;m.set(t,o[a]);o[a]=[n+".cb",t];(d[2]=d[2]||[]).push(t)}}const c=t=>t.postMessage([n,s,e,o],_(o));if(t.then){t.then(c)}else{c(t)}}));const y=import("./p-e68a4e16.js").then((t=>t.worker));const k=w(y,"stencil.table.worker","createWorkerStore");const x=w(y,"stencil.table.worker","syncConfigToWorker");const $=w(y,"stencil.table.worker","syncDataToWorker");const j=w(y,"stencil.table.worker","workerFilter");const O=w(y,"stencil.table.worker","workerSearch");const C=w(y,"stencil.table.worker","workerSort");function z(t){const n=JSON.parse(JSON.stringify(t));t.forEach((t=>{if(!!t.sortCompareFn){const e=n.find((n=>n.prop===t.prop));e.sortCompareFn=t.sortCompareFn.toString()}}));return n}const S=new WeakMap;async function I(t,n,e){const o={data:h({rows:[]}),config:h({columns:n}),general:h({workerId:null,scrollParent:e,host:t})};const i=await k(o.data.state.rows,z(o.config.state.columns));o.general.state.workerId=i;S.set(t,o);o.data.use({reset:()=>{if(o.general.state.workerId)$(o.general.state.workerId,null)},dispose:()=>{if(o.general.state.workerId)$(o.general.state.workerId,null)}});o.config.use({reset:()=>{if(o.general.state.workerId)x(o.general.state.workerId,null)},dispose:()=>{if(o.general.state.workerId)x(o.general.state.workerId,null)}});return o}function D(t){return S.get(t)}function T(t){if(t instanceof Date){return"date"}if(["number","string"].includes(typeof t)){return typeof t}return"unknown"}function R(t,n){const e=S.get(t);if(!e)return;const o=e.config.state.columns;const i=o.filter((t=>t.type==="date")).reduce(((t,n)=>[...t,n.prop]),[]);const r=o.filter((t=>!t.type));n=n.map(((t,n)=>{if(r.length&&n===0){e.config.state.columns=o.map((n=>{if(r.includes(n)&&t[n.prop]&&!n.type){n.type=T(t[n.prop]);if(n.type==="date")i.push(n.prop)}return n}))}i.forEach((n=>{var e;const o=(e=new Date(t[n]))!==null&&e!==void 0?e:null;if(!!o&&Number(o))t[n]=Number(o)}));t["__index"]=n;t["__uuid"]=d(o.map((n=>t[n.prop])).join());return t}));e.data.state.rows=n;if(e.general.state.workerId)return $(e.general.state.workerId,n)}function M(t,n){const e=S.get(t);if(!e)return;e.config.state.columns=n;if(e.general.state.workerId)return x(e.general.state.workerId,z(n))}async function N(t,n){const e=S.get(t);if(!e||!e.general.state.workerId)return;try{e.data.state.rows=await O(e.general.state.workerId,n)}catch(t){console.warn(t)}}async function B(t,n){const e=S.get(t);if(!e||!e.general.state.workerId)return;try{e.data.state.rows=await j(e.general.state.workerId,n)}catch(t){console.warn(t)}}async function F(t,n,e){const o=S.get(t);if(!o||!o.general.state.workerId)return;try{o.data.state.rows=await C(o.general.state.workerId,n,e)}catch(t){console.warn(t)}}function P(t,n){const e=E();const o=e.config.state.columns;const i=e.data.state.rows;const r=o[n];const s=r===null||r===void 0?void 0:r.prop;const a=i[t];const l=a?a[o[n].prop]:"";return{prop:s,cellModel:l,column:r,rowIndex:t,rowModel:a}}function A(t){const n=E();const e=n.data.state.rows;const o=e[t];return{rowModel:o,rowIndex:t}}function W(t,n){if(!n)return t;const e=Object.assign(Object.assign({},n),t);if(n.class){if(typeof n.class==="object"&&typeof e.class==="object"){e.class=Object.assign(Object.assign({},n.class),e.class)}else if(typeof n.class==="string"&&typeof e.class==="object"){e.class[n.class]=true}else if(typeof e.class==="string"){e.class+=" "+n.class}}if(n.style){e.style=Object.assign(Object.assign({},n.style),e.style)}return e}function E(){return D(n(e()))}function H(t,n,e){var o;const i=Object.assign({},e);const r=(o=E().config.state.columns[n])===null||o===void 0?void 0:o.cellProperties;if(!r)return i;const s=P(t,n);const a=r(s);if(!a)return i;return W(i,a)}function q(t){const n=t===null||t===void 0?void 0:t.columnTemplate;return n?n(o,t):o(i,null,t.title)}const J=new WeakMap;const L=new WeakMap;function Z(t,n,e){if(J.get(t))return;const o=E();const i=o.general.state.scrollParent;const r=new IntersectionObserver((([t])=>{const o=t.rootBounds||document.scrollingElement.getBoundingClientRect();const r={};if(n==="start"){r.start=t.boundingClientRect.x-(o.x+i.scrollLeft)<0&&!t.isIntersecting}if(n==="end"){r.end=t.boundingClientRect.right>t.boundingClientRect.width&&!t.isIntersecting}if(!!e)e(r)}),{threshold:[1],rootMargin:"1px 0px 100px 0px",root:i===document.scrollingElement?null:i});J.set(t,r);setTimeout((()=>r.observe(t)),300)}function U(t,n,e){if(L.get(t))return;const o=E();const i=o.general.state.scrollParent;const r=new IntersectionObserver((([t])=>{const o=t.rootBounds||document.scrollingElement.getBoundingClientRect();const r={};if(n==="top"){r.top=t.boundingClientRect.y-(o.y+i.scrollTop)<0&&!t.isIntersecting}if(n==="bottom"){const n=t.target.getBoundingClientRect();r.bottom=n.height+n.y>o.height&&!t.isIntersecting}if(!!e)e(r)}),{threshold:[1],rootMargin:"0px 100px 0px 100px",root:i===document.scrollingElement?null:i});L.set(t,r);requestAnimationFrame((()=>r.observe(t)))}function G(t,n,e=false){const o={[`${b}__${t}`]:true,[`${b}__pin`]:!!n,[`${b}__pin--top`]:n==="top",[`${b}__pin--bottom`]:n==="bottom"};if(e)return K(o);return o}function K(t){let n="";Object.entries(t).forEach((([t,e])=>{if(e)n+=t+" "}));return n}function Q(t){let n=getComputedStyle(t);const e=n.position==="absolute";const o=/(auto|scroll)/;if(n.position==="fixed")return document.documentElement;for(let i=t;i=i.parentElement;){n=getComputedStyle(i);if(e&&n.position==="static"){continue}if(o.test(n.overflow+n.overflowY+n.overflowX))return i}return document.documentElement}function V(t,n=100){const e=t.getBoundingClientRect();const o=window.innerHeight||document.documentElement.clientHeight;if(!e.bottom&&!e.top&&!e.left&&!e.right&&!e.height&&!e.width&&!e.x&&!e.y)return false;return!(Math.floor(100-(e.top>=0?0:e.top)/+-e.height*100)<n||Math.floor(100-(e.bottom-o)/e.height*100)<n)}function X(t,n,e){const o=[...e];const i=o.splice(t,1)[0];o.splice(n,0,i);return o}let Y;let tt;let nt;let et;const ot=({column:t,headRenderer:n,onColumnSortClick:e,onColumnPinned:r,onColumnDrag:s,onColumnDrop:a,defaults:l})=>{const d=E();function c(t,n){Y=n;tt=nt=t.target;et=tt.closest("."+`${b}__tr`);et.classList.add(`${b}__dragging`);tt.classList.add(`${b}__drag--start`);t.dataTransfer.effectAllowed="move";t.dataTransfer.setData("text/html",tt.innerHTML);s(n.prop,tt)}function h(){et.classList.remove(`${b}__dragging`);tt.classList.remove(`${b}__drag--start`);et.querySelectorAll(`.${b}__drag-mask--active`).forEach((t=>{t.classList.remove(`${b}__drag-mask--active`)}));tt=null;Y=null;et=null;nt=null}function p(t){if(nt===t.target)return;t.preventDefault();t.stopImmediatePropagation();t.dataTransfer.dropEffect="move";et.querySelectorAll(`.${b}__drag-mask--active`).forEach((t=>{t.classList.remove(`${b}__drag-mask--active`)}));nt=t.target;if(!nt.classList.contains(`${b}__drag-mask`)){t.dataTransfer.dropEffect="none";return}nt.classList.add(`${b}__drag-mask--active`)}function _(t){t.stopPropagation();const{colName:n}=this.dataset;if(n===Y.prop)return;const e=d.config.state.columns;let o=e.findIndex((t=>t.prop===n));const i=e.findIndex((t=>t===Y));if(o<i&&this.classList.contains(`${b}__drag-mask--end`))o++;if(o>i&&this.classList.contains(`${b}__drag-mask--start`))o--;if(o===i)return;a(Y.prop,d.config.state.columns[o].prop,tt)}function f(n){let o;switch(t.order){case"asc":o="desc";break;case"desc":o=null;break;default:o="asc"}e(o,t.prop,n.target.closest("th"))}function u(){return!!l.sortable&&t.sortable!==false||!l.sortable&&t.sortable===true}function g(){return!!l.draggable&&t.draggable!==false||!l.draggable&&t.draggable===true}let m={};if(t.columnProperties){m=t.columnProperties(t)||m}const v={class:Object.assign(Object.assign({},G("th",n===null||n===void 0?void 0:n.pinned)),{[`${b}__pin--start`]:t.pinned==="start",[`${b}__pin--end`]:t.pinned==="end",[`${b}__ordered`]:!!t.order,[`${b}__filtered`]:!!t.filter})};let w=m?W(v,m):v;const y=q(t);if(!y)return o(i,null);w=Number(w.colSpan)>1?Object.assign(Object.assign({},w),{scope:"colgroup"}):Object.assign(Object.assign({},w),{scope:"col"});if(u()){const n=t.order?t.order==="asc"?"ascending":"descending":"none";w=Object.assign(Object.assign({},w),{"aria-sort":n})}if(g()){w=Object.assign(Object.assign({},w),{draggable:true,onDragStart:n=>c(n,t),onDragOver:t=>t.preventDefault(),onDragEnd:()=>h()})}return o("th",Object.assign({},w,{ref:e=>{if(["end","start"].includes(t.pinned))Z(e,t.pinned,r);if(["top","bottom"].includes(n.pinned))U(e,n.pinned,r)},key:t.prop}),g()&&[o("div",{class:{[`${b}__drag-mask`]:true,[`${b}__drag-mask--start`]:true},"data-col-name":t.prop,onDragEnter:p,onDrop:_,onDragOver:t=>t.preventDefault()}),o("div",{class:{[`${b}__drag-mask`]:true,[`${b}__drag-mask--end`]:true},"data-col-name":t.prop,onDragEnter:p,onDrop:_,onDragOver:t=>t.preventDefault()})],u()?o("button",{class:{[`${b}__order-btn`]:true,[`${b}__cell-content`]:true},onClick:f},q(t),!!t.filter&&o("nano-icon",{name:"light/filter"}),!!t.order&&(t.order==="desc"?o("nano-icon",{name:"solid/long-arrow-down"}):o("nano-icon",{name:"solid/long-arrow-up"})),o("div",{class:`${b}__status-icons`},o("nano-icon",{name:"light/chevron-down"}))):o("div",{class:`${b}__cell-content`},q(t),!!t.filter&&o("nano-icon",{name:"light/bars-filter"})))};function it(t,n){var e,r;const s=E();const a=s.config.state.columns;const l=(e=a[n])===null||e===void 0?void 0:e.cellTemplate;const d=P(t,n);if(!!d.cellModel&&a[n].type==="date"){const t=new Date(d.cellModel);if(t instanceof Date&&!isNaN(t)){d.cellModel=!l?`${new Date(d.cellModel).toLocaleDateString()} ${new Date(d.cellModel).toLocaleTimeString()}`:t}}return l?l(o,d):d.cellModel?o(i,null,(r=d.cellModel)===null||r===void 0?void 0:r.toString()):""}const rt=(t,n=false)=>{const e=E();const o=e.config.state.columns[t];const i={[`${b}__td`]:true,[`${b}__ordered`]:!!o.order,[`${b}__pin`]:!!o.pinned,[`${b}__pin--start`]:o.pinned==="start",[`${b}__pin--end`]:o.pinned==="end"};if(n)return K(i);return i};const st=({rowIndex:t,colIndex:n,nestedContent:e})=>{const i=()=>e?e():it(t,n)||o("span",{class:"placeholder"}," ");let r="td";const s=E();const a=s.config.state.columns[n];let l=H(t,n,{class:rt(n)});if(a.rowHeader){l=Number(l.rowSpan)>1?Object.assign(Object.assign({},l),{scope:"rowgroup"}):Object.assign(Object.assign({},l),{scope:"row"});r="th"}const d=t=>o("div",Object.assign({},t,{class:{[`${b}__cell-content`]:true,[`${b}__cell-content--wrap`]:!!a.wrap}}),o(i,null));return o(r,Object.assign({},l),a.autoTooltip&&!a.wrap?o("nano-resize-observe",{notifyContentFit:"x",onNanoResizeContentFitChange:t=>t.target.firstElementChild.disabled=t.detail.x},o("nano-tooltip",{disabled:true,placement:"top",onNanoShow:t=>t.target.closest(r).style.zIndex="100",onNanoHide:t=>t.target.closest(r).style.zIndex=""},o(d,null),o("span",{slot:"content"},o(i,null)))):o(d,null))};const at=({rowRenderer:t,rowIndex:n,rowModel:e,onColumnPinned:i},r,s)=>{let a={};const l=({header:t,wrap:n},e)=>{const i=o("div",{class:{[`${b}__cell-content`]:true,[`${b}__cell-content--wrap`]:n}},e);return t?o("th",{scope:"row"},i):o("td",null,i)};if(!e){const t=A(n);e=t.rowModel}if(t===null||t===void 0?void 0:t.rowProperties){a=t.rowProperties({rowModel:e,rowIndex:n})||a}let d;if((t===null||t===void 0?void 0:t.pinned)&&typeof t.pinned==="function"){d=t.pinned()}const c={class:G("tr",d)};const h=a?W(c,a):c;const p=t===null||t===void 0?void 0:t.template;if(p){let t=p(o,{renderedRow:o("tr",Object.assign({},h,{key:e.__uuid}),r),rowModel:e,rowIndex:n},l);if(Array.isArray(t)){t=s.map(t,((t,n)=>{if(t.vtag==="tr"){if(!t.vkey)t.vkey=`${e.__uuid}_${n}`;t.vattrs=W({class:G("tr",d,true)},t.vattrs);if(!!t.vchildren){t.vchildren=s.map(t.vchildren,((t,n)=>{if(["td","th"].includes(t.vtag.toString())){t.vattrs=W({class:G(t.vtag.toString(),d,true)+rt(n,true),ref:t=>{if(!!t&&d==="top"||d==="bottom")U(t,d,i);if(!!t&&t.classList.contains("nano-tbl__pin--end"))Z(t,"end",i);if(!!t&&t.classList.contains("nano-tbl__pin--start"))Z(t,"start",i)}},t.vattrs)}return t}))}}return t}))}return t}return o("tr",Object.assign({},h,{key:e.__uuid}),r)};const lt=({rowRenderer:t,onColumnPinned:n},e,i)=>{let r={};if(t.rowProperties){r=t.rowProperties()||{}}const s=({header:t,wrap:n},e)=>{const i=o("div",{class:{[`${b}__cell-content`]:true,[`${b}__cell-content--wrap`]:n}},e);return t!==false?o("th",{scope:"col"},i):o("td",null,i)};const a=t.pinned||null;const l={class:G("tr",null)};const d=r?W(l,r):l;const c=t===null||t===void 0?void 0:t.template;if(c){let t=c(o,{renderedRow:o("tr",Object.assign({},d),e)},s);if(Array.isArray(t)){t=i.map(t,(t=>{if(t.vtag==="tr"){t.vattrs=W({class:G("tr",a,true)},t.vattrs);if(!!t.vchildren){t.vchildren=i.map(t.vchildren,(t=>{if(["td","th"].includes(t.vtag.toString())){t.vattrs=W({class:G(t.vtag.toString(),a,true),ref:t=>{if(!!t&&a==="top"||a==="bottom")U(t,a,n);if(!!t&&t.classList.contains("nano-tbl__pin--end"))Z(t,"end",n);if(!!t&&t.classList.contains("nano-tbl__pin--start"))Z(t,"start",n)}},t.vattrs)}return t}))}}return t}))}return t}return o("tr",Object.assign({},d),e)};const dt=':host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}nano-table{display:block;width:100%;--max-col-width:clamp(200px, 500px, 50vw);--color:var(--nano-color-mediumgrey, #68767e);--font-size:0.87rem;--cell-line-height:1.5;--thead-font-size:0.95rem;--thead-color:#455560;--tfoot-color:#455560;--border-color:#dddbda;--border-style:thin solid var(--border-color);--border-tint-color:#0084a9;--border-tint-style:3px solid var(--border-tint-color);--cell-bg-rgb:var(--nano-color-white-rgb, 255 255 255);--head-bg-rgb:250 250 249;--foot-bg-rgb:var(--head-bg-rgb);--th-row-bg-rgb:var(--cell-bg-rgb);--ordered-bg-rgb:var(--nano-color-offwhite-rgb, 249 249 251);--td-padding-start:0.625rem;--td-padding-end:0.625rem;--td-padding-top:0.5rem;--td-padding-bottom:0.4125rem;--th-padding-start:0.625rem;--th-padding-end:0.625rem;--th-padding-top:0.875rem;--th-padding-bottom:0.6875rem;--td-padding-v:var(--td-padding-top) var(--td-padding-bottom);--td-padding-h:var(--td-padding-start) var(--td-padding-end);--th-padding-v:var(--th-padding-top) var(--th-padding-bottom);--th-padding-h:var(--th-padding-start) var(--th-padding-end);--foot-th-padding-v:var(--td-padding-top) var(--td-padding-bottom);--foot-th-padding-h:var(--td-padding-start) var(--td-padding-end);--head-th-padding-v:var(--th-padding-top) var(--th-padding-bottom);--head-th-padding-h:var(--th-padding-start) var(--th-padding-end);--bookend-col-padding:2rem}.nano-tbl{color:var(--color);text-align:start;width:100%;font-size:var(--font-size);border-spacing:0 0;border-collapse:separate;background:rgb(var(--cell-bg-rgb));-webkit-border-end:1px solid transparent;border-inline-end:1px solid transparent;-webkit-border-before:1px solid transparent;border-block-start:1px solid transparent;position:relative;z-index:1}.nano-tbl__wrap{display:table;min-width:100%}.nano-tbl__top-anchor{clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);block-size:1px;inline-size:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;position:relative}.nano-tbl__ordered{background-color:var(--ordered-bg);-webkit-border-start:var(--border-style);border-inline-start:var(--border-style);-webkit-border-end:var(--border-style);border-inline-end:var(--border-style)}.nano-tbl__drag-mask{display:none;position:absolute;inset-block:-2px -2px;z-index:10;opacity:0;transition:0.2s ease opacity}.nano-tbl__drag-mask--start{width:calc(50% + 2px);inset-inline-start:-2px;-webkit-border-start:2px dashed var(--border-tint-color);border-inline-start:2px dashed var(--border-tint-color)}.nano-tbl__drag-mask--end{width:50%;inset-inline-end:0;-webkit-border-end:2px dashed var(--border-tint-color);border-inline-end:2px dashed var(--border-tint-color)}.nano-tbl__drag-mask--active{opacity:1}.nano-tbl__dragging .nano-tbl__drag-mask{display:block}.nano-tbl__drag--start{opacity:0.4}.nano-tbl__dragging .nano-tbl__td,.nano-tbl__dragging .nano-tbl__th{cursor:no-drop}.nano-tbl__dragging .nano-tbl__td .nano-tbl__cell-content,.nano-tbl__dragging .nano-tbl__th .nano-tbl__cell-content{pointer-events:none}.nano-tbl__order-btn{padding:0;border:none;outline:none;font:inherit;background:none;-webkit-appearance:none;appearance:none;color:inherit;display:flex;gap:10px;align-items:center;width:100%}.nano-tbl__status-icons{margin-inline:auto 10px;display:flex;gap:10px}.nano-tbl__progress-bar{font-size:0.2rem;position:sticky;inset-block-start:0;inset-inline:0;z-index:10;transition:scale 0.25s;transform:scale(0);width:100%;height:0}.nano-tbl__progress-bar--show{transform:scale(1);height:auto}.nano-tbl__caption--hide{clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);block-size:1px;inline-size:1px;margin:-1px;overflow:hidden;padding:0;position:absolute}.nano-tbl__td,.nano-tbl__th{line-height:var(--cell-line-height);text-align:start;-webkit-border-before:var(--border-style);border-block-start:var(--border-style);max-width:var(--max-col-width);background-color:rgb(var(--cell-bg-rgb))}tbody:first-of-type tr:first-child .nano-tbl__td,tbody:first-of-type tr:first-child .nano-tbl__th{-webkit-border-before:none;border-block-start:none}tbody:last-of-type tr:last-child .nano-tbl__td,tbody:last-of-type tr:last-child .nano-tbl__th{-webkit-border-after:var(--border-style);border-block-end:var(--border-style)}.md .nano-tbl__td:first-child .nano-tbl__cell-content,.md .nano-tbl__th:first-child .nano-tbl__cell-content{-webkit-padding-start:var(--bookend-col-padding);padding-inline-start:var(--bookend-col-padding)}.md .nano-tbl__td:last-child .nano-tbl__cell-content,.md .nano-tbl__th:last-child .nano-tbl__cell-content{-webkit-padding-end:var(--bookend-col-padding);padding-inline-end:var(--bookend-col-padding)}@media (max-width: 768px){.nano-tbl__td:first-child .nano-tbl__cell-content,.nano-tbl__th:first-child .nano-tbl__cell-content{-webkit-padding-start:var(--td-padding-start) !important;padding-inline-start:var(--td-padding-start) !important}.nano-tbl__td:last-child .nano-tbl__cell-content,.nano-tbl__th:last-child .nano-tbl__cell-content{-webkit-padding-end:var(--td-padding-end) !important;padding-inline-end:var(--td-padding-end) !important}}thead .nano-tbl__td,thead .nano-tbl__th{color:var(--thead-color);font-weight:800;background:rgb(var(--head-bg-rgb)/90%);font-size:var(--thead-font-size);-webkit-border-before:none !important;border-block-start:none !important;transition:all 0.2s ease}thead .nano-tbl__td .nano-tbl__cell-content,thead .nano-tbl__th .nano-tbl__cell-content{padding-block:var(--head-th-padding-v);padding-inline:var(--head-th-padding-h)}tfoot .nano-tbl__td,tfoot .nano-tbl__th{color:var(--tfoot-color);font-weight:800;-webkit-border-before:none;border-block-start:none;background:rgb(var(--foot-bg-rgb)/90%);font-size:var(--thead-font-size)}tfoot .nano-tbl__td .nano-tbl__cell-content,tfoot .nano-tbl__th .nano-tbl__cell-content{padding-block:var(--foot-th-padding-v);padding-inline:var(--foot-th-padding-h)}.nano-tbl__td.nano-tbl__ordered,.nano-tbl__th.nano-tbl__ordered{background-color:rgb(var(--ordered-bg-rgb)/80%) !important}.nano-tbl__cell-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:var(--td-padding-v);padding-inline:var(--td-padding-h)}.nano-tbl__cell-content--no-result{padding-block:2rem}.nano-tbl__cell-content--wrap{white-space:normal;overflow:visible}.nano-tbl tbody{will-change:scroll-position;opacity:1;transition:0.1s ease opacity;transform:translateZ(0)}.nano-tbl tbody.nano-tbl__inactive{opacity:0}.nano-tbl th[scope=row]{font-weight:800;margin:0}.nano-tbl__pin{position:sticky;transform:translateZ(0)}.nano-tbl__pin--start{inset-inline:-1px auto;transition:max-width 0.25s ease}.nano-tbl__pin--start::after{content:"";position:absolute;inset:0;box-shadow:5px 1px 4px 0 rgba(0, 0, 0, 0.2);opacity:0;z-index:-1}.nano-tbl__pinned--start .nano-tbl__pin--start{z-index:2;max-width:125px !important}.sm .nano-tbl__pinned--start .nano-tbl__pin--start{max-width:var(--max-col-width) !important}.nano-tbl__pinned--start .nano-tbl__pin--start::after{opacity:1}.nano-tbl__pin--end{}.nano-tbl__pin--start+.nano-tbl__pin--end{inset-inline:auto auto}.nano-tbl__pin--start+.nano-tbl__pin--end::after{display:none}.sm .nano-tbl__pin--end{inset-inline:auto -1px !important;max-width:min(50vw, 200px)}.sm .nano-tbl__pin--end::after{display:block !important;content:"";position:absolute;inset:0;box-shadow:-5px 1px 4px 0 rgba(0, 0, 0, 0.2);opacity:0;z-index:-1}.sm .nano-tbl__pinned--end .nano-tbl__pin--end::after{opacity:1}.nano-tbl__pin--top{inset-block:-1px auto}.nano-tbl__pinned--top .nano-tbl__pin--top{z-index:4 !important}.nano-tbl__pin--bottom{inset-block:auto -1px}.nano-tbl__pinned--bottom .nano-tbl__pin--bottom{z-index:5 !important}.nano-tbl__pinned--start .nano-tbl__pin--top.nano-tbl__pin--start{z-index:5 !important}.nano-tbl__pinned--top.nano-tbl__pinned--start .nano-tbl__pin--top.nano-tbl__pin--start{z-index:6 !important}.nano-tbl__pinned--end .nano-tbl__pin--top.nano-tbl__pin--end{z-index:5 !important}.nano-tbl__pinned--top.nano-tbl__pinned--end .nano-tbl__pin--top.nano-tbl__pin--end{z-index:6 !important}.nano-tbl__pinned--start .nano-tbl__pin--bottom.nano-tbl__pin--start{z-index:5 !important}.nano-tbl__pinned--bottom.nano-tbl__pinned--start .nano-tbl__pin--bottom.nano-tbl__pin--start{z-index:6 !important}.nano-tbl__pinned--end .nano-tbl__pin--bottom.nano-tbl__pin--end{z-index:5 !important}.nano-tbl__pinned--bottom.nano-tbl__pinned--end .nano-tbl__pin--bottom.nano-tbl__pin--end{z-index:6 !important}.nano-tbl thead tr:last-of-type td,.nano-tbl thead tr:last-of-type th{-webkit-border-after:var(--border-tint-style);border-block-end:var(--border-tint-style)}.nano-tbl tfoot tr:first-of-type td,.nano-tbl tfoot tr:first-of-type th{-webkit-border-before:none;border-block-start:none}.nano-tbl tfoot tr:last-of-type td,.nano-tbl tfoot tr:last-of-type th{-webkit-border-after:var(--border-tint-style);border-block-end:var(--border-tint-style)}.nano-tbl__pinned--bottom .nano-tbl tfoot tr.nano-tbl__pin--bottom:first-of-type td,.nano-tbl__pinned--bottom .nano-tbl tfoot tr.nano-tbl__pin--bottom:first-of-type th{-webkit-border-before:var(--border-tint-style) !important;border-block-start:var(--border-tint-style) !important}.nano-tbl__pinned--bottom .nano-tbl tfoot tr.nano-tbl__pin--bottom:last-of-type td,.nano-tbl__pinned--bottom .nano-tbl tfoot tr.nano-tbl__pin--bottom:last-of-type th{-webkit-border-after:none !important;border-block-end:none !important}.nano-tbl .unlimited-width{max-width:none}.nano-tbl__spinner{font-size:1.5rem;transition:scale 0.25s;scale:0;padding:0.5rem;position:absolute;inset-block-end:0;inset-inline-start:calc(50% - 0.75rem);z-index:0}.nano-tbl__spinner--show{scale:1;position:sticky}.nano-tbl nano-skeleton{line-height:var(--cell-line-height)}';let ct=0;const ht=class{constructor(t){r(this,t);this.nanoTblReady=s(this,"nanoTblReady",7);this.nanoTblBlockRendered=s(this,"nanoTblBlockRendered",7);this.nanoTblBeforeSort=s(this,"nanoTblBeforeSort",7);this.nanoTblAfterSort=s(this,"nanoTblAfterSort",7);this.nanoTblColDrag=s(this,"nanoTblColDrag",7);this.nanoTblColDrop=s(this,"nanoTblColDrop",7);this.nanoTblBeforeFilter=s(this,"nanoTblBeforeFilter",7);this.nanoTblAfterFilter=s(this,"nanoTblAfterFilter",7);this.nanoTblBeforeSearch=s(this,"nanoTblBeforeSearch",7);this.nanoTblAfterSearch=s(this,"nanoTblAfterSearch",7);this.nanoTblBeforeEdit=s(this,"nanoTblBeforeEdit",7);this.renderId="tbl-"+ct++;this.filters=[];this.currentFilters="[]";this.currentSort="";this.cacheScrollPosition=0;this.measureHeight=0;this.blockHeights=[];this.unitHeight=0;this._isReady=false;this.colDrag=t=>{this.nanoTblColDrag.emit({column:t})};this.colDrop=(t,n)=>{const e=this.store.config.state.columns;const o=e.findIndex((t=>t.prop===n));const i=e.findIndex((n=>n.prop===t));const r=this.nanoTblColDrop.emit({fromCol:t,toCol:n,fromIndex:i,toIndex:o});if(r.defaultPrevented)return;this.columns=X(i,o,e)};this.sortStart=async(t,n,e)=>{if(this.currentSort===t+":"+n)return;this._loading=true;const o=this.nanoTblBeforeSort.emit({column:n,order:t});if(o.defaultPrevented)return;this.currentSort=t+":"+n;this.scrollToTop(e);if(this.customSortFn){try{const e=await this.customSortFn(n,t);if(e===true){this.sortComplete(t,n);this._loading=false;return}}catch(t){console.warn("custom sort failed",t);this.currentSort="";this._loading=false;return}}try{await F(this.host,n,t);this.sortComplete(t,n)}catch(t){console.warn("sort failed",t);this.currentSort=""}finally{if(this.blocks.length)this._loading=false}};this.scrollHandler=()=>{this.cacheScrollPosition=this.scrollParent.scrollTop||window.scrollY;requestAnimationFrame((()=>{let t=0;let n=0;const e=this.blocks.length;while(n<e&&this.cacheScrollPosition>=t){t+=this.getBlockHeight(n);if(this.cacheScrollPosition<t){const t=[n,n+1,Math.max(0,n-1)];if(t.toString()!==this.activeBlocks.toString()){this.activeBlocks=t;this.setBlockHeight()}this.primaryBlockIndex=n}n++}}))};this.handleColumnPinned=t=>{Object.entries(t).forEach((([t,n])=>{this.tableEle.classList.toggle(`${b}__pinned--${t}`,n)}))};this.handleResizeChange=t=>{var n;this.tableWrapperEle.className="";let e=[`${b}__wrap`];if((n=t.target)===null||n===void 0?void 0:n.className)e=[...t.target.className.split(" "),...e];this.tableWrapperEle.classList.add(...e.filter((t=>!!t)))};this.type="table";this.caption=undefined;this.showCaption=false;this.loading=undefined;this.internalLoading=false;this.placeholderSize=5;this.rows=undefined;this.columns=[];this.headRender={pinned:"top"};this.rowRender=undefined;this.footRender={pinned:"bottom"};this.showFooter=false;this.perBlock=40;this.searchTerm=undefined;this.customFilterFn=undefined;this.customSortFn=undefined;this.defaultSort=true;this.defaultColDraggable=false;this.virtualTotalItems=0;this.blocks=[];this.activeBlocks=[0,1,2];this.debounceSetLoading=c(this.debounceSetLoading.bind(this),50)}get _loading(){return this.loading!==undefined?this.loading:this.internalLoading}set _loading(t){if(this.loading!==undefined)return;this.debounceSetLoading(t)}debounceSetLoading(t){this.internalLoading=t}handleRowsChange(){if(!this.rows){this._loading=true;return}this._loading=true;Promise.resolve(this.rows).then((async t=>{await R(this.host,t);this.currentFilters="";this.currentSort="";await this.columnInit();if(!this.isReady)this.setInitialBlockDimension();this._loading=false}))}async handleColsChange(){await M(this.host,this.columns);if(this.isReady)this.columnInit()}get blocksLength(){return this.blocks.length}handleSearchTermChange(){this.searchStart()}virtualTotalItemsChangeHandler(){this.setBlocks()}async resetSorting(){const t=this.columns.find((t=>!!t.order));if(!t)return;return this.sortStart(null,t.prop)}async addSort(t,n){const e=this.columns.find((n=>n.prop===t));if(!e)throw"Cannot find column with "+t;return this.sortStart(n,e.prop)}async resetFilters(){this.filters=[];return this.filterStart()}async addFilters(t,n=true){if(!n)this.filters=[];return this.filterStart(t,n)}async removeFilters(t){this.filters=this.filters.filter((n=>!t.includes(n.prop)));return this.filterStart()}async updateRow(t,n){this.rows.splice(n,1,t);this.handleRowsChange()}set measureEle(t){var n;if(!t)return;const e=t.getBoundingClientRect().height;this.measureHeight=Math.abs(this.measureHeight-e)<5?this.measureHeight:e;this.unitHeight=((n=t.querySelector("tr"))===null||n===void 0?void 0:n.getBoundingClientRect().height)||this.unitHeight}get scrollParent(){return this._scrollParent}set scrollParent(t){if(t===this._scrollParent)return;if(this._scrollParent){(this._scrollParent===document.documentElement?document:this._scrollParent).removeEventListener("scroll",this.scrollHandler)}(t===document.documentElement?document:t).addEventListener("scroll",this.scrollHandler);this._scrollParent=t}get primaryBlockIndex(){return this._primaryBlockIndex}set primaryBlockIndex(t){if(this._primaryBlockIndex===t)return;this._primaryBlockIndex=t;this.nanoTblBlockRendered.emit({block:t,totalBlocks:this.blockElements.length})}get isReady(){return this._isReady}set isReady(t){if(t===this._isReady)return;this._isReady=t;if(this.isReady)requestAnimationFrame((()=>this.handleReady()))}handleReady(){const t=window.location.hash;if(t.length>1){try{const n=document.querySelector(t);if(n)n.scrollIntoView()}catch(t){}}this.nanoTblReady.emit()}sortComplete(t,n){this.columns=this.columns.map((e=>{if(e.prop===n)return Object.assign(Object.assign({},e),{order:t});return Object.assign(Object.assign({},e),{order:null})}));this.nanoTblAfterSort.emit({column:n,order:t})}async searchStart(){this._loading=true;const t=this.nanoTblBeforeSearch.emit({term:this.searchTerm});if(t.defaultPrevented)return;this.scrollToTop();try{await N(this.host,this.searchTerm);this.nanoTblAfterSearch.emit({term:this.searchTerm})}catch(t){console.warn("search failed",t)}finally{this._loading=false}}async filterStart(t,n=true){if(t){if(n){this.filters=[...this.filters.filter((n=>!t.find((t=>t.prop===n.prop)))),...t]}else{this.filters=t}}if(this.currentFilters===JSON.stringify(this.filters))return;this._loading=true;const e=this.nanoTblBeforeFilter.emit({filters:this.filters});if(e.defaultPrevented)return;this.currentFilters=JSON.stringify(this.filters);this.scrollToTop();if(this.customFilterFn){try{const t=await this.customFilterFn(this.filters);if(t===true){this.filterComplete();this._loading=false}}catch(t){console.warn("custom filter failed",t);this.currentFilters="";this._loading=false}return}try{await B(this.host,this.filters);this.filterComplete()}catch(t){console.warn("filter failed",t)}finally{this._loading=false}}filterComplete(){this.columns=this.columns.map((t=>{const n=this.filters.find((n=>n.prop===t.prop));if(n)t.filter=n.filter;return t}));this.nanoTblAfterFilter.emit({filters:this.filters})}scrollToTop(t){var n;const e=(n=this.scrollParent.style)===null||n===void 0?void 0:n.scrollBehavior;const o=this.scrollParent.scrollLeft;this.scrollParent.style.scrollBehavior="auto";if(this.topAnchorEle&&!V(this.topAnchorEle,.1)){this.host.scrollIntoView()}if(t&&!V(t,1))setTimeout((()=>t.scrollIntoView({block:"start"})),500);if(o)this.scrollParent.scrollLeft=o;if(e)this.scrollParent.style.scrollBehavior=e;this.scrollHandler()}setMeasureElement(){a((()=>{this.measureEle=this.blockElements.find((t=>{var n;return!((n=t===null||t===void 0?void 0:t.classList)===null||n===void 0?void 0:n.contains(`${b}__inactive`))}))}))}setInitialBlockDimension(){var t;if(!((t=this.blockElements)===null||t===void 0?void 0:t.length))return;const n=new Promise((t=>{a((()=>{this.setMeasureElement();if(!this.measureEle&&!this.unitHeight)t();this.blockElements.forEach(((n,e)=>{var o;if(!n||!((o=n.classList)===null||o===void 0?void 0:o.contains(`${b}__inactive`))){if(e===this.blockElements.length-1)t();return}if(e===this.blockElements.length-1)t()}))}))}));n.then((()=>{requestAnimationFrame((()=>{this.isReady=true}))}))}async columnInit(){this.filters=this.columns.filter((t=>!!t.filter)).map((t=>{const{filter:n,prop:e}=t;return{filter:n,prop:e}}));if(this.searchTerm){await this.searchStart()}if(this.filters.length){await this.filterStart()}const t=this.columns.find((t=>!!t.order));if(!!t){await this.sortStart(t.order,t.prop)}}setBlocks(){const t=this.store.data.state.rows;if(!t.length){this.blocks=[];return}let n=1;const e=this.virtualTotalItems>t.length?this.virtualTotalItems:t.length;let o=[];const i=[];this.blockHeights=[];for(n;n<=e;n++){o.push(this.store.data.state.rows[n-1]||{__uuid:""});if(n%this.perBlock===0){i.push({rows:o,__uuid:d(o.map((t=>t.__uuid)).join())});o=[]}}if(o.length){i.push({rows:o,__uuid:d(o.map((t=>t.__uuid)).join())})}this.blocks=i}getBlockHeight(t){if(this.blockHeights.length){const n=this.blockHeights.find((n=>n.blockIndex===t));if(n)return n.height}const n=this.blocks[t].rows.length;if(n===this.perBlock&&this.measureHeight){return this.measureHeight}return this.unitHeight?this.unitHeight*n:undefined}setBlockHeight(){this.activeBlocks.forEach((t=>{const n=this.blockElements[t];if(!n)return;a((()=>{const e=n.getBoundingClientRect().height;const o=this.blockHeights.findIndex((n=>n.blockIndex===t));if(o>0){this.blockHeights[o]={height:e,blockIndex:t}}else this.blockHeights.push({height:e,blockIndex:t})}))}))}processSlots(){if(!this.caption&&!this.host.querySelector('[slot="caption"]')){console.error("For accessibility you must set a `caption` prop or use the `caption` slot")}}async componentWillLoad(){this.scrollParent=Q(this.host);this.store=await I(this.host,this.columns,this.scrollParent);await this.handleRowsChange();this.processSlots();this.store.data.onChange("rows",(()=>this.setBlocks()));this.setBlocks()}connectedCallback(){this.scrollParent=Q(this.host)}componentDidLoad(){this.setInitialBlockDimension()}componentShouldUpdate(t,n,e){if(["rows","columns"].includes(e))return false}componentWillRender(){}componentDidRender(){this.setMeasureElement()}render(){this.blockElements=[];return o(l,null,o("div",{class:`${b}__top-anchor`,ref:t=>this.topAnchorEle=t}," "),o("nano-resize-observe",{"aria-labelledby":"table-caption-"+this.renderId,tabindex:this.type==="grid"?"0":undefined,states:"576w sm, 768w md",class:"sm md",onNanoResizeStateChange:this.handleResizeChange}),o("div",{class:`${b}__wrap sm md`,ref:t=>this.tableWrapperEle=t},o("nano-progress-bar",{indeterminate:true,class:{[`${b}__progress-bar`]:true,[`${b}__progress-bar--show`]:this._loading}}),o("table",{role:this.type==="grid"?"grid":undefined,"aria-readonly":this.type==="table"?"true":undefined,"aria-rowcount":this.store.data.state.rows.length,"aria-colcount":this.store.config.state.columns.length,class:`${b}`,ref:t=>this.tableEle=t},o("caption",{class:{[`${b}__caption`]:true,[`${b}__caption--hide`]:!this.showCaption},id:"table-caption-"+this.renderId},o("slot",{name:"caption"},this.caption)),o("thead",null,o(lt,{rowRenderer:this.headRender,onColumnPinned:this.handleColumnPinned},this.store.config.state.columns.map((t=>[o(ot,{column:t,headRenderer:this.headRender,onColumnSortClick:this.sortStart,onColumnPinned:this.handleColumnPinned,onColumnDrag:this.colDrag,onColumnDrop:this.colDrop,defaults:{sortable:this.defaultSort,draggable:this.defaultColDraggable}})])))),this._loading&&!this.blocks.length&&o("tbody",{class:`${b}__active`},[...Array(10).keys()].map((t=>o("tr",null,this.store.config.state.columns.map(((n,e)=>o(st,{rowIndex:t,colIndex:e,nestedContent:()=>o("nano-skeleton",null)}))))))),!this._loading&&!this.blocks.length&&o("tr",null,o("th",{class:`${b}__th`,colSpan:this.store.config.state.columns.length},o("div",{class:"nano-tbl__cell-content nano-tbl__cell-content--no-result"},o("slot",{name:"no-results"},"No results found")))),this.blocks.map(((t,n)=>o("tbody",{key:t.__uuid,id:`tbody-${this.renderId}-${n}`,ref:t=>{this.blockElements.push(t)},class:{[`${b}__inactive`]:!this.activeBlocks.includes(n),[`${b}__active`]:this.activeBlocks.includes(n)}},this.activeBlocks.includes(n)?t.rows.map(((t,e)=>{const i=n>0?n*this.perBlock+e:e;return o(at,{rowRenderer:this.rowRender,rowModel:t,rowIndex:i},this.store.config.state.columns.map(((t,n)=>o(st,{rowIndex:i,colIndex:n}))))})):o("tr",null,o("td",{colSpan:this.store.config.state.columns.length,style:{height:this.getBlockHeight(n)+"px"}}))))),this.showFooter&&o("tfoot",null,o(lt,{rowRenderer:this.footRender,onColumnPinned:this.handleColumnPinned},this.store.config.state.columns.map((t=>[o(ot,{column:t,headRenderer:this.footRender,onColumnPinned:this.handleColumnPinned,onColumnSortClick:this.sortStart,defaults:{sortable:this.defaultSort,draggable:this.defaultColDraggable}})]))))),!!this.blocks.length&&o("nano-spinner",{type:"circle",class:{[`${b}__spinner`]:true,[`${b}__spinner--show`]:this._loading}})))}get host(){return n(this)}static get watchers(){return{rows:["handleRowsChange"],columns:["handleColsChange"],searchTerm:["handleSearchTermChange"],virtualTotalItems:["virtualTotalItemsChangeHandler"]}}};ht.style=dt;export{ht as T,v as c};
5
+ //# sourceMappingURL=p-b2b29eaf.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import{c as t}from"./p-3fe0ff90.js";import"./p-f6a8467a.js";import"./p-ee045579.js";import"./p-9746b0a5.js";import"./p-9ebbb814.js";const o="table.worker";const p="stencil.table.worker";const s=new URL("p-e2f9ccfa.js",import.meta.url).href;const e=new Blob(['importScripts("'+s+'")'],{type:"text/javascript"});const r=URL.createObjectURL(e);const c=t(r,o,p);URL.revokeObjectURL(r);export{c as worker,p as workerMsgId,o as workerName,s as workerPath};
5
- //# sourceMappingURL=p-cdf0aeb7.js.map
4
+ import{c as t}from"./p-b2b29eaf.js";import"./p-f6a8467a.js";import"./p-ee045579.js";import"./p-9746b0a5.js";import"./p-9ebbb814.js";const o="table.worker";const p="stencil.table.worker";const s=new URL("p-e2f9ccfa.js",import.meta.url).href;const e=new Blob(['importScripts("'+s+'")'],{type:"text/javascript"});const r=URL.createObjectURL(e);const c=t(r,o,p);URL.revokeObjectURL(r);export{c as worker,p as workerMsgId,o as workerName,s as workerPath};
5
+ //# sourceMappingURL=p-e68a4e16.js.map
@@ -33,6 +33,13 @@ export declare class Alert implements ComponentInterface {
33
33
  */
34
34
  duration: number;
35
35
  handleDurationChange(): void;
36
+ /**
37
+ * Relocate the dialog to the root of the DOM.
38
+ * Most useful in conjunction with `alert()` when parental elements
39
+ * have css stacking constraints which don't allow for `position: fixed`
40
+ */
41
+ hoist: boolean;
42
+ handleHoistChange(): void;
36
43
  /** Emitted when the alert opens. Calling `event.preventDefault()` will prevent it from being opened. */
37
44
  nanoShow: EventEmitter;
38
45
  /** Emitted after the alert opens and all transitions are complete. */
@@ -39,7 +39,7 @@ export declare class Checkbox implements ComponentInterface {
39
39
  /**
40
40
  * Controls the underlying field type and style.
41
41
  */
42
- type: 'radio' | 'checkbox' | 'tag' | 'segment' | 'segment-pill';
42
+ type: 'radio' | 'checkbox' | 'tag' | 'segment' | 'switch' | 'segment-pill';
43
43
  typeChange(): void;
44
44
  /**
45
45
  * label property that can be used to set the label text. Alternatively you may use a label slot.
@@ -1,6 +1,6 @@
1
1
  import { ComponentInterface, EventEmitter } from '../../stencil-public-runtime';
2
2
  import { ObservableMap } from '@stencil/store';
3
- import type { ValidationState, ValidatorValueStore } from '../../interface';
3
+ import type { NanoFormEvent, ValidationState, ValidatorValueStore, PlainFormEvent } from '../../interface';
4
4
  /**
5
5
  * A toolbox for `nano-...` form fields and form validation.
6
6
  * - Easy to add validation across field dependencies - e.g. "When Field1 contains '123' Field2 must contain '456'"
@@ -156,12 +156,12 @@ export declare class FieldValidator implements ComponentInterface {
156
156
  * Handles nano field value changes and passes to store
157
157
  * @param ev - the incoming change event
158
158
  */
159
- private handleFieldChange;
159
+ handleFieldChange(ev: NanoFormEvent): void;
160
160
  /**
161
161
  * Handles non-nano field value changes and passes to store
162
162
  * @param ev - the incoming change event
163
163
  */
164
- private handlePlainFieldChange;
164
+ handlePlainFieldChange(ev: PlainFormEvent): void;
165
165
  /**
166
166
  * Handles default field validation events
167
167
  * @param ev - the invalid event
@@ -171,7 +171,7 @@ export declare class FieldValidator implements ComponentInterface {
171
171
  * stops default form submission, checks if valid, then submits manually
172
172
  * @param e - a submit event from the nested form element
173
173
  */
174
- private handleSubmit;
174
+ handleSubmit(e: Event): Promise<void>;
175
175
  connectedCallback(): void;
176
176
  componentDidLoad(): void;
177
177
  disconnectedCallback(): void;
@@ -19,6 +19,8 @@ import type { SearchIndex, AloliaSearchResultDetail, MyAccountUser, MyAccountDat
19
19
  * @part burger - the overflow / burger menu
20
20
  * @part burger-actions-bar - the top bar of the overflow / burger menu
21
21
  * @part burger-content - the main content area of the overflow / burger menu
22
+ * @part sticker - the `nano-sticker` wrapping the main nav-bar
23
+ * @part bars - the main wrapper around the `main-bar` and `search-bar` nav bars
22
24
  * @part main-bar - the main nav menu bar
23
25
  * @part logo-link - the link wrapping the logo
24
26
  * @part search-bar - the search bar that appears under the main nav menu bar
@@ -62,7 +64,6 @@ export declare class GlobalNav implements ComponentInterface {
62
64
  mainSlotLen: number;
63
65
  overflowSlotLen: number;
64
66
  searchSlotLen: number;
65
- internalSearchIndeces: Array<SearchIndex>;
66
67
  thresholdReady: boolean;
67
68
  remoteDataReady: boolean;
68
69
  ready: boolean;
@@ -73,12 +74,13 @@ export declare class GlobalNav implements ComponentInterface {
73
74
  modalIsOpen: boolean;
74
75
  searchBarShown: boolean;
75
76
  scrollingUp: boolean;
76
- searchLoading: boolean;
77
77
  showAutocomplete: boolean;
78
78
  secondaryMenuOpen: HTMLNanoNavItemElement;
79
79
  userMenuOpen: boolean;
80
80
  menuFullScreen: boolean;
81
+ searchLoading: boolean;
81
82
  searchValInternal: string;
83
+ internalSearchIndeces: Array<SearchIndex>;
82
84
  private el;
83
85
  /**
84
86
  * Connect to local, dev, test or prod MyAccount
@@ -1,5 +1,9 @@
1
1
  import { ComponentInterface } from '../../stencil-public-runtime';
2
- /** Icons buttons are simple, icon-only buttons that can be used for actions and in toolbars. */
2
+ /** Icons buttons are simple, icon-only buttons that can be used for actions and in toolbars.
3
+ *
4
+ * @part base - the main control (either `<a />` or `<button />`)
5
+ * @part icon - a `<nano-icon />` component
6
+ */
3
7
  export declare class IconButton implements ComponentInterface {
4
8
  private button;
5
9
  /** The name of the icon to draw. */
@@ -15,6 +19,8 @@ export declare class IconButton implements ComponentInterface {
15
19
  /** A description that gets read by screen readers and other assistive devices. For optimal accessibility, you should
16
20
  * always include a label that describes what the icon button does. */
17
21
  label: string;
22
+ /** display the label as a `<nano-tooltip />` */
23
+ showTooltip: boolean;
18
24
  /** Set to true to disable the button. */
19
25
  disabled: boolean;
20
26
  /** Contains a URL or a URL fragment that the hyperlink points to.
@@ -28,5 +34,6 @@ export declare class IconButton implements ComponentInterface {
28
34
  componentDidLoad(): void;
29
35
  connectedCallback(): void;
30
36
  disconnectedCallback(): void;
37
+ private content;
31
38
  render(): any;
32
39
  }
@@ -2,10 +2,10 @@ import { ComponentInterface, EventEmitter } from '../../stencil-public-runtime';
2
2
  import { StorageMethods } from '../../utils/store/component-store';
3
3
  import type { Color } from '../../interface';
4
4
  /**
5
- * A tradtional tab implementation. It nests `nano-tab` and `nano-tab-content` sub-components.
5
+ * A traditional tab implementation. It nests `nano-tab` and `nano-tab-content` sub-components.
6
6
  *
7
7
  * Tabs can be stacked vertically or horizontally (which presents different styling variations) using the `placement` attribute.
8
- * Horizonal tabs that don't fit will overflow and scroll appropriately.
8
+ * Horizontal tabs that don't fit will overflow and scroll appropriately.
9
9
  * Tab-content can also be swiped to change tabs.
10
10
  *
11
11
  * @slot tabs - Add `nano-tab` elements to add clickable tabs.
@@ -5,7 +5,6 @@ import { EventEmitter } from '../../stencil-public-runtime';
5
5
  * @slot content - The tooltip's content. Alternatively, you can use the content prop.
6
6
  */
7
7
  export declare class Tooltip {
8
- private componentId;
9
8
  private isVisible;
10
9
  private popover;
11
10
  private tooltipPositioner;
@@ -13,9 +12,11 @@ export declare class Tooltip {
13
12
  private _target;
14
13
  private get target();
15
14
  private set target(value);
15
+ private label;
16
16
  host: HTMLNanoTooltipElement;
17
17
  /** The tooltip's content. Alternatively, you can use the content slot. */
18
18
  content: string;
19
+ setLabel(): void;
19
20
  /**
20
21
  * The preferred placement of the tooltip. Note that the actual placement may vary as needed to keep the tooltip
21
22
  * inside of the viewport.
@@ -63,7 +64,6 @@ export declare class Tooltip {
63
64
  private handleMouseOver;
64
65
  private handleMouseOut;
65
66
  private handleSlotChange;
66
- private handleTTSlotChange;
67
67
  componentDidLoad(): void;
68
68
  componentDidUpdate(): void;
69
69
  disconnectedCallback(): void;
@@ -49,6 +49,10 @@ export namespace Components {
49
49
  * Hides the alert
50
50
  */
51
51
  "hide": () => Promise<boolean>;
52
+ /**
53
+ * Relocate the dialog to the root of the DOM. Most useful in conjunction with `alert()` when parental elements have css stacking constraints which don't allow for `position: fixed`
54
+ */
55
+ "hoist": boolean;
52
56
  /**
53
57
  * Indicates whether or not the alert is open. You can use this in lieu of the show/hide methods.
54
58
  */
@@ -340,6 +344,7 @@ export namespace Components {
340
344
  | 'checkbox'
341
345
  | 'tag'
342
346
  | 'segment'
347
+ | 'switch'
343
348
  | 'segment-pill';
344
349
  /**
345
350
  * Current validation message - if any. @readonly
@@ -1267,6 +1272,10 @@ export namespace Components {
1267
1272
  * Sets focus on the internal button
1268
1273
  */
1269
1274
  "setFocus": () => Promise<void>;
1275
+ /**
1276
+ * display the label as a `<nano-tooltip />`
1277
+ */
1278
+ "showTooltip": boolean;
1270
1279
  /**
1271
1280
  * Specifies where to display the linked URL. Only applies when an `href` is provided. Special keywords: `"_blank"`, `"_self"`, `"_parent"`, `"_top"`.
1272
1281
  */
@@ -2206,9 +2215,9 @@ export namespace Components {
2206
2215
  "name": string;
2207
2216
  }
2208
2217
  /**
2209
- * A tradtional tab implementation. It nests `nano-tab` and `nano-tab-content` sub-components.
2218
+ * A traditional tab implementation. It nests `nano-tab` and `nano-tab-content` sub-components.
2210
2219
  * Tabs can be stacked vertically or horizontally (which presents different styling variations) using the `placement` attribute.
2211
- * Horizonal tabs that don't fit will overflow and scroll appropriately.
2220
+ * Horizontal tabs that don't fit will overflow and scroll appropriately.
2212
2221
  * Tab-content can also be swiped to change tabs.
2213
2222
  */
2214
2223
  interface NanoTabGroup {
@@ -3055,9 +3064,9 @@ declare global {
3055
3064
  new (): HTMLNanoTabContentElement;
3056
3065
  };
3057
3066
  /**
3058
- * A tradtional tab implementation. It nests `nano-tab` and `nano-tab-content` sub-components.
3067
+ * A traditional tab implementation. It nests `nano-tab` and `nano-tab-content` sub-components.
3059
3068
  * Tabs can be stacked vertically or horizontally (which presents different styling variations) using the `placement` attribute.
3060
- * Horizonal tabs that don't fit will overflow and scroll appropriately.
3069
+ * Horizontal tabs that don't fit will overflow and scroll appropriately.
3061
3070
  * Tab-content can also be swiped to change tabs.
3062
3071
  */
3063
3072
  interface HTMLNanoTabGroupElement extends Components.NanoTabGroup, HTMLStencilElement {
@@ -3176,6 +3185,10 @@ declare namespace LocalJSX {
3176
3185
  * The length of time, in milliseconds, the alert will show before closing itself. If the user interacts with the alert before it closes (e.g. moves the mouse over it), the timer will restart.
3177
3186
  */
3178
3187
  "duration"?: number;
3188
+ /**
3189
+ * Relocate the dialog to the root of the DOM. Most useful in conjunction with `alert()` when parental elements have css stacking constraints which don't allow for `position: fixed`
3190
+ */
3191
+ "hoist"?: boolean;
3179
3192
  /**
3180
3193
  * Emitted after the alert closes and all transitions are complete.
3181
3194
  */
@@ -3489,6 +3502,7 @@ declare namespace LocalJSX {
3489
3502
  | 'checkbox'
3490
3503
  | 'tag'
3491
3504
  | 'segment'
3505
+ | 'switch'
3492
3506
  | 'segment-pill';
3493
3507
  /**
3494
3508
  * Current validation message - if any. @readonly
@@ -4458,6 +4472,10 @@ declare namespace LocalJSX {
4458
4472
  * The name of the button, submitted as a pair with the button’s value as part of the form data.
4459
4473
  */
4460
4474
  "name"?: string;
4475
+ /**
4476
+ * display the label as a `<nano-tooltip />`
4477
+ */
4478
+ "showTooltip"?: boolean;
4461
4479
  /**
4462
4480
  * Specifies where to display the linked URL. Only applies when an `href` is provided. Special keywords: `"_blank"`, `"_self"`, `"_parent"`, `"_top"`.
4463
4481
  */
@@ -5439,9 +5457,9 @@ declare namespace LocalJSX {
5439
5457
  "name"?: string;
5440
5458
  }
5441
5459
  /**
5442
- * A tradtional tab implementation. It nests `nano-tab` and `nano-tab-content` sub-components.
5460
+ * A traditional tab implementation. It nests `nano-tab` and `nano-tab-content` sub-components.
5443
5461
  * Tabs can be stacked vertically or horizontally (which presents different styling variations) using the `placement` attribute.
5444
- * Horizonal tabs that don't fit will overflow and scroll appropriately.
5462
+ * Horizontal tabs that don't fit will overflow and scroll appropriately.
5445
5463
  * Tab-content can also be swiped to change tabs.
5446
5464
  */
5447
5465
  interface NanoTabGroup {
@@ -5998,9 +6016,9 @@ declare module "@stencil/core" {
5998
6016
  "nano-tab": LocalJSX.NanoTab & JSXBase.HTMLAttributes<HTMLNanoTabElement>;
5999
6017
  "nano-tab-content": LocalJSX.NanoTabContent & JSXBase.HTMLAttributes<HTMLNanoTabContentElement>;
6000
6018
  /**
6001
- * A tradtional tab implementation. It nests `nano-tab` and `nano-tab-content` sub-components.
6019
+ * A traditional tab implementation. It nests `nano-tab` and `nano-tab-content` sub-components.
6002
6020
  * Tabs can be stacked vertically or horizontally (which presents different styling variations) using the `placement` attribute.
6003
- * Horizonal tabs that don't fit will overflow and scroll appropriately.
6021
+ * Horizontal tabs that don't fit will overflow and scroll appropriately.
6004
6022
  * Tab-content can also be swiped to change tabs.
6005
6023
  */
6006
6024
  "nano-tab-group": LocalJSX.NanoTabGroup & JSXBase.HTMLAttributes<HTMLNanoTabGroupElement>;