@paperless/core 0.1.0-alpha.11 → 0.1.0-alpha.13
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/CHANGELOG.md +16 -0
- package/dist/build/p-332028c6.entry.js +1 -0
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/p-pagination.cjs.entry.js +10 -11
- package/dist/cjs/paperless.cjs.js +1 -1
- package/dist/collection/components/molecules/pagination/pagination.component.js +18 -33
- package/dist/components/p-pagination.js +12 -13
- package/dist/esm/loader.js +1 -1
- package/dist/esm/p-pagination.entry.js +11 -12
- package/dist/esm/paperless.js +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/p-332028c6.entry.js +1 -0
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +11 -11
- package/dist/types/components/molecules/pagination/pagination.component.d.ts +1 -6
- package/dist/types/components.d.ts +8 -16
- package/package.json +1 -1
- package/dist/build/p-d750cdf6.entry.js +0 -1
- package/dist/paperless/p-d750cdf6.entry.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 0.1.0-alpha.13 (2022-07-12)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @paperless/core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 0.1.0-alpha.12 (2022-07-12)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @paperless/core
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# 0.1.0-alpha.11 (2022-07-12)
|
|
7
23
|
|
|
8
24
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as e,H as i}from"./p-229f113b.js";const a=class{constructor(i){t(this,i),this.value=1,this.pageSize=12,this._pages=[],this._set=[],this._nextClick=()=>{const t=this.value+1;t>this._pages[this._pages.length-1]||this._changePage(t)},this._pageClick=t=>this._changePage(t),this._generateSet=(t=1,i=!0)=>{const a=this._pages.length;if(!a)return[];let o=this.value-t,r=this.value+t;r>a&&(r=a,o=a-2*t,o=o<1?1:o),o<=1&&(o=1,r=Math.min(2*t+1,a));const s=[],n={type:"previous",value:e("p-icon",{variant:"chevron",rotate:90})},w={type:"next",value:e("p-icon",{variant:"chevron",rotate:-90})};if(null===t){const t=this._pages.map((t=>({type:"page",value:t})));return i?[n,...t,w]:t}if(i&&s.push(n),o<=3)for(let t=1;t<o;t++)s.push({type:"page",value:this._pages[t-1]});else s.push({type:"page",value:1}),s.push({type:"ellipsis",value:"ellipsis"});for(let t=o;t<=r;t++)s.push({type:"page",value:this._pages[t-1]});if(r>=a-2)for(let t=r+1;t<=a;t++)s.push({type:"page",value:this._pages[t-1]});else s.push({type:"ellipsis"}),s.push({type:"page",value:this._pages[this._pages.length-1]});return i&&s.push(w),s}}componentWillRender(){this._generate()}render(){var t;return e(i,{class:"p-pagination"},null===(t=this._set)||void 0===t?void 0:t.map((t=>"previous"===t.type||"next"===t.type?e("p-pagination-item",{onClick:()=>"previous"===t.type?this._previousClick():this._nextClick()},t.value):"ellipsis"===t.type?e("p-pagination-item",null,"..."):e("p-pagination-item",{active:t.value===this.value,onClick:()=>this._pageClick(t.value)},t.value))))}pageChangeHandler(){this._generate()}_generate(){this._pages=this._generatePages(),this._set=this._generateSet()}_changePage(t){t&&(this.value=t)}_previousClick(){const t=this.value-1;t<this._pages[0]||this._changePage(t)}_generatePages(){if(!this.total||!this.pageSize)return[];const t=Math.ceil(this.total/this.pageSize);return new Array(t).fill(void 0).map(((t,e)=>e+1))}static get watchers(){return{value:["pageChangeHandler"],pageSize:["pageChangeHandler"],total:["pageChangeHandler"]}}};a.style='/*! tailwindcss v3.1.4 | MIT License | https://tailwindcss.com*/*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;border:0 solid;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.flex{display:flex!important}p-pagination{display:flex}.static{position:static!important}';export{a as p_pagination}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-229f113b.js";(()=>{const a=import.meta.url,i={};return""!==a&&(i.resourcesUrl=new URL(".",a).href),e(i)})().then((e=>a([["p-
|
|
1
|
+
import{p as e,b as a}from"./p-229f113b.js";(()=>{const a=import.meta.url,i={};return""!==a&&(i.resourcesUrl=new URL(".",a).href),e(i)})().then((e=>a([["p-332028c6",[[0,"p-pagination",{value:[1026],pageSize:[2,"page-size"],total:[2]}]]],["p-19afe191",[[1,"p-helper"]]],["p-5f0ec763",[[1,"p-info-panel",{variant:[1],header:[1],content:[1],closeable:[4]}]]],["p-e80637b9",[[1,"p-avatar",{variant:[1],size:[1],defaultImage:[1,"default-image"],src:[1],_src:[32]}]]],["p-06a38756",[[1,"p-counter"]]],["p-6c6c1137",[[1,"p-divider"]]],["p-23980fbb",[[0,"p-illustration",{variant:[1]}]]],["p-ec52095f",[[1,"p-pagination-item",{active:[4]}]]],["p-31f80006",[[1,"p-tooltip",{variant:[1],popover:[8],placement:[1],show:[4],canManuallyClose:[4,"can-manually-close"]},[[2,"click","clickHandler"],[6,"click","documentClickHandler"],[1,"mouseenter","mouseEnterHandler"],[0,"focus","mouseEnterHandler"],[1,"mouseleave","mouseLeaveHandler"],[0,"blur","mouseLeaveHandler"]]]]],["p-80bf9d06",[[4,"p-button",{variant:[1],href:[1],target:[1],size:[1],loading:[4],disabled:[4],icon:[1],iconPosition:[1,"icon-position"],iconFlip:[1,"icon-flip"],iconRotate:[2,"icon-rotate"]},[[2,"click","handleClick"]]],[1,"p-loader",{show:[4],variant:[1],color:[1],modalTitle:[1,"modal-title"],modalDescription:[1,"modal-description"]}],[0,"p-icon",{variant:[1],size:[1],rotate:[2],flip:[1]}]]]],e)));
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["p-pagination.cjs",[[0,"p-pagination",{"
|
|
17
|
+
return index.bootstrapLazy([["p-pagination.cjs",[[0,"p-pagination",{"value":[1026],"pageSize":[2,"page-size"],"total":[2]}]]],["p-helper.cjs",[[1,"p-helper"]]],["p-info-panel.cjs",[[1,"p-info-panel",{"variant":[1],"header":[1],"content":[1],"closeable":[4]}]]],["p-avatar.cjs",[[1,"p-avatar",{"variant":[1],"size":[1],"defaultImage":[1,"default-image"],"src":[1],"_src":[32]}]]],["p-counter.cjs",[[1,"p-counter"]]],["p-divider.cjs",[[1,"p-divider"]]],["p-illustration.cjs",[[0,"p-illustration",{"variant":[1]}]]],["p-pagination-item.cjs",[[1,"p-pagination-item",{"active":[4]}]]],["p-tooltip.cjs",[[1,"p-tooltip",{"variant":[1],"popover":[8],"placement":[1],"show":[4],"canManuallyClose":[4,"can-manually-close"]},[[2,"click","clickHandler"],[6,"click","documentClickHandler"],[1,"mouseenter","mouseEnterHandler"],[0,"focus","mouseEnterHandler"],[1,"mouseleave","mouseLeaveHandler"],[0,"blur","mouseLeaveHandler"]]]]],["p-button_3.cjs",[[4,"p-button",{"variant":[1],"href":[1],"target":[1],"size":[1],"loading":[4],"disabled":[4],"icon":[1],"iconPosition":[1,"icon-position"],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"]},[[2,"click","handleClick"]]],[1,"p-loader",{"show":[4],"variant":[1],"color":[1],"modalTitle":[1,"modal-title"],"modalDescription":[1,"modal-description"]}],[0,"p-icon",{"variant":[1],"size":[1],"rotate":[2],"flip":[1]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -9,11 +9,10 @@ const paginationComponentCss = "/*! tailwindcss v3.1.4 | MIT License | https://t
|
|
|
9
9
|
const Pagination = class {
|
|
10
10
|
constructor(hostRef) {
|
|
11
11
|
index.registerInstance(this, hostRef);
|
|
12
|
-
this.pageChange = index.createEvent(this, "pageChange", 7);
|
|
13
12
|
/**
|
|
14
13
|
* The current page
|
|
15
14
|
*/
|
|
16
|
-
this.
|
|
15
|
+
this.value = 1;
|
|
17
16
|
/**
|
|
18
17
|
* The amount of items per page
|
|
19
18
|
*/
|
|
@@ -21,7 +20,7 @@ const Pagination = class {
|
|
|
21
20
|
this._pages = [];
|
|
22
21
|
this._set = [];
|
|
23
22
|
this._nextClick = () => {
|
|
24
|
-
const nextPage = this.
|
|
23
|
+
const nextPage = this.value + 1;
|
|
25
24
|
if (nextPage > this._pages[this._pages.length - 1]) {
|
|
26
25
|
return;
|
|
27
26
|
}
|
|
@@ -33,8 +32,8 @@ const Pagination = class {
|
|
|
33
32
|
if (!totalPages) {
|
|
34
33
|
return [];
|
|
35
34
|
}
|
|
36
|
-
let start = this.
|
|
37
|
-
let end = this.
|
|
35
|
+
let start = this.value - range;
|
|
36
|
+
let end = this.value + range;
|
|
38
37
|
if (end > totalPages) {
|
|
39
38
|
end = totalPages;
|
|
40
39
|
start = totalPages - range * 2;
|
|
@@ -123,11 +122,10 @@ const Pagination = class {
|
|
|
123
122
|
if (p.type === 'ellipsis') {
|
|
124
123
|
return index.h("p-pagination-item", null, "...");
|
|
125
124
|
}
|
|
126
|
-
return (index.h("p-pagination-item", { active: p.value === this.
|
|
125
|
+
return (index.h("p-pagination-item", { active: p.value === this.value, onClick: () => this._pageClick(p.value) }, p.value));
|
|
127
126
|
})));
|
|
128
127
|
}
|
|
129
128
|
pageChangeHandler() {
|
|
130
|
-
console.log('Page changed!');
|
|
131
129
|
this._generate();
|
|
132
130
|
}
|
|
133
131
|
_generate() {
|
|
@@ -138,11 +136,10 @@ const Pagination = class {
|
|
|
138
136
|
if (!p) {
|
|
139
137
|
return;
|
|
140
138
|
}
|
|
141
|
-
this.
|
|
142
|
-
this.page = p;
|
|
139
|
+
this.value = p;
|
|
143
140
|
}
|
|
144
141
|
_previousClick() {
|
|
145
|
-
const previousPage = this.
|
|
142
|
+
const previousPage = this.value - 1;
|
|
146
143
|
if (previousPage < this._pages[0]) {
|
|
147
144
|
return;
|
|
148
145
|
}
|
|
@@ -156,7 +153,9 @@ const Pagination = class {
|
|
|
156
153
|
return new Array(pages).fill(undefined).map((_, i) => i + 1);
|
|
157
154
|
}
|
|
158
155
|
static get watchers() { return {
|
|
159
|
-
"
|
|
156
|
+
"value": ["pageChangeHandler"],
|
|
157
|
+
"pageSize": ["pageChangeHandler"],
|
|
158
|
+
"total": ["pageChangeHandler"]
|
|
160
159
|
}; }
|
|
161
160
|
};
|
|
162
161
|
Pagination.style = paginationComponentCss;
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["p-pagination.cjs",[[0,"p-pagination",{"
|
|
18
|
+
return index.bootstrapLazy([["p-pagination.cjs",[[0,"p-pagination",{"value":[1026],"pageSize":[2,"page-size"],"total":[2]}]]],["p-helper.cjs",[[1,"p-helper"]]],["p-info-panel.cjs",[[1,"p-info-panel",{"variant":[1],"header":[1],"content":[1],"closeable":[4]}]]],["p-avatar.cjs",[[1,"p-avatar",{"variant":[1],"size":[1],"defaultImage":[1,"default-image"],"src":[1],"_src":[32]}]]],["p-counter.cjs",[[1,"p-counter"]]],["p-divider.cjs",[[1,"p-divider"]]],["p-illustration.cjs",[[0,"p-illustration",{"variant":[1]}]]],["p-pagination-item.cjs",[[1,"p-pagination-item",{"active":[4]}]]],["p-tooltip.cjs",[[1,"p-tooltip",{"variant":[1],"popover":[8],"placement":[1],"show":[4],"canManuallyClose":[4,"can-manually-close"]},[[2,"click","clickHandler"],[6,"click","documentClickHandler"],[1,"mouseenter","mouseEnterHandler"],[0,"focus","mouseEnterHandler"],[1,"mouseleave","mouseLeaveHandler"],[0,"blur","mouseLeaveHandler"]]]]],["p-button_3.cjs",[[4,"p-button",{"variant":[1],"href":[1],"target":[1],"size":[1],"loading":[4],"disabled":[4],"icon":[1],"iconPosition":[1,"icon-position"],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"]},[[2,"click","handleClick"]]],[1,"p-loader",{"show":[4],"variant":[1],"color":[1],"modalTitle":[1,"modal-title"],"modalDescription":[1,"modal-description"]}],[0,"p-icon",{"variant":[1],"size":[1],"rotate":[2],"flip":[1]}]]]], options);
|
|
19
19
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, h, Host, Prop, Watch } from '@stencil/core';
|
|
2
2
|
export class Pagination {
|
|
3
3
|
constructor() {
|
|
4
4
|
/**
|
|
5
5
|
* The current page
|
|
6
6
|
*/
|
|
7
|
-
this.
|
|
7
|
+
this.value = 1;
|
|
8
8
|
/**
|
|
9
9
|
* The amount of items per page
|
|
10
10
|
*/
|
|
@@ -12,7 +12,7 @@ export class Pagination {
|
|
|
12
12
|
this._pages = [];
|
|
13
13
|
this._set = [];
|
|
14
14
|
this._nextClick = () => {
|
|
15
|
-
const nextPage = this.
|
|
15
|
+
const nextPage = this.value + 1;
|
|
16
16
|
if (nextPage > this._pages[this._pages.length - 1]) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
@@ -24,8 +24,8 @@ export class Pagination {
|
|
|
24
24
|
if (!totalPages) {
|
|
25
25
|
return [];
|
|
26
26
|
}
|
|
27
|
-
let start = this.
|
|
28
|
-
let end = this.
|
|
27
|
+
let start = this.value - range;
|
|
28
|
+
let end = this.value + range;
|
|
29
29
|
if (end > totalPages) {
|
|
30
30
|
end = totalPages;
|
|
31
31
|
start = totalPages - range * 2;
|
|
@@ -114,11 +114,10 @@ export class Pagination {
|
|
|
114
114
|
if (p.type === 'ellipsis') {
|
|
115
115
|
return h("p-pagination-item", null, "...");
|
|
116
116
|
}
|
|
117
|
-
return (h("p-pagination-item", { active: p.value === this.
|
|
117
|
+
return (h("p-pagination-item", { active: p.value === this.value, onClick: () => this._pageClick(p.value) }, p.value));
|
|
118
118
|
})));
|
|
119
119
|
}
|
|
120
120
|
pageChangeHandler() {
|
|
121
|
-
console.log('Page changed!');
|
|
122
121
|
this._generate();
|
|
123
122
|
}
|
|
124
123
|
_generate() {
|
|
@@ -129,11 +128,10 @@ export class Pagination {
|
|
|
129
128
|
if (!p) {
|
|
130
129
|
return;
|
|
131
130
|
}
|
|
132
|
-
this.
|
|
133
|
-
this.page = p;
|
|
131
|
+
this.value = p;
|
|
134
132
|
}
|
|
135
133
|
_previousClick() {
|
|
136
|
-
const previousPage = this.
|
|
134
|
+
const previousPage = this.value - 1;
|
|
137
135
|
if (previousPage < this._pages[0]) {
|
|
138
136
|
return;
|
|
139
137
|
}
|
|
@@ -154,9 +152,9 @@ export class Pagination {
|
|
|
154
152
|
"$": ["pagination.component.css"]
|
|
155
153
|
}; }
|
|
156
154
|
static get properties() { return {
|
|
157
|
-
"
|
|
155
|
+
"value": {
|
|
158
156
|
"type": "number",
|
|
159
|
-
"mutable":
|
|
157
|
+
"mutable": true,
|
|
160
158
|
"complexType": {
|
|
161
159
|
"original": "number",
|
|
162
160
|
"resolved": "number",
|
|
@@ -168,7 +166,7 @@ export class Pagination {
|
|
|
168
166
|
"tags": [],
|
|
169
167
|
"text": "The current page"
|
|
170
168
|
},
|
|
171
|
-
"attribute": "
|
|
169
|
+
"attribute": "value",
|
|
172
170
|
"reflect": false,
|
|
173
171
|
"defaultValue": "1"
|
|
174
172
|
},
|
|
@@ -208,27 +206,14 @@ export class Pagination {
|
|
|
208
206
|
"reflect": false
|
|
209
207
|
}
|
|
210
208
|
}; }
|
|
211
|
-
static get states() { return {
|
|
212
|
-
"page": {}
|
|
213
|
-
}; }
|
|
214
|
-
static get events() { return [{
|
|
215
|
-
"method": "pageChange",
|
|
216
|
-
"name": "pageChange",
|
|
217
|
-
"bubbles": true,
|
|
218
|
-
"cancelable": true,
|
|
219
|
-
"composed": true,
|
|
220
|
-
"docs": {
|
|
221
|
-
"tags": [],
|
|
222
|
-
"text": "Button click event"
|
|
223
|
-
},
|
|
224
|
-
"complexType": {
|
|
225
|
-
"original": "number",
|
|
226
|
-
"resolved": "number",
|
|
227
|
-
"references": {}
|
|
228
|
-
}
|
|
229
|
-
}]; }
|
|
230
209
|
static get watchers() { return [{
|
|
231
|
-
"propName": "
|
|
210
|
+
"propName": "value",
|
|
211
|
+
"methodName": "pageChangeHandler"
|
|
212
|
+
}, {
|
|
213
|
+
"propName": "pageSize",
|
|
214
|
+
"methodName": "pageChangeHandler"
|
|
215
|
+
}, {
|
|
216
|
+
"propName": "total",
|
|
232
217
|
"methodName": "pageChangeHandler"
|
|
233
218
|
}]; }
|
|
234
219
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement,
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$3 } from './icon.component.js';
|
|
3
3
|
import { d as defineCustomElement$2 } from './pagination-item.component.js';
|
|
4
4
|
|
|
@@ -8,11 +8,10 @@ const Pagination = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
8
8
|
constructor() {
|
|
9
9
|
super();
|
|
10
10
|
this.__registerHost();
|
|
11
|
-
this.pageChange = createEvent(this, "pageChange", 7);
|
|
12
11
|
/**
|
|
13
12
|
* The current page
|
|
14
13
|
*/
|
|
15
|
-
this.
|
|
14
|
+
this.value = 1;
|
|
16
15
|
/**
|
|
17
16
|
* The amount of items per page
|
|
18
17
|
*/
|
|
@@ -20,7 +19,7 @@ const Pagination = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
20
19
|
this._pages = [];
|
|
21
20
|
this._set = [];
|
|
22
21
|
this._nextClick = () => {
|
|
23
|
-
const nextPage = this.
|
|
22
|
+
const nextPage = this.value + 1;
|
|
24
23
|
if (nextPage > this._pages[this._pages.length - 1]) {
|
|
25
24
|
return;
|
|
26
25
|
}
|
|
@@ -32,8 +31,8 @@ const Pagination = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
32
31
|
if (!totalPages) {
|
|
33
32
|
return [];
|
|
34
33
|
}
|
|
35
|
-
let start = this.
|
|
36
|
-
let end = this.
|
|
34
|
+
let start = this.value - range;
|
|
35
|
+
let end = this.value + range;
|
|
37
36
|
if (end > totalPages) {
|
|
38
37
|
end = totalPages;
|
|
39
38
|
start = totalPages - range * 2;
|
|
@@ -122,11 +121,10 @@ const Pagination = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
122
121
|
if (p.type === 'ellipsis') {
|
|
123
122
|
return h("p-pagination-item", null, "...");
|
|
124
123
|
}
|
|
125
|
-
return (h("p-pagination-item", { active: p.value === this.
|
|
124
|
+
return (h("p-pagination-item", { active: p.value === this.value, onClick: () => this._pageClick(p.value) }, p.value));
|
|
126
125
|
})));
|
|
127
126
|
}
|
|
128
127
|
pageChangeHandler() {
|
|
129
|
-
console.log('Page changed!');
|
|
130
128
|
this._generate();
|
|
131
129
|
}
|
|
132
130
|
_generate() {
|
|
@@ -137,11 +135,10 @@ const Pagination = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
137
135
|
if (!p) {
|
|
138
136
|
return;
|
|
139
137
|
}
|
|
140
|
-
this.
|
|
141
|
-
this.page = p;
|
|
138
|
+
this.value = p;
|
|
142
139
|
}
|
|
143
140
|
_previousClick() {
|
|
144
|
-
const previousPage = this.
|
|
141
|
+
const previousPage = this.value - 1;
|
|
145
142
|
if (previousPage < this._pages[0]) {
|
|
146
143
|
return;
|
|
147
144
|
}
|
|
@@ -155,11 +152,13 @@ const Pagination = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
155
152
|
return new Array(pages).fill(undefined).map((_, i) => i + 1);
|
|
156
153
|
}
|
|
157
154
|
static get watchers() { return {
|
|
158
|
-
"
|
|
155
|
+
"value": ["pageChangeHandler"],
|
|
156
|
+
"pageSize": ["pageChangeHandler"],
|
|
157
|
+
"total": ["pageChangeHandler"]
|
|
159
158
|
}; }
|
|
160
159
|
static get style() { return paginationComponentCss; }
|
|
161
160
|
}, [0, "p-pagination", {
|
|
162
|
-
"
|
|
161
|
+
"value": [1026],
|
|
163
162
|
"pageSize": [2, "page-size"],
|
|
164
163
|
"total": [2]
|
|
165
164
|
}]);
|
package/dist/esm/loader.js
CHANGED
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["p-pagination",[[0,"p-pagination",{"
|
|
13
|
+
return bootstrapLazy([["p-pagination",[[0,"p-pagination",{"value":[1026],"pageSize":[2,"page-size"],"total":[2]}]]],["p-helper",[[1,"p-helper"]]],["p-info-panel",[[1,"p-info-panel",{"variant":[1],"header":[1],"content":[1],"closeable":[4]}]]],["p-avatar",[[1,"p-avatar",{"variant":[1],"size":[1],"defaultImage":[1,"default-image"],"src":[1],"_src":[32]}]]],["p-counter",[[1,"p-counter"]]],["p-divider",[[1,"p-divider"]]],["p-illustration",[[0,"p-illustration",{"variant":[1]}]]],["p-pagination-item",[[1,"p-pagination-item",{"active":[4]}]]],["p-tooltip",[[1,"p-tooltip",{"variant":[1],"popover":[8],"placement":[1],"show":[4],"canManuallyClose":[4,"can-manually-close"]},[[2,"click","clickHandler"],[6,"click","documentClickHandler"],[1,"mouseenter","mouseEnterHandler"],[0,"focus","mouseEnterHandler"],[1,"mouseleave","mouseLeaveHandler"],[0,"blur","mouseLeaveHandler"]]]]],["p-button_3",[[4,"p-button",{"variant":[1],"href":[1],"target":[1],"size":[1],"loading":[4],"disabled":[4],"icon":[1],"iconPosition":[1,"icon-position"],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"]},[[2,"click","handleClick"]]],[1,"p-loader",{"show":[4],"variant":[1],"color":[1],"modalTitle":[1,"modal-title"],"modalDescription":[1,"modal-description"]}],[0,"p-icon",{"variant":[1],"size":[1],"rotate":[2],"flip":[1]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-5c917d13.js';
|
|
2
2
|
|
|
3
3
|
const paginationComponentCss = "/*! tailwindcss v3.1.4 | MIT License | https://tailwindcss.com*/*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;border:0 solid;box-sizing:border-box}:after,:before{--tw-content:\"\"}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.flex{display:flex!important}p-pagination{display:flex}.static{position:static!important}";
|
|
4
4
|
|
|
5
5
|
const Pagination = class {
|
|
6
6
|
constructor(hostRef) {
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
|
-
this.pageChange = createEvent(this, "pageChange", 7);
|
|
9
8
|
/**
|
|
10
9
|
* The current page
|
|
11
10
|
*/
|
|
12
|
-
this.
|
|
11
|
+
this.value = 1;
|
|
13
12
|
/**
|
|
14
13
|
* The amount of items per page
|
|
15
14
|
*/
|
|
@@ -17,7 +16,7 @@ const Pagination = class {
|
|
|
17
16
|
this._pages = [];
|
|
18
17
|
this._set = [];
|
|
19
18
|
this._nextClick = () => {
|
|
20
|
-
const nextPage = this.
|
|
19
|
+
const nextPage = this.value + 1;
|
|
21
20
|
if (nextPage > this._pages[this._pages.length - 1]) {
|
|
22
21
|
return;
|
|
23
22
|
}
|
|
@@ -29,8 +28,8 @@ const Pagination = class {
|
|
|
29
28
|
if (!totalPages) {
|
|
30
29
|
return [];
|
|
31
30
|
}
|
|
32
|
-
let start = this.
|
|
33
|
-
let end = this.
|
|
31
|
+
let start = this.value - range;
|
|
32
|
+
let end = this.value + range;
|
|
34
33
|
if (end > totalPages) {
|
|
35
34
|
end = totalPages;
|
|
36
35
|
start = totalPages - range * 2;
|
|
@@ -119,11 +118,10 @@ const Pagination = class {
|
|
|
119
118
|
if (p.type === 'ellipsis') {
|
|
120
119
|
return h("p-pagination-item", null, "...");
|
|
121
120
|
}
|
|
122
|
-
return (h("p-pagination-item", { active: p.value === this.
|
|
121
|
+
return (h("p-pagination-item", { active: p.value === this.value, onClick: () => this._pageClick(p.value) }, p.value));
|
|
123
122
|
})));
|
|
124
123
|
}
|
|
125
124
|
pageChangeHandler() {
|
|
126
|
-
console.log('Page changed!');
|
|
127
125
|
this._generate();
|
|
128
126
|
}
|
|
129
127
|
_generate() {
|
|
@@ -134,11 +132,10 @@ const Pagination = class {
|
|
|
134
132
|
if (!p) {
|
|
135
133
|
return;
|
|
136
134
|
}
|
|
137
|
-
this.
|
|
138
|
-
this.page = p;
|
|
135
|
+
this.value = p;
|
|
139
136
|
}
|
|
140
137
|
_previousClick() {
|
|
141
|
-
const previousPage = this.
|
|
138
|
+
const previousPage = this.value - 1;
|
|
142
139
|
if (previousPage < this._pages[0]) {
|
|
143
140
|
return;
|
|
144
141
|
}
|
|
@@ -152,7 +149,9 @@ const Pagination = class {
|
|
|
152
149
|
return new Array(pages).fill(undefined).map((_, i) => i + 1);
|
|
153
150
|
}
|
|
154
151
|
static get watchers() { return {
|
|
155
|
-
"
|
|
152
|
+
"value": ["pageChangeHandler"],
|
|
153
|
+
"pageSize": ["pageChangeHandler"],
|
|
154
|
+
"total": ["pageChangeHandler"]
|
|
156
155
|
}; }
|
|
157
156
|
};
|
|
158
157
|
Pagination.style = paginationComponentCss;
|
package/dist/esm/paperless.js
CHANGED
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["p-pagination",[[0,"p-pagination",{"
|
|
16
|
+
return bootstrapLazy([["p-pagination",[[0,"p-pagination",{"value":[1026],"pageSize":[2,"page-size"],"total":[2]}]]],["p-helper",[[1,"p-helper"]]],["p-info-panel",[[1,"p-info-panel",{"variant":[1],"header":[1],"content":[1],"closeable":[4]}]]],["p-avatar",[[1,"p-avatar",{"variant":[1],"size":[1],"defaultImage":[1,"default-image"],"src":[1],"_src":[32]}]]],["p-counter",[[1,"p-counter"]]],["p-divider",[[1,"p-divider"]]],["p-illustration",[[0,"p-illustration",{"variant":[1]}]]],["p-pagination-item",[[1,"p-pagination-item",{"active":[4]}]]],["p-tooltip",[[1,"p-tooltip",{"variant":[1],"popover":[8],"placement":[1],"show":[4],"canManuallyClose":[4,"can-manually-close"]},[[2,"click","clickHandler"],[6,"click","documentClickHandler"],[1,"mouseenter","mouseEnterHandler"],[0,"focus","mouseEnterHandler"],[1,"mouseleave","mouseLeaveHandler"],[0,"blur","mouseLeaveHandler"]]]]],["p-button_3",[[4,"p-button",{"variant":[1],"href":[1],"target":[1],"size":[1],"loading":[4],"disabled":[4],"icon":[1],"iconPosition":[1,"icon-position"],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"]},[[2,"click","handleClick"]]],[1,"p-loader",{"show":[4],"variant":[1],"color":[1],"modalTitle":[1,"modal-title"],"modalDescription":[1,"modal-description"]}],[0,"p-icon",{"variant":[1],"size":[1],"rotate":[2],"flip":[1]}]]]], options);
|
|
17
17
|
});
|
package/dist/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <script type="module" src="/build/paperless.esm.js" data-stencil data-resources-url="/build/" data-stencil-namespace="paperless"></script> <script nomodule="" src="/build/paperless.js" data-stencil></script> </head> <body> <p-button>Buttono</p-button> <script data-build="2022-07-12T11:
|
|
1
|
+
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <script type="module" src="/build/paperless.esm.js" data-stencil data-resources-url="/build/" data-stencil-namespace="paperless"></script> <script nomodule="" src="/build/paperless.js" data-stencil></script> </head> <body> <p-button>Buttono</p-button> <script data-build="2022-07-12T11:50:12">
|
|
2
2
|
if ('serviceWorker' in navigator && location.protocol !== 'file:') {
|
|
3
3
|
window.addEventListener('load', function() {
|
|
4
4
|
navigator.serviceWorker.register('/sw.js')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as e,H as i}from"./p-229f113b.js";const a=class{constructor(i){t(this,i),this.value=1,this.pageSize=12,this._pages=[],this._set=[],this._nextClick=()=>{const t=this.value+1;t>this._pages[this._pages.length-1]||this._changePage(t)},this._pageClick=t=>this._changePage(t),this._generateSet=(t=1,i=!0)=>{const a=this._pages.length;if(!a)return[];let o=this.value-t,r=this.value+t;r>a&&(r=a,o=a-2*t,o=o<1?1:o),o<=1&&(o=1,r=Math.min(2*t+1,a));const s=[],n={type:"previous",value:e("p-icon",{variant:"chevron",rotate:90})},w={type:"next",value:e("p-icon",{variant:"chevron",rotate:-90})};if(null===t){const t=this._pages.map((t=>({type:"page",value:t})));return i?[n,...t,w]:t}if(i&&s.push(n),o<=3)for(let t=1;t<o;t++)s.push({type:"page",value:this._pages[t-1]});else s.push({type:"page",value:1}),s.push({type:"ellipsis",value:"ellipsis"});for(let t=o;t<=r;t++)s.push({type:"page",value:this._pages[t-1]});if(r>=a-2)for(let t=r+1;t<=a;t++)s.push({type:"page",value:this._pages[t-1]});else s.push({type:"ellipsis"}),s.push({type:"page",value:this._pages[this._pages.length-1]});return i&&s.push(w),s}}componentWillRender(){this._generate()}render(){var t;return e(i,{class:"p-pagination"},null===(t=this._set)||void 0===t?void 0:t.map((t=>"previous"===t.type||"next"===t.type?e("p-pagination-item",{onClick:()=>"previous"===t.type?this._previousClick():this._nextClick()},t.value):"ellipsis"===t.type?e("p-pagination-item",null,"..."):e("p-pagination-item",{active:t.value===this.value,onClick:()=>this._pageClick(t.value)},t.value))))}pageChangeHandler(){this._generate()}_generate(){this._pages=this._generatePages(),this._set=this._generateSet()}_changePage(t){t&&(this.value=t)}_previousClick(){const t=this.value-1;t<this._pages[0]||this._changePage(t)}_generatePages(){if(!this.total||!this.pageSize)return[];const t=Math.ceil(this.total/this.pageSize);return new Array(t).fill(void 0).map(((t,e)=>e+1))}static get watchers(){return{value:["pageChangeHandler"],pageSize:["pageChangeHandler"],total:["pageChangeHandler"]}}};a.style='/*! tailwindcss v3.1.4 | MIT License | https://tailwindcss.com*/*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;border:0 solid;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.flex{display:flex!important}p-pagination{display:flex}.static{position:static!important}';export{a as p_pagination}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-229f113b.js";(()=>{const a=import.meta.url,i={};return""!==a&&(i.resourcesUrl=new URL(".",a).href),e(i)})().then((e=>a([["p-
|
|
1
|
+
import{p as e,b as a}from"./p-229f113b.js";(()=>{const a=import.meta.url,i={};return""!==a&&(i.resourcesUrl=new URL(".",a).href),e(i)})().then((e=>a([["p-332028c6",[[0,"p-pagination",{value:[1026],pageSize:[2,"page-size"],total:[2]}]]],["p-19afe191",[[1,"p-helper"]]],["p-5f0ec763",[[1,"p-info-panel",{variant:[1],header:[1],content:[1],closeable:[4]}]]],["p-e80637b9",[[1,"p-avatar",{variant:[1],size:[1],defaultImage:[1,"default-image"],src:[1],_src:[32]}]]],["p-06a38756",[[1,"p-counter"]]],["p-6c6c1137",[[1,"p-divider"]]],["p-23980fbb",[[0,"p-illustration",{variant:[1]}]]],["p-ec52095f",[[1,"p-pagination-item",{active:[4]}]]],["p-31f80006",[[1,"p-tooltip",{variant:[1],popover:[8],placement:[1],show:[4],canManuallyClose:[4,"can-manually-close"]},[[2,"click","clickHandler"],[6,"click","documentClickHandler"],[1,"mouseenter","mouseEnterHandler"],[0,"focus","mouseEnterHandler"],[1,"mouseleave","mouseLeaveHandler"],[0,"blur","mouseLeaveHandler"]]]]],["p-80bf9d06",[[4,"p-button",{variant:[1],href:[1],target:[1],size:[1],loading:[4],disabled:[4],icon:[1],iconPosition:[1,"icon-position"],iconFlip:[1,"icon-flip"],iconRotate:[2,"icon-rotate"]},[[2,"click","handleClick"]]],[1,"p-loader",{show:[4],variant:[1],color:[1],modalTitle:[1,"modal-title"],modalDescription:[1,"modal-description"]}],[0,"p-icon",{variant:[1],size:[1],rotate:[2],flip:[1]}]]]],e)));
|
package/dist/sw.js
CHANGED
|
@@ -27,7 +27,7 @@ self.addEventListener('message', (event) => {
|
|
|
27
27
|
self.__precacheManifest = [
|
|
28
28
|
{
|
|
29
29
|
"url": "index.html",
|
|
30
|
-
"revision": "
|
|
30
|
+
"revision": "f69f2ae9171b17979673043fa4698ede"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"url": "build/index.esm.js",
|
|
@@ -48,6 +48,9 @@ self.__precacheManifest = [
|
|
|
48
48
|
{
|
|
49
49
|
"url": "build/p-31f80006.entry.js"
|
|
50
50
|
},
|
|
51
|
+
{
|
|
52
|
+
"url": "build/p-332028c6.entry.js"
|
|
53
|
+
},
|
|
51
54
|
{
|
|
52
55
|
"url": "build/p-5f0ec763.entry.js"
|
|
53
56
|
},
|
|
@@ -57,9 +60,6 @@ self.__precacheManifest = [
|
|
|
57
60
|
{
|
|
58
61
|
"url": "build/p-80bf9d06.entry.js"
|
|
59
62
|
},
|
|
60
|
-
{
|
|
61
|
-
"url": "build/p-d750cdf6.entry.js"
|
|
62
|
-
},
|
|
63
63
|
{
|
|
64
64
|
"url": "build/p-e80637b9.entry.js"
|
|
65
65
|
},
|
|
@@ -76,7 +76,7 @@ self.__precacheManifest = [
|
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
"url": "cjs/loader.cjs.js",
|
|
79
|
-
"revision": "
|
|
79
|
+
"revision": "9f0547e1ee2c46fd59ed49760f631ded"
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
"url": "cjs/p-avatar.cjs.entry.js",
|
|
@@ -116,7 +116,7 @@ self.__precacheManifest = [
|
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
"url": "cjs/paperless.cjs.js",
|
|
119
|
-
"revision": "
|
|
119
|
+
"revision": "7bc505b447cd109093b071fa0750830e"
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
"url": "collection/collection-manifest.json",
|
|
@@ -208,7 +208,7 @@ self.__precacheManifest = [
|
|
|
208
208
|
},
|
|
209
209
|
{
|
|
210
210
|
"url": "collection/components/molecules/pagination/pagination.component.js",
|
|
211
|
-
"revision": "
|
|
211
|
+
"revision": "b4687ca2647dd7ad6d4ace6be2d03c74"
|
|
212
212
|
},
|
|
213
213
|
{
|
|
214
214
|
"url": "collection/index.js",
|
|
@@ -329,7 +329,7 @@ self.__precacheManifest = [
|
|
|
329
329
|
},
|
|
330
330
|
{
|
|
331
331
|
"url": "esm/loader.js",
|
|
332
|
-
"revision": "
|
|
332
|
+
"revision": "22a14f1891da932d5a2e9011a3faf8b5"
|
|
333
333
|
},
|
|
334
334
|
{
|
|
335
335
|
"url": "esm/p-avatar.entry.js",
|
|
@@ -418,6 +418,9 @@ self.__precacheManifest = [
|
|
|
418
418
|
{
|
|
419
419
|
"url": "paperless/p-31f80006.entry.js"
|
|
420
420
|
},
|
|
421
|
+
{
|
|
422
|
+
"url": "paperless/p-332028c6.entry.js"
|
|
423
|
+
},
|
|
421
424
|
{
|
|
422
425
|
"url": "paperless/p-5f0ec763.entry.js"
|
|
423
426
|
},
|
|
@@ -427,9 +430,6 @@ self.__precacheManifest = [
|
|
|
427
430
|
{
|
|
428
431
|
"url": "paperless/p-80bf9d06.entry.js"
|
|
429
432
|
},
|
|
430
|
-
{
|
|
431
|
-
"url": "paperless/p-d750cdf6.entry.js"
|
|
432
|
-
},
|
|
433
433
|
{
|
|
434
434
|
"url": "paperless/p-e80637b9.entry.js"
|
|
435
435
|
},
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
3
2
|
export declare type SetItem = {
|
|
4
3
|
type: string;
|
|
5
4
|
value?: number | Element | JSX.Element | string;
|
|
@@ -8,7 +7,7 @@ export declare class Pagination {
|
|
|
8
7
|
/**
|
|
9
8
|
* The current page
|
|
10
9
|
*/
|
|
11
|
-
|
|
10
|
+
value: number;
|
|
12
11
|
/**
|
|
13
12
|
* The amount of items per page
|
|
14
13
|
*/
|
|
@@ -17,10 +16,6 @@ export declare class Pagination {
|
|
|
17
16
|
* The total amount of items
|
|
18
17
|
*/
|
|
19
18
|
total: number;
|
|
20
|
-
/**
|
|
21
|
-
* Button click event
|
|
22
|
-
*/
|
|
23
|
-
pageChange: EventEmitter<number>;
|
|
24
19
|
private _pages;
|
|
25
20
|
private _set;
|
|
26
21
|
componentWillRender(): void;
|
|
@@ -142,10 +142,6 @@ export namespace Components {
|
|
|
142
142
|
"variant": 'inline' | 'full-width' | 'full-screen' | 'modal';
|
|
143
143
|
}
|
|
144
144
|
interface PPagination {
|
|
145
|
-
/**
|
|
146
|
-
* The current page
|
|
147
|
-
*/
|
|
148
|
-
"page": number;
|
|
149
145
|
/**
|
|
150
146
|
* The amount of items per page
|
|
151
147
|
*/
|
|
@@ -154,6 +150,10 @@ export namespace Components {
|
|
|
154
150
|
* The total amount of items
|
|
155
151
|
*/
|
|
156
152
|
"total": number;
|
|
153
|
+
/**
|
|
154
|
+
* The current page
|
|
155
|
+
*/
|
|
156
|
+
"value": number;
|
|
157
157
|
}
|
|
158
158
|
interface PPaginationItem {
|
|
159
159
|
/**
|
|
@@ -188,10 +188,6 @@ export interface PButtonCustomEvent<T> extends CustomEvent<T> {
|
|
|
188
188
|
detail: T;
|
|
189
189
|
target: HTMLPButtonElement;
|
|
190
190
|
}
|
|
191
|
-
export interface PPaginationCustomEvent<T> extends CustomEvent<T> {
|
|
192
|
-
detail: T;
|
|
193
|
-
target: HTMLPPaginationElement;
|
|
194
|
-
}
|
|
195
191
|
declare global {
|
|
196
192
|
interface HTMLPAvatarElement extends Components.PAvatar, HTMLStencilElement {
|
|
197
193
|
}
|
|
@@ -416,14 +412,6 @@ declare namespace LocalJSX {
|
|
|
416
412
|
"variant"?: 'inline' | 'full-width' | 'full-screen' | 'modal';
|
|
417
413
|
}
|
|
418
414
|
interface PPagination {
|
|
419
|
-
/**
|
|
420
|
-
* Button click event
|
|
421
|
-
*/
|
|
422
|
-
"onPageChange"?: (event: PPaginationCustomEvent<number>) => void;
|
|
423
|
-
/**
|
|
424
|
-
* The current page
|
|
425
|
-
*/
|
|
426
|
-
"page"?: number;
|
|
427
415
|
/**
|
|
428
416
|
* The amount of items per page
|
|
429
417
|
*/
|
|
@@ -432,6 +420,10 @@ declare namespace LocalJSX {
|
|
|
432
420
|
* The total amount of items
|
|
433
421
|
*/
|
|
434
422
|
"total": number;
|
|
423
|
+
/**
|
|
424
|
+
* The current page
|
|
425
|
+
*/
|
|
426
|
+
"value"?: number;
|
|
435
427
|
}
|
|
436
428
|
interface PPaginationItem {
|
|
437
429
|
/**
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as a}from"./p-229f113b.js";const o=class{constructor(a){t(this,a),this.pageChange=e(this,"pageChange",7),this.page=1,this.pageSize=12,this._pages=[],this._set=[],this._nextClick=()=>{const t=this.page+1;t>this._pages[this._pages.length-1]||this._changePage(t)},this._pageClick=t=>this._changePage(t),this._generateSet=(t=1,e=!0)=>{const a=this._pages.length;if(!a)return[];let o=this.page-t,r=this.page+t;r>a&&(r=a,o=a-2*t,o=o<1?1:o),o<=1&&(o=1,r=Math.min(2*t+1,a));const s=[],n={type:"previous",value:i("p-icon",{variant:"chevron",rotate:90})},w={type:"next",value:i("p-icon",{variant:"chevron",rotate:-90})};if(null===t){const t=this._pages.map((t=>({type:"page",value:t})));return e?[n,...t,w]:t}if(e&&s.push(n),o<=3)for(let t=1;t<o;t++)s.push({type:"page",value:this._pages[t-1]});else s.push({type:"page",value:1}),s.push({type:"ellipsis",value:"ellipsis"});for(let t=o;t<=r;t++)s.push({type:"page",value:this._pages[t-1]});if(r>=a-2)for(let t=r+1;t<=a;t++)s.push({type:"page",value:this._pages[t-1]});else s.push({type:"ellipsis"}),s.push({type:"page",value:this._pages[this._pages.length-1]});return e&&s.push(w),s}}componentWillRender(){this._generate()}render(){var t;return i(a,{class:"p-pagination"},null===(t=this._set)||void 0===t?void 0:t.map((t=>"previous"===t.type||"next"===t.type?i("p-pagination-item",{onClick:()=>"previous"===t.type?this._previousClick():this._nextClick()},t.value):"ellipsis"===t.type?i("p-pagination-item",null,"..."):i("p-pagination-item",{active:t.value===this.page,onClick:()=>this._pageClick(t.value)},t.value))))}pageChangeHandler(){console.log("Page changed!"),this._generate()}_generate(){this._pages=this._generatePages(),this._set=this._generateSet()}_changePage(t){t&&(this.pageChange.emit(t),this.page=t)}_previousClick(){const t=this.page-1;t<this._pages[0]||this._changePage(t)}_generatePages(){if(!this.total||!this.pageSize)return[];const t=Math.ceil(this.total/this.pageSize);return new Array(t).fill(void 0).map(((t,e)=>e+1))}static get watchers(){return{page:["pageChangeHandler"]}}};o.style='/*! tailwindcss v3.1.4 | MIT License | https://tailwindcss.com*/*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;border:0 solid;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.flex{display:flex!important}p-pagination{display:flex}.static{position:static!important}';export{o as p_pagination}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as a}from"./p-229f113b.js";const o=class{constructor(a){t(this,a),this.pageChange=e(this,"pageChange",7),this.page=1,this.pageSize=12,this._pages=[],this._set=[],this._nextClick=()=>{const t=this.page+1;t>this._pages[this._pages.length-1]||this._changePage(t)},this._pageClick=t=>this._changePage(t),this._generateSet=(t=1,e=!0)=>{const a=this._pages.length;if(!a)return[];let o=this.page-t,r=this.page+t;r>a&&(r=a,o=a-2*t,o=o<1?1:o),o<=1&&(o=1,r=Math.min(2*t+1,a));const s=[],n={type:"previous",value:i("p-icon",{variant:"chevron",rotate:90})},w={type:"next",value:i("p-icon",{variant:"chevron",rotate:-90})};if(null===t){const t=this._pages.map((t=>({type:"page",value:t})));return e?[n,...t,w]:t}if(e&&s.push(n),o<=3)for(let t=1;t<o;t++)s.push({type:"page",value:this._pages[t-1]});else s.push({type:"page",value:1}),s.push({type:"ellipsis",value:"ellipsis"});for(let t=o;t<=r;t++)s.push({type:"page",value:this._pages[t-1]});if(r>=a-2)for(let t=r+1;t<=a;t++)s.push({type:"page",value:this._pages[t-1]});else s.push({type:"ellipsis"}),s.push({type:"page",value:this._pages[this._pages.length-1]});return e&&s.push(w),s}}componentWillRender(){this._generate()}render(){var t;return i(a,{class:"p-pagination"},null===(t=this._set)||void 0===t?void 0:t.map((t=>"previous"===t.type||"next"===t.type?i("p-pagination-item",{onClick:()=>"previous"===t.type?this._previousClick():this._nextClick()},t.value):"ellipsis"===t.type?i("p-pagination-item",null,"..."):i("p-pagination-item",{active:t.value===this.page,onClick:()=>this._pageClick(t.value)},t.value))))}pageChangeHandler(){console.log("Page changed!"),this._generate()}_generate(){this._pages=this._generatePages(),this._set=this._generateSet()}_changePage(t){t&&(this.pageChange.emit(t),this.page=t)}_previousClick(){const t=this.page-1;t<this._pages[0]||this._changePage(t)}_generatePages(){if(!this.total||!this.pageSize)return[];const t=Math.ceil(this.total/this.pageSize);return new Array(t).fill(void 0).map(((t,e)=>e+1))}static get watchers(){return{page:["pageChangeHandler"]}}};o.style='/*! tailwindcss v3.1.4 | MIT License | https://tailwindcss.com*/*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;border:0 solid;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.flex{display:flex!important}p-pagination{display:flex}.static{position:static!important}';export{o as p_pagination}
|