@maggioli-design-system/mds-paginator 2.1.0 → 2.1.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.
Files changed (35) hide show
  1. package/dist/cjs/{index-7709e21a.js → index-0a1b6680.js} +56 -1
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/mds-paginator.cjs.entry.js +5 -3
  4. package/dist/cjs/mds-paginator.cjs.js +2 -2
  5. package/dist/collection/collection-manifest.json +1 -1
  6. package/dist/collection/components/mds-paginator/mds-paginator.js +4 -2
  7. package/dist/components/mds-paginator.js +4 -2
  8. package/dist/esm/{index-e7fdb228.js → index-af99740b.js} +56 -1
  9. package/dist/esm/loader.js +3 -3
  10. package/dist/esm/mds-paginator.entry.js +5 -3
  11. package/dist/esm/mds-paginator.js +3 -3
  12. package/dist/esm-es5/{index-e7fdb228.js → index-af99740b.js} +0 -0
  13. package/dist/esm-es5/loader.js +1 -1
  14. package/dist/esm-es5/mds-paginator.entry.js +1 -1
  15. package/dist/esm-es5/mds-paginator.js +1 -1
  16. package/dist/mds-paginator/mds-paginator.esm.js +1 -1
  17. package/dist/mds-paginator/mds-paginator.js +1 -1
  18. package/dist/mds-paginator/p-3c5c184f.entry.js +1 -0
  19. package/dist/mds-paginator/{p-92658324.system.entry.js → p-4984613d.system.entry.js} +1 -1
  20. package/dist/mds-paginator/{p-3ddaee00.system.js → p-a53254ac.system.js} +0 -0
  21. package/dist/mds-paginator/{p-561f638e.js → p-bc44a1b3.js} +0 -0
  22. package/dist/mds-paginator/{p-d01c6201.system.js → p-d375dd5d.system.js} +1 -1
  23. package/dist/stats.json +29 -29
  24. package/dist/types/stencil-public-runtime.d.ts +11 -0
  25. package/package.json +3 -3
  26. package/src/components/mds-paginator/mds-paginator.tsx +4 -2
  27. package/www/build/mds-paginator.esm.js +1 -1
  28. package/www/build/mds-paginator.js +1 -1
  29. package/www/build/p-3c5c184f.entry.js +1 -0
  30. package/www/build/{p-92658324.system.entry.js → p-4984613d.system.entry.js} +1 -1
  31. package/www/build/{p-3ddaee00.system.js → p-a53254ac.system.js} +0 -0
  32. package/www/build/{p-561f638e.js → p-bc44a1b3.js} +0 -0
  33. package/www/build/{p-d01c6201.system.js → p-d375dd5d.system.js} +1 -1
  34. package/dist/mds-paginator/p-b90dd4e2.entry.js +0 -1
  35. package/www/build/p-b90dd4e2.entry.js +0 -1
@@ -141,6 +141,14 @@ const h = (nodeName, vnodeData, ...children) => {
141
141
  }
142
142
  return vnode;
143
143
  };
144
+ /**
145
+ * A utility function for creating a virtual DOM node from a tag and some
146
+ * possible text content.
147
+ *
148
+ * @param tag the tag for this element
149
+ * @param text possible text content for the node
150
+ * @returns a newly-minted virtual DOM node
151
+ */
144
152
  const newVNode = (tag, text) => {
145
153
  const vnode = {
146
154
  $flags$: 0,
@@ -158,6 +166,12 @@ const newVNode = (tag, text) => {
158
166
  return vnode;
159
167
  };
160
168
  const Host = {};
169
+ /**
170
+ * Check whether a given node is a Host node or not
171
+ *
172
+ * @param node the virtual DOM node to check
173
+ * @returns whether it's a Host node or not
174
+ */
161
175
  const isHost = (node) => node && node.$tag$ === Host;
162
176
  /**
163
177
  * Parse a new property value for a given property type.
@@ -465,6 +479,21 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
465
479
  }
466
480
  return elm;
467
481
  };
482
+ /**
483
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
484
+ * add them to the DOM in the appropriate place.
485
+ *
486
+ * @param parentElm the DOM node which should be used as a parent for the new
487
+ * DOM nodes
488
+ * @param before a child of the `parentElm` which the new children should be
489
+ * inserted before (optional)
490
+ * @param parentVNode the parent virtual DOM node
491
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
492
+ * @param startIdx the index in the child virtual DOM nodes at which to start
493
+ * creating DOM nodes (inclusive)
494
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
495
+ * creating DOM nodes (inclusive)
496
+ */
468
497
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
469
498
  let containerElm = (parentElm);
470
499
  let childNode;
@@ -481,6 +510,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
481
510
  }
482
511
  }
483
512
  };
513
+ /**
514
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
515
+ * This can be used to, for instance, clean up after a list of children which
516
+ * should no longer be shown.
517
+ *
518
+ * This function also handles some of Stencil's slot relocation logic.
519
+ *
520
+ * @param vnodes a list of virtual DOM nodes to remove
521
+ * @param startIdx the index at which to start removing nodes (inclusive)
522
+ * @param endIdx the index at which to stop removing nodes (inclusive)
523
+ * @param vnode a VNode
524
+ * @param elm an element
525
+ */
484
526
  const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
485
527
  for (; startIdx <= endIdx; ++startIdx) {
486
528
  if ((vnode = vnodes[startIdx])) {
@@ -709,7 +751,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
709
751
  *
710
752
  * So, in other words, if `key` attrs are not set on VNodes which may be
711
753
  * changing order within a `children` array or something along those lines then
712
- * we could obtain a false positive and then have to do needless re-rendering.
754
+ * we could obtain a false negative and then have to do needless re-rendering
755
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
713
756
  *
714
757
  * @param leftVNode the first VNode to check
715
758
  * @param rightVNode the second VNode to check
@@ -773,6 +816,18 @@ const patch = (oldVNode, newVNode) => {
773
816
  elm.data = text;
774
817
  }
775
818
  };
819
+ /**
820
+ * The main entry point for Stencil's virtual DOM-based rendering engine
821
+ *
822
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
823
+ * function will handle creating a virtual DOM tree with a single root, patching
824
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
825
+ * relocation, and reflecting attributes.
826
+ *
827
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
828
+ * the DOM node into which it should be rendered.
829
+ * @param renderFnResults the virtual DOM nodes to be rendered
830
+ */
776
831
  const renderVdom = (hostRef, renderFnResults) => {
777
832
  const hostElm = hostRef.$hostElement$;
778
833
  const cmpMeta = hostRef.$cmpMeta$;
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-7709e21a.js');
5
+ const index = require('./index-0a1b6680.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Esm v2.22.1 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Esm v2.22.2 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchEsm = () => {
11
11
  return index.promiseResolve();
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-7709e21a.js');
5
+ const index = require('./index-0a1b6680.js');
6
6
 
7
7
  const mdsPaginatorCss = ".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-paginator-background:rgb(var(--tone-neutral-09));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25rem}.pages{margin-left:0.5rem;margin-right:0.5rem;display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-align:center;align-items:center;overflow:auto;scroll-behavior:smooth;border-radius:9999px;padding:0.5rem;background-color:var(--mds-paginator-background);gap:2px;}:host() .pages{-ms-overflow-style:none;scrollbar-width:none}.pages::-webkit-scrollbar{display:none}";
8
8
 
@@ -31,7 +31,9 @@ const MdsPaginator = class {
31
31
  return;
32
32
  }
33
33
  this.currentPage = selectedPage;
34
- this.scrollPage();
34
+ if (this.pages > 2) {
35
+ this.scrollPage();
36
+ }
35
37
  this.pageChangedEvent.emit(this.currentPage);
36
38
  };
37
39
  this.pages = 0;
@@ -44,7 +46,7 @@ const MdsPaginator = class {
44
46
  }
45
47
  render() {
46
48
  return (index.h(index.Host, null, index.h("mds-paginator-item", { icon: "mi/baseline/arrow-back", disabled: this.currentPage === 1, onClick: () => this.goToPage(this.currentPage - 1) }), this.pages > 0 && index.h("mds-paginator-item", { active: this.currentPage === 1, onClick: () => this.goToPage(1) }, "1"), this.pages > 2 &&
47
- index.h("div", { class: "pages" }, Array.from(Array(this.pages - 2).keys()).map(i => index.h("mds-paginator-item", { key: i, active: this.currentPage === i + 2, onClick: () => this.goToPage(i + 2) }, i + 2))), this.pages && index.h("mds-paginator-item", { active: this.currentPage === this.pages, onClick: () => this.goToPage(this.pages) }, this.pages), index.h("mds-paginator-item", { icon: "mi/baseline/arrow-forward", disabled: this.currentPage === this.pages, onClick: () => this.goToPage(this.currentPage + 1) })));
49
+ index.h("div", { class: "pages" }, Array.from(Array(this.pages - 2).keys()).map(i => index.h("mds-paginator-item", { key: i, active: this.currentPage === i + 2, onClick: () => this.goToPage(i + 2) }, i + 2))), this.pages > 1 && index.h("mds-paginator-item", { active: this.currentPage === this.pages, onClick: () => this.goToPage(this.pages) }, this.pages), index.h("mds-paginator-item", { icon: "mi/baseline/arrow-forward", disabled: this.currentPage === this.pages, onClick: () => this.goToPage(this.currentPage + 1) })));
48
50
  }
