@umbraco-ui/uui-pagination 0.0.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.
- package/LICENSE +21 -0
- package/README.md +43 -0
- package/custom-elements.json +74 -0
- package/dist/uui-pagination.min.js +38 -0
- package/dist/uui-pagination.min.js.map +1 -0
- package/lib/UUIPaginationEvent.d.ts +5 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +254 -0
- package/lib/uui-pagination.element.d.ts +75 -0
- package/lib/uui-pagination.element.js +253 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 uui-app
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# uui-pagination
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Umbraco style pagination component. By implementing a resizeObserver it changes the number of visible buttons to fit the width of the container it sits in. Check this out in the [Storybook](https://uui.umbraco.com/?path=/story/uui-pagination--aaa-overview). Uses `<uui-button></uui-button>` and `<uui-button-group></uui-button-group>`.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
### ES imports
|
|
10
|
+
|
|
11
|
+
```zsh
|
|
12
|
+
npm i @umbraco-ui/uui-pagination
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Import the registration of `<uui-pagination>` via:
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
import '@umbraco-ui/uui-pagination/lib';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
When looking to leverage the `UUIPaginationElement` base class as a type and/or for extension purposes, do so via:
|
|
22
|
+
|
|
23
|
+
```javascript
|
|
24
|
+
import { UUIPaginationElement } from '@umbraco-ui/uui-pagination/lib/uui-pagination.element';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### CDN
|
|
28
|
+
|
|
29
|
+
The component is available via CDN. This means it can be added to your application without the need of any bundler configuration. Here is how to use it with jsDelivr.
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<!-- Latest Version -->
|
|
33
|
+
<script src="https://cdn.jsdelivr.net/npm/@umbraco-ui/uui-pagination@latest/dist/uui-pagination.min.js"></script>
|
|
34
|
+
|
|
35
|
+
<!-- Specific version -->
|
|
36
|
+
<script src="https://cdn.jsdelivr.net/npm/@umbraco-ui/uui-pagination@X.X.X/dist/uui-pagination.min.js"></script>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<uui-pagination total="100"></uui-pagination>
|
|
43
|
+
```
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "experimental",
|
|
3
|
+
"tags": [
|
|
4
|
+
{
|
|
5
|
+
"name": "uui-pagination",
|
|
6
|
+
"path": "./lib/uui-pagination.element.ts",
|
|
7
|
+
"attributes": [
|
|
8
|
+
{
|
|
9
|
+
"name": "label",
|
|
10
|
+
"description": "This property is used to generate a proper `aria-label`. It will be announced by screen reader as: \"<<this.label>>. Current page: <<this.current>>\"",
|
|
11
|
+
"type": "string",
|
|
12
|
+
"default": "\"\""
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "aria-label",
|
|
16
|
+
"description": "With this property you can overwrite aria-label.",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"default": "\"\""
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "total",
|
|
22
|
+
"description": "Set the amount of pages to navigate.",
|
|
23
|
+
"type": "number",
|
|
24
|
+
"default": "\": 1\""
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "current",
|
|
28
|
+
"description": "Define the current active page.",
|
|
29
|
+
"type": "number"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"properties": [
|
|
33
|
+
{
|
|
34
|
+
"name": "styles",
|
|
35
|
+
"type": "CSSResult[]",
|
|
36
|
+
"default": "[null]"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "label",
|
|
40
|
+
"attribute": "label",
|
|
41
|
+
"description": "This property is used to generate a proper `aria-label`. It will be announced by screen reader as: \"<<this.label>>. Current page: <<this.current>>\"",
|
|
42
|
+
"type": "string",
|
|
43
|
+
"default": "\"\""
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "ariaLabel",
|
|
47
|
+
"attribute": "aria-label",
|
|
48
|
+
"description": "With this property you can overwrite aria-label.",
|
|
49
|
+
"type": "string",
|
|
50
|
+
"default": "\"\""
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "total",
|
|
54
|
+
"attribute": "total",
|
|
55
|
+
"description": "Set the amount of pages to navigate.",
|
|
56
|
+
"type": "number",
|
|
57
|
+
"default": "\": 1\""
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "current",
|
|
61
|
+
"attribute": "current",
|
|
62
|
+
"description": "Define the current active page.",
|
|
63
|
+
"type": "number"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"events": [
|
|
67
|
+
{
|
|
68
|
+
"name": "change",
|
|
69
|
+
"description": "When clicked on the page button fires change event"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var Gt=Object.defineProperty,Wt=Object.defineProperties;var Ft=Object.getOwnPropertyDescriptors;var ft=Object.getOwnPropertySymbols;var Kt=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable;var mt=(d,v,$)=>v in d?Gt(d,v,{enumerable:!0,configurable:!0,writable:!0,value:$}):d[v]=$,D=(d,v)=>{for(var $ in v||(v={}))Kt.call(v,$)&&mt(d,$,v[$]);if(ft)for(var $ of ft(v))Jt.call(v,$)&&mt(d,$,v[$]);return d},z=(d,v)=>Wt(d,Ft(v));var Xt=typeof require!="undefined"?require:d=>{throw new Error('Dynamic require of "'+d+'" is not supported')};(function(d){typeof define=="function"&&define.amd?define(d):d()})(function(){"use strict";/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/const d=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,v=Symbol(),$=new Map;class J{constructor(t,e){if(this._$cssResult$=!0,e!==v)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=$.get(this.cssText);return d&&t===void 0&&($.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const bt=r=>new J(typeof r=="string"?r:r+"",v),yt=(r,...t)=>{const e=r.length===1?r[0]:t.reduce((i,s,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+r[n+1],r[0]);return new J(e,v)},At=(r,t)=>{d?r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{const i=document.createElement("style"),s=window.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,r.appendChild(i)})},Z=d?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return bt(e)})(r):r;/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*/var V;const X=window.trustedTypes,Et=X?X.emptyScript:"",Q=window.reactiveElementPolyfillSupport,q={toAttribute(r,t){switch(t){case Boolean:r=r?Et:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch(i){e=null}}return e}},Y=(r,t)=>t!==r&&(t==t||r==r),j={attribute:!0,type:String,converter:q,reflect:!1,hasChanged:Y};class w extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;(e=this.l)!==null&&e!==void 0||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((e,i)=>{const s=this._$Eh(i,e);s!==void 0&&(this._$Eu.set(s,i),t.push(s))}),t}static createProperty(t,e=j){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i=typeof t=="symbol"?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);s!==void 0&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const n=this[t];this[e]=s,this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||j}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const e=this.properties,i=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const s of i)this.createProperty(s,e[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(Z(s))}else t!==void 0&&e.push(Z(t));return e}static _$Eh(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Em(),this.requestUpdate(),(t=this.constructor.l)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,i;((e=this._$Eg)!==null&&e!==void 0?e:this._$Eg=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var e;(e=this._$Eg)===null||e===void 0||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;const e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return At(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$Eg)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostConnected)===null||i===void 0?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$Eg)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostDisconnected)===null||i===void 0?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ES(t,e,i=j){var s,n;const o=this.constructor._$Eh(t,i);if(o!==void 0&&i.reflect===!0){const h=((n=(s=i.converter)===null||s===void 0?void 0:s.toAttribute)!==null&&n!==void 0?n:q.toAttribute)(e,i.type);this._$Ei=t,h==null?this.removeAttribute(o):this.setAttribute(o,h),this._$Ei=null}}_$AK(t,e){var i,s,n;const o=this.constructor,h=o._$Eu.get(t);if(h!==void 0&&this._$Ei!==h){const l=o.getPropertyOptions(h),a=l.converter,_=(n=(s=(i=a)===null||i===void 0?void 0:i.fromAttribute)!==null&&s!==void 0?s:typeof a=="function"?a:null)!==null&&n!==void 0?n:q.fromAttribute;this._$Ei=h,this[h]=_(e,l.type),this._$Ei=null}}requestUpdate(t,e,i){let s=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||Y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Ei!==t&&(this._$E_===void 0&&(this._$E_=new Map),this._$E_.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$Ep=this._$EC())}async _$EC(){this.isUpdatePending=!0;try{await this._$Ep}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach((s,n)=>this[n]=s),this._$Et=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$Eg)===null||t===void 0||t.forEach(s=>{var n;return(n=s.hostUpdate)===null||n===void 0?void 0:n.call(s)}),this.update(i)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$Eg)===null||e===void 0||e.forEach(i=>{var s;return(s=i.hostUpdated)===null||s===void 0?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){this._$E_!==void 0&&(this._$E_.forEach((e,i)=>this._$ES(i,this[i],e)),this._$E_=void 0),this._$EU()}updated(t){}firstUpdated(t){}}w.finalized=!0,w.elementProperties=new Map,w.elementStyles=[],w.shadowRootOptions={mode:"open"},Q==null||Q({ReactiveElement:w}),((V=globalThis.reactiveElementVersions)!==null&&V!==void 0?V:globalThis.reactiveElementVersions=[]).push("1.0.2");/**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2017 Google LLC
|
|
12
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
+
*/var G;const P=globalThis.trustedTypes,tt=P?P.createPolicy("lit-html",{createHTML:r=>r}):void 0,b=`lit$${(Math.random()+"").slice(9)}$`,et="?"+b,wt=`<${et}>`,S=document,N=(r="")=>S.createComment(r),T=r=>r===null||typeof r!="object"&&typeof r!="function",it=Array.isArray,Pt=r=>{var t;return it(r)||typeof((t=r)===null||t===void 0?void 0:t[Symbol.iterator])=="function"},O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,rt=/>/g,A=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,nt=/'/g,ot=/"/g,lt=/^(?:script|style|textarea)$/i,St=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),m=St(1),C=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),at=new WeakMap,Ct=(r,t,e)=>{var i,s;const n=(i=e==null?void 0:e.renderBefore)!==null&&i!==void 0?i:t;let o=n._$litPart$;if(o===void 0){const h=(s=e==null?void 0:e.renderBefore)!==null&&s!==void 0?s:null;n._$litPart$=o=new k(t.insertBefore(N(),h),h,void 0,e!=null?e:{})}return o._$AI(r),o},x=S.createTreeWalker(S,129,null,!1),xt=(r,t)=>{const e=r.length-1,i=[];let s,n=t===2?"<svg>":"",o=O;for(let l=0;l<e;l++){const a=r[l];let _,u,c=-1,g=0;for(;g<a.length&&(o.lastIndex=g,u=o.exec(a),u!==null);)g=o.lastIndex,o===O?u[1]==="!--"?o=st:u[1]!==void 0?o=rt:u[2]!==void 0?(lt.test(u[2])&&(s=RegExp("</"+u[2],"g")),o=A):u[3]!==void 0&&(o=A):o===A?u[0]===">"?(o=s!=null?s:O,c=-1):u[1]===void 0?c=-2:(c=o.lastIndex-u[2].length,_=u[1],o=u[3]===void 0?A:u[3]==='"'?ot:nt):o===ot||o===nt?o=A:o===st||o===rt?o=O:(o=A,s=void 0);const B=o===A&&r[l+1].startsWith("/>")?" ":"";n+=o===O?a+wt:c>=0?(i.push(_),a.slice(0,c)+"$lit$"+a.slice(c)+b+B):a+b+(c===-2?(i.push(void 0),l):B)}const h=n+(r[e]||"<?>")+(t===2?"</svg>":"");return[tt!==void 0?tt.createHTML(h):h,i]};class H{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,o=0;const h=t.length-1,l=this.parts,[a,_]=xt(t,e);if(this.el=H.createElement(a,i),x.currentNode=this.el.content,e===2){const u=this.el.content,c=u.firstChild;c.remove(),u.append(...c.childNodes)}for(;(s=x.nextNode())!==null&&l.length<h;){if(s.nodeType===1){if(s.hasAttributes()){const u=[];for(const c of s.getAttributeNames())if(c.endsWith("$lit$")||c.startsWith(b)){const g=_[o++];if(u.push(c),g!==void 0){const B=s.getAttribute(g.toLowerCase()+"$lit$").split(b),I=/([.?@])?(.*)/.exec(g);l.push({type:1,index:n,name:I[2],strings:B,ctor:I[1]==="."?Nt:I[1]==="?"?Ot:I[1]==="@"?Ht:L})}else l.push({type:6,index:n})}for(const c of u)s.removeAttribute(c)}if(lt.test(s.tagName)){const u=s.textContent.split(b),c=u.length-1;if(c>0){s.textContent=P?P.emptyScript:"";for(let g=0;g<c;g++)s.append(u[g],N()),x.nextNode(),l.push({type:2,index:++n});s.append(u[c],N())}}}else if(s.nodeType===8)if(s.data===et)l.push({type:2,index:n});else{let u=-1;for(;(u=s.data.indexOf(b,u+1))!==-1;)l.push({type:7,index:n}),u+=b.length-1}n++}}static createElement(t,e){const i=S.createElement("template");return i.innerHTML=t,i}}function U(r,t,e=r,i){var s,n,o,h;if(t===C)return t;let l=i!==void 0?(s=e._$Cl)===null||s===void 0?void 0:s[i]:e._$Cu;const a=T(t)?void 0:t._$litDirective$;return(l==null?void 0:l.constructor)!==a&&((n=l==null?void 0:l._$AO)===null||n===void 0||n.call(l,!1),a===void 0?l=void 0:(l=new a(r),l._$AT(r,e,i)),i!==void 0?((o=(h=e)._$Cl)!==null&&o!==void 0?o:h._$Cl=[])[i]=l:e._$Cu=l),l!==void 0&&(t=U(r,l._$AS(r,t.values),l,i)),t}class Ut{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:s}=this._$AD,n=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:S).importNode(i,!0);x.currentNode=n;let o=x.nextNode(),h=0,l=0,a=s[0];for(;a!==void 0;){if(h===a.index){let _;a.type===2?_=new k(o,o.nextSibling,this,t):a.type===1?_=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(_=new kt(o,this,t)),this.v.push(_),a=s[++l]}h!==(a==null?void 0:a.index)&&(o=x.nextNode(),h++)}return n}m(t){let e=0;for(const i of this.v)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class k{constructor(t,e,i,s){var n;this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cg=(n=s==null?void 0:s.isConnected)===null||n===void 0||n}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&t.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=U(this,t,e),T(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==C&&this.$(t):t._$litType$!==void 0?this.T(t):t.nodeType!==void 0?this.S(t):Pt(t)?this.M(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==p&&T(this._$AH)?this._$AA.nextSibling.data=t:this.S(S.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=H.createElement(s.h,this.options)),s);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===n)this._$AH.m(i);else{const o=new Ut(n,this),h=o.p(this.options);o.m(i),this.S(h),this._$AH=o}}_$AC(t){let e=at.get(t.strings);return e===void 0&&at.set(t.strings,e=new H(t)),e}M(t){it(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new k(this.A(N()),this.A(N()),this,this.options)):i=e[s],i._$AI(n),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cg=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}}class L{constructor(t,e,i,s,n){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=p}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const n=this.strings;let o=!1;if(n===void 0)t=U(this,t,e,0),o=!T(t)||t!==this._$AH&&t!==C,o&&(this._$AH=t);else{const h=t;let l,a;for(t=n[0],l=0;l<n.length-1;l++)a=U(this,h[i+l],e,l),a===C&&(a=this._$AH[l]),o||(o=!T(a)||a!==this._$AH[l]),a===p?t=p:t!==p&&(t+=(a!=null?a:"")+n[l+1]),this._$AH[l]=a}o&&!s&&this.k(t)}k(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}}class Nt extends L{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===p?void 0:t}}const Tt=P?P.emptyScript:"";class Ot extends L{constructor(){super(...arguments),this.type=4}k(t){t&&t!==p?this.element.setAttribute(this.name,Tt):this.element.removeAttribute(this.name)}}class Ht extends L{constructor(t,e,i,s,n){super(t,e,i,s,n),this.type=5}_$AI(t,e=this){var i;if((t=(i=U(this,t,e,0))!==null&&i!==void 0?i:p)===C)return;const s=this._$AH,n=t===p&&s!==p||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==p&&(s===p||n);n&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;typeof this._$AH=="function"?this._$AH.call((i=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&i!==void 0?i:this.element,t):this._$AH.handleEvent(t)}}class kt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){U(this,t)}}const ht=window.litHtmlPolyfillSupport;ht==null||ht(H,k),((G=globalThis.litHtmlVersions)!==null&&G!==void 0?G:globalThis.litHtmlVersions=[]).push("2.0.2");/**
|
|
14
|
+
* @license
|
|
15
|
+
* Copyright 2017 Google LLC
|
|
16
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
+
*/var W,F;class R extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=Ct(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Dt)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Dt)===null||t===void 0||t.setConnected(!1)}render(){return C}}R.finalized=!0,R._$litElement$=!0,(W=globalThis.litElementHydrateSupport)===null||W===void 0||W.call(globalThis,{LitElement:R});const ut=globalThis.litElementPolyfillSupport;ut==null||ut({LitElement:R}),((F=globalThis.litElementVersions)!==null&&F!==void 0?F:globalThis.litElementVersions=[]).push("3.0.2");/**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright 2017 Google LLC
|
|
20
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
+
*/const Rt=(r,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?z(D({},t),{finisher(e){e.createProperty(t.key,r)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,r)}};function M(r){return(t,e)=>e!==void 0?((i,s,n)=>{s.constructor.createProperty(n,i)})(r,t,e):Rt(r,t)}/**
|
|
22
|
+
* @license
|
|
23
|
+
* Copyright 2017 Google LLC
|
|
24
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
+
*/function ct(r){return M(z(D({},r),{state:!0}))}/**
|
|
26
|
+
* @license
|
|
27
|
+
* Copyright 2017 Google LLC
|
|
28
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
|
+
*/const dt=({finisher:r,descriptor:t})=>(e,i)=>{var s;if(i===void 0){const n=(s=e.originalKey)!==null&&s!==void 0?s:e.key,o=t!=null?{kind:"method",placement:"prototype",key:n,descriptor:t(e.key)}:z(D({},e),{key:n});return r!=null&&(o.finisher=function(h){r(h,n)}),o}{const n=e.constructor;t!==void 0&&Object.defineProperty(e,i,t(i)),r==null||r(n,i)}};/**
|
|
30
|
+
* @license
|
|
31
|
+
* Copyright 2017 Google LLC
|
|
32
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
+
*/function Mt(r,t){return dt({descriptor:e=>{const i={get(){var s,n;return(n=(s=this.renderRoot)===null||s===void 0?void 0:s.querySelector(r))!==null&&n!==void 0?n:null},enumerable:!0,configurable:!0};if(t){const s=typeof e=="symbol"?Symbol():"__"+e;i.get=function(){var n,o;return this[s]===void 0&&(this[s]=(o=(n=this.renderRoot)===null||n===void 0?void 0:n.querySelector(r))!==null&&o!==void 0?o:null),this[s]}}return i}})}/**
|
|
34
|
+
* @license
|
|
35
|
+
* Copyright 2017 Google LLC
|
|
36
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
|
+
*/function Lt(r){return dt({descriptor:t=>({get(){var e,i;return(i=(e=this.renderRoot)===null||e===void 0?void 0:e.querySelectorAll(r))!==null&&i!==void 0?i:[]},enumerable:!0,configurable:!0})})}var Bt=Object.defineProperty,pt=Object.getOwnPropertySymbols,It=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,vt=(r,t,e)=>t in r?Bt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,$t=(r,t)=>{for(var e in t||(t={}))It.call(t,e)&&vt(r,e,t[e]);if(pt)for(var e of pt(t))Dt.call(t,e)&&vt(r,e,t[e]);return r};typeof require!="undefined"&&require;const _t=class extends Event{constructor(r,t={}){super(r,$t($t({},_t.defaultInit),t));this.detail=t.detail||{}}};let gt=_t;gt.defaultInit={composed:!0};class E extends gt{}E.CHANGE="change";var zt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor;typeof require!="undefined"&&require;var y=(r,t,e,i)=>{for(var s=i>1?void 0:i?Vt(t,e):t,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&zt(t,e,s),s};const qt=45,K=(r,t,e)=>Math.min(Math.max(r,t),e),jt=(r,t)=>Array.from({length:t-r+1},(e,i)=>r+i);class f extends R{constructor(){super(...arguments);this._observer=new ResizeObserver(this._calculateRange.bind(this)),this.label="",this.ariaLabel="",this.total=1,this._range=0,this._visiblePages=[],this._current=1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","navigation"),this._visiblePages=this._generateVisiblePages(this.current)}disconnectedCallback(){this._observer.disconnect()}firstUpdated(){this._observer.observe(this._pagesGroup),this.updateLabel(),this._calculateRange()}willUpdate(t){(t.has("current")||t.has("label"))&&this.updateLabel()}updateLabel(){this.ariaLabel=`${this.label||"Pagination navigation"}. Current page: ${this.current}.`}_calculateRange(){const t=this.offsetWidth,e=Array.from(this._navButtons).reduce((n,o)=>n+o.getBoundingClientRect().width,0),s=(t-e)/qt/2;this._range=Math.max(1,Math.floor(s)),this._visiblePages=this._generateVisiblePages(this.current)}_generateVisiblePages(t){const e=t<this._range?1:t<this.total-this._range?t-this._range:this.total-this._range*2,i=t<=this._range?this._range*2+1:t<this.total-this._range?t+this._range:this.total;return jt(K(e,1,this.total),K(i,1,this.total))}get current(){return this._current}set current(t){const e=this._current;this._current=K(t,1,this.total),this._visiblePages=this._generateVisiblePages(this._current),this.requestUpdate("current",e)}goToNextPage(){this.current++,this.dispatchEvent(new E(E.CHANGE))}goToPreviousPage(){this.current--,this.dispatchEvent(new E(E.CHANGE))}goToPage(t){this.current=t,this.dispatchEvent(new E(E.CHANGE))}focusActivePage(){requestAnimationFrame(()=>{const t=this.renderRoot.querySelector(".active");t&&t.focus()})}renderFirst(){return m`<uui-button compact="compact" look="outline" class="nav" role="listitem" aria-label="Go to first page" ?disabled="${this._current===1}" @click="${()=>this.goToPage(1)}">First</uui-button>`}renderPrevious(){return m`<uui-button compact="compact" look="outline" class="nav" role="listitem" aria-label="Go to previous page" ?disabled="${this._current===1}" @click="${this.goToPreviousPage}">Previous</uui-button>`}renderNext(){return m`<uui-button compact="compact" look="outline" role="listitem" class="nav" aria-label="Go to next page" ?disabled="${this._current===this.total}" @click="${this.goToNextPage}">Next</uui-button>`}renderLast(){return m`<uui-button compact="compact" look="outline" role="listitem" class="nav" aria-label="Go to last page" ?disabled="${this.total===this._current}" @click="${()=>this.goToPage(this.total)}">Last</uui-button>`}renderDots(){return m`<uui-button compact="compact" look="outline" tabindex="-1" class="dots">...</uui-button>`}renderPage(t){return m`<uui-button compact="compact" look="outline" role="listitem" aria-label="Go to page ${t}" class="${"page"+(t===this._current?" active":"")}" tabindex="${t===this._current?"-1":""}" @click="${()=>{t!==this._current&&(this.goToPage(t),this.focusActivePage())}}">${t}</uui-button>`}renderNavigationLeft(){return m`${this.renderFirst()} ${this.renderPrevious()} ${this._visiblePages.includes(1)?"":this.renderDots()}`}renderNavigationRight(){return m`${this._visiblePages.includes(this.total)?"":this.renderDots()} ${this.renderNext()} ${this.renderLast()}`}render(){return m`<uui-button-group role="list" id="pages">${this.renderNavigationLeft()} ${this._visiblePages.map(t=>this.renderPage(t))} ${this.renderNavigationRight()}</uui-button-group>`}}f.styles=[yt`uui-button-group{width:100%}uui-button{--uui-button-border-color:var(--uui-interface-border,#c4c4c4);--uui-button-border-color-disabled:var(--uui-interface-border,#c4c4c4)}.page{min-width:36px;max-width:72px}.page.active{--uui-button-background-color:var(--uui-interface-active,#f5c1bc)}.nav{min-width:72px}.dots{pointer-events:none}.active{pointer-events:none}`],y([Lt("uui-button.nav")],f.prototype,"_navButtons",2),y([Mt("#pages")],f.prototype,"_pagesGroup",2),y([M()],f.prototype,"label",2),y([M({reflect:!0,attribute:"aria-label"})],f.prototype,"ariaLabel",2),y([M({type:Number})],f.prototype,"total",2),y([ct()],f.prototype,"_range",2),y([ct()],f.prototype,"_visiblePages",2),y([M({type:Number})],f.prototype,"current",1),((r,t,e)=>{if(r.indexOf("-")>0===!1){console.error(`${r} is not a valid custom element name. A custom element name should consist of at least two words separated by a hyphen.`);return}customElements.get(r)?console.error(`${r} is already defined`):customElements.define(r,t,e)})("uui-pagination",f)});
|
|
38
|
+
//# sourceMappingURL=uui-pagination.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uui-pagination.min.js","sources":["../../../node_modules/@lit/reactive-element/css-tag.js","../../../node_modules/@lit/reactive-element/reactive-element.js","../../../node_modules/lit-html/lit-html.js","../../../node_modules/lit/node_modules/lit-element/lit-element.js","../../../node_modules/@lit/reactive-element/decorators/property.js","../../../node_modules/@lit/reactive-element/decorators/state.js","../../../node_modules/@lit/reactive-element/decorators/base.js","../../../node_modules/@lit/reactive-element/decorators/query.js","../../../node_modules/@lit/reactive-element/decorators/query-all.js","../../uui-base/lib/events/index.js","../lib/uui-pagination.element.js","../lib/index.ts","../../uui-base/lib/registration/index.js"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,e=Symbol(),n=new Map;class s{constructor(t,n){if(this._$cssResult$=!0,n!==e)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t}get styleSheet(){let e=n.get(this.cssText);return t&&void 0===e&&(n.set(this.cssText,e=new CSSStyleSheet),e.replaceSync(this.cssText)),e}toString(){return this.cssText}}const o=t=>new s(\"string\"==typeof t?t:t+\"\",e),r=(t,...n)=>{const o=1===t.length?t[0]:n.reduce(((e,n,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(n)+t[s+1]),t[0]);return new s(o,e)},i=(e,n)=>{t?e.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((t=>{const n=document.createElement(\"style\"),s=window.litNonce;void 0!==s&&n.setAttribute(\"nonce\",s),n.textContent=t.cssText,e.appendChild(n)}))},S=t?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const n of t.cssRules)e+=n.cssText;return o(e)})(t):t;export{s as CSSResult,i as adoptStyles,r as css,S as getCompatibleStyle,t as supportsAdoptingStyleSheets,o as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as i}from\"./css-tag.js\";export{CSSResult,adoptStyles,css,getCompatibleStyle,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */var s;const e=window.trustedTypes,r=e?e.emptyScript:\"\",h=window.reactiveElementPolyfillSupport,o={toAttribute(t,i){switch(i){case Boolean:t=t?r:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let s=t;switch(i){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},n=(t,i)=>i!==t&&(i==i||t==t),l={attribute:!0,type:String,converter:o,reflect:!1,hasChanged:n};class a extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var i;null!==(i=this.l)&&void 0!==i||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,s)=>{const e=this._$Eh(s,i);void 0!==e&&(this._$Eu.set(e,s),t.push(e))})),t}static createProperty(t,i=l){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const s=\"symbol\"==typeof t?Symbol():\"__\"+t,e=this.getPropertyDescriptor(t,s,i);void 0!==e&&Object.defineProperty(this.prototype,t,e)}}static getPropertyDescriptor(t,i,s){return{get(){return this[i]},set(e){const r=this[t];this[i]=e,this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||l}static finalize(){if(this.hasOwnProperty(\"finalized\"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty(\"properties\")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of i)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(i){const s=[];if(Array.isArray(i)){const e=new Set(i.flat(1/0).reverse());for(const i of e)s.unshift(t(i))}else void 0!==i&&s.push(t(i));return s}static _$Eh(t,i){const s=i.attribute;return!1===s?void 0:\"string\"==typeof s?s:\"string\"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,s;(null!==(i=this._$Eg)&&void 0!==i?i:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var i;null===(i=this._$Eg)||void 0===i||i.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Et.set(i,this[i]),delete this[i])}))}createRenderRoot(){var t;const s=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return i(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,s){this._$AK(t,s)}_$ES(t,i,s=l){var e,r;const h=this.constructor._$Eh(t,s);if(void 0!==h&&!0===s.reflect){const n=(null!==(r=null===(e=s.converter)||void 0===e?void 0:e.toAttribute)&&void 0!==r?r:o.toAttribute)(i,s.type);this._$Ei=t,null==n?this.removeAttribute(h):this.setAttribute(h,n),this._$Ei=null}}_$AK(t,i){var s,e,r;const h=this.constructor,n=h._$Eu.get(t);if(void 0!==n&&this._$Ei!==n){const t=h.getPropertyOptions(n),l=t.converter,a=null!==(r=null!==(e=null===(s=l)||void 0===s?void 0:s.fromAttribute)&&void 0!==e?e:\"function\"==typeof l?l:null)&&void 0!==r?r:o.fromAttribute;this._$Ei=n,this[n]=a(i,t.type),this._$Ei=null}}requestUpdate(t,i,s){let e=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||n)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===s.reflect&&this._$Ei!==t&&(void 0===this._$E_&&(this._$E_=new Map),this._$E_.set(t,s))):e=!1),!this.isUpdatePending&&e&&(this._$Ep=this._$EC())}async _$EC(){this.isUpdatePending=!0;try{await this._$Ep}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,i)=>this[i]=t)),this._$Et=void 0);let i=!1;const s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(s)):this._$EU()}catch(t){throw i=!1,this._$EU(),t}i&&this._$AE(s)}willUpdate(t){}_$AE(t){var i;null===(i=this._$Eg)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$E_&&(this._$E_.forEach(((t,i)=>this._$ES(i,this[i],t))),this._$E_=void 0),this._$EU()}updated(t){}firstUpdated(t){}}a.finalized=!0,a.elementProperties=new Map,a.elementStyles=[],a.shadowRootOptions={mode:\"open\"},null==h||h({ReactiveElement:a}),(null!==(s=globalThis.reactiveElementVersions)&&void 0!==s?s:globalThis.reactiveElementVersions=[]).push(\"1.0.2\");export{a as ReactiveElement,o as defaultConverter,n as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nvar t;const i=globalThis.trustedTypes,s=i?i.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,e=`lit$${(Math.random()+\"\").slice(9)}$`,o=\"?\"+e,n=`<${o}>`,l=document,h=(t=\"\")=>l.createComment(t),r=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,d=Array.isArray,u=t=>{var i;return d(t)||\"function\"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])},c=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,v=/-->/g,a=/>/g,f=/>|[ \t\\n\f\\r](?:([^\\s\"'>=/]+)([ \t\\n\f\\r]*=[ \t\\n\f\\r]*(?:[^ \t\\n\f\\r\"'`<>=]|(\"|')|))|$)/g,_=/'/g,m=/\"/g,g=/^(?:script|style|textarea)$/i,$=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),p=$(1),y=$(2),b=Symbol.for(\"lit-noChange\"),T=Symbol.for(\"lit-nothing\"),x=new WeakMap,w=(t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new N(i.insertBefore(h(),t),t,void 0,null!=s?s:{})}return l._$AI(t),l},A=l.createTreeWalker(l,129,null,!1),C=(t,i)=>{const o=t.length-1,l=[];let h,r=2===i?\"<svg>\":\"\",d=c;for(let i=0;i<o;i++){const s=t[i];let o,u,$=-1,p=0;for(;p<s.length&&(d.lastIndex=p,u=d.exec(s),null!==u);)p=d.lastIndex,d===c?\"!--\"===u[1]?d=v:void 0!==u[1]?d=a:void 0!==u[2]?(g.test(u[2])&&(h=RegExp(\"</\"+u[2],\"g\")),d=f):void 0!==u[3]&&(d=f):d===f?\">\"===u[0]?(d=null!=h?h:c,$=-1):void 0===u[1]?$=-2:($=d.lastIndex-u[2].length,o=u[1],d=void 0===u[3]?f:'\"'===u[3]?m:_):d===m||d===_?d=f:d===v||d===a?d=c:(d=f,h=void 0);const y=d===f&&t[i+1].startsWith(\"/>\")?\" \":\"\";r+=d===c?s+n:$>=0?(l.push(o),s.slice(0,$)+\"$lit$\"+s.slice($)+e+y):s+e+(-2===$?(l.push(void 0),i):y)}const u=r+(t[o]||\"<?>\")+(2===i?\"</svg>\":\"\");return[void 0!==s?s.createHTML(u):u,l]};class P{constructor({strings:t,_$litType$:s},n){let l;this.parts=[];let r=0,d=0;const u=t.length-1,c=this.parts,[v,a]=C(t,s);if(this.el=P.createElement(v,n),A.currentNode=this.el.content,2===s){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(l=A.nextNode())&&c.length<u;){if(1===l.nodeType){if(l.hasAttributes()){const t=[];for(const i of l.getAttributeNames())if(i.endsWith(\"$lit$\")||i.startsWith(e)){const s=a[d++];if(t.push(i),void 0!==s){const t=l.getAttribute(s.toLowerCase()+\"$lit$\").split(e),i=/([.?@])?(.*)/.exec(s);c.push({type:1,index:r,name:i[2],strings:t,ctor:\".\"===i[1]?M:\"?\"===i[1]?H:\"@\"===i[1]?I:S})}else c.push({type:6,index:r})}for(const i of t)l.removeAttribute(i)}if(g.test(l.tagName)){const t=l.textContent.split(e),s=t.length-1;if(s>0){l.textContent=i?i.emptyScript:\"\";for(let i=0;i<s;i++)l.append(t[i],h()),A.nextNode(),c.push({type:2,index:++r});l.append(t[s],h())}}}else if(8===l.nodeType)if(l.data===o)c.push({type:2,index:r});else{let t=-1;for(;-1!==(t=l.data.indexOf(e,t+1));)c.push({type:7,index:r}),t+=e.length-1}r++}}static createElement(t,i){const s=l.createElement(\"template\");return s.innerHTML=t,s}}function V(t,i,s=t,e){var o,n,l,h;if(i===b)return i;let d=void 0!==e?null===(o=s._$Cl)||void 0===o?void 0:o[e]:s._$Cu;const u=r(i)?void 0:i._$litDirective$;return(null==d?void 0:d.constructor)!==u&&(null===(n=null==d?void 0:d._$AO)||void 0===n||n.call(d,!1),void 0===u?d=void 0:(d=new u(t),d._$AT(t,s,e)),void 0!==e?(null!==(l=(h=s)._$Cl)&&void 0!==l?l:h._$Cl=[])[e]=d:s._$Cu=d),void 0!==d&&(i=V(t,d._$AS(t,i.values),d,e)),i}class E{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:l).importNode(s,!0);A.currentNode=o;let n=A.nextNode(),h=0,r=0,d=e[0];for(;void 0!==d;){if(h===d.index){let i;2===d.type?i=new N(n,n.nextSibling,this,t):1===d.type?i=new d.ctor(n,d.name,d.strings,this,t):6===d.type&&(i=new L(n,this,t)),this.v.push(i),d=e[++r]}h!==(null==d?void 0:d.index)&&(n=A.nextNode(),h++)}return o}m(t){let i=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class N{constructor(t,i,s,e){var o;this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cg=null===(o=null==e?void 0:e.isConnected)||void 0===o||o}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=V(this,t,i),r(t)?t===T||null==t||\"\"===t?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==b&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):u(t)?this.M(t):this.$(t)}A(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==T&&r(this._$AH)?this._$AA.nextSibling.data=t:this.S(l.createTextNode(t)),this._$AH=t}T(t){var i;const{values:s,_$litType$:e}=t,o=\"number\"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=P.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.m(s);else{const t=new E(o,this),i=t.p(this.options);t.m(s),this.S(i),this._$AH=t}}_$AC(t){let i=x.get(t.strings);return void 0===i&&x.set(t.strings,i=new P(t)),i}M(t){d(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new N(this.A(h()),this.A(h()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class S{constructor(t,i,s,e,o){this.type=1,this._$AH=T,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=T}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=V(this,t,i,0),n=!r(t)||t!==this._$AH&&t!==b,n&&(this._$AH=t);else{const e=t;let l,h;for(t=o[0],l=0;l<o.length-1;l++)h=V(this,e[s+l],i,l),h===b&&(h=this._$AH[l]),n||(n=!r(h)||h!==this._$AH[l]),h===T?t=T:t!==T&&(t+=(null!=h?h:\"\")+o[l+1]),this._$AH[l]=h}n&&!e&&this.k(t)}k(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:\"\")}}class M extends S{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===T?void 0:t}}const k=i?i.emptyScript:\"\";class H extends S{constructor(){super(...arguments),this.type=4}k(t){t&&t!==T?this.element.setAttribute(this.name,k):this.element.removeAttribute(this.name)}}class I extends S{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=V(this,t,i,0))&&void 0!==s?s:T)===b)return;const e=this._$AH,o=t===T&&e!==T||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==T&&(e===T||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;\"function\"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class L{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){V(this,t)}}const R={P:\"$lit$\",V:e,L:o,I:1,N:C,R:E,D:u,j:V,H:N,O:S,F:H,B:I,W:M,Z:L},z=window.litHtmlPolyfillSupport;null==z||z(P,N),(null!==(t=globalThis.litHtmlVersions)&&void 0!==t?t:globalThis.litHtmlVersions=[]).push(\"2.0.2\");export{R as _$LH,p as html,b as noChange,T as nothing,w as render,y as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{ReactiveElement as t}from\"@lit/reactive-element\";export*from\"@lit/reactive-element\";import{render as e,noChange as i}from\"lit-html\";export*from\"lit-html\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */var l,o;const r=t;class s extends t{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=e(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return i}}s.finalized=!0,s._$litElement$=!0,null===(l=globalThis.litElementHydrateSupport)||void 0===l||l.call(globalThis,{LitElement:s});const n=globalThis.litElementPolyfillSupport;null==n||n({LitElement:s});const h={_$AK:(t,e,i)=>{t._$AK(e,i)},_$AL:t=>t._$AL};(null!==(o=globalThis.litElementVersions)&&void 0!==o?o:globalThis.litElementVersions=[]).push(\"3.0.2\");export{s as LitElement,r as UpdatingElement,h as _$LE};\n//# sourceMappingURL=lit-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst i=(i,e)=>\"method\"===e.kind&&e.descriptor&&!(\"value\"in e.descriptor)?{...e,finisher(n){n.createProperty(e.key,i)}}:{kind:\"field\",key:Symbol(),placement:\"own\",descriptor:{},originalKey:e.key,initializer(){\"function\"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(n){n.createProperty(e.key,i)}};function e(e){return(n,t)=>void 0!==t?((i,e,n)=>{e.constructor.createProperty(n,i)})(e,n,t):i(e,n)}export{e as property};\n//# sourceMappingURL=property.js.map\n","import{property as r}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function t(t){return r({...t,state:!0})}export{t as state};\n//# sourceMappingURL=state.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst e=(e,t,o)=>{Object.defineProperty(t,o,e)},t=(e,t)=>({kind:\"method\",placement:\"prototype\",key:t.key,descriptor:e}),o=({finisher:e,descriptor:t})=>(o,n)=>{var r;if(void 0===n){const n=null!==(r=o.originalKey)&&void 0!==r?r:o.key,i=null!=t?{kind:\"method\",placement:\"prototype\",key:n,descriptor:t(o.key)}:{...o,key:n};return null!=e&&(i.finisher=function(t){e(t,n)}),i}{const r=o.constructor;void 0!==t&&Object.defineProperty(o,n,t(n)),null==e||e(r,n)}};export{o as decorateProperty,e as legacyPrototypeMethod,t as standardPrototypeMethod};\n//# sourceMappingURL=base.js.map\n","import{decorateProperty as o}from\"./base.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function i(i,n){return o({descriptor:o=>{const t={get(){var o,n;return null!==(n=null===(o=this.renderRoot)||void 0===o?void 0:o.querySelector(i))&&void 0!==n?n:null},enumerable:!0,configurable:!0};if(n){const n=\"symbol\"==typeof o?Symbol():\"__\"+o;t.get=function(){var o,t;return void 0===this[n]&&(this[n]=null!==(t=null===(o=this.renderRoot)||void 0===o?void 0:o.querySelector(i))&&void 0!==t?t:null),this[n]}}return t}})}export{i as query};\n//# sourceMappingURL=query.js.map\n","import{decorateProperty as r}from\"./base.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function e(e){return r({descriptor:r=>({get(){var r,o;return null!==(o=null===(r=this.renderRoot)||void 0===r?void 0:r.querySelectorAll(e))&&void 0!==o?o:[]},enumerable:!0,configurable:!0})})}export{e as queryAll};\n//# sourceMappingURL=query-all.js.map\n","var __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\ntypeof require !== \"undefined\" ? require : (x) => {\n throw new Error('Dynamic require of \"' + x + '\" is not supported');\n};\nconst _UUIEvent = class extends Event {\n constructor(evName, eventInit = {}) {\n super(evName, __spreadValues(__spreadValues({}, _UUIEvent.defaultInit), eventInit));\n this.detail = eventInit.detail || {};\n }\n};\nlet UUIEvent = _UUIEvent;\nUUIEvent.defaultInit = {\n composed: true\n};\n\nclass UUIListItemClickEvent extends UUIEvent {\n}\n\nclass UUIListItemFocusEvent extends UUIEvent {\n constructor() {\n super(\"focus\");\n }\n}\n\nexport { UUIEvent, UUIListItemClickEvent, UUIListItemFocusEvent };\n","import { css, LitElement, html } from 'lit';\nimport { queryAll, query, property, state } from 'lit/decorators.js';\nimport { UUIEvent } from '@umbraco-ui/uui-base/lib/events';\n\nclass UUIPaginationEvent extends UUIEvent {\n}\nUUIPaginationEvent.CHANGE = \"change\";\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\ntypeof require !== \"undefined\" ? require : (x) => {\n throw new Error('Dynamic require of \"' + x + '\" is not supported');\n};\nvar __decorateClass = (decorators, target, key, kind) => {\n var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;\n for (var i = decorators.length - 1, decorator; i >= 0; i--)\n if (decorator = decorators[i])\n result = (kind ? decorator(target, key, result) : decorator(result)) || result;\n if (kind && result)\n __defProp(target, key, result);\n return result;\n};\nconst PAGE_BUTTON_MAX_WIDTH = 45;\nconst limit = (val, min, max) => {\n return Math.min(Math.max(val, min), max);\n};\nconst arrayOfNumbers = (start, stop) => {\n return Array.from({ length: stop - start + 1 }, (_, i) => start + i);\n};\nclass UUIPaginationElement extends LitElement {\n constructor() {\n super(...arguments);\n this._observer = new ResizeObserver(this._calculateRange.bind(this));\n this.label = \"\";\n this.ariaLabel = \"\";\n this.total = 1;\n this._range = 0;\n this._visiblePages = [];\n this._current = 1;\n }\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute(\"role\", \"navigation\");\n this._visiblePages = this._generateVisiblePages(this.current);\n }\n disconnectedCallback() {\n this._observer.disconnect();\n }\n firstUpdated() {\n this._observer.observe(this._pagesGroup);\n this.updateLabel();\n this._calculateRange();\n }\n willUpdate(changedProperties) {\n if (changedProperties.has(\"current\") || changedProperties.has(\"label\")) {\n this.updateLabel();\n }\n }\n updateLabel() {\n this.ariaLabel = `${this.label || \"Pagination navigation\"}. Current page: ${this.current}.`;\n }\n _calculateRange() {\n const containerWidth = this.offsetWidth;\n const navButtonsWidth = Array.from(this._navButtons).reduce((totalWidth, button) => {\n return totalWidth + button.getBoundingClientRect().width;\n }, 0);\n const rangeBaseWidth = containerWidth - navButtonsWidth;\n const range = rangeBaseWidth / PAGE_BUTTON_MAX_WIDTH / 2;\n this._range = Math.max(1, Math.floor(range));\n this._visiblePages = this._generateVisiblePages(this.current);\n }\n _generateVisiblePages(current) {\n const start = current < this._range ? 1 : current < this.total - this._range ? current - this._range : this.total - this._range * 2;\n const stop = current <= this._range ? this._range * 2 + 1 : current < this.total - this._range ? current + this._range : this.total;\n const pages = arrayOfNumbers(limit(start, 1, this.total), limit(stop, 1, this.total));\n return pages;\n }\n get current() {\n return this._current;\n }\n set current(newValue) {\n const oldValue = this._current;\n this._current = limit(newValue, 1, this.total);\n this._visiblePages = this._generateVisiblePages(this._current);\n this.requestUpdate(\"current\", oldValue);\n }\n goToNextPage() {\n this.current++;\n this.dispatchEvent(new UUIPaginationEvent(UUIPaginationEvent.CHANGE));\n }\n goToPreviousPage() {\n this.current--;\n this.dispatchEvent(new UUIPaginationEvent(UUIPaginationEvent.CHANGE));\n }\n goToPage(page) {\n this.current = page;\n this.dispatchEvent(new UUIPaginationEvent(UUIPaginationEvent.CHANGE));\n }\n focusActivePage() {\n requestAnimationFrame(() => {\n const activeButtonElement = this.renderRoot.querySelector(\".active\");\n if (activeButtonElement) {\n activeButtonElement.focus();\n }\n });\n }\n renderFirst() {\n return html`<uui-button\n compact\n look=\"outline\"\n class=\"nav\"\n role=\"listitem\"\n aria-label=\"Go to first page\"\n ?disabled=${this._current === 1}\n @click=${() => this.goToPage(1)}>\n First\n </uui-button>`;\n }\n renderPrevious() {\n return html`<uui-button\n compact\n look=\"outline\"\n class=\"nav\"\n role=\"listitem\"\n aria-label=\"Go to previous page\"\n ?disabled=${this._current === 1}\n @click=${this.goToPreviousPage}>\n Previous\n </uui-button>`;\n }\n renderNext() {\n return html`<uui-button\n compact\n look=\"outline\"\n role=\"listitem\"\n class=\"nav\"\n aria-label=\"Go to next page\"\n ?disabled=${this._current === this.total}\n @click=${this.goToNextPage}>\n Next\n </uui-button>`;\n }\n renderLast() {\n return html`\n <uui-button\n compact\n look=\"outline\"\n role=\"listitem\"\n class=\"nav\"\n aria-label=\"Go to last page\"\n ?disabled=${this.total === this._current}\n @click=${() => this.goToPage(this.total)}>\n Last\n </uui-button>\n `;\n }\n renderDots() {\n return html`<uui-button compact look=\"outline\" tabindex=\"-1\" class=\"dots\"\n >...</uui-button\n > `;\n }\n renderPage(page) {\n return html`<uui-button\n compact\n look=\"outline\"\n role=\"listitem\"\n aria-label=\"Go to page ${page}\"\n class=${\"page\" + (page === this._current ? \" active\" : \"\")}\n tabindex=${page === this._current ? \"-1\" : \"\"}\n @click=${() => {\n if (page === this._current)\n return;\n this.goToPage(page);\n this.focusActivePage();\n }}>\n ${page}\n </uui-button>`;\n }\n renderNavigationLeft() {\n return html` ${this.renderFirst()} ${this.renderPrevious()}\n ${this._visiblePages.includes(1) ? \"\" : this.renderDots()}`;\n }\n renderNavigationRight() {\n return html`${this._visiblePages.includes(this.total) ? \"\" : this.renderDots()}\n ${this.renderNext()} ${this.renderLast()}`;\n }\n render() {\n return html`<uui-button-group role=\"list\" id=\"pages\">\n ${this.renderNavigationLeft()}\n ${this._visiblePages.map((page) => this.renderPage(page))}\n ${this.renderNavigationRight()}\n </uui-button-group>\n `;\n }\n}\nUUIPaginationElement.styles = [\n css`\n uui-button-group {\n width: 100%;\n }\n\n uui-button {\n --uui-button-border-color: var(--uui-interface-border,#c4c4c4);\n --uui-button-border-color-disabled: var(--uui-interface-border,#c4c4c4);\n }\n\n .page {\n min-width: 36px;\n max-width: 72px;\n }\n .page.active {\n --uui-button-background-color: var(--uui-interface-active,#f5c1bc);\n }\n\n .nav {\n min-width: 72px;\n }\n\n .dots {\n pointer-events: none;\n }\n\n .active {\n pointer-events: none;\n }\n `\n];\n__decorateClass([\n queryAll(\"uui-button.nav\")\n], UUIPaginationElement.prototype, \"_navButtons\", 2);\n__decorateClass([\n query(\"#pages\")\n], UUIPaginationElement.prototype, \"_pagesGroup\", 2);\n__decorateClass([\n property()\n], UUIPaginationElement.prototype, \"label\", 2);\n__decorateClass([\n property({ reflect: true, attribute: \"aria-label\" })\n], UUIPaginationElement.prototype, \"ariaLabel\", 2);\n__decorateClass([\n property({ type: Number })\n], UUIPaginationElement.prototype, \"total\", 2);\n__decorateClass([\n state()\n], UUIPaginationElement.prototype, \"_range\", 2);\n__decorateClass([\n state()\n], UUIPaginationElement.prototype, \"_visiblePages\", 2);\n__decorateClass([\n property({ type: Number })\n], UUIPaginationElement.prototype, \"current\", 1);\n\nexport { UUIPaginationElement };\n","import { UUIPaginationElement } from './uui-pagination.element';\nimport { defineElement } from '@umbraco-ui/uui-base/lib/registration';\n\ndefineElement('uui-pagination', UUIPaginationElement as any);\n","const defineElement = (name, constructor, options) => {\n const isValidElementName = name.indexOf(\"-\") > 0;\n if (isValidElementName === false) {\n console.error(`${name} is not a valid custom element name. A custom element name should consist of at least two words separated by a hyphen.`);\n return;\n }\n if (customElements.get(name)) {\n console.error(`${name} is already defined`);\n } else {\n customElements.define(name, constructor, options);\n }\n};\n\nexport { defineElement };\n"],"names":["t","e","n","o","s","r","i","S","h","l","a","__defProp","LitElement","html","css","queryAll","query","property","state"],"mappings":"uoBAAA;AAAA;AAAA;AAAA;AAAA,GAKA,KAAMA,GAAE,OAAO,YAAa,CAAS,OAAO,WAAhB,QAA0B,OAAO,SAAS,eAAe,sBAAuB,UAAS,WAAW,WAAY,eAAc,UAAUC,EAAE,SAASC,EAAE,GAAI,KAAI,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,GAAG,KAAK,aAAa,GAAG,IAAID,EAAE,KAAM,OAAM,qEAAqE,KAAK,QAAQ,KAAM,aAAY,CAAC,GAAI,GAAEC,EAAE,IAAI,KAAK,SAAS,MAAOF,IAAG,AAAS,IAAT,QAAaE,GAAE,IAAI,KAAK,QAAQ,EAAE,GAAI,gBAAe,EAAE,YAAY,KAAK,UAAU,EAAE,UAAU,CAAC,MAAO,MAAK,SAAS,KAAMC,IAAE,GAAG,GAAIC,GAAE,AA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,254 @@
|
|
|
1
|
+
import { css, LitElement, html } from 'lit';
|
|
2
|
+
import { queryAll, query, property, state } from 'lit/decorators.js';
|
|
3
|
+
import { UUIEvent } from '@umbraco-ui/uui-base/lib/events';
|
|
4
|
+
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
|
|
5
|
+
|
|
6
|
+
class UUIPaginationEvent extends UUIEvent {
|
|
7
|
+
}
|
|
8
|
+
UUIPaginationEvent.CHANGE = "change";
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
typeof require !== "undefined" ? require : (x) => {
|
|
13
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
14
|
+
};
|
|
15
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
16
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
17
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
18
|
+
if (decorator = decorators[i])
|
|
19
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
20
|
+
if (kind && result)
|
|
21
|
+
__defProp(target, key, result);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
24
|
+
const PAGE_BUTTON_MAX_WIDTH = 45;
|
|
25
|
+
const limit = (val, min, max) => {
|
|
26
|
+
return Math.min(Math.max(val, min), max);
|
|
27
|
+
};
|
|
28
|
+
const arrayOfNumbers = (start, stop) => {
|
|
29
|
+
return Array.from({ length: stop - start + 1 }, (_, i) => start + i);
|
|
30
|
+
};
|
|
31
|
+
class UUIPaginationElement extends LitElement {
|
|
32
|
+
constructor() {
|
|
33
|
+
super(...arguments);
|
|
34
|
+
this._observer = new ResizeObserver(this._calculateRange.bind(this));
|
|
35
|
+
this.label = "";
|
|
36
|
+
this.ariaLabel = "";
|
|
37
|
+
this.total = 1;
|
|
38
|
+
this._range = 0;
|
|
39
|
+
this._visiblePages = [];
|
|
40
|
+
this._current = 1;
|
|
41
|
+
}
|
|
42
|
+
connectedCallback() {
|
|
43
|
+
super.connectedCallback();
|
|
44
|
+
this.setAttribute("role", "navigation");
|
|
45
|
+
this._visiblePages = this._generateVisiblePages(this.current);
|
|
46
|
+
}
|
|
47
|
+
disconnectedCallback() {
|
|
48
|
+
this._observer.disconnect();
|
|
49
|
+
}
|
|
50
|
+
firstUpdated() {
|
|
51
|
+
this._observer.observe(this._pagesGroup);
|
|
52
|
+
this.updateLabel();
|
|
53
|
+
this._calculateRange();
|
|
54
|
+
}
|
|
55
|
+
willUpdate(changedProperties) {
|
|
56
|
+
if (changedProperties.has("current") || changedProperties.has("label")) {
|
|
57
|
+
this.updateLabel();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
updateLabel() {
|
|
61
|
+
this.ariaLabel = `${this.label || "Pagination navigation"}. Current page: ${this.current}.`;
|
|
62
|
+
}
|
|
63
|
+
_calculateRange() {
|
|
64
|
+
const containerWidth = this.offsetWidth;
|
|
65
|
+
const navButtonsWidth = Array.from(this._navButtons).reduce((totalWidth, button) => {
|
|
66
|
+
return totalWidth + button.getBoundingClientRect().width;
|
|
67
|
+
}, 0);
|
|
68
|
+
const rangeBaseWidth = containerWidth - navButtonsWidth;
|
|
69
|
+
const range = rangeBaseWidth / PAGE_BUTTON_MAX_WIDTH / 2;
|
|
70
|
+
this._range = Math.max(1, Math.floor(range));
|
|
71
|
+
this._visiblePages = this._generateVisiblePages(this.current);
|
|
72
|
+
}
|
|
73
|
+
_generateVisiblePages(current) {
|
|
74
|
+
const start = current < this._range ? 1 : current < this.total - this._range ? current - this._range : this.total - this._range * 2;
|
|
75
|
+
const stop = current <= this._range ? this._range * 2 + 1 : current < this.total - this._range ? current + this._range : this.total;
|
|
76
|
+
const pages = arrayOfNumbers(limit(start, 1, this.total), limit(stop, 1, this.total));
|
|
77
|
+
return pages;
|
|
78
|
+
}
|
|
79
|
+
get current() {
|
|
80
|
+
return this._current;
|
|
81
|
+
}
|
|
82
|
+
set current(newValue) {
|
|
83
|
+
const oldValue = this._current;
|
|
84
|
+
this._current = limit(newValue, 1, this.total);
|
|
85
|
+
this._visiblePages = this._generateVisiblePages(this._current);
|
|
86
|
+
this.requestUpdate("current", oldValue);
|
|
87
|
+
}
|
|
88
|
+
goToNextPage() {
|
|
89
|
+
this.current++;
|
|
90
|
+
this.dispatchEvent(new UUIPaginationEvent(UUIPaginationEvent.CHANGE));
|
|
91
|
+
}
|
|
92
|
+
goToPreviousPage() {
|
|
93
|
+
this.current--;
|
|
94
|
+
this.dispatchEvent(new UUIPaginationEvent(UUIPaginationEvent.CHANGE));
|
|
95
|
+
}
|
|
96
|
+
goToPage(page) {
|
|
97
|
+
this.current = page;
|
|
98
|
+
this.dispatchEvent(new UUIPaginationEvent(UUIPaginationEvent.CHANGE));
|
|
99
|
+
}
|
|
100
|
+
focusActivePage() {
|
|
101
|
+
requestAnimationFrame(() => {
|
|
102
|
+
const activeButtonElement = this.renderRoot.querySelector(".active");
|
|
103
|
+
if (activeButtonElement) {
|
|
104
|
+
activeButtonElement.focus();
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
renderFirst() {
|
|
109
|
+
return html`<uui-button
|
|
110
|
+
compact
|
|
111
|
+
look="outline"
|
|
112
|
+
class="nav"
|
|
113
|
+
role="listitem"
|
|
114
|
+
aria-label="Go to first page"
|
|
115
|
+
?disabled=${this._current === 1}
|
|
116
|
+
@click=${() => this.goToPage(1)}>
|
|
117
|
+
First
|
|
118
|
+
</uui-button>`;
|
|
119
|
+
}
|
|
120
|
+
renderPrevious() {
|
|
121
|
+
return html`<uui-button
|
|
122
|
+
compact
|
|
123
|
+
look="outline"
|
|
124
|
+
class="nav"
|
|
125
|
+
role="listitem"
|
|
126
|
+
aria-label="Go to previous page"
|
|
127
|
+
?disabled=${this._current === 1}
|
|
128
|
+
@click=${this.goToPreviousPage}>
|
|
129
|
+
Previous
|
|
130
|
+
</uui-button>`;
|
|
131
|
+
}
|
|
132
|
+
renderNext() {
|
|
133
|
+
return html`<uui-button
|
|
134
|
+
compact
|
|
135
|
+
look="outline"
|
|
136
|
+
role="listitem"
|
|
137
|
+
class="nav"
|
|
138
|
+
aria-label="Go to next page"
|
|
139
|
+
?disabled=${this._current === this.total}
|
|
140
|
+
@click=${this.goToNextPage}>
|
|
141
|
+
Next
|
|
142
|
+
</uui-button>`;
|
|
143
|
+
}
|
|
144
|
+
renderLast() {
|
|
145
|
+
return html`
|
|
146
|
+
<uui-button
|
|
147
|
+
compact
|
|
148
|
+
look="outline"
|
|
149
|
+
role="listitem"
|
|
150
|
+
class="nav"
|
|
151
|
+
aria-label="Go to last page"
|
|
152
|
+
?disabled=${this.total === this._current}
|
|
153
|
+
@click=${() => this.goToPage(this.total)}>
|
|
154
|
+
Last
|
|
155
|
+
</uui-button>
|
|
156
|
+
`;
|
|
157
|
+
}
|
|
158
|
+
renderDots() {
|
|
159
|
+
return html`<uui-button compact look="outline" tabindex="-1" class="dots"
|
|
160
|
+
>...</uui-button
|
|
161
|
+
> `;
|
|
162
|
+
}
|
|
163
|
+
renderPage(page) {
|
|
164
|
+
return html`<uui-button
|
|
165
|
+
compact
|
|
166
|
+
look="outline"
|
|
167
|
+
role="listitem"
|
|
168
|
+
aria-label="Go to page ${page}"
|
|
169
|
+
class=${"page" + (page === this._current ? " active" : "")}
|
|
170
|
+
tabindex=${page === this._current ? "-1" : ""}
|
|
171
|
+
@click=${() => {
|
|
172
|
+
if (page === this._current)
|
|
173
|
+
return;
|
|
174
|
+
this.goToPage(page);
|
|
175
|
+
this.focusActivePage();
|
|
176
|
+
}}>
|
|
177
|
+
${page}
|
|
178
|
+
</uui-button>`;
|
|
179
|
+
}
|
|
180
|
+
renderNavigationLeft() {
|
|
181
|
+
return html` ${this.renderFirst()} ${this.renderPrevious()}
|
|
182
|
+
${this._visiblePages.includes(1) ? "" : this.renderDots()}`;
|
|
183
|
+
}
|
|
184
|
+
renderNavigationRight() {
|
|
185
|
+
return html`${this._visiblePages.includes(this.total) ? "" : this.renderDots()}
|
|
186
|
+
${this.renderNext()} ${this.renderLast()}`;
|
|
187
|
+
}
|
|
188
|
+
render() {
|
|
189
|
+
return html`<uui-button-group role="list" id="pages">
|
|
190
|
+
${this.renderNavigationLeft()}
|
|
191
|
+
${this._visiblePages.map((page) => this.renderPage(page))}
|
|
192
|
+
${this.renderNavigationRight()}
|
|
193
|
+
</uui-button-group>
|
|
194
|
+
`;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
UUIPaginationElement.styles = [
|
|
198
|
+
css`
|
|
199
|
+
uui-button-group {
|
|
200
|
+
width: 100%;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
uui-button {
|
|
204
|
+
--uui-button-border-color: var(--uui-interface-border,#c4c4c4);
|
|
205
|
+
--uui-button-border-color-disabled: var(--uui-interface-border,#c4c4c4);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.page {
|
|
209
|
+
min-width: 36px;
|
|
210
|
+
max-width: 72px;
|
|
211
|
+
}
|
|
212
|
+
.page.active {
|
|
213
|
+
--uui-button-background-color: var(--uui-interface-active,#f5c1bc);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.nav {
|
|
217
|
+
min-width: 72px;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.dots {
|
|
221
|
+
pointer-events: none;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.active {
|
|
225
|
+
pointer-events: none;
|
|
226
|
+
}
|
|
227
|
+
`
|
|
228
|
+
];
|
|
229
|
+
__decorateClass([
|
|
230
|
+
queryAll("uui-button.nav")
|
|
231
|
+
], UUIPaginationElement.prototype, "_navButtons", 2);
|
|
232
|
+
__decorateClass([
|
|
233
|
+
query("#pages")
|
|
234
|
+
], UUIPaginationElement.prototype, "_pagesGroup", 2);
|
|
235
|
+
__decorateClass([
|
|
236
|
+
property()
|
|
237
|
+
], UUIPaginationElement.prototype, "label", 2);
|
|
238
|
+
__decorateClass([
|
|
239
|
+
property({ reflect: true, attribute: "aria-label" })
|
|
240
|
+
], UUIPaginationElement.prototype, "ariaLabel", 2);
|
|
241
|
+
__decorateClass([
|
|
242
|
+
property({ type: Number })
|
|
243
|
+
], UUIPaginationElement.prototype, "total", 2);
|
|
244
|
+
__decorateClass([
|
|
245
|
+
state()
|
|
246
|
+
], UUIPaginationElement.prototype, "_range", 2);
|
|
247
|
+
__decorateClass([
|
|
248
|
+
state()
|
|
249
|
+
], UUIPaginationElement.prototype, "_visiblePages", 2);
|
|
250
|
+
__decorateClass([
|
|
251
|
+
property({ type: Number })
|
|
252
|
+
], UUIPaginationElement.prototype, "current", 1);
|
|
253
|
+
|
|
254
|
+
defineElement("uui-pagination", UUIPaginationElement);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @element uui-pagination
|
|
4
|
+
* @description Jump to a certain page and navigate to the next, last, previous or first page. The amount of visible page-buttons are adjusted to the available space.
|
|
5
|
+
* @fires change - When clicked on the page button fires change event
|
|
6
|
+
*/
|
|
7
|
+
export declare class UUIPaginationElement extends LitElement {
|
|
8
|
+
static styles: import("lit").CSSResult[];
|
|
9
|
+
private _observer;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
disconnectedCallback(): void;
|
|
12
|
+
firstUpdated(): void;
|
|
13
|
+
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
14
|
+
protected updateLabel(): void;
|
|
15
|
+
private _calculateRange;
|
|
16
|
+
private _generateVisiblePages;
|
|
17
|
+
private _navButtons;
|
|
18
|
+
private _pagesGroup;
|
|
19
|
+
/**
|
|
20
|
+
* This property is used to generate a proper `aria-label`. It will be announced by screen reader as: "<<this.label>>. Current page: <<this.current>>"
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @attr
|
|
23
|
+
*/
|
|
24
|
+
label: string;
|
|
25
|
+
/**
|
|
26
|
+
* With this property you can overwrite aria-label.
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @attr
|
|
29
|
+
*/
|
|
30
|
+
ariaLabel: string;
|
|
31
|
+
/**
|
|
32
|
+
* Set the amount of pages to navigate.
|
|
33
|
+
* @type {number}
|
|
34
|
+
* @attr
|
|
35
|
+
* @default: 1
|
|
36
|
+
*/
|
|
37
|
+
total: number;
|
|
38
|
+
private _range;
|
|
39
|
+
private _visiblePages;
|
|
40
|
+
private _current;
|
|
41
|
+
/**
|
|
42
|
+
* Define the current active page.
|
|
43
|
+
* @type {number}
|
|
44
|
+
* @attr
|
|
45
|
+
*/
|
|
46
|
+
get current(): number;
|
|
47
|
+
set current(newValue: number);
|
|
48
|
+
/**
|
|
49
|
+
* This method will change the page to a next one.
|
|
50
|
+
* @memberof UUIPaginationElement
|
|
51
|
+
*/
|
|
52
|
+
goToNextPage(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Change the page to a previous one.
|
|
55
|
+
* @memberof UUIPaginationElement
|
|
56
|
+
*/
|
|
57
|
+
goToPreviousPage(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Change the page to the one passed as an argument to this method.
|
|
60
|
+
* @param {number} page
|
|
61
|
+
* @memberof UUIPaginationElement
|
|
62
|
+
*/
|
|
63
|
+
goToPage(page: number): void;
|
|
64
|
+
/** When having limited display of page-buttons and clicking a page-button that changes the current range, the focus stays on the position of the clicked button which is not anymore representing the number clicked, therefore we move focus to the button that represents the current page. */
|
|
65
|
+
protected focusActivePage(): void;
|
|
66
|
+
protected renderFirst(): import("lit-html").TemplateResult<1>;
|
|
67
|
+
protected renderPrevious(): import("lit-html").TemplateResult<1>;
|
|
68
|
+
protected renderNext(): import("lit-html").TemplateResult<1>;
|
|
69
|
+
protected renderLast(): import("lit-html").TemplateResult<1>;
|
|
70
|
+
protected renderDots(): import("lit-html").TemplateResult<1>;
|
|
71
|
+
protected renderPage(page: number): import("lit-html").TemplateResult<1>;
|
|
72
|
+
protected renderNavigationLeft(): import("lit-html").TemplateResult<1>;
|
|
73
|
+
protected renderNavigationRight(): import("lit-html").TemplateResult<1>;
|
|
74
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
75
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { css, LitElement, html } from 'lit';
|
|
2
|
+
import { queryAll, query, property, state } from 'lit/decorators.js';
|
|
3
|
+
import { UUIEvent } from '@umbraco-ui/uui-base/lib/events';
|
|
4
|
+
|
|
5
|
+
class UUIPaginationEvent extends UUIEvent {
|
|
6
|
+
}
|
|
7
|
+
UUIPaginationEvent.CHANGE = "change";
|
|
8
|
+
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
|
+
typeof require !== "undefined" ? require : (x) => {
|
|
12
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
+
};
|
|
14
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
15
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
16
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
17
|
+
if (decorator = decorators[i])
|
|
18
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
19
|
+
if (kind && result)
|
|
20
|
+
__defProp(target, key, result);
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
const PAGE_BUTTON_MAX_WIDTH = 45;
|
|
24
|
+
const limit = (val, min, max) => {
|
|
25
|
+
return Math.min(Math.max(val, min), max);
|
|
26
|
+
};
|
|
27
|
+
const arrayOfNumbers = (start, stop) => {
|
|
28
|
+
return Array.from({ length: stop - start + 1 }, (_, i) => start + i);
|
|
29
|
+
};
|
|
30
|
+
class UUIPaginationElement extends LitElement {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(...arguments);
|
|
33
|
+
this._observer = new ResizeObserver(this._calculateRange.bind(this));
|
|
34
|
+
this.label = "";
|
|
35
|
+
this.ariaLabel = "";
|
|
36
|
+
this.total = 1;
|
|
37
|
+
this._range = 0;
|
|
38
|
+
this._visiblePages = [];
|
|
39
|
+
this._current = 1;
|
|
40
|
+
}
|
|
41
|
+
connectedCallback() {
|
|
42
|
+
super.connectedCallback();
|
|
43
|
+
this.setAttribute("role", "navigation");
|
|
44
|
+
this._visiblePages = this._generateVisiblePages(this.current);
|
|
45
|
+
}
|
|
46
|
+
disconnectedCallback() {
|
|
47
|
+
this._observer.disconnect();
|
|
48
|
+
}
|
|
49
|
+
firstUpdated() {
|
|
50
|
+
this._observer.observe(this._pagesGroup);
|
|
51
|
+
this.updateLabel();
|
|
52
|
+
this._calculateRange();
|
|
53
|
+
}
|
|
54
|
+
willUpdate(changedProperties) {
|
|
55
|
+
if (changedProperties.has("current") || changedProperties.has("label")) {
|
|
56
|
+
this.updateLabel();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
updateLabel() {
|
|
60
|
+
this.ariaLabel = `${this.label || "Pagination navigation"}. Current page: ${this.current}.`;
|
|
61
|
+
}
|
|
62
|
+
_calculateRange() {
|
|
63
|
+
const containerWidth = this.offsetWidth;
|
|
64
|
+
const navButtonsWidth = Array.from(this._navButtons).reduce((totalWidth, button) => {
|
|
65
|
+
return totalWidth + button.getBoundingClientRect().width;
|
|
66
|
+
}, 0);
|
|
67
|
+
const rangeBaseWidth = containerWidth - navButtonsWidth;
|
|
68
|
+
const range = rangeBaseWidth / PAGE_BUTTON_MAX_WIDTH / 2;
|
|
69
|
+
this._range = Math.max(1, Math.floor(range));
|
|
70
|
+
this._visiblePages = this._generateVisiblePages(this.current);
|
|
71
|
+
}
|
|
72
|
+
_generateVisiblePages(current) {
|
|
73
|
+
const start = current < this._range ? 1 : current < this.total - this._range ? current - this._range : this.total - this._range * 2;
|
|
74
|
+
const stop = current <= this._range ? this._range * 2 + 1 : current < this.total - this._range ? current + this._range : this.total;
|
|
75
|
+
const pages = arrayOfNumbers(limit(start, 1, this.total), limit(stop, 1, this.total));
|
|
76
|
+
return pages;
|
|
77
|
+
}
|
|
78
|
+
get current() {
|
|
79
|
+
return this._current;
|
|
80
|
+
}
|
|
81
|
+
set current(newValue) {
|
|
82
|
+
const oldValue = this._current;
|
|
83
|
+
this._current = limit(newValue, 1, this.total);
|
|
84
|
+
this._visiblePages = this._generateVisiblePages(this._current);
|
|
85
|
+
this.requestUpdate("current", oldValue);
|
|
86
|
+
}
|
|
87
|
+
goToNextPage() {
|
|
88
|
+
this.current++;
|
|
89
|
+
this.dispatchEvent(new UUIPaginationEvent(UUIPaginationEvent.CHANGE));
|
|
90
|
+
}
|
|
91
|
+
goToPreviousPage() {
|
|
92
|
+
this.current--;
|
|
93
|
+
this.dispatchEvent(new UUIPaginationEvent(UUIPaginationEvent.CHANGE));
|
|
94
|
+
}
|
|
95
|
+
goToPage(page) {
|
|
96
|
+
this.current = page;
|
|
97
|
+
this.dispatchEvent(new UUIPaginationEvent(UUIPaginationEvent.CHANGE));
|
|
98
|
+
}
|
|
99
|
+
focusActivePage() {
|
|
100
|
+
requestAnimationFrame(() => {
|
|
101
|
+
const activeButtonElement = this.renderRoot.querySelector(".active");
|
|
102
|
+
if (activeButtonElement) {
|
|
103
|
+
activeButtonElement.focus();
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
renderFirst() {
|
|
108
|
+
return html`<uui-button
|
|
109
|
+
compact
|
|
110
|
+
look="outline"
|
|
111
|
+
class="nav"
|
|
112
|
+
role="listitem"
|
|
113
|
+
aria-label="Go to first page"
|
|
114
|
+
?disabled=${this._current === 1}
|
|
115
|
+
@click=${() => this.goToPage(1)}>
|
|
116
|
+
First
|
|
117
|
+
</uui-button>`;
|
|
118
|
+
}
|
|
119
|
+
renderPrevious() {
|
|
120
|
+
return html`<uui-button
|
|
121
|
+
compact
|
|
122
|
+
look="outline"
|
|
123
|
+
class="nav"
|
|
124
|
+
role="listitem"
|
|
125
|
+
aria-label="Go to previous page"
|
|
126
|
+
?disabled=${this._current === 1}
|
|
127
|
+
@click=${this.goToPreviousPage}>
|
|
128
|
+
Previous
|
|
129
|
+
</uui-button>`;
|
|
130
|
+
}
|
|
131
|
+
renderNext() {
|
|
132
|
+
return html`<uui-button
|
|
133
|
+
compact
|
|
134
|
+
look="outline"
|
|
135
|
+
role="listitem"
|
|
136
|
+
class="nav"
|
|
137
|
+
aria-label="Go to next page"
|
|
138
|
+
?disabled=${this._current === this.total}
|
|
139
|
+
@click=${this.goToNextPage}>
|
|
140
|
+
Next
|
|
141
|
+
</uui-button>`;
|
|
142
|
+
}
|
|
143
|
+
renderLast() {
|
|
144
|
+
return html`
|
|
145
|
+
<uui-button
|
|
146
|
+
compact
|
|
147
|
+
look="outline"
|
|
148
|
+
role="listitem"
|
|
149
|
+
class="nav"
|
|
150
|
+
aria-label="Go to last page"
|
|
151
|
+
?disabled=${this.total === this._current}
|
|
152
|
+
@click=${() => this.goToPage(this.total)}>
|
|
153
|
+
Last
|
|
154
|
+
</uui-button>
|
|
155
|
+
`;
|
|
156
|
+
}
|
|
157
|
+
renderDots() {
|
|
158
|
+
return html`<uui-button compact look="outline" tabindex="-1" class="dots"
|
|
159
|
+
>...</uui-button
|
|
160
|
+
> `;
|
|
161
|
+
}
|
|
162
|
+
renderPage(page) {
|
|
163
|
+
return html`<uui-button
|
|
164
|
+
compact
|
|
165
|
+
look="outline"
|
|
166
|
+
role="listitem"
|
|
167
|
+
aria-label="Go to page ${page}"
|
|
168
|
+
class=${"page" + (page === this._current ? " active" : "")}
|
|
169
|
+
tabindex=${page === this._current ? "-1" : ""}
|
|
170
|
+
@click=${() => {
|
|
171
|
+
if (page === this._current)
|
|
172
|
+
return;
|
|
173
|
+
this.goToPage(page);
|
|
174
|
+
this.focusActivePage();
|
|
175
|
+
}}>
|
|
176
|
+
${page}
|
|
177
|
+
</uui-button>`;
|
|
178
|
+
}
|
|
179
|
+
renderNavigationLeft() {
|
|
180
|
+
return html` ${this.renderFirst()} ${this.renderPrevious()}
|
|
181
|
+
${this._visiblePages.includes(1) ? "" : this.renderDots()}`;
|
|
182
|
+
}
|
|
183
|
+
renderNavigationRight() {
|
|
184
|
+
return html`${this._visiblePages.includes(this.total) ? "" : this.renderDots()}
|
|
185
|
+
${this.renderNext()} ${this.renderLast()}`;
|
|
186
|
+
}
|
|
187
|
+
render() {
|
|
188
|
+
return html`<uui-button-group role="list" id="pages">
|
|
189
|
+
${this.renderNavigationLeft()}
|
|
190
|
+
${this._visiblePages.map((page) => this.renderPage(page))}
|
|
191
|
+
${this.renderNavigationRight()}
|
|
192
|
+
</uui-button-group>
|
|
193
|
+
`;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
UUIPaginationElement.styles = [
|
|
197
|
+
css`
|
|
198
|
+
uui-button-group {
|
|
199
|
+
width: 100%;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
uui-button {
|
|
203
|
+
--uui-button-border-color: var(--uui-interface-border,#c4c4c4);
|
|
204
|
+
--uui-button-border-color-disabled: var(--uui-interface-border,#c4c4c4);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.page {
|
|
208
|
+
min-width: 36px;
|
|
209
|
+
max-width: 72px;
|
|
210
|
+
}
|
|
211
|
+
.page.active {
|
|
212
|
+
--uui-button-background-color: var(--uui-interface-active,#f5c1bc);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.nav {
|
|
216
|
+
min-width: 72px;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.dots {
|
|
220
|
+
pointer-events: none;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.active {
|
|
224
|
+
pointer-events: none;
|
|
225
|
+
}
|
|
226
|
+
`
|
|
227
|
+
];
|
|
228
|
+
__decorateClass([
|
|
229
|
+
queryAll("uui-button.nav")
|
|
230
|
+
], UUIPaginationElement.prototype, "_navButtons", 2);
|
|
231
|
+
__decorateClass([
|
|
232
|
+
query("#pages")
|
|
233
|
+
], UUIPaginationElement.prototype, "_pagesGroup", 2);
|
|
234
|
+
__decorateClass([
|
|
235
|
+
property()
|
|
236
|
+
], UUIPaginationElement.prototype, "label", 2);
|
|
237
|
+
__decorateClass([
|
|
238
|
+
property({ reflect: true, attribute: "aria-label" })
|
|
239
|
+
], UUIPaginationElement.prototype, "ariaLabel", 2);
|
|
240
|
+
__decorateClass([
|
|
241
|
+
property({ type: Number })
|
|
242
|
+
], UUIPaginationElement.prototype, "total", 2);
|
|
243
|
+
__decorateClass([
|
|
244
|
+
state()
|
|
245
|
+
], UUIPaginationElement.prototype, "_range", 2);
|
|
246
|
+
__decorateClass([
|
|
247
|
+
state()
|
|
248
|
+
], UUIPaginationElement.prototype, "_visiblePages", 2);
|
|
249
|
+
__decorateClass([
|
|
250
|
+
property({ type: Number })
|
|
251
|
+
], UUIPaginationElement.prototype, "current", 1);
|
|
252
|
+
|
|
253
|
+
export { UUIPaginationElement };
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@umbraco-ui/uui-pagination",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Umbraco",
|
|
7
|
+
"Custom elements",
|
|
8
|
+
"Web components",
|
|
9
|
+
"UI",
|
|
10
|
+
"Lit",
|
|
11
|
+
"Pagination"
|
|
12
|
+
],
|
|
13
|
+
"description": "Umbraco UI pagination component. By implementing a resizeObserver it changes the number of visible buttons to fit the width of the container it sits in. Based on uui-button and uui-button-group.",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/umbraco/Umbraco.UI.git",
|
|
17
|
+
"directory": "packages/uui-pagination"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/umbraco/Umbraco.UI/issues"
|
|
21
|
+
},
|
|
22
|
+
"main": "./dist/uui-pagination.min.js",
|
|
23
|
+
"module": "./lib/index.js",
|
|
24
|
+
"customElements": "custom-elements.json",
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"lib/**/*.d.ts",
|
|
28
|
+
"lib/**/*.js",
|
|
29
|
+
"custom-elements.json"
|
|
30
|
+
],
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@umbraco-ui/uui-base": "0.0.14"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@umbraco-ui/uui-button": "~0.1.6",
|
|
36
|
+
"@umbraco-ui/uui-button-group": "~0.0.8"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
|
|
40
|
+
"clean": "tsc --build --clean && rimraf dist lib/*.js lib/**/*.js custom-elements.json",
|
|
41
|
+
"analyze": "web-component-analyzer **/*.element.ts --outFile custom-elements.json"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://uui.umbraco.com/?path=/story/uui-pagination",
|
|
47
|
+
"gitHead": "27d48bb352dcac2b08d55958ecba92b28c11d957"
|
|
48
|
+
}
|