@jumpgroup/jump-design-system 0.2.5 → 0.2.7

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 (110) hide show
  1. package/dist/cjs/jump-badge.cjs.entry.js +1 -1
  2. package/dist/cjs/jump-badge.cjs.entry.js.map +1 -1
  3. package/dist/cjs/jump-button.cjs.entry.js +1 -1
  4. package/dist/cjs/jump-button.cjs.entry.js.map +1 -1
  5. package/dist/cjs/jump-card.cjs.entry.js +1 -1
  6. package/dist/cjs/jump-card.cjs.entry.js.map +1 -1
  7. package/dist/cjs/jump-design-system.cjs.js +1 -1
  8. package/dist/cjs/jump-icon.cjs.entry.js +3 -2
  9. package/dist/cjs/jump-icon.cjs.entry.js.map +1 -1
  10. package/dist/cjs/jump-pagination-table.cjs.entry.js +79 -0
  11. package/dist/cjs/jump-pagination-table.cjs.entry.js.map +1 -0
  12. package/dist/cjs/jump-pagination.cjs.entry.js +14 -26
  13. package/dist/cjs/jump-pagination.cjs.entry.js.map +1 -1
  14. package/dist/cjs/jump-tab.cjs.entry.js +1 -1
  15. package/dist/cjs/loader.cjs.js +1 -1
  16. package/dist/collection/collection-manifest.json +1 -0
  17. package/dist/collection/components/jump-badge/jump-badge.css +2 -1
  18. package/dist/collection/components/jump-button/jump-button-dimension.stories.js +3 -3
  19. package/dist/collection/components/jump-button/jump-button-dimension.stories.js.map +1 -1
  20. package/dist/collection/components/jump-button/jump-button.css +13 -65
  21. package/dist/collection/components/jump-card/jump-card.css +0 -49
  22. package/dist/collection/components/jump-card/jump-card.stories.js +0 -8
  23. package/dist/collection/components/jump-card/jump-card.stories.js.map +1 -1
  24. package/dist/collection/components/jump-icon/jump-icon.css +16 -2
  25. package/dist/collection/components/jump-icon/jump-icon.js +19 -1
  26. package/dist/collection/components/jump-icon/jump-icon.js.map +1 -1
  27. package/dist/collection/components/jump-icon/jump-icon.stories.js +14 -4
  28. package/dist/collection/components/jump-icon/jump-icon.stories.js.map +1 -1
  29. package/dist/collection/components/jump-pagination/jump-pagination.css +8 -18
  30. package/dist/collection/components/jump-pagination/jump-pagination.js +20 -125
  31. package/dist/collection/components/jump-pagination/jump-pagination.js.map +1 -1
  32. package/dist/collection/components/jump-pagination/jump-pagination.stories.js +68 -0
  33. package/dist/collection/components/jump-pagination/jump-pagination.stories.js.map +1 -0
  34. package/dist/collection/components/jump-pagination-table/jump-pagination-table.css +56 -0
  35. package/dist/collection/components/jump-pagination-table/jump-pagination-table.js +262 -0
  36. package/dist/collection/components/jump-pagination-table/jump-pagination-table.js.map +1 -0
  37. package/dist/collection/components/jump-pagination-table/jump-pagination-table.stories.js +90 -0
  38. package/dist/collection/components/jump-pagination-table/jump-pagination-table.stories.js.map +1 -0
  39. package/dist/collection/components/jump-pagination-table/test/jump-pagination-table.e2e.js +10 -0
  40. package/dist/collection/components/jump-pagination-table/test/jump-pagination-table.e2e.js.map +1 -0
  41. package/dist/collection/components/jump-pagination-table/test/jump-pagination-table.spec.js +18 -0
  42. package/dist/collection/components/jump-pagination-table/test/jump-pagination-table.spec.js.map +1 -0
  43. package/dist/collection/components/jump-tab/jump-tab.js +1 -1
  44. package/dist/components/jump-badge.js +1 -1
  45. package/dist/components/jump-badge.js.map +1 -1
  46. package/dist/components/jump-button.js +1 -1
  47. package/dist/components/jump-button.js.map +1 -1
  48. package/dist/components/jump-card.js +1 -1
  49. package/dist/components/jump-card.js.map +1 -1
  50. package/dist/components/jump-icon2.js +5 -3
  51. package/dist/components/jump-icon2.js.map +1 -1
  52. package/dist/components/jump-pagination-table.d.ts +11 -0
  53. package/dist/components/jump-pagination-table.js +109 -0
  54. package/dist/components/jump-pagination-table.js.map +1 -0
  55. package/dist/components/jump-pagination.js +19 -37
  56. package/dist/components/jump-pagination.js.map +1 -1
  57. package/dist/components/jump-tab.js +1 -1
  58. package/dist/esm/jump-badge.entry.js +1 -1
  59. package/dist/esm/jump-badge.entry.js.map +1 -1
  60. package/dist/esm/jump-button.entry.js +1 -1
  61. package/dist/esm/jump-button.entry.js.map +1 -1
  62. package/dist/esm/jump-card.entry.js +1 -1
  63. package/dist/esm/jump-card.entry.js.map +1 -1
  64. package/dist/esm/jump-design-system.js +1 -1
  65. package/dist/esm/jump-icon.entry.js +3 -2
  66. package/dist/esm/jump-icon.entry.js.map +1 -1
  67. package/dist/esm/jump-pagination-table.entry.js +75 -0
  68. package/dist/esm/jump-pagination-table.entry.js.map +1 -0
  69. package/dist/esm/jump-pagination.entry.js +14 -26
  70. package/dist/esm/jump-pagination.entry.js.map +1 -1
  71. package/dist/esm/jump-tab.entry.js +1 -1
  72. package/dist/esm/loader.js +1 -1
  73. package/dist/jump-design-system/jump-design-system.esm.js +1 -1
  74. package/dist/jump-design-system/jump-design-system.esm.js.map +1 -1
  75. package/dist/jump-design-system/p-02914b1e.entry.js +2 -0
  76. package/dist/jump-design-system/p-02914b1e.entry.js.map +1 -0
  77. package/dist/jump-design-system/p-1a533536.entry.js +2 -0
  78. package/dist/jump-design-system/p-1a533536.entry.js.map +1 -0
  79. package/dist/jump-design-system/{p-61729377.entry.js → p-93d8245f.entry.js} +2 -2
  80. package/dist/jump-design-system/p-e69ee35f.entry.js +2 -0
  81. package/dist/jump-design-system/p-e69ee35f.entry.js.map +1 -0
  82. package/dist/jump-design-system/p-eb16952a.entry.js +2 -0
  83. package/dist/jump-design-system/p-eb16952a.entry.js.map +1 -0
  84. package/dist/jump-design-system/p-ed65e359.entry.js +2 -0
  85. package/dist/jump-design-system/p-ed65e359.entry.js.map +1 -0
  86. package/dist/jump-design-system/{p-511d4425.entry.js → p-fa148b53.entry.js} +57 -57
  87. package/dist/jump-design-system/{p-511d4425.entry.js.map → p-fa148b53.entry.js.map} +1 -1
  88. package/dist/jump-design-system-elements.json +30 -5
  89. package/dist/types/components/jump-icon/jump-icon.d.ts +4 -0
  90. package/dist/types/components/jump-icon/jump-icon.stories.d.ts +3 -1
  91. package/dist/types/components/jump-pagination/jump-pagination.d.ts +4 -22
  92. package/dist/types/components/jump-pagination/jump-pagination.stories.d.ts +30 -0
  93. package/dist/types/components/jump-pagination-table/jump-pagination-table.d.ts +23 -0
  94. package/dist/types/components/{jump-pagination/jump-pagination-products.stories.d.ts → jump-pagination-table/jump-pagination-table.stories.d.ts} +11 -39
  95. package/dist/types/components.d.ts +54 -15
  96. package/package.json +1 -1
  97. package/dist/collection/components/jump-pagination/jump-pagination-pages.stories.js +0 -119
  98. package/dist/collection/components/jump-pagination/jump-pagination-pages.stories.js.map +0 -1
  99. package/dist/collection/components/jump-pagination/jump-pagination-products.stories.js +0 -102
  100. package/dist/collection/components/jump-pagination/jump-pagination-products.stories.js.map +0 -1
  101. package/dist/jump-design-system/p-700b96b4.entry.js +0 -2
  102. package/dist/jump-design-system/p-700b96b4.entry.js.map +0 -1
  103. package/dist/jump-design-system/p-87256ed6.entry.js +0 -2
  104. package/dist/jump-design-system/p-87256ed6.entry.js.map +0 -1
  105. package/dist/jump-design-system/p-8f5caf32.entry.js +0 -2
  106. package/dist/jump-design-system/p-8f5caf32.entry.js.map +0 -1
  107. package/dist/jump-design-system/p-960188c6.entry.js +0 -2
  108. package/dist/jump-design-system/p-960188c6.entry.js.map +0 -1
  109. package/dist/types/components/jump-pagination/jump-pagination-pages.stories.d.ts +0 -75
  110. /package/dist/jump-design-system/{p-61729377.entry.js.map → p-93d8245f.entry.js.map} +0 -0