49
51
  get element() { return index.getElement(this); }
50
52
  };
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-7709e21a.js');
5
+ const index = require('./index-0a1b6680.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Browser v2.22.1 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v2.22.2 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchBrowser = () => {
11
11
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-paginator.cjs.js', document.baseURI).href));
@@ -4,7 +4,7 @@
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "2.22.1",
7
+ "version": "2.22.2",
8
8
  "typescriptVersion": "4.9.4"
9
9
  },
10
10
  "collections": [],
@@ -22,7 +22,9 @@ export class MdsPaginator {
22
22
  return;
23
23
  }
24
24
  this.currentPage = selectedPage;
25
- this.scrollPage();
25
+ if (this.pages > 2) {
26
+ this.scrollPage();
27
+ }
26
28
  this.pageChangedEvent.emit(this.currentPage);
27
29
  };
28
30
  this.pages = 0;
@@ -35,7 +37,7 @@ export class MdsPaginator {
35
37
  }
36
38
  render() {
37
39
  return (h(Host, null, h("mds-paginator-item", { icon: "mi/baseline/arrow-back", disabled: this.currentPage === 1, onClick: () => this.goToPage(this.currentPage - 1) }), this.pages > 0 && h("mds-paginator-item", { active: this.currentPage === 1, onClick: () => this.goToPage(1) }, "1"), this.pages > 2 &&
38
- h("div", { class: "pages" }, Array.from(Array(this.pages - 2).keys()).map(i => h("mds-paginator-item", { key: i, active: this.currentPage === i + 2, onClick: () => this.goToPage(i + 2) }, i + 2))), this.pages && h("mds-paginator-item", { active: this.currentPage === this.pages, onClick: () => this.goToPage(this.pages) }, this.pages), h("mds-paginator-item", { icon: "mi/baseline/arrow-forward", disabled: this.currentPage === this.pages, onClick: () => this.goToPage(this.currentPage + 1) })));
40
+ h("div", { class: "pages" }, Array.from(Array(this.pages - 2).keys()).map(i => h("mds-paginator-item", { key: i, active: this.currentPage === i + 2, onClick: () => this.goToPage(i + 2) }, i + 2))), this.pages > 1 && h("mds-paginator-item", { active: this.currentPage === this.pages, onClick: () => this.goToPage(this.pages) }, this.pages), h("mds-paginator-item", { icon: "mi/baseline/arrow-forward", disabled: this.currentPage === this.pages, onClick: () => this.goToPage(this.currentPage + 1) })));
39
41
  }
40
42
  static get is() { return "mds-paginator"; }
41
43
  static get encapsulation() { return "shadow"; }
@@ -29,7 +29,9 @@ const MdsPaginator$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
29
29
  return;
30
30
  }
31
31
  this.currentPage = selectedPage;
32
- this.scrollPage();
32
+ if (this.pages > 2) {
33
+ this.scrollPage();
34
+ }
33
35
  this.pageChangedEvent.emit(this.currentPage);
34
36
  };
35
37
  this.pages = 0;
@@ -42,7 +44,7 @@ const MdsPaginator$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
42
44
  }
43
45
  render() {
44
46
  return (h(Host, null, h("mds-paginator-item", { icon: "mi/baseline/arrow-back", disabled: this.currentPage === 1, onClick: () => this.goToPage(this.currentPage - 1) }), this.pages > 0 && h("mds-paginator-item", { active: this.currentPage === 1, onClick: () => this.goToPage(1) }, "1"), this.pages > 2 &&
45
- h("div", { class: "pages" }, Array.from(Array(this.pages - 2).keys()).map(i => h("mds-paginator-item", { key: i, active: this.currentPage === i + 2, onClick: () => this.goToPage(i + 2) }, i + 2))), this.pages && h("mds-paginator-item", { active: this.currentPage === this.pages, onClick: () => this.goToPage(this.pages) }, this.pages), h("mds-paginator-item", { icon: "mi/baseline/arrow-forward", disabled: this.currentPage === this.pages, onClick: () => this.goToPage(this.currentPage + 1) })));
47
+ h("div", { class: "pages" }, Array.from(Array(this.pages - 2).keys()).map(i => h("mds-paginator-item", { key: i, active: this.currentPage === i + 2, onClick: () => this.goToPage(i + 2) }, i + 2))), this.pages > 1 && h("mds-paginator-item", { active: this.currentPage === this.pages, onClick: () => this.goToPage(this.pages) }, this.pages), h("mds-paginator-item", { icon: "mi/baseline/arrow-forward", disabled: this.currentPage === this.pages, onClick: () => this.goToPage(this.currentPage + 1) })));
46
48
  }
47
49
  get element() { return this; }
48
50
  static get style() { return mdsPaginatorCss; }
@@ -119,6 +119,14 @@ const h = (nodeName, vnodeData, ...children) => {
119
119
  }
120
120
  return vnode;
121
121
  };
122
+ /**
123
+ * A utility function for creating a virtual DOM node from a tag and some
124
+ * possible text content.
125
+ *
126
+ * @param tag the tag for this element
127
+ * @param text possible text content for the node
128
+ * @returns a newly-minted virtual DOM node
129
+ */
122
130
  const newVNode = (tag, text) => {
123
131
  const vnode = {
124
132
  $flags$: 0,
@@ -136,6 +144,12 @@ const newVNode = (tag, text) => {
136
144
  return vnode;
137
145
  };
138
146
  const Host = {};
147
+ /**
148
+ * Check whether a given node is a Host node or not
149
+ *
150
+ * @param node the virtual DOM node to check
151
+ * @returns whether it's a Host node or not
152
+ */
139
153
  const isHost = (node) => node && node.$tag$ === Host;
140
154
  /**
141
155
  * Parse a new property value for a given property type.
@@ -443,6 +457,21 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
443
457
  }
444
458
  return elm;
445
459
  };
460
+ /**
461
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
462
+ * add them to the DOM in the appropriate place.
463
+ *
464
+ * @param parentElm the DOM node which should be used as a parent for the new
465
+ * DOM nodes
466
+ * @param before a child of the `parentElm` which the new children should be
467
+ * inserted before (optional)
468
+ * @param parentVNode the parent virtual DOM node
469
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
470
+ * @param startIdx the index in the child virtual DOM nodes at which to start
471
+ * creating DOM nodes (inclusive)
472
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
473
+ * creating DOM nodes (inclusive)
474
+ */
446
475
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
447
476
  let containerElm = (parentElm);
448
477
  let childNode;
@@ -459,6 +488,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
459
488
  }
460
489
  }
