lituix 0.1.5 → 0.1.6
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 +1 -1
- package/dist/components/lui-pagination.d.ts.map +1 -1
- package/dist/index.browser.js +2 -2
- package/dist/index.browser.js.map +3 -3
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +3 -3
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +3 -3
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3306,8 +3306,8 @@ var L2=Object.create;var ms=Object.defineProperty;var nh=Object.getOwnPropertyDe
|
|
|
3306
3306
|
padding: 0 38px 0 14px;
|
|
3307
3307
|
font-size: var(--lui-font-size);
|
|
3308
3308
|
}
|
|
3309
|
-
`],a([Ee({reflect:!0})],pe.prototype,"value",2),a([Ee({attribute:!1})],pe.prototype,"source",2),a([Ee({reflect:!0,attribute:"label-key"})],pe.prototype,"labelKey",2),a([Ee({reflect:!0,attribute:"value-key"})],pe.prototype,"valueKey",2),a([Ee({reflect:!0,attribute:"disabled-key"})],pe.prototype,"disabledKey",2),a([Ee({reflect:!0,attribute:"group-key"})],pe.prototype,"groupKey",2),a([Ee({attribute:!1})],pe.prototype,"renderOption",2),a([Ee({attribute:!1})],pe.prototype,"renderTag",2),a([Ee({type:Boolean,attribute:"virtualized",reflect:!0})],pe.prototype,"virtualized",2),a([Ee({type:Number,attribute:"virtual-threshold"})],pe.prototype,"virtualThreshold",2),a([Ee({reflect:!0})],pe.prototype,"placeholder",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"disabled",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"noborder",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"multiple",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"searchable",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"clearable",2),a([Ee({reflect:!0,attribute:"search-placeholder"})],pe.prototype,"searchPlaceholder",2),a([Ee({reflect:!0,attribute:"empty-text"})],pe.prototype,"emptyText",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"open",2),a([Ee({reflect:!0})],pe.prototype,"placement",2),a([Ee({reflect:!0})],pe.prototype,"size",2),a([Ee({type:Boolean,attribute:"close-on-select"})],pe.prototype,"closeOnSelect",2),a([Ee({reflect:!0,attribute:"multiple-display"})],pe.prototype,"multipleDisplay",2),a([Ee()],pe.prototype,"locale",2),a([Ee({attribute:!1})],pe.prototype,"translations",2),a([Ee({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)}}})],pe.prototype,"maxTagCount",2),a([Ee({attribute:!1})],pe.prototype,"values",2),a([Gs()],pe.prototype,"_displayLabel",2),a([Gs()],pe.prototype,"_currentOptionValue",2),a([Gs()],pe.prototype,"_searchKeyword",2),a([Gs()],pe.prototype,"_responsiveMaxTagCount",2),a([Us('[part~="trigger"]')],pe.prototype,"_triggerNode",2),a([Us('[part="value-wrap"]')],pe.prototype,"_valueWrapNode",2),a([Us('[part~="panel"]')],pe.prototype,"_panelNode",2),a([Us('[part="search-input"]')],pe.prototype,"_searchInputNode",2),pe=a([Rc("lui-select")],pe);var Re=class extends Vf{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=F(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=F(this,"pagination");re(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=ke(()=>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,r){let n=Fe(this,this.locale,this.translations);return ie(oe(n.locale,n.translations),e,t,r)}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 r=Number(this._current)
|
|
3310
|
-
<div class="pager" part="pager" aria-label=${this._t("pagination.label","Pagination")}>
|
|
3309
|
+
`],a([Ee({reflect:!0})],pe.prototype,"value",2),a([Ee({attribute:!1})],pe.prototype,"source",2),a([Ee({reflect:!0,attribute:"label-key"})],pe.prototype,"labelKey",2),a([Ee({reflect:!0,attribute:"value-key"})],pe.prototype,"valueKey",2),a([Ee({reflect:!0,attribute:"disabled-key"})],pe.prototype,"disabledKey",2),a([Ee({reflect:!0,attribute:"group-key"})],pe.prototype,"groupKey",2),a([Ee({attribute:!1})],pe.prototype,"renderOption",2),a([Ee({attribute:!1})],pe.prototype,"renderTag",2),a([Ee({type:Boolean,attribute:"virtualized",reflect:!0})],pe.prototype,"virtualized",2),a([Ee({type:Number,attribute:"virtual-threshold"})],pe.prototype,"virtualThreshold",2),a([Ee({reflect:!0})],pe.prototype,"placeholder",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"disabled",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"noborder",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"multiple",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"searchable",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"clearable",2),a([Ee({reflect:!0,attribute:"search-placeholder"})],pe.prototype,"searchPlaceholder",2),a([Ee({reflect:!0,attribute:"empty-text"})],pe.prototype,"emptyText",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"open",2),a([Ee({reflect:!0})],pe.prototype,"placement",2),a([Ee({reflect:!0})],pe.prototype,"size",2),a([Ee({type:Boolean,attribute:"close-on-select"})],pe.prototype,"closeOnSelect",2),a([Ee({reflect:!0,attribute:"multiple-display"})],pe.prototype,"multipleDisplay",2),a([Ee()],pe.prototype,"locale",2),a([Ee({attribute:!1})],pe.prototype,"translations",2),a([Ee({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)}}})],pe.prototype,"maxTagCount",2),a([Ee({attribute:!1})],pe.prototype,"values",2),a([Gs()],pe.prototype,"_displayLabel",2),a([Gs()],pe.prototype,"_currentOptionValue",2),a([Gs()],pe.prototype,"_searchKeyword",2),a([Gs()],pe.prototype,"_responsiveMaxTagCount",2),a([Us('[part~="trigger"]')],pe.prototype,"_triggerNode",2),a([Us('[part="value-wrap"]')],pe.prototype,"_valueWrapNode",2),a([Us('[part~="panel"]')],pe.prototype,"_panelNode",2),a([Us('[part="search-input"]')],pe.prototype,"_searchInputNode",2),pe=a([Rc("lui-select")],pe);var Re=class extends Vf{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=F(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=F(this,"pagination");re(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._pagerNode?.setAttribute("data-indicator-still",""),this._schedulePageIndicatorLayout()}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=ke(()=>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,r){let n=Fe(this,this.locale,this.translations);return ie(oe(n.locale,n.translations),e,t,r)}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 r=Number(this._current);this._indicatorLastPage!==null&&this._indicatorLastPage!==r&&e.removeAttribute("data-indicator-still");let s=e.getBoundingClientRect(),d=t.getBoundingClientRect();e.style.setProperty("--lui-pagination-indicator-x",`${d.left-s.left+e.scrollLeft}px`),e.style.setProperty("--lui-pagination-indicator-y",`${d.top-s.top+e.scrollTop}px`),e.style.setProperty("--lui-pagination-indicator-width",`${d.width}px`),e.style.setProperty("--lui-pagination-indicator-height",`${d.height}px`),e.style.setProperty("--lui-pagination-indicator-opacity","1"),this._indicatorLastPage=r}_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=r=>{let n=Number(r);Number.isFinite(n)&&n>0&&e.add(Math.floor(n))};return this.pageSizeOptions.forEach(t),t(this._pageSize),[...e].sort((r,n)=>r-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 r=Math.min(this._pageCount,Math.max(1,e));r!==this._current&&(this.current=r,this._emitChange(r,t))}_setPageSize(e){if(!Number.isFinite(e))return;let t=Math.max(1,Math.floor(e));if(t===this.pageSize)return;let r=(this._current-1)*this._pageSize;this.pageSize=t;let n=Math.floor(r/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,r=this._current,n=Math.max(5,e||7);if(t<=n)return Array.from({length:t},(f,x)=>x+1);let s=[1],d=n-2,h=Math.max(2,r-Math.floor(d/2)),p=h+d-1;p>=t&&(p=t-1,h=p-d+1),h>2&&s.push("ellipsis");for(let f=h;f<=p;f+=1)s.push(f);return p<t-1&&s.push("ellipsis"),s.push(t),s}_renderPager(){let e=this._current,t=this._pageCount,r=this._effectiveSimple,n=this.showFirstLast&&this._showAuxiliaryControls&&!r;return fo`
|
|
3310
|
+
<div class="pager" part="pager" data-indicator-still aria-label=${this._t("pagination.label","Pagination")}>
|
|
3311
3311
|
<span class="page-indicator" part="page-indicator" aria-hidden="true"></span>
|
|
3312
3312
|
${n?fo`
|
|
3313
3313
|
<button
|