lituix 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/components.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$comment": "Generated by scripts/generate-llm-docs.mjs from source. Do not edit by hand; run pnpm docs:llm.",
3
3
  "package": "lituix",
4
- "version": "0.1.4",
4
+ "version": "0.1.5",
5
5
  "generatedFrom": {
6
6
  "components": "src/components",
7
7
  "stories": "stories"
@@ -36,7 +36,7 @@ export declare class LuiPagination extends LitElement {
36
36
  private _resizeObserver?;
37
37
  private _layoutFrame;
38
38
  private _indicatorFrame;
39
- private _indicatorSettled;
39
+ private _indicatorLastPage;
40
40
  private _observedParent?;
41
41
  private _disposeLocaleChange?;
42
42
  private _explicitAttrs;
@@ -1 +1 @@
1
- {"version":3,"file":"lui-pagination.d.ts","sourceRoot":"","sources":["../../src/components/lui-pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAK1E,OAAO,EAAgD,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAClG,OAAO,YAAY,CAAC;AAEpB,OAAO,cAAc,CAAC;AAEtB,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAChD,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEvE,MAAM,WAAW,qBAAqB;IACpC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAWD,qBACa,aAAc,SAAQ,UAAU;IAC3C,MAAM,CAAC,MAAM,4BA0PX;IAGF,OAAO,SAAK;IAGZ,KAAK,SAAK;IAGV,QAAQ,SAAM;IAGd,UAAU,SAAK;IAGf,IAAI,EAAE,cAAc,CAAQ;IAG5B,WAAW,UAAS;IAGpB,SAAS,UAAS;IAGlB,UAAU,UA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,GAElC;IAED,OAAO,KAAK,0BAA0B,GASrC;IAED,OAAO,CAAC,WAAW;IAiBnB,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,WAAW;IAwBnB,OAAO,CAAC,cAAc,CAGpB;IAEF,OAAO,CAAC,iBAAiB,CAGvB;IAEF,OAAO,CAAC,aAAa,CAKnB;IAEF,OAAO,CAAC,gBAAgB,CAKtB;IAEF,OAAO,CAAC,YAAY;IA+EpB,MAAM;CAyDP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAC;KACjC;CACF"}
@@ -3308,7 +3308,7 @@
3308
3308
  padding: 0 38px 0 14px;
3309
3309
  font-size: var(--lui-font-size);
3310
3310
  }
3311
- `],s([h({reflect:!0})],je.prototype,"value",2),s([h({attribute:!1})],je.prototype,"source",2),s([h({reflect:!0,attribute:"label-key"})],je.prototype,"labelKey",2),s([h({reflect:!0,attribute:"value-key"})],je.prototype,"valueKey",2),s([h({reflect:!0,attribute:"disabled-key"})],je.prototype,"disabledKey",2),s([h({reflect:!0,attribute:"group-key"})],je.prototype,"groupKey",2),s([h({attribute:!1})],je.prototype,"renderOption",2),s([h({attribute:!1})],je.prototype,"renderTag",2),s([h({type:Boolean,attribute:"virtualized",reflect:!0})],je.prototype,"virtualized",2),s([h({type:Number,attribute:"virtual-threshold"})],je.prototype,"virtualThreshold",2),s([h({reflect:!0})],je.prototype,"placeholder",2),s([h({type:Boolean,reflect:!0})],je.prototype,"disabled",2),s([h({type:Boolean,reflect:!0})],je.prototype,"noborder",2),s([h({type:Boolean,reflect:!0})],je.prototype,"multiple",2),s([h({type:Boolean,reflect:!0})],je.prototype,"searchable",2),s([h({type:Boolean,reflect:!0})],je.prototype,"clearable",2),s([h({reflect:!0,attribute:"search-placeholder"})],je.prototype,"searchPlaceholder",2),s([h({reflect:!0,attribute:"empty-text"})],je.prototype,"emptyText",2),s([h({type:Boolean,reflect:!0})],je.prototype,"open",2),s([h({reflect:!0})],je.prototype,"placement",2),s([h({reflect:!0})],je.prototype,"size",2),s([h({type:Boolean,attribute:"close-on-select"})],je.prototype,"closeOnSelect",2),s([h({reflect:!0,attribute:"multiple-display"})],je.prototype,"multipleDisplay",2),s([h()],je.prototype,"locale",2),s([h({attribute:!1})],je.prototype,"translations",2),s([h({attribute:"max-tag-count",converter:{fromAttribute(e){if(e==null||e==="")return;if(e==="responsive"||e==="auto")return e;let t=Number(e);return Number.isFinite(t)?t:void 0},toAttribute(e){return e==null?null:String(e)}}})],je.prototype,"maxTagCount",2),s([h({attribute:!1})],je.prototype,"values",2),s([Y()],je.prototype,"_displayLabel",2),s([Y()],je.prototype,"_currentOptionValue",2),s([Y()],je.prototype,"_searchKeyword",2),s([Y()],je.prototype,"_responsiveMaxTagCount",2),s([G('[part~="trigger"]')],je.prototype,"_triggerNode",2),s([G('[part="value-wrap"]')],je.prototype,"_valueWrapNode",2),s([G('[part~="panel"]')],je.prototype,"_panelNode",2),s([G('[part="search-input"]')],je.prototype,"_searchInputNode",2),je=s([N("lui-select")],je);var tt=class extends L{constructor(){super(...arguments);this.current=1;this.total=0;this.pageSize=10;this.maxVisible=7;this.size="md";this.showSummary=!1;this.showTotal=!1;this.showJumper=!1;this.showSizeChanger=!1;this.showFirstLast=!1;this.hideOnSinglePage=!1;this.simple=!1;this.compact=!1;this.responsive=!1;this.pageSizeOptions=[10,20,50,100];this.selectProps={};this._jumperValue="";this._responsiveMode="normal";this._layoutFrame=0;this._indicatorFrame=0;this._indicatorSettled=!1;this._explicitAttrs=new Set;this._onJumperInput=e=>{e.stopPropagation(),this._jumperValue=e.target.value};this._onPageSizeChange=e=>{e.stopPropagation(),this._setPageSize(Number(e.detail?.value))};this._commitJumper=()=>{let e=Number(this._jumperValue);Number.isFinite(e)&&(this._setPage(e,"jumper"),this._jumperValue="")};this._onJumperKeydown=e=>{e.key==="Enter"&&(e.preventDefault(),this._commitJumper())}}willUpdate(e){let t=re(this,"pagination");this._explicitAttrs.size||(this._explicitAttrs=new Set(this.getAttributeNames())),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("compact")&&typeof t.compact=="boolean"&&this.compact!==t.compact&&(this.compact=t.compact)}updated(e){let t=re(this,"pagination");Se(this._sizeSelect,{...t.selectProps??{},...this.selectProps??{}}),this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),(e.has("responsive")||e.has("size")||e.has("showTotal")||e.has("showSummary")||e.has("showJumper")||e.has("showSizeChanger")||e.has("showFirstLast")||e.has("simple")||e.has("compact")||e.has("current")||e.has("total")||e.has("pageSize")||e.has("maxVisible"))&&this._scheduleResponsiveLayout(),this._schedulePageIndicatorLayout()}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=Ie(()=>this.requestUpdate()),this._resizeObserver=new ResizeObserver(()=>this._scheduleResponsiveLayout())}firstUpdated(){this._resizeObserver?.observe(this),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._scheduleResponsiveLayout()}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.(),this._resizeObserver?.disconnect(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame)}_t(e,t,i){let n=lt(this,this.locale,this.translations);return Me(_e(n.locale,n.translations),e,t,i)}get _pageSize(){let e=Number(this.pageSize);return Number.isFinite(e)&&e>0?Math.floor(e):10}get _pageCount(){let e=Number(this.total);return Math.max(1,Math.ceil((Number.isFinite(e)?e:0)/this._pageSize))}get _current(){let e=Number(this.current);return Math.min(this._pageCount,Math.max(1,Number.isFinite(e)?Math.floor(e):1))}_scheduleResponsiveLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._updateResponsiveMode(),this._schedulePageIndicatorLayout()})}_schedulePageIndicatorLayout(){this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._indicatorFrame=requestAnimationFrame(()=>{this._indicatorFrame=0,this._updatePageIndicator()})}_updatePageIndicator(){let e=this._pagerNode;if(!e||this._effectiveSimple){e?.style.setProperty("--lui-pagination-indicator-opacity","0"),this._indicatorSettled=!1;return}let t=e.querySelector(`button.page[data-page="${this._current}"]`);if(!t){e.style.setProperty("--lui-pagination-indicator-opacity","0"),this._indicatorSettled=!1;return}let i=e.getBoundingClientRect(),n=t.getBoundingClientRect(),a=!this._indicatorSettled;a&&e.setAttribute("data-indicator-still",""),e.style.setProperty("--lui-pagination-indicator-x",`${n.left-i.left+e.scrollLeft}px`),e.style.setProperty("--lui-pagination-indicator-y",`${n.top-i.top+e.scrollTop}px`),e.style.setProperty("--lui-pagination-indicator-width",`${n.width}px`),e.style.setProperty("--lui-pagination-indicator-height",`${n.height}px`),e.style.setProperty("--lui-pagination-indicator-opacity","1"),a?requestAnimationFrame(()=>{e.removeAttribute("data-indicator-still"),this._indicatorSettled=!0}):this._indicatorSettled=!0}_getResponsiveAvailableWidth(){let e=Math.floor(this.clientWidth||this.getBoundingClientRect().width||0);if(e>0)return e;let t=this.parentElement;return t?Math.floor(t.clientWidth||t.getBoundingClientRect().width||0):0}_updateResponsiveMode(){if(!this.responsive){this._responsiveMode!=="normal"&&(this._responsiveMode="normal"),this.dataset.responsiveMode="normal";return}let e=Math.floor(this._getResponsiveAvailableWidth()),t=e>0&&e<360?"simple":e>0&&e<860?"compact":"normal";this.dataset.responsiveMode=t,t!==this._responsiveMode&&(this._responsiveMode=t,this._indicatorSettled=!1)}get _effectiveSimple(){return this.simple||this.responsive&&this._responsiveMode==="simple"}get _effectiveMaxVisible(){return this.responsive?this._responsiveMode==="simple"?1:this._responsiveMode==="compact"?Math.min(this.maxVisible||5,5):this.maxVisible:this.maxVisible}get _showAuxiliaryControls(){return!this.responsive||this._responsiveMode==="normal"}get _showCompactSizeChanger(){return!this.responsive||this._responsiveMode==="normal"}get _normalizedPageSizeOptions(){let e=new Set,t=i=>{let n=Number(i);Number.isFinite(n)&&n>0&&e.add(Math.floor(n))};return this.pageSizeOptions.forEach(t),t(this._pageSize),[...e].sort((i,n)=>i-n)}_emitChange(e,t){this.dispatchEvent(new CustomEvent("change",{detail:{page:e,current:e,pageSize:this._pageSize,total:Number.isFinite(Number(this.total))?Number(this.total):0,pageCount:this._pageCount,action:t},bubbles:!0,composed:!0}))}_setPage(e,t){let i=Math.min(this._pageCount,Math.max(1,e));i!==this._current&&(this.current=i,this._emitChange(i,t))}_setPageSize(e){if(!Number.isFinite(e))return;let t=Math.max(1,Math.floor(e));if(t===this.pageSize)return;let i=(this._current-1)*this._pageSize;this.pageSize=t;let n=Math.floor(i/t)+1;this.current=Math.min(Math.max(1,n),Math.max(1,Math.ceil(this.total/t))),this._emitChange(this.current,"page-size")}_buildPages(e=this.maxVisible){let t=this._pageCount,i=this._current,n=Math.max(5,e||7);if(t<=n)return Array.from({length:t},(m,v)=>v+1);let a=[1],l=n-2,d=Math.max(2,i-Math.floor(l/2)),p=d+l-1;p>=t&&(p=t-1,d=p-l+1),d>2&&a.push("ellipsis");for(let m=d;m<=p;m+=1)a.push(m);return p<t-1&&a.push("ellipsis"),a.push(t),a}_renderPager(){let e=this._current,t=this._pageCount,i=this._effectiveSimple,n=this.showFirstLast&&this._showAuxiliaryControls&&!i;return b`
3311
+ `],s([h({reflect:!0})],je.prototype,"value",2),s([h({attribute:!1})],je.prototype,"source",2),s([h({reflect:!0,attribute:"label-key"})],je.prototype,"labelKey",2),s([h({reflect:!0,attribute:"value-key"})],je.prototype,"valueKey",2),s([h({reflect:!0,attribute:"disabled-key"})],je.prototype,"disabledKey",2),s([h({reflect:!0,attribute:"group-key"})],je.prototype,"groupKey",2),s([h({attribute:!1})],je.prototype,"renderOption",2),s([h({attribute:!1})],je.prototype,"renderTag",2),s([h({type:Boolean,attribute:"virtualized",reflect:!0})],je.prototype,"virtualized",2),s([h({type:Number,attribute:"virtual-threshold"})],je.prototype,"virtualThreshold",2),s([h({reflect:!0})],je.prototype,"placeholder",2),s([h({type:Boolean,reflect:!0})],je.prototype,"disabled",2),s([h({type:Boolean,reflect:!0})],je.prototype,"noborder",2),s([h({type:Boolean,reflect:!0})],je.prototype,"multiple",2),s([h({type:Boolean,reflect:!0})],je.prototype,"searchable",2),s([h({type:Boolean,reflect:!0})],je.prototype,"clearable",2),s([h({reflect:!0,attribute:"search-placeholder"})],je.prototype,"searchPlaceholder",2),s([h({reflect:!0,attribute:"empty-text"})],je.prototype,"emptyText",2),s([h({type:Boolean,reflect:!0})],je.prototype,"open",2),s([h({reflect:!0})],je.prototype,"placement",2),s([h({reflect:!0})],je.prototype,"size",2),s([h({type:Boolean,attribute:"close-on-select"})],je.prototype,"closeOnSelect",2),s([h({reflect:!0,attribute:"multiple-display"})],je.prototype,"multipleDisplay",2),s([h()],je.prototype,"locale",2),s([h({attribute:!1})],je.prototype,"translations",2),s([h({attribute:"max-tag-count",converter:{fromAttribute(e){if(e==null||e==="")return;if(e==="responsive"||e==="auto")return e;let t=Number(e);return Number.isFinite(t)?t:void 0},toAttribute(e){return e==null?null:String(e)}}})],je.prototype,"maxTagCount",2),s([h({attribute:!1})],je.prototype,"values",2),s([Y()],je.prototype,"_displayLabel",2),s([Y()],je.prototype,"_currentOptionValue",2),s([Y()],je.prototype,"_searchKeyword",2),s([Y()],je.prototype,"_responsiveMaxTagCount",2),s([G('[part~="trigger"]')],je.prototype,"_triggerNode",2),s([G('[part="value-wrap"]')],je.prototype,"_valueWrapNode",2),s([G('[part~="panel"]')],je.prototype,"_panelNode",2),s([G('[part="search-input"]')],je.prototype,"_searchInputNode",2),je=s([N("lui-select")],je);var tt=class extends L{constructor(){super(...arguments);this.current=1;this.total=0;this.pageSize=10;this.maxVisible=7;this.size="md";this.showSummary=!1;this.showTotal=!1;this.showJumper=!1;this.showSizeChanger=!1;this.showFirstLast=!1;this.hideOnSinglePage=!1;this.simple=!1;this.compact=!1;this.responsive=!1;this.pageSizeOptions=[10,20,50,100];this.selectProps={};this._jumperValue="";this._responsiveMode="normal";this._layoutFrame=0;this._indicatorFrame=0;this._indicatorLastPage=null;this._explicitAttrs=new Set;this._onJumperInput=e=>{e.stopPropagation(),this._jumperValue=e.target.value};this._onPageSizeChange=e=>{e.stopPropagation(),this._setPageSize(Number(e.detail?.value))};this._commitJumper=()=>{let e=Number(this._jumperValue);Number.isFinite(e)&&(this._setPage(e,"jumper"),this._jumperValue="")};this._onJumperKeydown=e=>{e.key==="Enter"&&(e.preventDefault(),this._commitJumper())}}willUpdate(e){let t=re(this,"pagination");this._explicitAttrs.size||(this._explicitAttrs=new Set(this.getAttributeNames())),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("compact")&&typeof t.compact=="boolean"&&this.compact!==t.compact&&(this.compact=t.compact)}updated(e){let t=re(this,"pagination");Se(this._sizeSelect,{...t.selectProps??{},...this.selectProps??{}}),this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),(e.has("responsive")||e.has("size")||e.has("showTotal")||e.has("showSummary")||e.has("showJumper")||e.has("showSizeChanger")||e.has("showFirstLast")||e.has("simple")||e.has("compact")||e.has("current")||e.has("total")||e.has("pageSize")||e.has("maxVisible"))&&this._scheduleResponsiveLayout(),this._schedulePageIndicatorLayout()}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=Ie(()=>this.requestUpdate()),this._resizeObserver=new ResizeObserver(()=>this._scheduleResponsiveLayout())}firstUpdated(){this._resizeObserver?.observe(this),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._scheduleResponsiveLayout()}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.(),this._resizeObserver?.disconnect(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame)}_t(e,t,i){let n=lt(this,this.locale,this.translations);return Me(_e(n.locale,n.translations),e,t,i)}get _pageSize(){let e=Number(this.pageSize);return Number.isFinite(e)&&e>0?Math.floor(e):10}get _pageCount(){let e=Number(this.total);return Math.max(1,Math.ceil((Number.isFinite(e)?e:0)/this._pageSize))}get _current(){let e=Number(this.current);return Math.min(this._pageCount,Math.max(1,Number.isFinite(e)?Math.floor(e):1))}_scheduleResponsiveLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._updateResponsiveMode(),this._schedulePageIndicatorLayout()})}_schedulePageIndicatorLayout(){this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._indicatorFrame=requestAnimationFrame(()=>{this._indicatorFrame=0,this._updatePageIndicator()})}_updatePageIndicator(){let e=this._pagerNode;if(!e||this._effectiveSimple){e?.style.setProperty("--lui-pagination-indicator-opacity","0"),this._indicatorLastPage=null;return}let t=e.querySelector(`button.page[data-page="${this._current}"]`);if(!t){e.style.setProperty("--lui-pagination-indicator-opacity","0"),this._indicatorLastPage=null;return}let i=Number(this._current),n=this._indicatorLastPage!==null&&this._indicatorLastPage!==i;n||e.setAttribute("data-indicator-still","");let a=e.getBoundingClientRect(),l=t.getBoundingClientRect();e.style.setProperty("--lui-pagination-indicator-x",`${l.left-a.left+e.scrollLeft}px`),e.style.setProperty("--lui-pagination-indicator-y",`${l.top-a.top+e.scrollTop}px`),e.style.setProperty("--lui-pagination-indicator-width",`${l.width}px`),e.style.setProperty("--lui-pagination-indicator-height",`${l.height}px`),e.style.setProperty("--lui-pagination-indicator-opacity","1"),this._indicatorLastPage=i,n||requestAnimationFrame(()=>e.removeAttribute("data-indicator-still"))}_getResponsiveAvailableWidth(){let e=Math.floor(this.clientWidth||this.getBoundingClientRect().width||0);if(e>0)return e;let t=this.parentElement;return t?Math.floor(t.clientWidth||t.getBoundingClientRect().width||0):0}_updateResponsiveMode(){if(!this.responsive){this._responsiveMode!=="normal"&&(this._responsiveMode="normal"),this.dataset.responsiveMode="normal";return}let e=Math.floor(this._getResponsiveAvailableWidth()),t=e>0&&e<360?"simple":e>0&&e<860?"compact":"normal";this.dataset.responsiveMode=t,t!==this._responsiveMode&&(this._responsiveMode=t,this._indicatorLastPage=null)}get _effectiveSimple(){return this.simple||this.responsive&&this._responsiveMode==="simple"}get _effectiveMaxVisible(){return this.responsive?this._responsiveMode==="simple"?1:this._responsiveMode==="compact"?Math.min(this.maxVisible||5,5):this.maxVisible:this.maxVisible}get _showAuxiliaryControls(){return!this.responsive||this._responsiveMode==="normal"}get _showCompactSizeChanger(){return!this.responsive||this._responsiveMode==="normal"}get _normalizedPageSizeOptions(){let e=new Set,t=i=>{let n=Number(i);Number.isFinite(n)&&n>0&&e.add(Math.floor(n))};return this.pageSizeOptions.forEach(t),t(this._pageSize),[...e].sort((i,n)=>i-n)}_emitChange(e,t){this.dispatchEvent(new CustomEvent("change",{detail:{page:e,current:e,pageSize:this._pageSize,total:Number.isFinite(Number(this.total))?Number(this.total):0,pageCount:this._pageCount,action:t},bubbles:!0,composed:!0}))}_setPage(e,t){let i=Math.min(this._pageCount,Math.max(1,e));i!==this._current&&(this.current=i,this._emitChange(i,t))}_setPageSize(e){if(!Number.isFinite(e))return;let t=Math.max(1,Math.floor(e));if(t===this.pageSize)return;let i=(this._current-1)*this._pageSize;this.pageSize=t;let n=Math.floor(i/t)+1;this.current=Math.min(Math.max(1,n),Math.max(1,Math.ceil(this.total/t))),this._emitChange(this.current,"page-size")}_buildPages(e=this.maxVisible){let t=this._pageCount,i=this._current,n=Math.max(5,e||7);if(t<=n)return Array.from({length:t},(m,v)=>v+1);let a=[1],l=n-2,d=Math.max(2,i-Math.floor(l/2)),p=d+l-1;p>=t&&(p=t-1,d=p-l+1),d>2&&a.push("ellipsis");for(let m=d;m<=p;m+=1)a.push(m);return p<t-1&&a.push("ellipsis"),a.push(t),a}_renderPager(){let e=this._current,t=this._pageCount,i=this._effectiveSimple,n=this.showFirstLast&&this._showAuxiliaryControls&&!i;return b`
3312
3312
  <div class="pager" part="pager" aria-label=${this._t("pagination.label","Pagination")}>
3313
3313
  <span class="page-indicator" part="page-indicator" aria-hidden="true"></span>
3314
3314
  ${n?b`