461
490
  };
491
+ /**
492
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
493
+ * This can be used to, for instance, clean up after a list of children which
494
+ * should no longer be shown.
495
+ *
496
+ * This function also handles some of Stencil's slot relocation logic.
497
+ *
498
+ * @param vnodes a list of virtual DOM nodes to remove
499
+ * @param startIdx the index at which to start removing nodes (inclusive)
500
+ * @param endIdx the index at which to stop removing nodes (inclusive)
501
+ * @param vnode a VNode
502
+ * @param elm an element
503
+ */
462
504
  const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
463
505
  for (; startIdx <= endIdx; ++startIdx) {
464
506
  if ((vnode = vnodes[startIdx])) {
@@ -687,7 +729,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
687
729
  *
688
730
  * So, in other words, if `key` attrs are not set on VNodes which may be
689
731
  * changing order within a `children` array or something along those lines then
690
- * we could obtain a false positive and then have to do needless re-rendering.
732
+ * we could obtain a false negative and then have to do needless re-rendering
733
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
691
734
  *
692
735
  * @param leftVNode the first VNode to check
693
736
  * @param rightVNode the second VNode to check
@@ -751,6 +794,18 @@ const patch = (oldVNode, newVNode) => {
751
794
  elm.data = text;
752
795
  }
753
796
  };
797
+ /**
798
+ * The main entry point for Stencil's virtual DOM-based rendering engine
799
+ *
800
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
801
+ * function will handle creating a virtual DOM tree with a single root, patching
802
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
803
+ * relocation, and reflecting attributes.
804
+ *
805
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
806
+ * the DOM node into which it should be rendered.
807
+ * @param renderFnResults the virtual DOM nodes to be rendered
808
+ */
754
809
  const renderVdom = (hostRef, renderFnResults) => {
755
810
  const hostElm = hostRef.$hostElement$;
756
811
  const cmpMeta = hostRef.$cmpMeta$;
@@ -1,8 +1,8 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-e7fdb228.js';
2
- export { s as setNonce } from './index-e7fdb228.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-af99740b.js';
2
+ export { s as setNonce } from './index-af99740b.js';
3
3
 
4
4
  /*
5
- Stencil Client Patch Esm v2.22.1 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Patch Esm v2.22.2 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  const patchEsm = () => {
8
8
  return promiseResolve();
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-e7fdb228.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-af99740b.js';
2
2
 
3
3
  const mdsPaginatorCss = ".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-paginator-background:rgb(var(--tone-neutral-09));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25rem}.pages{margin-left:0.5rem;margin-right:0.5rem;display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-align:center;align-items:center;overflow:auto;scroll-behavior:smooth;border-radius:9999px;padding:0.5rem;background-color:var(--mds-paginator-background);gap:2px;}:host() .pages{-ms-overflow-style:none;scrollbar-width:none}.pages::-webkit-scrollbar{display:none}";
4
4
 
@@ -27,7 +27,9 @@ const MdsPaginator = class {
27
27
  return;
28
28
  }
29
29
  this.currentPage = selectedPage;
30
- this.scrollPage();
30
+ if (this.pages > 2) {
31
+ this.scrollPage();
32
+ }
31
33
  this.pageChangedEvent.emit(this.currentPage);
32
34
  };
33
35
  this.pages = 0;
@@ -40,7 +42,7 @@ const MdsPaginator = class {
40
42
  }
41
43
  render() {
42
44
  return (h(Host, null, h("mds-paginator-item", { icon: "mi/baseline/arrow-back", disabled: this.currentPage === 1, onClick: () => this.goToPage(this.currentPage - 1) }), this.pages > 0 && h("mds-paginator-item", { active: this.currentPage === 1, onClick: () => this.goToPage(1) }, "1"), this.pages > 2 &&
43
- h("div", { class: "pages" }, Array.from(Array(this.pages - 2).keys()).map(i => h("mds-paginator-item", { key: i, active: this.currentPage === i + 2, onClick: () => this.goToPage(i + 2) }, i + 2))), this.pages && h("mds-paginator-item", { active: this.currentPage === this.pages, onClick: () => this.goToPage(this.pages) }, this.pages), h("mds-paginator-item", { icon: "mi/baseline/arrow-forward", disabled: this.currentPage === this.pages, onClick: () => this.goToPage(this.currentPage + 1) })));
45
+ h("div", { class: "pages" }, Array.from(Array(this.pages - 2).keys()).map(i => h("mds-paginator-item", { key: i, active: this.currentPage === i + 2, onClick: () => this.goToPage(i + 2) }, i + 2))), this.pages > 1 && h("mds-paginator-item", { active: this.currentPage === this.pages, onClick: () => this.goToPage(this.pages) }, this.pages), h("mds-paginator-item", { icon: "mi/baseline/arrow-forward", disabled: this.currentPage === this.pages, onClick: () => this.goToPage(this.currentPage + 1) })));
44
46
  }
45
47
  get element() { return getElement(this); }
46
48
  };
@@ -1,8 +1,8 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-e7fdb228.js';
2
- export { s as setNonce } from './index-e7fdb228.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-af99740b.js';
2
+ export { s as setNonce } from './index-af99740b.js';
3
3
 
4
4
  /*
5
- Stencil Client Patch Browser v2.22.1 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Patch Browser v2.22.2 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  const patchBrowser = () => {
8
8
  const importMeta = import.meta.url;
@@ -1 +1 @@
1
- import{p as promiseResolve,b as bootstrapLazy}from"./index-e7fdb228.js";export{s as setNonce}from"./index-e7fdb228.js";var patchEsm=function(){return promiseResolve()};var defineCustomElements=function(e,r){if(typeof window==="undefined")return Promise.resolve();return patchEsm().then((function(){return bootstrapLazy([["mds-paginator",[[1,"mds-paginator",{pages:[2],currentPage:[1538,"current-page"]}]]]],r)}))};export{defineCustomElements};
1
+ import{p as promiseResolve,b as bootstrapLazy}from"./index-af99740b.js";export{s as setNonce}from"./index-af99740b.js";var patchEsm=function(){return promiseResolve()};var defineCustomElements=function(e,r){if(typeof window==="undefined")return Promise.resolve();return patchEsm().then((function(){return bootstrapLazy([["mds-paginator",[[1,"mds-paginator",{pages:[2],currentPage:[1538,"current-page"]}]]]],r)}))};export{defineCustomElements};
@@ -1 +1 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-e7fdb228.js";var mdsPaginatorCss=".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-paginator-background:rgb(var(--tone-neutral-09));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25rem}.pages{margin-left:0.5rem;margin-right:0.5rem;display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-align:center;align-items:center;overflow:auto;scroll-behavior:smooth;border-radius:9999px;padding:0.5rem;background-color:var(--mds-paginator-background);gap:2px;}:host() .pages{-ms-overflow-style:none;scrollbar-width:none}.pages::-webkit-scrollbar{display:none}";var MdsPaginator=function(){function e(e){var t=this;registerInstance(this,e);this.pageChangedEvent=createEvent(this,"pageChangedEvent",7);this.scrollPage=function(){var e=t.currentPage-2;var r=t.element.shadowRoot.querySelector(".pages");var a=r.querySelectorAll("mds-paginator-item");if(e<0){r.scrollLeft=0;return}if(e>a.length-1){var o=a[a.length-1];r.scrollLeft=o.offsetLeft-r.offsetLeft;return}var n=a[e];r.scrollLeft=n.offsetLeft-r.offsetLeft-r.offsetWidth/2+n.offsetWidth/2};this.goToPage=function(e){if(e<1||e>t.pages){return}t.currentPage=e;t.scrollPage();t.pageChangedEvent.emit(t.currentPage)};this.pages=0;this.currentPage=1}e.prototype.componentDidLoad=function(){var e=this;setTimeout((function(){e.goToPage(e.currentPage)}),10)};e.prototype.render=function(){var e=this;return h(Host,null,h("mds-paginator-item",{icon:"mi/baseline/arrow-back",disabled:this.currentPage===1,onClick:function(){return e.goToPage(e.currentPage-1)}}),this.pages>0&&h("mds-paginator-item",{active:this.currentPage===1,onClick:function(){return e.goToPage(1)}},"1"),this.pages>2&&h("div",{class:"pages"},Array.from(Array(this.pages-2).keys()).map((function(t){return h("mds-paginator-item",{key:t,active:e.currentPage===t+2,onClick:function(){return e.goToPage(t+2)}},t+2)}))),this.pages&&h("mds-paginator-item",{active:this.currentPage===this.pages,onClick:function(){return e.goToPage(e.pages)}},this.pages),h("mds-paginator-item",{icon:"mi/baseline/arrow-forward",disabled:this.currentPage===this.pages,onClick:function(){return e.goToPage(e.currentPage+1)}}))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();MdsPaginator.style=mdsPaginatorCss;export{MdsPaginator as mds_paginator};
1
+ import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-af99740b.js";var mdsPaginatorCss=".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-paginator-background:rgb(var(--tone-neutral-09));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25rem}.pages{margin-left:0.5rem;margin-right:0.5rem;display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-align:center;align-items:center;overflow:auto;scroll-behavior:smooth;border-radius:9999px;padding:0.5rem;background-color:var(--mds-paginator-background);gap:2px;}:host() .pages{-ms-overflow-style:none;scrollbar-width:none}.pages::-webkit-scrollbar{display:none}";var MdsPaginator=function(){function e(e){var t=this;registerInstance(this,e);this.pageChangedEvent=createEvent(this,"pageChangedEvent",7);this.scrollPage=function(){var e=t.currentPage-2;var r=t.element.shadowRoot.querySelector(".pages");var a=r.querySelectorAll("mds-paginator-item");if(e<0){r.scrollLeft=0;return}if(e>a.length-1){var o=a[a.length-1];r.scrollLeft=o.offsetLeft-r.offsetLeft;return}var n=a[e];r.scrollLeft=n.offsetLeft-r.offsetLeft-r.offsetWidth/2+n.offsetWidth/2};this.goToPage=function(e){if(e<1||e>t.pages){return}t.currentPage=e;if(t.pages>2){t.scrollPage()}t.pageChangedEvent.emit(t.currentPage)};this.pages=0;this.currentPage=1}e.prototype.componentDidLoad=function(){var e=this;setTimeout((function(){e.goToPage(e.currentPage)}),10)};e.prototype.render=function(){var e=this;return h(Host,null,h("mds-paginator-item",{icon:"mi/baseline/arrow-back",disabled:this.currentPage===1,onClick:function(){return e.goToPage(e.currentPage-1)}}),this.pages>0&&h("mds-paginator-item",{active:this.currentPage===1,onClick:function(){return e.goToPage(1)}},"1"),this.pages>2&&h("div",{class:"pages"},Array.from(Array(this.pages-2).keys()).map((function(t){return h("mds-paginator-item",{key:t,active:e.currentPage===t+2,onClick:function(){return e.goToPage(t+2)}},t+2)}))),this.pages>1&&h("mds-paginator-item",{active:this.currentPage===this.pages,onClick:function(){return e.goToPage(e.pages)}},this.pages),h("mds-paginator-item",{icon:"mi/baseline/arrow-forward",disabled:this.currentPage===this.pages,onClick:function(){return e.goToPage(e.currentPage+1)}}))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();MdsPaginator.style=mdsPaginatorCss;export{MdsPaginator as mds_paginator};
@@ -1 +1 @@
1
- import{p as promiseResolve,b as bootstrapLazy}from"./index-e7fdb228.js";export{s as setNonce}from"./index-e7fdb228.js";var patchBrowser=function(){var r=import.meta.url;var e={};if(r!==""){e.resourcesUrl=new URL(".",r).href}return promiseResolve(e)};patchBrowser().then((function(r){return bootstrapLazy([["mds-paginator",[[1,"mds-paginator",{pages:[2],currentPage:[1538,"current-page"]}]]]],r)}));
1
+ import{p as promiseResolve,b as bootstrapLazy}from"./index-af99740b.js";export{s as setNonce}from"./index-af99740b.js";var patchBrowser=function(){var r=import.meta.url;var e={};if(r!==""){e.resourcesUrl=new URL(".",r).href}return promiseResolve(e)};patchBrowser().then((function(r){return bootstrapLazy([["mds-paginator",[[1,"mds-paginator",{pages:[2],currentPage:[1538,"current-page"]}]]]],r)}));
@@ -1 +1 @@
1
- import{p as e,b as r}from"./p-561f638e.js";export{s as setNonce}from"./p-561f638e.js";(()=>{const r=import.meta.url,p={};return""!==r&&(p.resourcesUrl=new URL(".",r).href),e(p)})().then((e=>r([["p-b90dd4e2",[[1,"mds-paginator",{pages:[2],currentPage:[1538,"current-page"]}]]]],e)));
1
+ import{p as r,b as a}from"./p-bc44a1b3.js";export{s as setNonce}from"./p-bc44a1b3.js";(()=>{const a=import.meta.url,e={};return""!==a&&(e.resourcesUrl=new URL(".",a).href),r(e)})().then((r=>a([["p-3c5c184f",[[1,"mds-paginator",{pages:[2],currentPage:[1538,"current-page"]}]]]],r)));
@@ -115,7 +115,7 @@ DOMTokenList
115
115
  var resourcesUrl = scriptElm ? scriptElm.getAttribute('data-resources-url') || scriptElm.src : '';
116
116
  var start = function() {
117
117
  // if src is not present then origin is "null", and new URL() throws TypeError: Failed to construct 'URL': Invalid base URL
118
- var url = new URL('./p-d01c6201.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
118
+ var url = new URL('./p-d375dd5d.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
119
119
  System.import(url.href);
120
120
  };
121
121
 
@@ -0,0 +1 @@
1
+ import{r as s,c as i,h as t,H as a,g as o}from"./p-bc44a1b3.js";const r=class{constructor(t){s(this,t),this.pageChangedEvent=i(this,"pageChangedEvent",7),this.scrollPage=()=>{const s=this.currentPage-2,i=this.element.shadowRoot.querySelector(".pages"),t=i.querySelectorAll("mds-paginator-item");if(s<0)return void(i.scrollLeft=0);if(s>t.length-1)return void(i.scrollLeft=t[t.length-1].offsetLeft-i.offsetLeft);const a=t[s];i.scrollLeft=a.offsetLeft-i.offsetLeft-i.offsetWidth/2+a.offsetWidth/2},this.goToPage=s=>{s<1||s>this.pages||(this.currentPage=s,this.pages>2&&this.scrollPage(),this.pageChangedEvent.emit(this.currentPage))},this.pages=0,this.currentPage=1}componentDidLoad(){setTimeout((()=>{this.goToPage(this.currentPage)}),10)}render(){return t(a,null,t("mds-paginator-item",{icon:"mi/baseline/arrow-back",disabled:1===this.currentPage,onClick:()=>this.goToPage(this.currentPage-1)}),this.pages>0&&t("mds-paginator-item",{active:1===this.currentPage,onClick:()=>this.goToPage(1)},"1"),this.pages>2&&t("div",{class:"pages"},Array.from(Array(this.pages-2).keys()).map((s=>t("mds-paginator-item",{key:s,active:this.currentPage===s+2,onClick:()=>this.goToPage(s+2)},s+2)))),this.pages>1&&t("mds-paginator-item",{active:this.currentPage===this.pages,onClick:()=>this.goToPage(this.pages)},this.pages),t("mds-paginator-item",{icon:"mi/baseline/arrow-forward",disabled:this.currentPage===this.pages,onClick:()=>this.goToPage(this.currentPage+1)}))}get element(){return o(this)}};r.style=".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-paginator-background:rgb(var(--tone-neutral-09));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25rem}.pages{margin-left:0.5rem;margin-right:0.5rem;display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-align:center;align-items:center;overflow:auto;scroll-behavior:smooth;border-radius:9999px;padding:0.5rem;background-color:var(--mds-paginator-background);gap:2px;}:host() .pages{-ms-overflow-style:none;scrollbar-width:none}.pages::-webkit-scrollbar{display:none}";export{r as mds_paginator}
@@ -1 +1 @@
1
- System.register(["./p-3ddaee00.system.js"],(function(e){"use strict";var t,r,a,o,n;return{setters:[function(e){t=e.r;r=e.c;a=e.h;o=e.H;n=e.g}],execute:function(){var s=".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-paginator-background:rgb(var(--tone-neutral-09));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25rem}.pages{margin-left:0.5rem;margin-right:0.5rem;display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-align:center;align-items:center;overflow:auto;scroll-behavior:smooth;border-radius:9999px;padding:0.5rem;background-color:var(--mds-paginator-background);gap:2px;}:host() .pages{-ms-overflow-style:none;scrollbar-width:none}.pages::-webkit-scrollbar{display:none}";var i=e("mds_paginator",function(){function e(e){var a=this;t(this,e);this.pageChangedEvent=r(this,"pageChangedEvent",7);this.scrollPage=function(){var e=a.currentPage-2;var t=a.element.shadowRoot.querySelector(".pages");var r=t.querySelectorAll("mds-paginator-item");if(e<0){t.scrollLeft=0;return}if(e>r.length-1){var o=r[r.length-1];t.scrollLeft=o.offsetLeft-t.offsetLeft;return}var n=r[e];t.scrollLeft=n.offsetLeft-t.offsetLeft-t.offsetWidth/2+n.offsetWidth/2};this.goToPage=function(e){if(e<1||e>a.pages){return}a.currentPage=e;a.scrollPage();a.pageChangedEvent.emit(a.currentPage)};this.pages=0;this.currentPage=1}e.prototype.componentDidLoad=function(){var e=this;setTimeout((function(){e.goToPage(e.currentPage)}),10)};e.prototype.render=function(){var e=this;return a(o,null,a("mds-paginator-item",{icon:"mi/baseline/arrow-back",disabled:this.currentPage===1,onClick:function(){return e.goToPage(e.currentPage-1)}}),this.pages>0&&a("mds-paginator-item",{active:this.currentPage===1,onClick:function(){return e.goToPage(1)}},"1"),this.pages>2&&a("div",{class:"pages"},Array.from(Array(this.pages-2).keys()).map((function(t){return a("mds-paginator-item",{key:t,active:e.currentPage===t+2,onClick:function(){return e.goToPage(t+2)}},t+2)}))),this.pages&&a("mds-paginator-item",{active:this.currentPage===this.pages,onClick:function(){return e.goToPage(e.pages)}},this.pages),a("mds-paginator-item",{icon:"mi/baseline/arrow-forward",disabled:this.currentPage===this.pages,onClick:function(){return e.goToPage(e.currentPage+1)}}))};Object.defineProperty(e.prototype,"element",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());i.style=s}}}));
1
+ System.register(["./p-a53254ac.system.js"],(function(e){"use strict";var t,r,a,o,n;return{setters:[function(e){t=e.r;r=e.c;a=e.h;o=e.H;n=e.g}],execute:function(){var s=".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-paginator-background:rgb(var(--tone-neutral-09));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25rem}.pages{margin-left:0.5rem;margin-right:0.5rem;display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-align:center;align-items:center;overflow:auto;scroll-behavior:smooth;border-radius:9999px;padding:0.5rem;background-color:var(--mds-paginator-background);gap:2px;}:host() .pages{-ms-overflow-style:none;scrollbar-width:none}.pages::-webkit-scrollbar{display:none}";var i=e("mds_paginator",function(){function e(e){var a=this;t(this,e);this.pageChangedEvent=r(this,"pageChangedEvent",7);this.scrollPage=function(){var e=a.currentPage-2;var t=a.element.shadowRoot.querySelector(".pages");var r=t.querySelectorAll("mds-paginator-item");if(e<0){t.scrollLeft=0;return}if(e>r.length-1){var o=r[r.length-1];t.scrollLeft=o.offsetLeft-t.offsetLeft;return}var n=r[e];t.scrollLeft=n.offsetLeft-t.offsetLeft-t.offsetWidth/2+n.offsetWidth/2};this.goToPage=function(e){if(e<1||e>a.pages){return}a.currentPage=e;if(a.pages>2){a.scrollPage()}a.pageChangedEvent.emit(a.currentPage)};this.pages=0;this.currentPage=1}e.prototype.componentDidLoad=function(){var e=this;setTimeout((function(){e.goToPage(e.currentPage)}),10)};e.prototype.render=function(){var e=this;return a(o,null,a("mds-paginator-item",{icon:"mi/baseline/arrow-back",disabled:this.currentPage===1,onClick:function(){return e.goToPage(e.currentPage-1)}}),this.pages>0&&a("mds-paginator-item",{active:this.currentPage===1,onClick:function(){return e.goToPage(1)}},"1"),this.pages>2&&a("div",{class:"pages"},Array.from(Array(this.pages-2).keys()).map((function(t){return a("mds-paginator-item",{key:t,active:e.currentPage===t+2,onClick:function(){return e.goToPage(t+2)}},t+2)}))),this.pages>1&&a("mds-paginator-item",{active:this.currentPage===this.pages,onClick:function(){return e.goToPage(e.pages)}},this.pages),a("mds-paginator-item",{icon:"mi/baseline/arrow-forward",disabled:this.currentPage===this.pages,onClick:function(){return e.goToPage(e.currentPage+1)}}))};Object.defineProperty(e.prototype,"element",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());i.style=s}}}));
@@ -1 +1 @@
1
- System.register(["./p-3ddaee00.system.js"],(function(e,r){"use strict";var t,n;return{setters:[function(r){t=r.p;n=r.b;e("setNonce",r.s)}],execute:function(){var e=function(){var e=r.meta.url;var n={};if(e!==""){n.resourcesUrl=new URL(".",e).href}return t(n)};e().then((function(e){return n([["p-92658324.system",[[1,"mds-paginator",{pages:[2],currentPage:[1538,"current-page"]}]]]],e)}))}}}));
1
+ System.register(["./p-a53254ac.system.js"],(function(e,r){"use strict";var t,n;return{setters:[function(r){t=r.p;n=r.b;e("setNonce",r.s)}],execute:function(){var e=function(){var e=r.meta.url;var n={};if(e!==""){n.resourcesUrl=new URL(".",e).href}return t(n)};e().then((function(e){return n([["p-4984613d.system",[[1,"mds-paginator",{pages:[2],currentPage:[1538,"current-page"]}]]]],e)}))}}}));
package/dist/stats.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-01-20T18:25:16",
2
+ "timestamp": "2023-02-02T09:28:42",
3
3
  "compiler": {
4
4
  "name": "node",
5
5
  "version": "18.3.0"
@@ -54,17 +54,17 @@
54
54
  "name": "dist-lazy",
55
55
  "files": 35,
56
56
  "generatedFiles": [
57
- "./dist/cjs/index-7709e21a.js",
57
+ "./dist/cjs/index-0a1b6680.js",
58
58
  "./dist/cjs/index.cjs.js",
59
59
  "./dist/cjs/loader.cjs.js",
60
60
  "./dist/cjs/mds-paginator.cjs.entry.js",
61
61
  "./dist/cjs/mds-paginator.cjs.js",
62
- "./dist/esm-es5/index-e7fdb228.js",
62
+ "./dist/esm-es5/index-af99740b.js",
63
63
  "./dist/esm-es5/index.js",
64
64
  "./dist/esm-es5/loader.js",
65
65
  "./dist/esm-es5/mds-paginator.entry.js",
66
66
  "./dist/esm-es5/mds-paginator.js",
67
- "./dist/esm/index-e7fdb228.js",
67
+ "./dist/esm/index-af99740b.js",
68
68
  "./dist/esm/index.js",
69
69
  "./dist/esm/loader.js",
70
70
  "./dist/esm/mds-paginator.entry.js",
@@ -74,21 +74,21 @@
74
74
  "./dist/mds-paginator/index.esm.js",
75
75
  "./dist/mds-paginator/mds-paginator.esm.js",
76
76
  "./dist/mds-paginator/mds-paginator.js",
77
- "./dist/mds-paginator/p-3ddaee00.system.js",
77
+ "./dist/mds-paginator/p-3c5c184f.entry.js",
78
+ "./dist/mds-paginator/p-4984613d.system.entry.js",
78
79
  "./dist/mds-paginator/p-50ea2036.system.js",
79
- "./dist/mds-paginator/p-561f638e.js",
80
- "./dist/mds-paginator/p-92658324.system.entry.js",
81
- "./dist/mds-paginator/p-b90dd4e2.entry.js",
82
- "./dist/mds-paginator/p-d01c6201.system.js",
80
+ "./dist/mds-paginator/p-a53254ac.system.js",
81
+ "./dist/mds-paginator/p-bc44a1b3.js",
82
+ "./dist/mds-paginator/p-d375dd5d.system.js",
83
83
  "./www/build/index.esm.js",
84
84
  "./www/build/mds-paginator.esm.js",
85
85
  "./www/build/mds-paginator.js",
86
- "./www/build/p-3ddaee00.system.js",
86
+ "./www/build/p-3c5c184f.entry.js",
87
+ "./www/build/p-4984613d.system.entry.js",
87
88
  "./www/build/p-50ea2036.system.js",
88
- "./www/build/p-561f638e.js",
89
- "./www/build/p-92658324.system.entry.js",
90
- "./www/build/p-b90dd4e2.entry.js",
91
- "./www/build/p-d01c6201.system.js"
89
+ "./www/build/p-a53254ac.system.js",
90
+ "./www/build/p-bc44a1b3.js",
91
+ "./www/build/p-d375dd5d.system.js"
92
92
  ]
93
93
  },
94
94
  {
@@ -121,12 +121,12 @@
121
121
  "components": [
122
122
  "mds-paginator"
123
123
  ],
124
- "bundleId": "p-b90dd4e2",
125
- "fileName": "p-b90dd4e2.entry.js",
124
+ "bundleId": "p-3c5c184f",
125
+ "fileName": "p-3c5c184f.entry.js",
126
126
  "imports": [
127
- "p-561f638e.js"
127
+ "p-bc44a1b3.js"
128
128
  ],
129
- "originalByteSize": 3383
129
+ "originalByteSize": 3425
130
130
  }
131
131
  ],
132
132
  "esm": [
@@ -138,9 +138,9 @@
138
138
  "bundleId": "mds-paginator",
139
139
  "fileName": "mds-paginator.entry.js",
140
140
  "imports": [
141
- "index-e7fdb228.js"
141
+ "index-af99740b.js"
142
142
  ],
143
- "originalByteSize": 3387
143
+ "originalByteSize": 3429
144
144
  }
145
145
  ],
146
146
  "es5": [
@@ -152,9 +152,9 @@
152
152
  "bundleId": "mds-paginator",
153
153
  "fileName": "mds-paginator.entry.js",
154
154
  "imports": [
155
- "index-e7fdb228.js"
155
+ "index-af99740b.js"
156
156
  ],
157
- "originalByteSize": 3387
157
+ "originalByteSize": 3429
158
158
  }
159
159
  ],
160
160
  "system": [
@@ -163,12 +163,12 @@
163
163
  "components": [
164
164
  "mds-paginator"
165
165
  ],
166
- "bundleId": "p-92658324.system",
167
- "fileName": "p-92658324.system.entry.js",
166
+ "bundleId": "p-4984613d.system",
167
+ "fileName": "p-4984613d.system.entry.js",
168
168
  "imports": [
169
- "p-3ddaee00.system.js"
169
+ "p-a53254ac.system.js"
170
170
  ],
171
- "originalByteSize": 3896
171
+ "originalByteSize": 3950
172
172
  }
173
173
  ],
174
174
  "commonjs": [
@@ -180,9 +180,9 @@
180
180
  "bundleId": "mds-paginator.cjs",
181
181
  "fileName": "mds-paginator.cjs.entry.js",
182
182
  "imports": [
183
- "index-7709e21a.js"
183
+ "index-0a1b6680.js"
184
184
  ],
185
- "originalByteSize": 3464
185
+ "originalByteSize": 3506
186
186
  }
187
187
  ]
188
188
  },
@@ -455,7 +455,7 @@
455
455
  ],
456
456
  "componentGraph": {
457
457
  "sc-mds-paginator": [
458
- "p-561f638e.js"
458
+ "p-bc44a1b3.js"
459
459
  ]
460
460
  },
461
461
  "sourceGraph": {
@@ -485,6 +485,14 @@ export interface FunctionalUtilities {
485
485
  export interface FunctionalComponent<T = {}> {
486
486
  (props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[];
487
487
  }
488
+ /**
489
+ * A Child VDOM node
490
+ *
491
+ * This has most of the same properties as {@link VNode} but friendlier names
492
+ * (i.e. `vtag` instead of `$tag$`, `vchildren` instead of `$children$`) in
493
+ * order to provide a friendlier public interface for users of the
494
+ * {@link FunctionalUtilities}).
495
+ */
488
496
  export interface ChildNode {
489
497
  vtag?: string | number | Function;
490
498
  vkey?: string | number;
@@ -531,6 +539,9 @@ export declare function h(sel: any, children: Array<VNode | undefined | null>):
531
539
  export declare function h(sel: any, data: VNodeData | null, text: string): VNode;
532
540
  export declare function h(sel: any, data: VNodeData | null, children: Array<VNode | undefined | null>): VNode;
533
541
  export declare function h(sel: any, data: VNodeData | null, children: VNode): VNode;
542
+ /**
543
+ * A virtual DOM node
544
+ */
534
545
  export interface VNode {
535
546
  $flags$: number;
536
547
  $tag$: string | number | Function;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maggioli-design-system/mds-paginator",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "mds-paginator is a web-component from Maggioli Design System Magma, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScirpt framework you are using.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@maggioli-design-system/mds-paginator-item": "^2.1.0",
27
- "@maggioli-design-system/styles": "^10.0.1",
28
- "@stencil/core": "^2.22.1"
27
+ "@maggioli-design-system/styles": "^11.1.0",
28
+ "@stencil/core": "^2.22.2"
29
29
  },
30
30
  "license": "MIT",
31
31
  "author": {
@@ -55,7 +55,9 @@ export class MdsPaginator {
55
55
  return
56
56
  }
57
57
  this.currentPage = selectedPage
58
- this.scrollPage()
58
+ if (this.pages > 2) {
59
+ this.scrollPage()
60
+ }
59
61
  this.pageChangedEvent.emit(this.currentPage)
60
62
  }
61
63
 
@@ -69,7 +71,7 @@ export class MdsPaginator {
69
71
  { Array.from(Array(this.pages - 2).keys()).map( i => <mds-paginator-item key={i} active={this.currentPage === i + 2} onClick={() => this.goToPage(i + 2)}>{ i + 2 }</mds-paginator-item>) }
70
72
  </div>
71
73
  }
72
- { this.pages && <mds-paginator-item active={this.currentPage === this.pages} onClick={() => this.goToPage(this.pages)}>{ this.pages }</mds-paginator-item>}
74
+ { this.pages > 1 && <mds-paginator-item active={this.currentPage === this.pages} onClick={() => this.goToPage(this.pages)}>{ this.pages }</mds-paginator-item>}
73
75
  <mds-paginator-item icon="mi/baseline/arrow-forward" disabled={this.currentPage === this.pages} onClick={() => this.goToPage(this.currentPage + 1)}/>
74
76
  </Host>
75
77
  )
@@ -1 +1 @@
1
- import{p as e,b as r}from"./p-561f638e.js";export{s as setNonce}from"./p-561f638e.js";(()=>{const r=import.meta.url,p={};return""!==r&&(p.resourcesUrl=new URL(".",r).href),e(p)})().then((e=>r([["p-b90dd4e2",[[1,"mds-paginator",{pages:[2],currentPage:[1538,"current-page"]}]]]],e)));
1
+ import{p as r,b as a}from"./p-bc44a1b3.js";export{s as setNonce}from"./p-bc44a1b3.js";(()=>{const a=import.meta.url,e={};return""!==a&&(e.resourcesUrl=new URL(".",a).href),r(e)})().then((r=>a([["p-3c5c184f",[[1,"mds-paginator",{pages:[2],currentPage:[1538,"current-page"]}]]]],r)));
@@ -115,7 +115,7 @@ DOMTokenList
115
115
  var resourcesUrl = scriptElm ? scriptElm.getAttribute('data-resources-url') || scriptElm.src : '';
116
116
  var start = function() {
117
117
  // if src is not present then origin is "null", and new URL() throws TypeError: Failed to construct 'URL': Invalid base URL
118
- var url = new URL('./p-d01c6201.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
118
+ var url = new URL('./p-d375dd5d.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
119
119
  System.import(url.href);
120
120
  };
121
121
 
@@ -0,0 +1 @@
1
+ import{r as s,c as i,h as t,H as a,g as o}from"./p-bc44a1b3.js";const r=class{constructor(t){s(this,t),this.pageChangedEvent=i(this,"pageChangedEvent",7),this.scrollPage=()=>{const s=this.currentPage-2,i=this.element.shadowRoot.querySelector(".pages"),t=i.querySelectorAll("mds-paginator-item");if(s<0)return void(i.scrollLeft=0);if(s>t.length-1)return void(i.scrollLeft=t[t.length-1].offsetLeft-i.offsetLeft);const a=t[s];i.scrollLeft=a.offsetLeft-i.offsetLeft-i.offsetWidth/2+a.offsetWidth/2},this.goToPage=s=>{s<1||s>this.pages||(this.currentPage=s,this.pages>2&&this.scrollPage(),this.pageChangedEvent.emit(this.currentPage))},this.pages=0,this.currentPage=1}componentDidLoad(){setTimeout((()=>{this.goToPage(this.currentPage)}),10)}render(){return t(a,null,t("mds-paginator-item",{icon:"mi/baseline/arrow-back",disabled:1===this.currentPage,onClick:()=>this.goToPage(this.currentPage-1)}),this.pages>0&&t("mds-paginator-item",{active:1===this.currentPage,onClick:()=>this.goToPage(1)},"1"),this.pages>2&&t("div",{class:"pages"},Array.from(Array(this.pages-2).keys()).map((s=>t("mds-paginator-item",{key:s,active:this.currentPage===s+2,onClick:()=>this.goToPage(s+2)},s+2)))),this.pages>1&&t("mds-paginator-item",{active:this.currentPage===this.pages,onClick:()=>this.goToPage(this.pages)},this.pages),t("mds-paginator-item",{icon:"mi/baseline/arrow-forward",disabled:this.currentPage===this.pages,onClick:()=>this.goToPage(this.currentPage+1)}))}get element(){return o(this)}};r.style=".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-paginator-background:rgb(var(--tone-neutral-09));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25rem}.pages{margin-left:0.5rem;margin-right:0.5rem;display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-align:center;align-items:center;overflow:auto;scroll-behavior:smooth;border-radius:9999px;padding:0.5rem;background-color:var(--mds-paginator-background);gap:2px;}:host() .pages{-ms-overflow-style:none;scrollbar-width:none}.pages::-webkit-scrollbar{display:none}";export{r as mds_paginator}
@@ -1 +1 @@
1
- System.register(["./p-3ddaee00.system.js"],(function(e){"use strict";var t,r,a,o,n;return{setters:[function(e){t=e.r;r=e.c;a=e.h;o=e.H;n=e.g}],execute:function(){var s=".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-paginator-background:rgb(var(--tone-neutral-09));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25rem}.pages{margin-left:0.5rem;margin-right:0.5rem;display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-align:center;align-items:center;overflow:auto;scroll-behavior:smooth;border-radius:9999px;padding:0.5rem;background-color:var(--mds-paginator-background);gap:2px;}:host() .pages{-ms-overflow-style:none;scrollbar-width:none}.pages::-webkit-scrollbar{display:none}";var i=e("mds_paginator",function(){function e(e){var a=this;t(this,e);this.pageChangedEvent=r(this,"pageChangedEvent",7);this.scrollPage=function(){var e=a.currentPage-2;var t=a.element.shadowRoot.querySelector(".pages");var r=t.querySelectorAll("mds-paginator-item");if(e<0){t.scrollLeft=0;return}if(e>r.length-1){var o=r[r.length-1];t.scrollLeft=o.offsetLeft-t.offsetLeft;return}var n=r[e];t.scrollLeft=n.offsetLeft-t.offsetLeft-t.offsetWidth/2+n.offsetWidth/2};this.goToPage=function(e){if(e<1||e>a.pages){return}a.currentPage=e;a.scrollPage();a.pageChangedEvent.emit(a.currentPage)};this.pages=0;this.currentPage=1}e.prototype.componentDidLoad=function(){var e=this;setTimeout((function(){e.goToPage(e.currentPage)}),10)};e.prototype.render=function(){var e=this;return a(o,null,a("mds-paginator-item",{icon:"mi/baseline/arrow-back",disabled:this.currentPage===1,onClick:function(){return e.goToPage(e.currentPage-1)}}),this.pages>0&&a("mds-paginator-item",{active:this.currentPage===1,onClick:function(){return e.goToPage(1)}},"1"),this.pages>2&&a("div",{class:"pages"},Array.from(Array(this.pages-2).keys()).map((function(t){return a("mds-paginator-item",{key:t,active:e.currentPage===t+2,onClick:function(){return e.goToPage(t+2)}},t+2)}))),this.pages&&a("mds-paginator-item",{active:this.currentPage===this.pages,onClick:function(){return e.goToPage(e.pages)}},this.pages),a("mds-paginator-item",{icon:"mi/baseline/arrow-forward",disabled:this.currentPage===this.pages,onClick:function(){return e.goToPage(e.currentPage+1)}}))};Object.defineProperty(e.prototype,"element",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());i.style=s}}}));
1
+ System.register(["./p-a53254ac.system.js"],(function(e){"use strict";var t,r,a,o,n;return{setters:[function(e){t=e.r;r=e.c;a=e.h;o=e.H;n=e.g}],execute:function(){var s=".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-paginator-background:rgb(var(--tone-neutral-09));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25rem}.pages{margin-left:0.5rem;margin-right:0.5rem;display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-align:center;align-items:center;overflow:auto;scroll-behavior:smooth;border-radius:9999px;padding:0.5rem;background-color:var(--mds-paginator-background);gap:2px;}:host() .pages{-ms-overflow-style:none;scrollbar-width:none}.pages::-webkit-scrollbar{display:none}";var i=e("mds_paginator",function(){function e(e){var a=this;t(this,e);this.pageChangedEvent=r(this,"pageChangedEvent",7);this.scrollPage=function(){var e=a.currentPage-2;var t=a.element.shadowRoot.querySelector(".pages");var r=t.querySelectorAll("mds-paginator-item");if(e<0){t.scrollLeft=0;return}if(e>r.length-1){var o=r[r.length-1];t.scrollLeft=o.offsetLeft-t.offsetLeft;return}var n=r[e];t.scrollLeft=n.offsetLeft-t.offsetLeft-t.offsetWidth/2+n.offsetWidth/2};this.goToPage=function(e){if(e<1||e>a.pages){return}a.currentPage=e;if(a.pages>2){a.scrollPage()}a.pageChangedEvent.emit(a.currentPage)};this.pages=0;this.currentPage=1}e.prototype.componentDidLoad=function(){var e=this;setTimeout((function(){e.goToPage(e.currentPage)}),10)};e.prototype.render=function(){var e=this;return a(o,null,a("mds-paginator-item",{icon:"mi/baseline/arrow-back",disabled:this.currentPage===1,onClick:function(){return e.goToPage(e.currentPage-1)}}),this.pages>0&&a("mds-paginator-item",{active:this.currentPage===1,onClick:function(){return e.goToPage(1)}},"1"),this.pages>2&&a("div",{class:"pages"},Array.from(Array(this.pages-2).keys()).map((function(t){return a("mds-paginator-item",{key:t,active:e.currentPage===t+2,onClick:function(){return e.goToPage(t+2)}},t+2)}))),this.pages>1&&a("mds-paginator-item",{active:this.currentPage===this.pages,onClick:function(){return e.goToPage(e.pages)}},this.pages),a("mds-paginator-item",{icon:"mi/baseline/arrow-forward",disabled:this.currentPage===this.pages,onClick:function(){return e.goToPage(e.currentPage+1)}}))};Object.defineProperty(e.prototype,"element",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());i.style=s}}}));
File without changes
@@ -1 +1 @@
1
- System.register(["./p-3ddaee00.system.js"],(function(e,r){"use strict";var t,n;return{setters:[function(r){t=r.p;n=r.b;e("setNonce",r.s)}],execute:function(){var e=function(){var e=r.meta.url;var n={};if(e!==""){n.resourcesUrl=new URL(".",e).href}return t(n)};e().then((function(e){return n([["p-92658324.system",[[1,"mds-paginator",{pages:[2],currentPage:[1538,"current-page"]}]]]],e)}))}}}));
1
+ System.register(["./p-a53254ac.system.js"],(function(e,r){"use strict";var t,n;return{setters:[function(r){t=r.p;n=r.b;e("setNonce",r.s)}],execute:function(){var e=function(){var e=r.meta.url;var n={};if(e!==""){n.resourcesUrl=new URL(".",e).href}return t(n)};e().then((function(e){return n([["p-4984613d.system",[[1,"mds-paginator",{pages:[2],currentPage:[1538,"current-page"]}]]]],e)}))}}}));
@@ -1 +0,0 @@
1
- import{r as s,c as i,h as t,H as a,g as o}from"./p-561f638e.js";const r=class{constructor(t){s(this,t),this.pageChangedEvent=i(this,"pageChangedEvent",7),this.scrollPage=()=>{const s=this.currentPage-2,i=this.element.shadowRoot.querySelector(".pages"),t=i.querySelectorAll("mds-paginator-item");if(s<0)return void(i.scrollLeft=0);if(s>t.length-1)return void(i.scrollLeft=t[t.length-1].offsetLeft-i.offsetLeft);const a=t[s];i.scrollLeft=a.offsetLeft-i.offsetLeft-i.offsetWidth/2+a.offsetWidth/2},this.goToPage=s=>{s<1||s>this.pages||(this.currentPage=s,this.scrollPage(),this.pageChangedEvent.emit(this.currentPage))},this.pages=0,this.currentPage=1}componentDidLoad(){setTimeout((()=>{this.goToPage(this.currentPage)}),10)}render(){return t(a,null,t("mds-paginator-item",{icon:"mi/baseline/arrow-back",disabled:1===this.currentPage,onClick:()=>this.goToPage(this.currentPage-1)}),this.pages>0&&t("mds-paginator-item",{active:1===this.currentPage,onClick:()=>this.goToPage(1)},"1"),this.pages>2&&t("div",{class:"pages"},Array.from(Array(this.pages-2).keys()).map((s=>t("mds-paginator-item",{key:s,active:this.currentPage===s+2,onClick:()=>this.goToPage(s+2)},s+2)))),this.pages&&t("mds-paginator-item",{active:this.currentPage===this.pages,onClick:()=>this.goToPage(this.pages)},this.pages),t("mds-paginator-item",{icon:"mi/baseline/arrow-forward",disabled:this.currentPage===this.pages,onClick:()=>this.goToPage(this.currentPage+1)}))}get element(){return o(this)}};r.style=".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-paginator-background:rgb(var(--tone-neutral-09));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25rem}.pages{margin-left:0.5rem;margin-right:0.5rem;display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-align:center;align-items:center;overflow:auto;scroll-behavior:smooth;border-radius:9999px;padding:0.5rem;background-color:var(--mds-paginator-background);gap:2px;}:host() .pages{-ms-overflow-style:none;scrollbar-width:none}.pages::-webkit-scrollbar{display:none}";export{r as mds_paginator}
@@ -1 +0,0 @@
1
- import{r as s,c as i,h as t,H as a,g as o}from"./p-561f638e.js";const r=class{constructor(t){s(this,t),this.pageChangedEvent=i(this,"pageChangedEvent",7),this.scrollPage=()=>{const s=this.currentPage-2,i=this.element.shadowRoot.querySelector(".pages"),t=i.querySelectorAll("mds-paginator-item");if(s<0)return void(i.scrollLeft=0);if(s>t.length-1)return void(i.scrollLeft=t[t.length-1].offsetLeft-i.offsetLeft);const a=t[s];i.scrollLeft=a.offsetLeft-i.offsetLeft-i.offsetWidth/2+a.offsetWidth/2},this.goToPage=s=>{s<1||s>this.pages||(this.currentPage=s,this.scrollPage(),this.pageChangedEvent.emit(this.currentPage))},this.pages=0,this.currentPage=1}componentDidLoad(){setTimeout((()=>{this.goToPage(this.currentPage)}),10)}render(){return t(a,null,t("mds-paginator-item",{icon:"mi/baseline/arrow-back",disabled:1===this.currentPage,onClick:()=>this.goToPage(this.currentPage-1)}),this.pages>0&&t("mds-paginator-item",{active:1===this.currentPage,onClick:()=>this.goToPage(1)},"1"),this.pages>2&&t("div",{class:"pages"},Array.from(Array(this.pages-2).keys()).map((s=>t("mds-paginator-item",{key:s,active:this.currentPage===s+2,onClick:()=>this.goToPage(s+2)},s+2)))),this.pages&&t("mds-paginator-item",{active:this.currentPage===this.pages,onClick:()=>this.goToPage(this.pages)},this.pages),t("mds-paginator-item",{icon:"mi/baseline/arrow-forward",disabled:this.currentPage===this.pages,onClick:()=>this.goToPage(this.currentPage+1)}))}get element(){return o(this)}};r.style=".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{--mds-paginator-background:rgb(var(--tone-neutral-09));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25rem}.pages{margin-left:0.5rem;margin-right:0.5rem;display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-align:center;align-items:center;overflow:auto;scroll-behavior:smooth;border-radius:9999px;padding:0.5rem;background-color:var(--mds-paginator-background);gap:2px;}:host() .pages{-ms-overflow-style:none;scrollbar-width:none}.pages::-webkit-scrollbar{display:none}";export{r as mds_paginator}