@paperless/core 0.1.0-alpha.23 → 0.1.0-alpha.26

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.
@@ -34,7 +34,7 @@ export class Loader {
34
34
  h("div", { class: "loader-wrapper" }, this._loader)))));
35
35
  }
36
36
  return (h(Host, { class: `p-loader flex ${this.variant === 'full-width' &&
37
- 'w-full d-block flex justify-center text-4xl'}` }, this._loader));
37
+ 'w-full flex justify-center text-4xl'}` }, this._loader));
38
38
  }
39
39
  _checkShow() {
40
40
  var _a;
@@ -120,11 +120,16 @@ export class Pagination {
120
120
  })));
121
121
  }
122
122
  pageChangeHandler() {
123
+ console.log('pageChangeHandler called');
123
124
  this._generate();
124
125
  }
125
126
  _generate() {
127
+ var _a;
126
128
  this._pages = this._generatePages();
127
129
  this._set = this._generateSet();
130
+ if (this.page > ((_a = this._pages) === null || _a === void 0 ? void 0 : _a.length)) {
131
+ this._changePage(this._pages.length);
132
+ }
128
133
  }
129
134
  _changePage(p) {
130
135
  if (!p) {
@@ -36,7 +36,7 @@ const Loader = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
36
36
  return (h(Host, { class: "p-loader variant-full-screen" }, h("div", { class: "loading-screen" }, h("div", { class: "content" }, h("slot", null), h("div", { class: "loader-wrapper" }, this._loader)))));
37
37
  }
38
38
  return (h(Host, { class: `p-loader flex ${this.variant === 'full-width' &&
39
- 'w-full d-block flex justify-center text-4xl'}` }, this._loader));
39
+ 'w-full flex justify-center text-4xl'}` }, this._loader));
40
40
  }
41
41
  _checkShow() {
42
42
  var _a;
@@ -128,11 +128,16 @@ const Pagination = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
128
128
  })));
129
129
  }
130
130
  pageChangeHandler() {
131
+ console.log('pageChangeHandler called');
131
132
  this._generate();
132
133
  }
133
134
  _generate() {
135
+ var _a;
134
136
  this._pages = this._generatePages();
135
137
  this._set = this._generateSet();
138
+ if (this.page > ((_a = this._pages) === null || _a === void 0 ? void 0 : _a.length)) {
139
+ this._changePage(this._pages.length);
140
+ }
136
141
  }
137
142
  _changePage(p) {
138
143
  if (!p) {
@@ -880,7 +880,7 @@ const Loader = class {
880
880
  return (h(Host, { class: "p-loader variant-full-screen" }, h("div", { class: "loading-screen" }, h("div", { class: "content" }, h("slot", null), h("div", { class: "loader-wrapper" }, this._loader)))));
881
881
  }
882
882
  return (h(Host, { class: `p-loader flex ${this.variant === 'full-width' &&
883
- 'w-full d-block flex justify-center text-4xl'}` }, this._loader));
883
+ 'w-full flex justify-center text-4xl'}` }, this._loader));
884
884
  }
885
885
  _checkShow() {
886
886
  var _a;
@@ -125,11 +125,16 @@ const Pagination = class {
125
125
  })));
126
126
  }
127
127
  pageChangeHandler() {
128
+ console.log('pageChangeHandler called');
128
129
  this._generate();
129
130
  }
130
131
  _generate() {
132
+ var _a;
131
133
  this._pages = this._generatePages();
132
134
  this._set = this._generateSet();
135
+ if (this.page > ((_a = this._pages) === null || _a === void 0 ? void 0 : _a.length)) {
136
+ this._changePage(this._pages.length);
137
+ }
133
138
  }
134
139
  _changePage(p) {
135
140
  if (!p) {
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-12T15:41:21">
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-12T16:40:46">
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,c as e,h as i,H as a}from"./p-76464e0b.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})},l={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,l]: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(l),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("pageChangeHandler called"),this._generate()}_generate(){var t;this._pages=this._generatePages(),this._set=this._generateSet(),this.page>(null===(t=this._pages)||void 0===t?void 0:t.length)&&this._changePage(this._pages.length)}_changePage(t){t&&(this.page=t,this.pageChange.emit(this.page))}_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"],pageSize:["pageChangeHandler"],total:["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}