@@ -13,13 +13,23 @@ export default {
13
13
  name: 'Classi aggiuntive',
14
14
  control: 'text',
15
15
  description: 'Aggiungi classi aggiuntive all\'icona (separate da spazio)'
16
- }
16
+ },
17
17
  }
18
18
  };
19
19
  const Template = (args) => `<jump-icon class="${args.class}" name="${args.name}"></jump-icon>`;
20
- export const Icon = Template.bind({});
21
- Icon.args = {
20
+ export const IconSmall = Template.bind({});
21
+ IconSmall.args = {
22
+ name: Object.keys(feather.icons)[0],
23
+ class: 'small',
24
+ };
25
+ export const IconMedium = Template.bind({});
26
+ IconMedium.args = {
27
+ name: Object.keys(feather.icons)[0],
28
+ class: 'medium',
29
+ };
30
+ export const IconLarge = Template.bind({});
31
+ IconLarge.args = {
22
32
  name: Object.keys(feather.icons)[0],
23
- class: '',
33
+ class: 'large',
24
34
  };
25
35
  //# sourceMappingURL=jump-icon.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jump-icon.stories.js","sourceRoot":"","sources":["../../../src/components/jump-icon/jump-icon.stories.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,eAAe,CAAC;AAEpC,eAAe;IACb,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;YACnC,WAAW,EAAE,kDAAkD;SAChE;QACD,KAAK,EAAE;YACL,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,4DAA4D;SAC1E;KACF;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAqB,IAAI,CAAC,KAAK,WAAW,IAAI,CAAC,IAAI,gBAAgB,CAAC;AAE/F,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtC,IAAI,CAAC,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,KAAK,EAAE,EAAE;CACV,CAAC","sourcesContent":["import feather from 'feather-icons';\n\nexport default {\n title: 'Components/Icon',\n tags: ['autodocs'],\n argTypes: {\n name: {\n name: 'Nome Icona',\n control: 'select',\n options: Object.keys(feather.icons),\n description: 'Seleziona il nome dell\\'icona dal menu a tendina'\n },\n class: {\n name: 'Classi aggiuntive',\n control: 'text',\n description: 'Aggiungi classi aggiuntive all\\'icona (separate da spazio)'\n }\n }\n};\n\nconst Template = (args) => `<jump-icon class=\"${args.class}\" name=\"${args.name}\"></jump-icon>`;\n\nexport const Icon = Template.bind({});\nIcon.args = {\n name: Object.keys(feather.icons)[0],\n class: '',\n};"]}
1
+ {"version":3,"file":"jump-icon.stories.js","sourceRoot":"","sources":["../../../src/components/jump-icon/jump-icon.stories.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,eAAe,CAAC;AAEpC,eAAe;IACb,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;YACnC,WAAW,EAAE,kDAAkD;SAChE;QACD,KAAK,EAAE;YACL,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,4DAA4D;SAC1E;KACF;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAqB,IAAI,CAAC,KAAK,WAAW,IAAI,CAAC,IAAI,gBAAgB,CAAC;AAE/F,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,GAAG;IACf,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,KAAK,EAAE,OAAO;CACf,CAAC;AACF,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,UAAU,CAAC,IAAI,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,GAAG;IACf,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,KAAK,EAAE,OAAO;CACf,CAAC","sourcesContent":["import feather from 'feather-icons';\n\nexport default {\n title: 'Components/Icon',\n tags: ['autodocs'],\n argTypes: {\n name: {\n name: 'Nome Icona',\n control: 'select',\n options: Object.keys(feather.icons),\n description: 'Seleziona il nome dell\\'icona dal menu a tendina'\n },\n class: {\n name: 'Classi aggiuntive',\n control: 'text',\n description: 'Aggiungi classi aggiuntive all\\'icona (separate da spazio)'\n },\n }\n};\n\nconst Template = (args) => `<jump-icon class=\"${args.class}\" name=\"${args.name}\"></jump-icon>`;\n\nexport const IconSmall = Template.bind({});\nIconSmall.args = {\n name: Object.keys(feather.icons)[0],\n class: 'small',\n};\nexport const IconMedium = Template.bind({});\nIconMedium.args = {\n name: Object.keys(feather.icons)[0],\n class: 'medium',\n};\nexport const IconLarge = Template.bind({});\nIconLarge.args = {\n name: Object.keys(feather.icons)[0],\n class: 'large',\n};"]}
@@ -3,35 +3,25 @@
3
3
  }
4
4
 
5
5
  .JumpPagination {
6
- --pagination-label-color: var(--neutral-grey-secondary);
7
- --pagination-arrows-color: var(--neutral-grey-secondary);
8
- --pagination-arrows-disabled: #CBCBCB;
6
+ --jump-pagination-label: var(--neutral-grey-secondary);
7
+ --jump-pagination-arrows-color: var(--neutral-grey-secondary);
8
+ --jump-pagination-arrows-disabled: var(--neutral-grey-disabled);
9
9
  font-family: var(--ff-primary);
10
10
  }
11
11
  .JumpPagination__Wrapper {
12
12
  display: flex;
13
13
  justify-content: space-between;
14
14
  }
15
- .JumpPagination__Wrapper .elementsPerPage {
16
- display: flex;
17
- gap: 1rem;
18
- align-items: center;
19
- }
20
- .JumpPagination__Wrapper .elementsPerPage label {
21
- color: var(--pagination-label-color);
22
- font-size: 14px;
23
- font-weight: normal;
24
- }
25
15
  .JumpPagination__Wrapper .indicators {
26
- font-size: 16px;
16
+ font-size: var(--fs-400);
27
17
  font-weight: normal;
28
18
  display: flex;
29
19
  justify-content: space-between;
30
20
  gap: 20px;
31
- color: var(--pagination-label-color);
21
+ color: var(--jump-pagination-label);
32
22
  }
33
23
  .JumpPagination__Wrapper .indicators .arrow {
34
- color: var(--pagination-arrows-color);
24
+ color: var(--jump-pagination-arrows-color);
35
25
  display: flex;
36
26
  align-items: center;
37
27
  gap: 10px;
@@ -46,10 +36,10 @@
46
36
  }
47
37
  .JumpPagination__Wrapper .indicators .arrow button:disabled {
48
38
  cursor: not-allowed;
49
- color: var(--pagination-arrows-disabled);
39
+ color: var(--jump-pagination-arrows-disabled);
50
40
  }
51
41
  .JumpPagination__Wrapper .indicators .elements {
52
- color: var(--pagination-label-color);
42
+ color: var(--jump-pagination-label);
53
43
  display: flex;
54
44
  align-items: center;
55
45
  gap: 5px;
@@ -1,41 +1,29 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  export class JumpPagination {
3
3
  constructor() {
4
- this.firstPage = 1;
5
- this.currentPage = undefined;
6
- this.totalElements = undefined;
4
+ this.current = 1;
7
5
  this.pagLabel = 'di';
8
- this.initialPage = 1;
9
- this.lastPage = 10;
10
- this.labelElementsPerPage = 'Elementi per pagina';
11
- this.elementsRanges = [10, 20, 60, 100];
12
- this.completeVersion = false;
6
+ this.last = 10;
13
7
  this.showFirstAndLast = false;
14
8
  }
15
- watchCurrentPage(newValue, oldValue) {
9
+ watchcurrent(newValue, oldValue) {
16
10
  let details = {
17
- currentPage: newValue,
11
+ current: newValue,
18
12
  previousPage: oldValue,
19
- firstPage: this.firstPage,
20
- lastPage: this.lastPage,
13
+ first: 1,
14
+ last: this.last,
21
15
  direction: newValue > oldValue ? 'next' : 'prev'
22
16
  };
23
- this.jumpChangePage.emit(details);
17
+ this.changePage.emit(details);
24
18
  }
25
19
  /* ---------------------- @LIFECYCLE ------------------------- */
26
20
  componentWillLoad() {
27
- this.currentPage = this.initialPage;
21
+ this.current = 1;
28
22
  }
29
23
  render() {
30
- var _a;
31
- console.log('completeVersion', this.completeVersion);
32
- return (h(Host, { key: '32e300881b3a78d25edf6480e9a8a6594f907c76', class: "JumpPagination" }, h("div", { key: '0c4e133e409740331083588fbb046d79c2878ea9', class: "JumpPagination__Wrapper" }, this.completeVersion &&
33
- h("div", { key: '13daa8e819ec294b50823becc7e8d904eff66f32', class: "elementsPerPage" }, h("label", { key: '162555e0ebfc295d96d5ba358ec879eba1730746', htmlFor: "elements" }, (_a = this.labelElementsPerPage) !== null && _a !== void 0 ? _a : 'Elements per page'), h("select", { key: 'c4e99d784347a67c5616b3ed0ca25934dbdae55f', name: "elements", id: "elements" }, this.elementsRanges.map((range) => (h("option", { value: range }, range))))), h("div", { key: '5eb516226cf5bcb23e575109371c4f55ca235e04', class: "indicators" }, h("div", { key: '58a8655b582e8cdcd9f8c553343d9e407dd66971', class: "elements" }, this.completeVersion ?
34
- h("span", null, h("span", null, this.firstPage), " - ", h("span", null, this.currentPage), " ", this.pagLabel, " ", h("span", null, this.totalElements))
35
- :
36
- h("span", null, h("span", null, this.currentPage), " ", this.pagLabel, " ", h("span", null, this.lastPage))), h("div", { key: '92b5476c223e477532726304c282ed34e1acccc7', class: "arrow" }, this.showFirstAndLast &&
37
- h("button", { key: '740c67ee4f73c5a55a022b2281913d8652deeed2', onClick: () => { this.currentPage = this.firstPage; }, disabled: (this.currentPage === this.firstPage) ? true : false }, " ", h("jump-icon", { key: '5a880ea7c01afcc8ae9a4e84934e386e0edab58c', slot: "prefix", name: "chevrons-left" }), " "), h("button", { key: '08fe7f7faa6c7645151ec3ea2b4bf4247f082a2d', onClick: () => { this.currentPage--; }, disabled: (this.currentPage === this.firstPage) ? true : false }, " ", h("jump-icon", { key: '04a972584533f1272b10c7e9068ce332aef77299', slot: "prefix", name: "chevron-left" }), " "), h("button", { key: '0ea012c03b06b587296c9190eece67351579b6e3', onClick: () => { this.currentPage++; }, disabled: (this.currentPage === this.lastPage) ? true : false }, " ", h("jump-icon", { key: '155d6a407989f9cc5d38832df8fb98a3505c3113', slot: "prefix", name: "chevron-right" }), " "), this.showFirstAndLast &&
38
- h("button", { key: 'be46c67831f6d732d47e9340aca1a43a650af958', onClick: () => { this.currentPage = this.lastPage; }, disabled: (this.currentPage === this.lastPage) ? true : false }, " ", h("jump-icon", { key: 'b04a3d8a8726f945d5639761dde68a300e40f80a', slot: "prefix", name: "chevrons-right" }), " "))))));
24
+ return (h(Host, { key: '2a7576df479d537fce9ddb57bbd1c2281966338a', class: "JumpPagination" }, h("div", { key: 'b17c027eeeb798a07575a329d6d84b378258c3f8', class: "JumpPagination__Wrapper" }, h("div", { key: 'afd615f030a3affbc8eb42eca80b15c19d248865', class: "indicators" }, h("div", { key: '62ba94ec7d2a97e9c9cb4b305817c65fe841b8d2', class: "elements" }, h("span", { key: '72a1e04a055661f44add8d8a6b7da470ca4dc141' }, h("span", { key: '17d723e90600fc2dd461b3df5806ae1a53f8a9e2' }, this.current), " ", this.pagLabel, " ", h("span", { key: '8226df90a89580310fc165fb3283de0d850a9edd' }, this.last))), h("div", { key: '6ba82177760ff8722071d9306e7c997bb651b838', class: "arrow" }, this.showFirstAndLast &&
25
+ h("button", { key: 'f97ce0ac5ae55f5efa46e3049740f0e71d30d51a', onClick: () => { this.current = 1; }, disabled: (this.current === 1) ? true : false }, " ", h("jump-icon", { key: 'a3beda6c56fb82248712c4c185bafd7d1ab2b05b', slot: "prefix", name: "chevrons-left" }), " "), h("button", { key: 'f989324f4950b41d3224ec4661416f76eacc1c4b', onClick: () => { this.current--; }, disabled: (this.current === 1) ? true : false }, " ", h("jump-icon", { key: '282db7bb875d3fb32f2ed4e5f7aa445c369fc916', slot: "prefix", name: "chevron-left" }), " "), h("button", { key: '65f1681d7f53d756c111aaba7e8473545c903eb7', onClick: () => { this.current++; }, disabled: (this.current === this.last) ? true : false }, " ", h("jump-icon", { key: 'a8365aa471c81a95b470bbc333fe4119f77dc72e', slot: "prefix", name: "chevron-right" }), " "), this.showFirstAndLast &&
26
+ h("button", { key: 'df7fa6824a028b74042b6a08191e1979ed42617b', onClick: () => { this.current = this.last; }, disabled: (this.current === this.last) ? true : false }, " ", h("jump-icon", { key: '101a5fca010de64d804b8b8dbd336e1ad498c958', slot: "prefix", name: "chevrons-right" }), " "))))));
39
27
  }
40
28
  static get is() { return "jump-pagination"; }
41
29
  static get originalStyleUrls() {
@@ -50,23 +38,6 @@ export class JumpPagination {
50
38
  }
51
39
  static get properties() {
52
40
  return {
53
- "totalElements": {
54
- "type": "number",
55
- "mutable": false,
56
- "complexType": {
57
- "original": "number",
58
- "resolved": "number",
59
- "references": {}
60
- },
61
- "required": false,
62
- "optional": false,
63
- "docs": {
64
- "tags": [],
65
- "text": ""
66
- },
67
- "attribute": "total-elements",
68
- "reflect": true
69
- },
70
41
  "pagLabel": {
71
42
  "type": "string",
72
43
  "mutable": false,
@@ -82,28 +53,10 @@ export class JumpPagination {
82
53
  "text": ""
83
54
  },
84
55
  "attribute": "pag-label",
85
- "reflect": true,
56
+ "reflect": false,
86
57
  "defaultValue": "'di'"
87
58
  },
88
- "initialPage": {
89
- "type": "number",
90
- "mutable": false,
91
- "complexType": {
92
- "original": "number",
93
- "resolved": "number",
94
- "references": {}
95
- },
96
- "required": false,
97
- "optional": false,
98
- "docs": {
99
- "tags": [],
100
- "text": ""
101
- },
102
- "attribute": "initial-page",
103
- "reflect": true,
104
- "defaultValue": "1"
105
- },
106
- "lastPage": {
59
+ "last": {
107
60
  "type": "number",
108
61
  "mutable": false,
109
62
  "complexType": {
@@ -117,67 +70,10 @@ export class JumpPagination {
117
70
  "tags": [],
118
71
  "text": ""
119
72
  },
120
- "attribute": "last-page",
121
- "reflect": true,
73
+ "attribute": "last",
74
+ "reflect": false,
122
75
  "defaultValue": "10"
123
76
  },
124
- "labelElementsPerPage": {
125
- "type": "string",
126
- "mutable": false,
127
- "complexType": {
128
- "original": "string",
129
- "resolved": "string",
130
- "references": {}
131
- },
132
- "required": false,
133
- "optional": false,
134
- "docs": {
135
- "tags": [],
136
- "text": "Label for the elements per page select"
137
- },
138
- "attribute": "label-elements-per-page",
139
- "reflect": true,
140
- "defaultValue": "'Elementi per pagina'"
141
- },
142
- "elementsRanges": {
143
- "type": "unknown",
144
- "mutable": false,
145
- "complexType": {
146
- "original": "Array<number>",
147
- "resolved": "number[]",
148
- "references": {
149
- "Array": {
150
- "location": "global",
151
- "id": "global::Array"
152
- }
153
- }
154
- },
155
- "required": false,
156
- "optional": false,
157
- "docs": {
158
- "tags": [],
159
- "text": "Values for the elements per page select"
160
- },
161
- "defaultValue": "[10, 20, 60, 100]"
162
- },
163
- "completeVersion": {
164
- "type": "boolean",
165
- "mutable": false,
166
- "complexType": {
167
- "original": "boolean",
168
- "resolved": "boolean",
169
- "references": {}
170
- },
171
- "required": false,
172
- "optional": false,
173
- "docs": {
174
- "tags": [],
175
- "text": "If true, the component will show the complete version of the pagination, with elements informations"
176
- },
177
- "attribute": "complete-version",
178
- "reflect": true,
179
- "defaultValue": "false"
180
- },
181
77
  "showFirstAndLast": {
182
78
  "type": "boolean",
183
79
  "mutable": false,
@@ -193,20 +89,19 @@ export class JumpPagination {
193
89
  "text": ""
194
90
  },
195
91
  "attribute": "show-first-and-last",
196
- "reflect": true,
92
+ "reflect": false,
197
93
  "defaultValue": "false"
198
94
  }
199
95
  };
200
96
  }
201
97
  static get states() {
202
98
  return {
203
- "firstPage": {},
204
- "currentPage": {}
99
+ "current": {}
205
100
  };
206
101
  }
207
102
  static get events() {
208
103
  return [{
209
- "method": "jumpChangePage",
104
+ "method": "changePage",
210
105
  "name": "jump-change-page",
211
106
  "bubbles": true,
212
107
  "cancelable": true,
@@ -224,8 +119,8 @@ export class JumpPagination {
224
119
  }
225
120
  static get watchers() {
226
121
  return [{
227
- "propName": "currentPage",
228
- "methodName": "watchCurrentPage"
122
+ "propName": "current",
123
+ "methodName": "watchcurrent"
229
124
  }];
230
125
  }
231
126
  }
@@ -1 +1 @@
1
- {"version":3,"file":"jump-pagination.js","sourceRoot":"","sources":["../../../src/components/jump-pagination/jump-pagination.tsx"],"names":[],"mappings":"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","sourcesContent":["import { Component, Host, State, Event, EventEmitter, Prop, h, Watch } from '@stencil/core';\n\n@Component({\n tag: 'jump-pagination',\n styleUrl: 'jump-pagination.scss',\n shadow: false,\n})\nexport class JumpPagination {\n \n /* ---------------------- @STATE ------------------------- */\n /**\n * Indicates the first page/product of the list\n */\n @State() firstPage: number = 1;\n\n @State() currentPage: number;\n\n @Watch('currentPage')\n watchCurrentPage(newValue: number, oldValue: number) {\n let details = {\n currentPage: newValue,\n previousPage: oldValue,\n firstPage: this.firstPage,\n lastPage: this.lastPage,\n direction: newValue > oldValue ? 'next' : 'prev'\n };\n\n this.jumpChangePage.emit(details);\n }\n\n /* ---------------------- @PROPERTIES ------------------------- */\n\n @Prop({reflect:true}) totalElements: number;\n\n @Prop({reflect:true}) pagLabel: string = 'di'; // Identifica la label testuale di pagination. \n\n @Prop({reflect:true}) initialPage: number = 1;\n\n @Prop({reflect:true}) lastPage: number = 10; \n\n /**\n * Label for the elements per page select\n */\n @Prop({reflect:true}) labelElementsPerPage: string = 'Elementi per pagina';\n\n /**\n * Values for the elements per page select\n */\n @Prop({reflect:true}) elementsRanges: Array<number> = [10, 20, 60, 100];\n\n\n /**\n * If true, the component will show the complete version of the pagination, with elements informations\n */\n @Prop({reflect:true}) completeVersion: boolean = false;\n\n @Prop({reflect:true}) showFirstAndLast: boolean = false;\n\n /* ---------------------- @EVENTS ------------------------- */\n @Event({ eventName: 'jump-change-page' }) jumpChangePage: EventEmitter;\n\n /* ---------------------- @LIFECYCLE ------------------------- */\n componentWillLoad() {\n this.currentPage = this.initialPage;\n }\n\n render() {\n console.log('completeVersion', this.completeVersion);\n return (\n <Host class=\"JumpPagination\">\n <div class=\"JumpPagination__Wrapper\">\n { this.completeVersion && \n <div class=\"elementsPerPage\">\n <label htmlFor=\"elements\">{this.labelElementsPerPage ?? 'Elements per page'}</label>\n <select name=\"elements\" id=\"elements\">\n {this.elementsRanges.map((range) => (\n <option value={range}>{range}</option>\n ))}\n </select>\n </div> \n }\n <div class=\"indicators\"> \n <div class=\"elements\">\n {this.completeVersion ?\n <span>\n <span>{this.firstPage}</span> - <span>{this.currentPage}</span> {this.pagLabel} <span>{this.totalElements}</span>\n </span>\n \n :\n <span>\n <span>{this.currentPage}</span> {this.pagLabel} <span>{this.lastPage}</span>\n </span>\n }\n </div>\n <div class=\"arrow\">\n {this.showFirstAndLast &&\n <button \n onClick={() => {this.currentPage = this.firstPage} }\n disabled={(this.currentPage === this.firstPage) ? true : false}\n > <jump-icon slot=\"prefix\" name=\"chevrons-left\"></jump-icon> </button>\n }\n <button \n onClick={() => {this.currentPage--}} \n disabled={(this.currentPage === this.firstPage) ? true : false}\n > <jump-icon slot=\"prefix\" name=\"chevron-left\"></jump-icon> </button>\n <button \n onClick={() => {this.currentPage++}}\n disabled={(this.currentPage === this.lastPage) ? true : false}\n > <jump-icon slot=\"prefix\" name=\"chevron-right\"></jump-icon> </button>\n {this.showFirstAndLast &&\n <button \n onClick={() => {this.currentPage = this.lastPage}}\n disabled={(this.currentPage === this.lastPage) ? true : false}\n > <jump-icon slot=\"prefix\" name=\"chevrons-right\"></jump-icon> </button> \n }\n </div> \n </div>\n </div>\n </Host>\n );\n }\n\n}\n"]}
1
+ {"version":3,"file":"jump-pagination.js","sourceRoot":"","sources":["../../../src/components/jump-pagination/jump-pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAO5F,MAAM,OAAO,cAAc;;uBAGE,CAAC;wBAgBD,IAAI;oBAER,EAAE;gCAEW,KAAK;;IAjBzC,YAAY,CAAC,QAAgB,EAAE,QAAgB;QAC7C,IAAI,OAAO,GAAG;YACZ,OAAO,EAAE,QAAQ;YACjB,YAAY,EAAE,QAAQ;YACtB,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;SACjD,CAAC;QAEF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAYD,iEAAiE;IACjE,iBAAiB;QACf,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IACnB,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,KAAK,EAAC,gBAAgB;YAC1B,4DAAK,KAAK,EAAC,yBAAyB;gBAClC,4DAAK,KAAK,EAAC,YAAY;oBACrB,4DAAK,KAAK,EAAC,UAAU;wBACnB;4BACE,+DAAO,IAAI,CAAC,OAAO,CAAQ;;4BAAE,IAAI,CAAC,QAAQ;;4BAAE,+DAAO,IAAI,CAAC,IAAI,CAAQ,CAC/D,CACH;oBACN,4DAAK,KAAK,EAAC,OAAO;wBACf,IAAI,CAAC,gBAAgB;4BACpB,+DACE,OAAO,EAAE,GAAG,EAAE,GAAE,IAAI,CAAC,OAAO,GAAG,CAAC,CAAA,CAAA,CAAC,EACjC,QAAQ,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;;gCAC7C,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,eAAe,GAAa;sCAAY;wBAE1E,+DACE,OAAO,EAAE,GAAG,EAAE,GAAE,IAAI,CAAC,OAAO,EAAE,CAAA,CAAA,CAAC,EAC/B,QAAQ,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;;4BAC7C,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,cAAc,GAAa;kCAAY;wBACvE,+DACE,OAAO,EAAE,GAAG,EAAE,GAAE,IAAI,CAAC,OAAO,EAAE,CAAA,CAAA,CAAC,EAC/B,QAAQ,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;;4BACnD,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,eAAe,GAAa;kCAAY;wBACzE,IAAI,CAAC,gBAAgB;4BACpB,+DACE,OAAO,EAAE,GAAG,EAAE,GAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAA,CAAA,CAAC,EACzC,QAAQ,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;;gCACnD,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,gBAAgB,GAAa;sCAAY,CAEzE,CACF,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, State, Event, EventEmitter, Prop, h, Watch } from '@stencil/core';\n\n@Component({\n tag: 'jump-pagination',\n styleUrl: 'jump-pagination.scss',\n shadow: false,\n})\nexport class JumpPagination {\n \n /* ---------------------- @STATE ------------------------- */\n @State() current: number = 1;\n\n @Watch('current')\n watchcurrent(newValue: number, oldValue: number) {\n let details = {\n current: newValue,\n previousPage: oldValue,\n first: 1,\n last: this.last,\n direction: newValue > oldValue ? 'next' : 'prev'\n };\n\n this.changePage.emit(details);\n }\n\n /* ---------------------- @PROPERTIES ------------------------- */\n @Prop() pagLabel: string = 'di'; // Identifica la label testuale di pagination. \n\n @Prop() last: number = 10; \n\n @Prop() showFirstAndLast: boolean = false;\n\n /* ---------------------- @EVENTS ------------------------- */\n @Event({ eventName: 'jump-change-page' }) changePage: EventEmitter;\n\n /* ---------------------- @LIFECYCLE ------------------------- */\n componentWillLoad() {\n this.current = 1;\n }\n \n render() {\n return (\n <Host class=\"JumpPagination\">\n <div class=\"JumpPagination__Wrapper\">\n <div class=\"indicators\"> \n <div class=\"elements\">\n <span>\n <span>{this.current}</span> {this.pagLabel} <span>{this.last}</span>\n </span>\n </div>\n <div class=\"arrow\">\n {this.showFirstAndLast &&\n <button \n onClick={() => {this.current = 1} }\n disabled={(this.current === 1) ? true : false}\n > <jump-icon slot=\"prefix\" name=\"chevrons-left\"></jump-icon> </button>\n }\n <button \n onClick={() => {this.current--}} \n disabled={(this.current === 1) ? true : false}\n > <jump-icon slot=\"prefix\" name=\"chevron-left\"></jump-icon> </button>\n <button \n onClick={() => {this.current++}}\n disabled={(this.current === this.last) ? true : false}\n > <jump-icon slot=\"prefix\" name=\"chevron-right\"></jump-icon> </button>\n {this.showFirstAndLast &&\n <button \n onClick={() => {this.current = this.last}}\n disabled={(this.current === this.last) ? true : false}\n > <jump-icon slot=\"prefix\" name=\"chevrons-right\"></jump-icon> </button> \n }\n </div> \n </div>\n </div>\n </Host>\n );\n }\n\n}\n"]}
@@ -0,0 +1,68 @@
1
+ import { generateAttributesFromArgs, formatHtml } from "../../utils/utils";
2
+ export default {
3
+ title: 'Components/Pagination/PaginationBase',
4
+ tags: ['autodocs'],
5
+ argTypes: {
6
+ pagLabel: {
7
+ name: "pag-label",
8
+ control: 'text',
9
+ description: 'Indica la dicitura di paginazione. Di default è "di".'
10
+ },
11
+ showFirstAndLast: {
12
+ name: 'show-first-and-last',
13
+ control: 'boolean',
14
+ description: 'Indica se mostrare le frecce aggiuntive per navigare rapidamente nella prima o ultima pagina. Da preferire con un numero elevato di pagine.'
15
+ },
16
+ current: {
17
+ name: 'current-page',
18
+ control: 'number',
19
+ description: 'Pagina corrente'
20
+ },
21
+ last: {
22
+ name: 'last',
23
+ control: 'number',
24
+ description: 'Indica l\'ultima pagina',
25
+ },
26
+ }
27
+ };
28
+ const Template = (args) => {
29
+ const attributes = generateAttributesFromArgs(args);
30
+ return formatHtml(`<jump-pagination ${attributes}></jump-pagination>`);
31
+ };
32
+ const TemplateWithListenerExample = (args, data) => {
33
+ let id = data.id;
34
+ const attributes = generateAttributesFromArgs(args);
35
+ return formatHtml(`<jump-pagination ${attributes}></jump-pagination>
36
+ <div>La pagina corrente è: <span id="page-number">loading..<span></div>
37
+ <script>
38
+ (function() {
39
+ let container;
40
+ container = document.querySelector('#story--${id}');
41
+ container.querySelector('jump-pagination').addEventListener('jump-change-page', (ev) => {
42
+ container.querySelector('#page-number').innerText = ev.detail.current;
43
+ });
44
+ })();
45
+ </script>`);
46
+ };
47
+ export const Playground = Template.bind({});
48
+ Playground.args = {
49
+ showFirstAndLast: false,
50
+ current: 1,
51
+ last: 10,
52
+ pagLabel: 'di'
53
+ };
54
+ export const PaginationRidotto = TemplateWithListenerExample.bind({});
55
+ PaginationRidotto.args = {
56
+ showFirstAndLast: false,
57
+ current: 1,
58
+ last: 10,
59
+ pagLabel: 'di'
60
+ };
61
+ export const PaginationCompleto = TemplateWithListenerExample.bind({});
62
+ PaginationCompleto.args = {
63
+ showFirstAndLast: true,
64
+ current: 1,
65
+ last: 10,
66
+ pagLabel: 'di'
67
+ };
68
+ //# sourceMappingURL=jump-pagination.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jump-pagination.stories.js","sourceRoot":"","sources":["../../../src/components/jump-pagination/jump-pagination.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE1E,eAAe;IACb,KAAK,EAAE,sCAAsC;IAC7C,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,QAAQ,EAAC;YACP,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,uDAAuD;SACrE;QAED,gBAAgB,EAAE;YAChB,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,6IAA6I;SAC3J;QACD,OAAO,EAAE;YACP,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,iBAAiB;SAC/B;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,yBAAyB;SACvC;KACF;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE;IACxB,MAAM,UAAU,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,UAAU,CAAC,oBAAoB,UAAU,qBAAqB,CAAC,CAAC;AACzE,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;IACjD,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IACjB,MAAM,UAAU,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,UAAU,CAAC,oBAAoB,UAAU;;;;;4DAKU,EAAE;;;;;oBAK1C,CAAC,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAE5C,UAAU,CAAC,IAAI,GAAG;IAChB,gBAAgB,EAAE,KAAK;IACvB,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEtE,iBAAiB,CAAC,IAAI,GAAG;IACvB,gBAAgB,EAAE,KAAK;IACvB,OAAO,EAAE,CAAC;IACV,IAAI,EAAC,EAAE;IACP,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEvE,kBAAkB,CAAC,IAAI,GAAG;IACxB,gBAAgB,EAAE,IAAI;IACtB,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,IAAI;CACf,CAAC","sourcesContent":["import { generateAttributesFromArgs, formatHtml} from '../../utils/utils';\n\nexport default {\n title: 'Components/Pagination/PaginationBase',\n tags: ['autodocs'],\n argTypes: {\n pagLabel:{\n name: \"pag-label\",\n control: 'text',\n description: 'Indica la dicitura di paginazione. Di default è \"di\".'\n },\n \n showFirstAndLast: {\n name: 'show-first-and-last',\n control: 'boolean',\n description: 'Indica se mostrare le frecce aggiuntive per navigare rapidamente nella prima o ultima pagina. Da preferire con un numero elevato di pagine.'\n },\n current: {\n name: 'current-page',\n control: 'number',\n description: 'Pagina corrente'\n },\n last: {\n name: 'last',\n control: 'number',\n description: 'Indica l\\'ultima pagina',\n },\n }\n};\n\nconst Template = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`<jump-pagination ${attributes}></jump-pagination>`);\n};\n\nconst TemplateWithListenerExample = (args, data) => {\n let id = data.id;\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`<jump-pagination ${attributes}></jump-pagination>\n <div>La pagina corrente è: <span id=\"page-number\">loading..<span></div>\n <script>\n (function() {\n let container;\n container = document.querySelector('#story--${id}');\n container.querySelector('jump-pagination').addEventListener('jump-change-page', (ev) => {\n container.querySelector('#page-number').innerText = ev.detail.current;\n });\n })();\n </script>`);\n};\n\nexport const Playground = Template.bind({});\n\nPlayground.args = {\n showFirstAndLast: false,\n current: 1,\n last: 10,\n pagLabel: 'di'\n};\n\nexport const PaginationRidotto = TemplateWithListenerExample.bind({});\n\nPaginationRidotto.args = {\n showFirstAndLast: false,\n current: 1,\n last:10,\n pagLabel: 'di'\n};\n\nexport const PaginationCompleto = TemplateWithListenerExample.bind({});\n\nPaginationCompleto.args = {\n showFirstAndLast: true,\n current: 1,\n last: 10,\n pagLabel: 'di'\n};"]}
@@ -0,0 +1,56 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .JumpPaginationTable {
6
+ --jump-pagination-table-label: var(--neutral-grey-secondary);
7
+ --jump-pagination-table-arrows: var(--neutral-grey-secondary);
8
+ --jump-pagination-table-arrows-disabled: var(--neutral-grey-disabled);
9
+ font-family: var(--ff-primary);
10
+ }
11
+ .JumpPaginationTable__Wrapper {
12
+ display: flex;
13
+ justify-content: space-between;
14
+ }
15
+ .JumpPaginationTable__Wrapper .elementsPerPage {
16
+ display: flex;
17
+ gap: 1rem;
18
+ align-items: center;
19
+ }
20
+ .JumpPaginationTable__Wrapper .elementsPerPage label {
21
+ color: var(--jump-pagination-table-label);
22
+ font-size: var(--fs-300);
23
+ font-weight: normal;
24
+ }
25
+ .JumpPaginationTable__Wrapper .indicators {
26
+ font-size: var(--fs-400);
27
+ font-weight: normal;
28
+ display: flex;
29
+ justify-content: space-between;
30
+ gap: 20px;
31
+ color: var(--jump-pagination-table-label);
32
+ }
33
+ .JumpPaginationTable__Wrapper .indicators .arrow {
34
+ color: var(--jump-pagination-table-arrows);
35
+ display: flex;
36
+ align-items: center;
37
+ gap: 10px;
38
+ }
39
+ .JumpPaginationTable__Wrapper .indicators .arrow button {
40
+ background-color: transparent;
41
+ border: none;
42
+ cursor: pointer;
43
+ padding: 0px;
44
+ display: flex;
45
+ align-items: center;
46
+ }
47
+ .JumpPaginationTable__Wrapper .indicators .arrow button:disabled {
48
+ cursor: not-allowed;
49
+ color: var(--jump-pagination-table-arrows-disabled);
50
+ }
51
+ .JumpPaginationTable__Wrapper .indicators .elements {
52
+ color: var(--jump-pagination-table-label);
53
+ display: flex;
54
+ align-items: center;
55
+ gap: 5px;
56
+ }