@jumpgroup/jump-design-system 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/jump-design-system.cjs.js +1 -1
- package/dist/cjs/jump-pagination-table.cjs.entry.js +17 -18
- package/dist/cjs/jump-pagination-table.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/jump-pagination-table/jump-pagination-table.js +31 -45
- package/dist/collection/components/jump-pagination-table/jump-pagination-table.js.map +1 -1
- package/dist/collection/components/jump-pagination-table/jump-pagination-table.stories.js +6 -14
- package/dist/collection/components/jump-pagination-table/jump-pagination-table.stories.js.map +1 -1
- package/dist/components/jump-pagination-table.js +22 -21
- package/dist/components/jump-pagination-table.js.map +1 -1
- package/dist/esm/jump-design-system.js +1 -1
- package/dist/esm/jump-pagination-table.entry.js +17 -18
- package/dist/esm/jump-pagination-table.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/jump-design-system/jump-design-system.esm.js +1 -1
- package/dist/jump-design-system/jump-design-system.esm.js.map +1 -1
- package/dist/jump-design-system/p-37114ce3.entry.js +2 -0
- package/dist/jump-design-system/p-37114ce3.entry.js.map +1 -0
- package/dist/jump-design-system-elements.json +2 -2
- package/dist/types/components/jump-pagination-table/jump-pagination-table.d.ts +3 -1
- package/dist/types/components/jump-pagination-table/jump-pagination-table.stories.d.ts +1 -6
- package/dist/types/components.d.ts +2 -10
- package/package.json +1 -1
- package/dist/jump-design-system/p-594b15ee.entry.js +0 -2
- package/dist/jump-design-system/p-594b15ee.entry.js.map +0 -1
|
@@ -19,7 +19,7 @@ const patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["jump-button_2.cjs",[[1,"jump-button",{"disabled":[4],"variant":[1],"outline":[4],"size":[1],"full":[4],"pill":[4],"text":[4],"onlyIcon":[4,"only-icon"],"href":[1],"target":[1],"type":[1],"name":[1],"value":[1],"ariaLabel":[1,"aria-label"],"class":[1],"buttonId":[1,"button-id"]}],[1,"jump-icon",{"class":[1],"library":[1],"name":[1],"category":[1],"size":[1],"label":[1],"src":[1]}]]],["jump-card-ecommerce.cjs",[[1,"jump-card-ecommerce",{"onlyIconButton":[4,"only-icon-button"],"hasBackground":[4,"has-background"],"badge":[1],"favorite":[1540],"hasFavorite":[4,"has-favorite"],"favoriteBtnClass":[1,"favorite-btn-class"],"link":[1],"img":[1],"imgAlt":[1,"img-alt"],"hoverImg":[1,"hover-img"],"hoverImgAlt":[1,"hover-img-alt"],"videoSrc":[1,"video-src"],"notificationUrl":[1,"notification-url"],"notificationText":[1,"notification-text"],"productName":[1,"product-name"],"subtitle":[1],"productId":[1,"product-id"],"price":[2],"salePrice":[2,"sale-price"],"currency":[1],"outOfStock":[1540,"out-of-stock"],"outOfStockText":[1,"out-of-stock-text"],"addToCartText":[1,"add-to-cart-text"],"waitingListText":[1,"waiting-list-text"],"addToWaitingList":[4,"add-to-waiting-list"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32]},[[0,"jump-card-ecommerce-option-connected","addOption"]]]]],["jump-filter.cjs",[[1,"jump-filter",{"direction":[1],"filterHeading":[1,"filter-heading"],"filterButtonLabel":[1,"filter-button-label"],"filterButtonIcon":[1,"filter-button-icon"],"mobileThreshold":[2,"mobile-threshold"],"filters":[8],"activeFilters":[32],"showMobileFilters":[32],"isMobile":[32],"getFilters":[64]},[[0,"jump-filterchange","filterChangeHandler"],[9,"resize","handleResize"]]]]],["jump-filtergroup.cjs",[[1,"jump-filtergroup",{"name":[1],"title":[1],"otherLabel":[1,"other-label"],"lessLabel":[1,"less-label"],"maxElements":[2,"max-elements"],"variant":[1],"values":[32],"value":[32],"slotItems":[32],"inputs":[32],"showMore":[32],"getValues":[64],"getActiveAmount":[64],"getInputs":[64],"getName":[64]}]]],["jump-pagination.cjs",[[1,"jump-pagination",{"pagLabel":[1,"pag-label"],"last":[2],"showFirstAndLast":[4,"show-first-and-last"],"current":[32]},null,{"current":["watchcurrent"]}]]],["jump-pagination-table.cjs",[[0,"jump-pagination-table",{"elementsRanges":[
|
|
22
|
+
return index.bootstrapLazy([["jump-button_2.cjs",[[1,"jump-button",{"disabled":[4],"variant":[1],"outline":[4],"size":[1],"full":[4],"pill":[4],"text":[4],"onlyIcon":[4,"only-icon"],"href":[1],"target":[1],"type":[1],"name":[1],"value":[1],"ariaLabel":[1,"aria-label"],"class":[1],"buttonId":[1,"button-id"]}],[1,"jump-icon",{"class":[1],"library":[1],"name":[1],"category":[1],"size":[1],"label":[1],"src":[1]}]]],["jump-card-ecommerce.cjs",[[1,"jump-card-ecommerce",{"onlyIconButton":[4,"only-icon-button"],"hasBackground":[4,"has-background"],"badge":[1],"favorite":[1540],"hasFavorite":[4,"has-favorite"],"favoriteBtnClass":[1,"favorite-btn-class"],"link":[1],"img":[1],"imgAlt":[1,"img-alt"],"hoverImg":[1,"hover-img"],"hoverImgAlt":[1,"hover-img-alt"],"videoSrc":[1,"video-src"],"notificationUrl":[1,"notification-url"],"notificationText":[1,"notification-text"],"productName":[1,"product-name"],"subtitle":[1],"productId":[1,"product-id"],"price":[2],"salePrice":[2,"sale-price"],"currency":[1],"outOfStock":[1540,"out-of-stock"],"outOfStockText":[1,"out-of-stock-text"],"addToCartText":[1,"add-to-cart-text"],"waitingListText":[1,"waiting-list-text"],"addToWaitingList":[4,"add-to-waiting-list"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32]},[[0,"jump-card-ecommerce-option-connected","addOption"]]]]],["jump-filter.cjs",[[1,"jump-filter",{"direction":[1],"filterHeading":[1,"filter-heading"],"filterButtonLabel":[1,"filter-button-label"],"filterButtonIcon":[1,"filter-button-icon"],"mobileThreshold":[2,"mobile-threshold"],"filters":[8],"activeFilters":[32],"showMobileFilters":[32],"isMobile":[32],"getFilters":[64]},[[0,"jump-filterchange","filterChangeHandler"],[9,"resize","handleResize"]]]]],["jump-filtergroup.cjs",[[1,"jump-filtergroup",{"name":[1],"title":[1],"otherLabel":[1,"other-label"],"lessLabel":[1,"less-label"],"maxElements":[2,"max-elements"],"variant":[1],"values":[32],"value":[32],"slotItems":[32],"inputs":[32],"showMore":[32],"getValues":[64],"getActiveAmount":[64],"getInputs":[64],"getName":[64]}]]],["jump-pagination.cjs",[[1,"jump-pagination",{"pagLabel":[1,"pag-label"],"last":[2],"showFirstAndLast":[4,"show-first-and-last"],"current":[32]},null,{"current":["watchcurrent"]}]]],["jump-pagination-table.cjs",[[0,"jump-pagination-table",{"elementsRanges":[1,"elements-ranges"],"pagLabel":[513,"pag-label"],"labelElementsPerPage":[513,"label-elements-per-page"],"total":[514],"first":[514],"last":[514],"showFirstAndLast":[516,"show-first-and-last"],"elementsRangesArray":[32],"elPerPage":[32]},null,{"elementsRanges":["elementsRangesChanged"],"elPerPage":["elPerPageChanged"]}]]],["jump-quantity.cjs",[[65,"jump-quantity",{"min":[2],"max":[2],"step":[2],"label":[1],"type":[1],"variant":[1],"showButtons":[4,"show-buttons"],"value":[2],"getValue":[64],"reset":[64]},null,{"value":["onValueChange"]}]]],["jump-tab-item.cjs",[[1,"jump-tab-item",{"identifier":[1],"iconName":[1,"icon-name"],"iconPosition":[1,"icon-position"],"label":[1],"active":[4],"disabled":[4],"variant":[32]}]]],["jump-accordion.cjs",[[1,"jump-accordion"]]],["jump-card.cjs",[[4,"jump-card",{"horizontal":[4],"dark":[4],"shadow":[4],"border":[4],"borderRadius":[4,"border-radius"],"topBorderContentRadius":[4,"top-border-content-radius"],"boxed":[4],"roundedMedia":[4,"rounded-media"],"imgSrc":[1,"img-src"],"imgAlt":[1,"img-alt"],"videoSrc":[1,"video-src"]}]]],["jump-card-ecommerce-option.cjs",[[1,"jump-card-ecommerce-option",{"code":[1],"imgUrl":[1,"img-url"],"label":[1],"sku":[1],"taxonomy":[1]}]]],["jump-tab.cjs",[[1,"jump-tab",{"tabGroupName":[1,"tab-group-name"],"variant":[1]},[[0,"jump-change-active-tab","changeActiveTabHandler"]]]]],["jump-tab-panel.cjs",[[1,"jump-tab-panel",{"identifier":[1],"active":[4]}]]],["jump-badge.cjs",[[1,"jump-badge",{"label":[1],"variant":[513],"dimension":[513],"soft":[516],"outline":[516]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -12,8 +12,9 @@ const JumpPaginationTable = class {
|
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
13
|
this.changePage = index.createEvent(this, "jump-change-page", 7);
|
|
14
14
|
this.changeElPerPage = index.createEvent(this, "jump-change-el-per-page", 7);
|
|
15
|
-
this.elementsRanges =
|
|
16
|
-
this.
|
|
15
|
+
this.elementsRanges = "10,20,60,100";
|
|
16
|
+
this.elementsRangesArray = undefined;
|
|
17
|
+
this.elPerPage = undefined;
|
|
17
18
|
this.pagLabel = 'di';
|
|
18
19
|
this.labelElementsPerPage = 'Elementi per pagina';
|
|
19
20
|
this.total = 100;
|
|
@@ -21,6 +22,14 @@ const JumpPaginationTable = class {
|
|
|
21
22
|
this.last = 10;
|
|
22
23
|
this.showFirstAndLast = false;
|
|
23
24
|
}
|
|
25
|
+
elementsRangesChanged(newValue, oldValue) {
|
|
26
|
+
console.log('dentro el');
|
|
27
|
+
if (newValue !== oldValue) {
|
|
28
|
+
this.elementsRangesArray = newValue.split(',').map(Number);
|
|
29
|
+
}
|
|
30
|
+
this.elementsRangesArray = [...this.elementsRangesArray];
|
|
31
|
+
console.log('elementsRangesChanged', newValue, oldValue);
|
|
32
|
+
}
|
|
24
33
|
elPerPageChanged(newValue, oldValue) {
|
|
25
34
|
if (newValue !== oldValue) {
|
|
26
35
|
// Riporta la paginazione allo stato iniziale
|
|
@@ -31,7 +40,8 @@ const JumpPaginationTable = class {
|
|
|
31
40
|
}
|
|
32
41
|
/* -------------------- LYFECYCLE EVENTS ---------------------- */
|
|
33
42
|
componentWillLoad() {
|
|
34
|
-
this.
|
|
43
|
+
this.elementsRangesArray = this.elementsRanges.split(',').map(Number);
|
|
44
|
+
this.elPerPage = this.elementsRangesArray[0];
|
|
35
45
|
}
|
|
36
46
|
/* -------------------- @LISTEN ------------------------------- */
|
|
37
47
|
/* -------------------- @METHOD ------------------------------- */
|
|
@@ -71,23 +81,12 @@ const JumpPaginationTable = class {
|
|
|
71
81
|
/* --------------------- RENDER ------------------------------- */
|
|
72
82
|
render() {
|
|
73
83
|
var _a;
|
|
74
|
-
return (index.h(index.Host, { key: '
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
// disabled={this.first === 1}
|
|
78
|
-
// >
|
|
79
|
-
// <jump-icon slot="prefix" name="chevrons-left"></jump-icon>
|
|
80
|
-
// </button>
|
|
81
|
-
index.h("jump-button", { key: 'c7a833acee791a25257e237d88aef4e5bf5b5cc8', onClick: () => this.doChangePage('first'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", index.h("jump-icon", { key: 'ffb50e27e476c8ca8d58ff18ce30c96ff6330872', slot: "suffix", name: "chevrons-left" }), " "), index.h("jump-button", { key: '46bf715a0803deef866d90a1523675ab24c1793f', onClick: () => this.doChangePage('previous'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", index.h("jump-icon", { key: '223bf0f161ffce6ee0e17fbae7b8467cae790be3', slot: "suffix", name: "chevron-left" }), " "), index.h("jump-button", { key: '97696457a54e5808a0c252eeda2c8d915bcfe2e8', onClick: () => this.doChangePage('next'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", index.h("jump-icon", { key: '9e01f45cc02450c41bf3ffc2f14cfd6606ab5a96', slot: "suffix", name: "chevron-right" }), " "), this.showFirstAndLast &&
|
|
82
|
-
// <button
|
|
83
|
-
// onClick={() => this.doChangePage('last')}
|
|
84
|
-
// disabled={this.last === this.total}
|
|
85
|
-
// >
|
|
86
|
-
// <jump-icon slot="prefix" name="chevrons-right"></jump-icon>
|
|
87
|
-
// </button>
|
|
88
|
-
index.h("jump-button", { key: '05a745e26f5f14383e745a744c0c23e5598b0623', onClick: () => this.doChangePage('last'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", index.h("jump-icon", { key: '0ba46ee7053a3aed0091c05a20444c767738dc2f', slot: "suffix", name: "chevrons-right" }), " "))))));
|
|
84
|
+
return (index.h(index.Host, { key: 'fd4a13e65dfbcc334ace661e61297ff05d78624d', class: "JumpPaginationTable" }, index.h("div", { key: 'ae50a5dbac84be7f7f02c5c93f1e7cbd73a1fc6f', class: "JumpPaginationTable__Wrapper" }, index.h("div", { key: '2eade4e3a54fb4c84f3c7718d827d6e5295508bf', class: "elementsPerPage" }, index.h("label", { key: '4211a782ce895731ed90d52c88a278ccf69e03fc', htmlFor: "elements" }, (_a = this.labelElementsPerPage) !== null && _a !== void 0 ? _a : 'Elements per page'), index.h("select", { key: '6ce02a5ad892bf1d6b48b3ccb2605e1e1de3416b', name: "elements", id: "elements", onChange: (e) => this.setElPerPage(e) }, this.elementsRangesArray.map((range) => (index.h("option", { value: range, selected: (this.elPerPage == range) && true }, range))))), index.h("div", { key: '915e8eefc53385620b2d554935ab6f81f9571407', class: "indicators" }, index.h("div", { key: '02b3867d0fe90a6408aced6bd7b639d92cec61a6', class: "elements" }, index.h("span", { key: 'e1d25f5be0f4fbdd995588642d1ba1583e90a280' }, index.h("span", { key: '775b964a3dcc29be4d914c9ff309f6809555683b' }, this.first), " - ", index.h("span", { key: '31886227817ee097c5594bc1a81f271ac185531c' }, this.last), " ", this.pagLabel, " ", index.h("span", { key: 'a6525640edea1672b429732d2e23c72b1fbacf04' }, this.total))), index.h("div", { key: '9231615ab10231842136b4d64ce2a5e87a502c3f', class: "arrow" }, this.showFirstAndLast &&
|
|
85
|
+
index.h("jump-button", { key: 'cd9d9073f37b561464dfe5209cb43bc351392b40', onClick: () => this.doChangePage('first'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", index.h("jump-icon", { key: '48ece4b1628154ea80b33698c2de4a473e433d25', slot: "suffix", name: "chevrons-left" }), " "), index.h("jump-button", { key: '69c9b009244d96aa5c5e770d38ed9535330c1904', onClick: () => this.doChangePage('previous'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", index.h("jump-icon", { key: 'd5b18f4b7809af2032b4c955c59b0de2fb81b1b0', slot: "suffix", name: "chevron-left" }), " "), index.h("jump-button", { key: '95bf121ea17a00e01f4d47c256191665850dfcb6', onClick: () => this.doChangePage('next'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", index.h("jump-icon", { key: '64ac86934180ce2203c06472c00ec33334d128dd', slot: "suffix", name: "chevron-right" }), " "), this.showFirstAndLast &&
|
|
86
|
+
index.h("jump-button", { key: '2de71c60a69f5dc61088e2e4a27591e8b442967a', onClick: () => this.doChangePage('last'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", index.h("jump-icon", { key: 'c2113c26705cfafe41c9cb5c92527856dc7ee433', slot: "suffix", name: "chevrons-right" }), " "))))));
|
|
89
87
|
}
|
|
90
88
|
static get watchers() { return {
|
|
89
|
+
"elementsRanges": ["elementsRangesChanged"],
|
|
91
90
|
"elPerPage": ["elPerP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EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,EAAC,SAAS,EAAC,IAAI,QAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,OAAO,gBAAY,oBAAe,EAAC,EAAE,EAAC,QAAQ,EAAC,QAAQ,QAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,SAAGA,wEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,eAAe,GAAc,MAAe,EAOrR,IAAI,CAAC,gBAAgB;;;;;;;YAOpBA,0EAAa,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,EAAC,SAAS,EAAC,IAAI,QAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,OAAO,gBAAY,oBAAe,EAAC,EAAE,EAAC,QAAQ,EAAC,QAAQ,QAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,SAAGA,wEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,gBAAgB,GAAc,MAAe,CAErR,CACF,CACF,CACD,EACP;KACH;;;;;;;;;","names":["h","Host"],"sources":["src/components/jump-pagination-table/jump-pagination-table.scss?tag=jump-pagination-table","src/components/jump-pagination-table/jump-pagination-table.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.JumpPaginationTable {\n --jump-pagination-table-label: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows-disabled: var(--neutral-grey-disabled); //mappare una variabile del design system\n\n font-family: var(--ff-primary);\n\n &__Wrapper {\n display: flex;\n justify-content: space-between;\n \n .elementsPerPage {\n display: flex;\n gap: 1rem;\n align-items: center;\n \n label {\n color: var(--jump-pagination-table-label);\n font-size: var(--fs-300);\n font-weight: normal;\n }\n }\n \n .indicators {\n font-size: var(--fs-400);\n font-weight: normal;\n display: flex;\n justify-content: space-between;\n gap: 20px;\n \n color: var(--jump-pagination-table-label);\n \n .arrow {\n color: var(--jump-pagination-table-arrows);\n display: flex;\n align-items: center;\n gap: 10px;\n \n button {\n background-color: transparent;\n border: none;\n cursor: pointer;\n padding: 0px;\n display: flex;\n align-items: center;\n }\n \n button:disabled {\n cursor: not-allowed;\n color: var(--jump-pagination-table-arrows-disabled);\n \n }\n }\n \n .elements {\n color: var(--jump-pagination-table-label);\n display: flex;\n align-items: center;\n gap: 5px;\n }\n }\n \n }\n}","import { Component, Event, EventEmitter, Watch, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'jump-pagination-table',\n styleUrl: 'jump-pagination-table.scss',\n shadow: false,\n})\nexport class JumpPaginationTable {\n\n /* ---------------------- OWN PROPERTIES ---------------------- */\n\n /* ---------------------- @ELEMENT ---------------------------- */\n\n /* ---------------------- @STATE ------------------------------ */\n\n /* ---------------------- @PROPERTIES ------------------------- */\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 * Number of elements per page selected\n */\n @Prop() elPerPage: number = 10;\n @Watch('elPerPage')\n elPerPageChanged(newValue: number, oldValue: number) {\n if (newValue !== oldValue) {\n // Riporta la paginazione allo stato iniziale\n this.first = 1;\n this.last = Math.min(this.total, newValue);\n }\n\n this.changeElPerPage.emit({ elPerPage: newValue });\n }\n\n @Prop({ reflect: true }) pagLabel: string = 'di'; // Identifica la label testuale di pagination. \n\n /**\n * Label for the elements per page select\n */\n @Prop({ reflect: true }) labelElementsPerPage: string = 'Elementi per pagina';\n\n /**\n * Total of elements\n */\n @Prop({ reflect: true }) total: number = 100; \n\n /**\n * First element of the page\n */\n @Prop({ reflect: true }) first: number = 1;\n\n /**\n * Last element of the page\n */\n @Prop({ reflect: true }) last: number = 10;\n\n /**\n * Show button to navigate so first e last page\n */\n @Prop({ reflect: true }) showFirstAndLast: boolean = false;\n\n /* ---------------------- @EVENTS ------------------------- */\n @Event({ eventName: 'jump-change-page' }) changePage: EventEmitter;\n @Event({ eventName: 'jump-change-el-per-page' }) changeElPerPage: EventEmitter;\n\n /* -------------------- LYFECYCLE EVENTS ---------------------- */\n componentWillLoad() {\n this.elPerPage = this.elementsRanges[0];\n }\n\n /* -------------------- @LISTEN ------------------------------- */\n\n /* -------------------- @METHOD ------------------------------- */\n\n /* -------------------- LOCAL METHODS ------------------------- */\n setElPerPage(e) {\n this.elPerPage = e.target.value;\n }\n\n doChangePage(dir) {\n let newFirst;\n let newLast;\n\n //TODO refactorare \n if (dir === 'first') {\n newFirst = 1;\n newLast = Math.min(this.total, this.elPerPage);\n } else if (dir === 'last') {\n newLast = this.total;\n newFirst = Math.max(1, this.total - this.elPerPage + 1);\n } else if (dir === 'previous') {\n newFirst = Math.max(1, this.first - this.elPerPage);\n newLast = Math.min(this.total, newFirst + this.elPerPage - 1);\n } else if (dir === 'next') {\n newLast = Math.min(this.total, this.last + this.elPerPage);\n newFirst = Math.max(1, newLast - this.elPerPage + 1);\n }\n\n this.first = newFirst;\n this.last = newLast;\n\n let details = {\n first: newFirst,\n last: newLast,\n direction: dir\n }\n\n this.changePage.emit(details);\n }\n\n /* --------------------- RENDER ------------------------------- */\n render() {\n return (\n <Host class=\"JumpPaginationTable\">\n <div class=\"JumpPaginationTable__Wrapper\">\n <div class=\"elementsPerPage\">\n <label htmlFor=\"elements\">{this.labelElementsPerPage ?? 'Elements per page'}</label>\n <select name=\"elements\" id=\"elements\" onChange={(e) => this.setElPerPage(e)}>\n {this.elementsRanges.map((range) => (\n <option value={range} selected={(this.elPerPage == range) && true}>{range}</option>\n ))}\n </select>\n </div> \n <div class=\"indicators\">\n <div class=\"elements\">\n <span>\n <span>{this.first}</span> - <span>{this.last}</span> {this.pagLabel} <span>{this.total}</span>\n </span>\n </div>\n <div class=\"arrow\">\n {this.showFirstAndLast &&\n // <button \n // onClick={() => this.doChangePage('first')}\n // disabled={this.first === 1}\n // >\n // <jump-icon slot=\"prefix\" name=\"chevrons-left\"></jump-icon>\n // </button>\n <jump-button onClick={() => this.doChangePage('first')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevrons-left\" ></jump-icon> </jump-button>\n }\n {/* <button\n onClick={() => this.doChangePage('previous')}\n disabled={this.first === 1}\n >\n <jump-icon slot=\"prefix\" name=\"chevron-left\"></jump-icon>\n </button> */}\n <jump-button onClick={() => this.doChangePage('previous')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevron-left\" ></jump-icon> </jump-button>\n <jump-button onClick={() => this.doChangePage('next')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevron-right\" ></jump-icon> </jump-button>\n {/* <button\n onClick={() => this.doChangePage('next')}\n disabled={this.last === this.total}\n >\n <jump-icon slot=\"prefix\" name=\"chevron-right\"></jump-icon>\n </button> */}\n {this.showFirstAndLast &&\n // <button\n // onClick={() => this.doChangePage('last')}\n // disabled={this.last === this.total}\n // >\n // <jump-icon slot=\"prefix\" name=\"chevrons-right\"></jump-icon>\n // </button>\n <jump-button onClick={() => this.doChangePage('last')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevrons-right\" ></jump-icon> </jump-button>\n }\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n}\n"],"version":3}
|
|
1
|
+
{"file":"jump-pagination-table.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,sBAAsB,GAAG,+wCAA+wC,CAAC;AAC/yC,kCAAe,sBAA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AAC,IAAI,QAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,OAAO,gBAAY,oBAAe,EAAC,EAAE,EAAC,QAAQ,EAAC,QAAQ,QAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,KAAK,CAAC,SAAGA,wEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,cAAc,GAAc,MAAe,EACjRA,0EAAa,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,EAAC,SAAS,EAAC,IAAI,QAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,OAAO,gBAAY,oBAAe,EAAC,EAAE,EAAC,QAAQ,EAAC,QAAQ,QAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,SAAGA,wEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,eAAe,GAAc,MAAe,EACrR,IAAI,CAAC,gBAAgB;YACpBA,0EAAa,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,EAAC,SAAS,EAAC,IAAI,QAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,OAAO,gBAAY,oBAAe,EAAC,EAAE,EAAC,QAAQ,EAAC,QAAQ,QAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,SAAGA,wEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,gBAAgB,GAAc,MAAe,CAErR,CACF,CACF,CACD,EACP;KACH;;;;;;;;;;","names":["h","Host"],"sources":["src/components/jump-pagination-table/jump-pagination-table.scss?tag=jump-pagination-table","src/components/jump-pagination-table/jump-pagination-table.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.JumpPaginationTable {\n --jump-pagination-table-label: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows-disabled: var(--neutral-grey-disabled); //mappare una variabile del design system\n\n font-family: var(--ff-primary);\n\n &__Wrapper {\n display: flex;\n justify-content: space-between;\n \n .elementsPerPage {\n display: flex;\n gap: 1rem;\n align-items: center;\n \n label {\n color: var(--jump-pagination-table-label);\n font-size: var(--fs-300);\n font-weight: normal;\n }\n }\n \n .indicators {\n font-size: var(--fs-400);\n font-weight: normal;\n display: flex;\n justify-content: space-between;\n gap: 20px;\n \n color: var(--jump-pagination-table-label);\n \n .arrow {\n color: var(--jump-pagination-table-arrows);\n display: flex;\n align-items: center;\n gap: 10px;\n \n button {\n background-color: transparent;\n border: none;\n cursor: pointer;\n padding: 0px;\n display: flex;\n align-items: center;\n }\n \n button:disabled {\n cursor: not-allowed;\n color: var(--jump-pagination-table-arrows-disabled);\n \n }\n }\n \n .elements {\n color: var(--jump-pagination-table-label);\n display: flex;\n align-items: center;\n gap: 5px;\n }\n }\n \n }\n}","import { Component, State, Event, EventEmitter, Watch, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'jump-pagination-table',\n styleUrl: 'jump-pagination-table.scss',\n shadow: false,\n})\nexport class JumpPaginationTable {\n\n /* ---------------------- OWN PROPERTIES ---------------------- */\n\n /* ---------------------- @ELEMENT ---------------------------- */\n\n /* ---------------------- @STATE ------------------------------ */\n\n /* ---------------------- @PROPERTIES ------------------------- */\n\n /**\n * Values for the elements per page select\n */\n @Prop() elementsRanges: string = \"10,20,60,100\";\n\n @State() elementsRangesArray: number[];\n @Watch('elementsRanges')\n elementsRangesChanged(newValue, oldValue) {\n console.log('dentro el');\n if(newValue !== oldValue) {\n this.elementsRangesArray = newValue.split(',').map(Number);\n }\n this.elementsRangesArray = [...this.elementsRangesArray]\n console.log('elementsRangesChanged', newValue, oldValue);\n }\n\n /**\n * Number of elements per page selected\n */\n @State() elPerPage: number;\n @Watch('elPerPage')\n elPerPageChanged(newValue: number, oldValue: number) {\n if (newValue !== oldValue) {\n // Riporta la paginazione allo stato iniziale\n this.first = 1;\n this.last = Math.min(this.total, newValue);\n }\n\n this.changeElPerPage.emit({ elPerPage: newValue });\n }\n\n @Prop({ reflect: true }) pagLabel: string = 'di'; // Identifica la label testuale di pagination. \n\n /**\n * Label for the elements per page select\n */\n @Prop({ reflect: true }) labelElementsPerPage: string = 'Elementi per pagina';\n\n /**\n * Total of elements\n */\n @Prop({ reflect: true }) total: number = 100; \n\n /**\n * First element of the page\n */\n @Prop({ reflect: true }) first: number = 1;\n\n /**\n * Last element of the page\n */\n @Prop({ reflect: true }) last: number = 10;\n\n /**\n * Show button to navigate so first e last page\n */\n @Prop({ reflect: true }) showFirstAndLast: boolean = false;\n\n /* ---------------------- @EVENTS ------------------------- */\n @Event({ eventName: 'jump-change-page' }) changePage: EventEmitter;\n @Event({ eventName: 'jump-change-el-per-page' }) changeElPerPage: EventEmitter;\n\n /* -------------------- LYFECYCLE EVENTS ---------------------- */\n componentWillLoad() {\n this.elementsRangesArray = this.elementsRanges.split(',').map(Number);\n this.elPerPage = this.elementsRangesArray[0];\n }\n\n /* -------------------- @LISTEN ------------------------------- */\n\n /* -------------------- @METHOD ------------------------------- */\n\n /* -------------------- LOCAL METHODS ------------------------- */\n setElPerPage(e) {\n this.elPerPage = e.target.value;\n }\n\n doChangePage(dir) {\n let newFirst;\n let newLast;\n\n //TODO refactorare \n if (dir === 'first') {\n newFirst = 1;\n newLast = Math.min(this.total, this.elPerPage);\n } else if (dir === 'last') {\n newLast = this.total;\n newFirst = Math.max(1, this.total - this.elPerPage + 1);\n } else if (dir === 'previous') {\n newFirst = Math.max(1, this.first - this.elPerPage);\n newLast = Math.min(this.total, newFirst + this.elPerPage - 1);\n } else if (dir === 'next') {\n newLast = Math.min(this.total, this.last + this.elPerPage);\n newFirst = Math.max(1, newLast - this.elPerPage + 1);\n }\n\n this.first = newFirst;\n this.last = newLast;\n\n let details = {\n first: newFirst,\n last: newLast,\n direction: dir\n }\n\n this.changePage.emit(details);\n }\n\n /* --------------------- RENDER ------------------------------- */\n render() {\n return (\n <Host class=\"JumpPaginationTable\">\n <div class=\"JumpPaginationTable__Wrapper\">\n <div class=\"elementsPerPage\">\n <label htmlFor=\"elements\">{this.labelElementsPerPage ?? 'Elements per page'}</label>\n <select name=\"elements\" id=\"elements\" onChange={(e) => this.setElPerPage(e)}>\n {this.elementsRangesArray.map((range) => (\n <option value={range} selected={(this.elPerPage == range) && true}>{range}</option>\n ))}\n </select>\n </div> \n <div class=\"indicators\">\n <div class=\"elements\">\n <span>\n <span>{this.first}</span> - <span>{this.last}</span> {this.pagLabel} <span>{this.total}</span>\n </span>\n </div>\n <div class=\"arrow\">\n {this.showFirstAndLast &&\n <jump-button onClick={() => this.doChangePage('first')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevrons-left\" ></jump-icon> </jump-button>\n }\n <jump-button onClick={() => this.doChangePage('previous')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevron-left\" ></jump-icon> </jump-button>\n <jump-button onClick={() => this.doChangePage('next')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevron-right\" ></jump-icon> </jump-button>\n {this.showFirstAndLast &&\n <jump-button onClick={() => this.doChangePage('last')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevrons-right\" ></jump-icon> </jump-button>\n }\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n}\n"],"version":3}
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["jump-button_2.cjs",[[1,"jump-button",{"disabled":[4],"variant":[1],"outline":[4],"size":[1],"full":[4],"pill":[4],"text":[4],"onlyIcon":[4,"only-icon"],"href":[1],"target":[1],"type":[1],"name":[1],"value":[1],"ariaLabel":[1,"aria-label"],"class":[1],"buttonId":[1,"button-id"]}],[1,"jump-icon",{"class":[1],"library":[1],"name":[1],"category":[1],"size":[1],"label":[1],"src":[1]}]]],["jump-card-ecommerce.cjs",[[1,"jump-card-ecommerce",{"onlyIconButton":[4,"only-icon-button"],"hasBackground":[4,"has-background"],"badge":[1],"favorite":[1540],"hasFavorite":[4,"has-favorite"],"favoriteBtnClass":[1,"favorite-btn-class"],"link":[1],"img":[1],"imgAlt":[1,"img-alt"],"hoverImg":[1,"hover-img"],"hoverImgAlt":[1,"hover-img-alt"],"videoSrc":[1,"video-src"],"notificationUrl":[1,"notification-url"],"notificationText":[1,"notification-text"],"productName":[1,"product-name"],"subtitle":[1],"productId":[1,"product-id"],"price":[2],"salePrice":[2,"sale-price"],"currency":[1],"outOfStock":[1540,"out-of-stock"],"outOfStockText":[1,"out-of-stock-text"],"addToCartText":[1,"add-to-cart-text"],"waitingListText":[1,"waiting-list-text"],"addToWaitingList":[4,"add-to-waiting-list"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32]},[[0,"jump-card-ecommerce-option-connected","addOption"]]]]],["jump-filter.cjs",[[1,"jump-filter",{"direction":[1],"filterHeading":[1,"filter-heading"],"filterButtonLabel":[1,"filter-button-label"],"filterButtonIcon":[1,"filter-button-icon"],"mobileThreshold":[2,"mobile-threshold"],"filters":[8],"activeFilters":[32],"showMobileFilters":[32],"isMobile":[32],"getFilters":[64]},[[0,"jump-filterchange","filterChangeHandler"],[9,"resize","handleResize"]]]]],["jump-filtergroup.cjs",[[1,"jump-filtergroup",{"name":[1],"title":[1],"otherLabel":[1,"other-label"],"lessLabel":[1,"less-label"],"maxElements":[2,"max-elements"],"variant":[1],"values":[32],"value":[32],"slotItems":[32],"inputs":[32],"showMore":[32],"getValues":[64],"getActiveAmount":[64],"getInputs":[64],"getName":[64]}]]],["jump-pagination.cjs",[[1,"jump-pagination",{"pagLabel":[1,"pag-label"],"last":[2],"showFirstAndLast":[4,"show-first-and-last"],"current":[32]},null,{"current":["watchcurrent"]}]]],["jump-pagination-table.cjs",[[0,"jump-pagination-table",{"elementsRanges":[
|
|
11
|
+
return index.bootstrapLazy([["jump-button_2.cjs",[[1,"jump-button",{"disabled":[4],"variant":[1],"outline":[4],"size":[1],"full":[4],"pill":[4],"text":[4],"onlyIcon":[4,"only-icon"],"href":[1],"target":[1],"type":[1],"name":[1],"value":[1],"ariaLabel":[1,"aria-label"],"class":[1],"buttonId":[1,"button-id"]}],[1,"jump-icon",{"class":[1],"library":[1],"name":[1],"category":[1],"size":[1],"label":[1],"src":[1]}]]],["jump-card-ecommerce.cjs",[[1,"jump-card-ecommerce",{"onlyIconButton":[4,"only-icon-button"],"hasBackground":[4,"has-background"],"badge":[1],"favorite":[1540],"hasFavorite":[4,"has-favorite"],"favoriteBtnClass":[1,"favorite-btn-class"],"link":[1],"img":[1],"imgAlt":[1,"img-alt"],"hoverImg":[1,"hover-img"],"hoverImgAlt":[1,"hover-img-alt"],"videoSrc":[1,"video-src"],"notificationUrl":[1,"notification-url"],"notificationText":[1,"notification-text"],"productName":[1,"product-name"],"subtitle":[1],"productId":[1,"product-id"],"price":[2],"salePrice":[2,"sale-price"],"currency":[1],"outOfStock":[1540,"out-of-stock"],"outOfStockText":[1,"out-of-stock-text"],"addToCartText":[1,"add-to-cart-text"],"waitingListText":[1,"waiting-list-text"],"addToWaitingList":[4,"add-to-waiting-list"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32]},[[0,"jump-card-ecommerce-option-connected","addOption"]]]]],["jump-filter.cjs",[[1,"jump-filter",{"direction":[1],"filterHeading":[1,"filter-heading"],"filterButtonLabel":[1,"filter-button-label"],"filterButtonIcon":[1,"filter-button-icon"],"mobileThreshold":[2,"mobile-threshold"],"filters":[8],"activeFilters":[32],"showMobileFilters":[32],"isMobile":[32],"getFilters":[64]},[[0,"jump-filterchange","filterChangeHandler"],[9,"resize","handleResize"]]]]],["jump-filtergroup.cjs",[[1,"jump-filtergroup",{"name":[1],"title":[1],"otherLabel":[1,"other-label"],"lessLabel":[1,"less-label"],"maxElements":[2,"max-elements"],"variant":[1],"values":[32],"value":[32],"slotItems":[32],"inputs":[32],"showMore":[32],"getValues":[64],"getActiveAmount":[64],"getInputs":[64],"getName":[64]}]]],["jump-pagination.cjs",[[1,"jump-pagination",{"pagLabel":[1,"pag-label"],"last":[2],"showFirstAndLast":[4,"show-first-and-last"],"current":[32]},null,{"current":["watchcurrent"]}]]],["jump-pagination-table.cjs",[[0,"jump-pagination-table",{"elementsRanges":[1,"elements-ranges"],"pagLabel":[513,"pag-label"],"labelElementsPerPage":[513,"label-elements-per-page"],"total":[514],"first":[514],"last":[514],"showFirstAndLast":[516,"show-first-and-last"],"elementsRangesArray":[32],"elPerPage":[32]},null,{"elementsRanges":["elementsRangesChanged"],"elPerPage":["elPerPageChanged"]}]]],["jump-quantity.cjs",[[65,"jump-quantity",{"min":[2],"max":[2],"step":[2],"label":[1],"type":[1],"variant":[1],"showButtons":[4,"show-buttons"],"value":[2],"getValue":[64],"reset":[64]},null,{"value":["onValueChange"]}]]],["jump-tab-item.cjs",[[1,"jump-tab-item",{"identifier":[1],"iconName":[1,"icon-name"],"iconPosition":[1,"icon-position"],"label":[1],"active":[4],"disabled":[4],"variant":[32]}]]],["jump-accordion.cjs",[[1,"jump-accordion"]]],["jump-card.cjs",[[4,"jump-card",{"horizontal":[4],"dark":[4],"shadow":[4],"border":[4],"borderRadius":[4,"border-radius"],"topBorderContentRadius":[4,"top-border-content-radius"],"boxed":[4],"roundedMedia":[4,"rounded-media"],"imgSrc":[1,"img-src"],"imgAlt":[1,"img-alt"],"videoSrc":[1,"video-src"]}]]],["jump-card-ecommerce-option.cjs",[[1,"jump-card-ecommerce-option",{"code":[1],"imgUrl":[1,"img-url"],"label":[1],"sku":[1],"taxonomy":[1]}]]],["jump-tab.cjs",[[1,"jump-tab",{"tabGroupName":[1,"tab-group-name"],"variant":[1]},[[0,"jump-change-active-tab","changeActiveTabHandler"]]]]],["jump-tab-panel.cjs",[[1,"jump-tab-panel",{"identifier":[1],"active":[4]}]]],["jump-badge.cjs",[[1,"jump-badge",{"label":[1],"variant":[513],"dimension":[513],"soft":[516],"outline":[516]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class JumpPaginationTable {
|
|
3
3
|
constructor() {
|
|
4
|
-
this.elementsRanges =
|
|
5
|
-
this.
|
|
4
|
+
this.elementsRanges = "10,20,60,100";
|
|
5
|
+
this.elementsRangesArray = undefined;
|
|
6
|
+
this.elPerPage = undefined;
|
|
6
7
|
this.pagLabel = 'di';
|
|
7
8
|
this.labelElementsPerPage = 'Elementi per pagina';
|
|
8
9
|
this.total = 100;
|
|
@@ -10,6 +11,14 @@ export class JumpPaginationTable {
|
|
|
10
11
|
this.last = 10;
|
|
11
12
|
this.showFirstAndLast = false;
|
|
12
13
|
}
|
|
14
|
+
elementsRangesChanged(newValue, oldValue) {
|
|
15
|
+
console.log('dentro el');
|
|
16
|
+
if (newValue !== oldValue) {
|
|
17
|
+
this.elementsRangesArray = newValue.split(',').map(Number);
|
|
18
|
+
}
|
|
19
|
+
this.elementsRangesArray = [...this.elementsRangesArray];
|
|
20
|
+
console.log('elementsRangesChanged', newValue, oldValue);
|
|
21
|
+
}
|
|
13
22
|
elPerPageChanged(newValue, oldValue) {
|
|
14
23
|
if (newValue !== oldValue) {
|
|
15
24
|
// Riporta la paginazione allo stato iniziale
|
|
@@ -20,7 +29,8 @@ export class JumpPaginationTable {
|
|
|
20
29
|
}
|
|
21
30
|
/* -------------------- LYFECYCLE EVENTS ---------------------- */
|
|
22
31
|
componentWillLoad() {
|
|
23
|
-
this.
|
|
32
|
+
this.elementsRangesArray = this.elementsRanges.split(',').map(Number);
|
|
33
|
+
this.elPerPage = this.elementsRangesArray[0];
|
|
24
34
|
}
|
|
25
35
|
/* -------------------- @LISTEN ------------------------------- */
|
|
26
36
|
/* -------------------- @METHOD ------------------------------- */
|
|
@@ -60,21 +70,9 @@ export class JumpPaginationTable {
|
|
|
60
70
|
/* --------------------- RENDER ------------------------------- */
|
|
61
71
|
render() {
|
|
62
72
|
var _a;
|
|
63
|
-
return (h(Host, { key: '
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
// disabled={this.first === 1}
|
|
67
|
-
// >
|
|
68
|
-
// <jump-icon slot="prefix" name="chevrons-left"></jump-icon>
|
|
69
|
-
// </button>
|
|
70
|
-
h("jump-button", { key: 'c7a833acee791a25257e237d88aef4e5bf5b5cc8', onClick: () => this.doChangePage('first'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: 'ffb50e27e476c8ca8d58ff18ce30c96ff6330872', slot: "suffix", name: "chevrons-left" }), " "), h("jump-button", { key: '46bf715a0803deef866d90a1523675ab24c1793f', onClick: () => this.doChangePage('previous'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: '223bf0f161ffce6ee0e17fbae7b8467cae790be3', slot: "suffix", name: "chevron-left" }), " "), h("jump-button", { key: '97696457a54e5808a0c252eeda2c8d915bcfe2e8', onClick: () => this.doChangePage('next'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: '9e01f45cc02450c41bf3ffc2f14cfd6606ab5a96', slot: "suffix", name: "chevron-right" }), " "), this.showFirstAndLast &&
|
|
71
|
-
// <button
|
|
72
|
-
// onClick={() => this.doChangePage('last')}
|
|
73
|
-
// disabled={this.last === this.total}
|
|
74
|
-
// >
|
|
75
|
-
// <jump-icon slot="prefix" name="chevrons-right"></jump-icon>
|
|
76
|
-
// </button>
|
|
77
|
-
h("jump-button", { key: '05a745e26f5f14383e745a744c0c23e5598b0623', onClick: () => this.doChangePage('last'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: '0ba46ee7053a3aed0091c05a20444c767738dc2f', slot: "suffix", name: "chevrons-right" }), " "))))));
|
|
73
|
+
return (h(Host, { key: 'fd4a13e65dfbcc334ace661e61297ff05d78624d', class: "JumpPaginationTable" }, h("div", { key: 'ae50a5dbac84be7f7f02c5c93f1e7cbd73a1fc6f', class: "JumpPaginationTable__Wrapper" }, h("div", { key: '2eade4e3a54fb4c84f3c7718d827d6e5295508bf', class: "elementsPerPage" }, h("label", { key: '4211a782ce895731ed90d52c88a278ccf69e03fc', htmlFor: "elements" }, (_a = this.labelElementsPerPage) !== null && _a !== void 0 ? _a : 'Elements per page'), h("select", { key: '6ce02a5ad892bf1d6b48b3ccb2605e1e1de3416b', name: "elements", id: "elements", onChange: (e) => this.setElPerPage(e) }, this.elementsRangesArray.map((range) => (h("option", { value: range, selected: (this.elPerPage == range) && true }, range))))), h("div", { key: '915e8eefc53385620b2d554935ab6f81f9571407', class: "indicators" }, h("div", { key: '02b3867d0fe90a6408aced6bd7b639d92cec61a6', class: "elements" }, h("span", { key: 'e1d25f5be0f4fbdd995588642d1ba1583e90a280' }, h("span", { key: '775b964a3dcc29be4d914c9ff309f6809555683b' }, this.first), " - ", h("span", { key: '31886227817ee097c5594bc1a81f271ac185531c' }, this.last), " ", this.pagLabel, " ", h("span", { key: 'a6525640edea1672b429732d2e23c72b1fbacf04' }, this.total))), h("div", { key: '9231615ab10231842136b4d64ce2a5e87a502c3f', class: "arrow" }, this.showFirstAndLast &&
|
|
74
|
+
h("jump-button", { key: 'cd9d9073f37b561464dfe5209cb43bc351392b40', onClick: () => this.doChangePage('first'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: '48ece4b1628154ea80b33698c2de4a473e433d25', slot: "suffix", name: "chevrons-left" }), " "), h("jump-button", { key: '69c9b009244d96aa5c5e770d38ed9535330c1904', onClick: () => this.doChangePage('previous'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: 'd5b18f4b7809af2032b4c955c59b0de2fb81b1b0', slot: "suffix", name: "chevron-left" }), " "), h("jump-button", { key: '95bf121ea17a00e01f4d47c256191665850dfcb6', onClick: () => this.doChangePage('next'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: '64ac86934180ce2203c06472c00ec33334d128dd', slot: "suffix", name: "chevron-right" }), " "), this.showFirstAndLast &&
|
|
75
|
+
h("jump-button", { key: '2de71c60a69f5dc61088e2e4a27591e8b442967a', onClick: () => this.doChangePage('last'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: 'c2113c26705cfafe41c9cb5c92527856dc7ee433', slot: "suffix", name: "chevrons-right" }), " "))))));
|
|
78
76
|
}
|
|
79
77
|
static get is() { return "jump-pagination-table"; }
|
|
80
78
|
static get originalStyleUrls() {
|
|
@@ -90,43 +88,22 @@ export class JumpPaginationTable {
|
|
|
90
88
|
static get properties() {
|
|
91
89
|
return {
|
|
92
90
|
"elementsRanges": {
|
|
93
|
-
"type": "
|
|
94
|
-
"mutable": false,
|
|
95
|
-
"complexType": {
|
|
96
|
-
"original": "Array<number>",
|
|
97
|
-
"resolved": "number[]",
|
|
98
|
-
"references": {
|
|
99
|
-
"Array": {
|
|
100
|
-
"location": "global",
|
|
101
|
-
"id": "global::Array"
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
"required": false,
|
|
106
|
-
"optional": false,
|
|
107
|
-
"docs": {
|
|
108
|
-
"tags": [],
|
|
109
|
-
"text": "Values for the elements per page select"
|
|
110
|
-
},
|
|
111
|
-
"defaultValue": "[10, 20, 60, 100]"
|
|
112
|
-
},
|
|
113
|
-
"elPerPage": {
|
|
114
|
-
"type": "number",
|
|
91
|
+
"type": "string",
|
|
115
92
|
"mutable": false,
|
|
116
93
|
"complexType": {
|
|
117
|
-
"original": "
|
|
118
|
-
"resolved": "
|
|
94
|
+
"original": "string",
|
|
95
|
+
"resolved": "string",
|
|
119
96
|
"references": {}
|
|
120
97
|
},
|
|
121
98
|
"required": false,
|
|
122
99
|
"optional": false,
|
|
123
100
|
"docs": {
|
|
124
101
|
"tags": [],
|
|
125
|
-
"text": "
|
|
102
|
+
"text": "Values for the elements per page select"
|
|
126
103
|
},
|
|
127
|
-
"attribute": "
|
|
104
|
+
"attribute": "elements-ranges",
|
|
128
105
|
"reflect": false,
|
|
129
|
-
"defaultValue": "10"
|
|
106
|
+
"defaultValue": "\"10,20,60,100\""
|
|
130
107
|
},
|
|
131
108
|
"pagLabel": {
|
|
132
109
|
"type": "string",
|
|
@@ -238,6 +215,12 @@ export class JumpPaginationTable {
|
|
|
238
215
|
}
|
|
239
216
|
};
|
|
240
217
|
}
|
|
218
|
+
static get states() {
|
|
219
|
+
return {
|
|
220
|
+
"elementsRangesArray": {},
|
|
221
|
+
"elPerPage": {}
|
|
222
|
+
};
|
|
223
|
+
}
|
|
241
224
|
static get events() {
|
|
242
225
|
return [{
|
|
243
226
|
"method": "changePage",
|
|
@@ -273,6 +256,9 @@ export class JumpPaginationTable {
|
|
|
273
256
|
}
|
|
274
257
|
static get watchers() {
|
|
275
258
|
return [{
|
|
259
|
+
"propName": "elementsRanges",
|
|
260
|
+
"methodName": "elementsRangesChanged"
|
|
261
|
+
}, {
|
|
276
262
|
"propName": "elPerPage",
|
|
277
263
|
"methodName": "elPerPageChanged"
|
|
278
264
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jump-pagination-table.js","sourceRoot":"","sources":["../../../src/components/jump-pagination-table/jump-pagination-table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOrF,MAAM,OAAO,mBAAmB;;8BAa2B,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;yBAK9C,EAAE;wBAYc,IAAI;oCAKQ,qBAAqB;qBAKpC,GAAG;qBAKH,CAAC;oBAKF,EAAE;gCAKW,KAAK;;IAnC1D,gBAAgB,CAAC,QAAgB,EAAE,QAAgB;QACjD,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC1B,6CAA6C;YAC7C,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;YACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC7C,CAAC;QAED,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrD,CAAC;IAiCD,kEAAkE;IAClE,iBAAiB;QACf,IAAI,CAAC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,IAAI;4BACJ,gEAAgE;4BAChE,YAAY;4BACZ,oEAAa,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,EAAC,SAAS,EAAC,IAAI,QAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,OAAO,gBAAY,oBAAe,EAAC,EAAE,EAAC,QAAQ,EAAC,QAAQ,QAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK;;gCAAG,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,gBAAgB,GAAc;oCAAe,CAErR,CACF,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Event, EventEmitter, Watch, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'jump-pagination-table',\n styleUrl: 'jump-pagination-table.scss',\n shadow: false,\n})\nexport class JumpPaginationTable {\n\n /* ---------------------- OWN PROPERTIES ---------------------- */\n\n /* ---------------------- @ELEMENT ---------------------------- */\n\n /* ---------------------- @STATE ------------------------------ */\n\n /* ---------------------- @PROPERTIES ------------------------- */\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 * Number of elements per page selected\n */\n @Prop() elPerPage: number = 10;\n @Watch('elPerPage')\n elPerPageChanged(newValue: number, oldValue: number) {\n if (newValue !== oldValue) {\n // Riporta la paginazione allo stato iniziale\n this.first = 1;\n this.last = Math.min(this.total, newValue);\n }\n\n this.changeElPerPage.emit({ elPerPage: newValue });\n }\n\n @Prop({ reflect: true }) pagLabel: string = 'di'; // Identifica la label testuale di pagination. \n\n /**\n * Label for the elements per page select\n */\n @Prop({ reflect: true }) labelElementsPerPage: string = 'Elementi per pagina';\n\n /**\n * Total of elements\n */\n @Prop({ reflect: true }) total: number = 100; \n\n /**\n * First element of the page\n */\n @Prop({ reflect: true }) first: number = 1;\n\n /**\n * Last element of the page\n */\n @Prop({ reflect: true }) last: number = 10;\n\n /**\n * Show button to navigate so first e last page\n */\n @Prop({ reflect: true }) showFirstAndLast: boolean = false;\n\n /* ---------------------- @EVENTS ------------------------- */\n @Event({ eventName: 'jump-change-page' }) changePage: EventEmitter;\n @Event({ eventName: 'jump-change-el-per-page' }) changeElPerPage: EventEmitter;\n\n /* -------------------- LYFECYCLE EVENTS ---------------------- */\n componentWillLoad() {\n this.elPerPage = this.elementsRanges[0];\n }\n\n /* -------------------- @LISTEN ------------------------------- */\n\n /* -------------------- @METHOD ------------------------------- */\n\n /* -------------------- LOCAL METHODS ------------------------- */\n setElPerPage(e) {\n this.elPerPage = e.target.value;\n }\n\n doChangePage(dir) {\n let newFirst;\n let newLast;\n\n //TODO refactorare \n if (dir === 'first') {\n newFirst = 1;\n newLast = Math.min(this.total, this.elPerPage);\n } else if (dir === 'last') {\n newLast = this.total;\n newFirst = Math.max(1, this.total - this.elPerPage + 1);\n } else if (dir === 'previous') {\n newFirst = Math.max(1, this.first - this.elPerPage);\n newLast = Math.min(this.total, newFirst + this.elPerPage - 1);\n } else if (dir === 'next') {\n newLast = Math.min(this.total, this.last + this.elPerPage);\n newFirst = Math.max(1, newLast - this.elPerPage + 1);\n }\n\n this.first = newFirst;\n this.last = newLast;\n\n let details = {\n first: newFirst,\n last: newLast,\n direction: dir\n }\n\n this.changePage.emit(details);\n }\n\n /* --------------------- RENDER ------------------------------- */\n render() {\n return (\n <Host class=\"JumpPaginationTable\">\n <div class=\"JumpPaginationTable__Wrapper\">\n <div class=\"elementsPerPage\">\n <label htmlFor=\"elements\">{this.labelElementsPerPage ?? 'Elements per page'}</label>\n <select name=\"elements\" id=\"elements\" onChange={(e) => this.setElPerPage(e)}>\n {this.elementsRanges.map((range) => (\n <option value={range} selected={(this.elPerPage == range) && true}>{range}</option>\n ))}\n </select>\n </div> \n <div class=\"indicators\">\n <div class=\"elements\">\n <span>\n <span>{this.first}</span> - <span>{this.last}</span> {this.pagLabel} <span>{this.total}</span>\n </span>\n </div>\n <div class=\"arrow\">\n {this.showFirstAndLast &&\n // <button \n // onClick={() => this.doChangePage('first')}\n // disabled={this.first === 1}\n // >\n // <jump-icon slot=\"prefix\" name=\"chevrons-left\"></jump-icon>\n // </button>\n <jump-button onClick={() => this.doChangePage('first')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevrons-left\" ></jump-icon> </jump-button>\n }\n {/* <button\n onClick={() => this.doChangePage('previous')}\n disabled={this.first === 1}\n >\n <jump-icon slot=\"prefix\" name=\"chevron-left\"></jump-icon>\n </button> */}\n <jump-button onClick={() => this.doChangePage('previous')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevron-left\" ></jump-icon> </jump-button>\n <jump-button onClick={() => this.doChangePage('next')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevron-right\" ></jump-icon> </jump-button>\n {/* <button\n onClick={() => this.doChangePage('next')}\n disabled={this.last === this.total}\n >\n <jump-icon slot=\"prefix\" name=\"chevron-right\"></jump-icon>\n </button> */}\n {this.showFirstAndLast &&\n // <button\n // onClick={() => this.doChangePage('last')}\n // disabled={this.last === this.total}\n // >\n // <jump-icon slot=\"prefix\" name=\"chevrons-right\"></jump-icon>\n // </button>\n <jump-button onClick={() => this.doChangePage('last')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevrons-right\" ></jump-icon> </jump-button>\n }\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"jump-pagination-table.js","sourceRoot":"","sources":["../../../src/components/jump-pagination-table/jump-pagination-table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAG,KAAK,EAAgB,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAO7F,MAAM,OAAO,mBAAmB;;8BAaG,cAAc;;;wBA4BH,IAAI;oCAKQ,qBAAqB;qBAKpC,GAAG;qBAKH,CAAC;oBAKF,EAAE;gCAKW,KAAK;;IAjD1D,qBAAqB,CAAC,QAAQ,EAAE,QAAQ;QACtC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACzB,IAAG,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACzB,IAAI,CAAC,mBAAmB,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC3D,CAAC;QACH,IAAI,CAAC,mBAAmB,GAAG,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,CAAA;QACxD,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAOD,gBAAgB,CAAC,QAAgB,EAAE,QAAgB;QACjD,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC1B,6CAA6C;YAC7C,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;YACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ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Q,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK;;4BAAG,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,eAAe,GAAc;gCAAe;wBACrR,IAAI,CAAC,gBAAgB;4BACpB,oEAAa,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,EAAC,SAAS,EAAC,IAAI,QAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,OAAO,gBAAY,oBAAe,EAAC,EAAE,EAAC,QAAQ,EAAC,QAAQ,QAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK;;gCAAG,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,gBAAgB,GAAc;oCAAe,CAErR,CACF,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, State, Event, EventEmitter, Watch, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'jump-pagination-table',\n styleUrl: 'jump-pagination-table.scss',\n shadow: false,\n})\nexport class JumpPaginationTable {\n\n /* ---------------------- OWN PROPERTIES ---------------------- */\n\n /* ---------------------- @ELEMENT ---------------------------- */\n\n /* ---------------------- @STATE ------------------------------ */\n\n /* ---------------------- @PROPERTIES ------------------------- */\n\n /**\n * Values for the elements per page select\n */\n @Prop() elementsRanges: string = \"10,20,60,100\";\n\n @State() elementsRangesArray: number[];\n @Watch('elementsRanges')\n elementsRangesChanged(newValue, oldValue) {\n console.log('dentro el');\n if(newValue !== oldValue) {\n this.elementsRangesArray = newValue.split(',').map(Number);\n }\n this.elementsRangesArray = [...this.elementsRangesArray]\n console.log('elementsRangesChanged', newValue, oldValue);\n }\n\n /**\n * Number of elements per page selected\n */\n @State() elPerPage: number;\n @Watch('elPerPage')\n elPerPageChanged(newValue: number, oldValue: number) {\n if (newValue !== oldValue) {\n // Riporta la paginazione allo stato iniziale\n this.first = 1;\n this.last = Math.min(this.total, newValue);\n }\n\n this.changeElPerPage.emit({ elPerPage: newValue });\n }\n\n @Prop({ reflect: true }) pagLabel: string = 'di'; // Identifica la label testuale di pagination. \n\n /**\n * Label for the elements per page select\n */\n @Prop({ reflect: true }) labelElementsPerPage: string = 'Elementi per pagina';\n\n /**\n * Total of elements\n */\n @Prop({ reflect: true }) total: number = 100; \n\n /**\n * First element of the page\n */\n @Prop({ reflect: true }) first: number = 1;\n\n /**\n * Last element of the page\n */\n @Prop({ reflect: true }) last: number = 10;\n\n /**\n * Show button to navigate so first e last page\n */\n @Prop({ reflect: true }) showFirstAndLast: boolean = false;\n\n /* ---------------------- @EVENTS ------------------------- */\n @Event({ eventName: 'jump-change-page' }) changePage: EventEmitter;\n @Event({ eventName: 'jump-change-el-per-page' }) changeElPerPage: EventEmitter;\n\n /* -------------------- LYFECYCLE EVENTS ---------------------- */\n componentWillLoad() {\n this.elementsRangesArray = this.elementsRanges.split(',').map(Number);\n this.elPerPage = this.elementsRangesArray[0];\n }\n\n /* -------------------- @LISTEN ------------------------------- */\n\n /* -------------------- @METHOD ------------------------------- */\n\n /* -------------------- LOCAL METHODS ------------------------- */\n setElPerPage(e) {\n this.elPerPage = e.target.value;\n }\n\n doChangePage(dir) {\n let newFirst;\n let newLast;\n\n //TODO refactorare \n if (dir === 'first') {\n newFirst = 1;\n newLast = Math.min(this.total, this.elPerPage);\n } else if (dir === 'last') {\n newLast = this.total;\n newFirst = Math.max(1, this.total - this.elPerPage + 1);\n } else if (dir === 'previous') {\n newFirst = Math.max(1, this.first - this.elPerPage);\n newLast = Math.min(this.total, newFirst + this.elPerPage - 1);\n } else if (dir === 'next') {\n newLast = Math.min(this.total, this.last + this.elPerPage);\n newFirst = Math.max(1, newLast - this.elPerPage + 1);\n }\n\n this.first = newFirst;\n this.last = newLast;\n\n let details = {\n first: newFirst,\n last: newLast,\n direction: dir\n }\n\n this.changePage.emit(details);\n }\n\n /* --------------------- RENDER ------------------------------- */\n render() {\n return (\n <Host class=\"JumpPaginationTable\">\n <div class=\"JumpPaginationTable__Wrapper\">\n <div class=\"elementsPerPage\">\n <label htmlFor=\"elements\">{this.labelElementsPerPage ?? 'Elements per page'}</label>\n <select name=\"elements\" id=\"elements\" onChange={(e) => this.setElPerPage(e)}>\n {this.elementsRangesArray.map((range) => (\n <option value={range} selected={(this.elPerPage == range) && true}>{range}</option>\n ))}\n </select>\n </div> \n <div class=\"indicators\">\n <div class=\"elements\">\n <span>\n <span>{this.first}</span> - <span>{this.last}</span> {this.pagLabel} <span>{this.total}</span>\n </span>\n </div>\n <div class=\"arrow\">\n {this.showFirstAndLast &&\n <jump-button onClick={() => this.doChangePage('first')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevrons-left\" ></jump-icon> </jump-button>\n }\n <jump-button onClick={() => this.doChangePage('previous')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevron-left\" ></jump-icon> </jump-button>\n <jump-button onClick={() => this.doChangePage('next')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevron-right\" ></jump-icon> </jump-button>\n {this.showFirstAndLast &&\n <jump-button onClick={() => this.doChangePage('last')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevrons-right\" ></jump-icon> </jump-button>\n }\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n}\n"]}
|
|
@@ -29,19 +29,14 @@ export default {
|
|
|
29
29
|
description: 'Indica l\'etichetta per gli elementi per pagina',
|
|
30
30
|
},
|
|
31
31
|
elementsRanges: {
|
|
32
|
-
name: 'elements-
|
|
33
|
-
control: '
|
|
34
|
-
|
|
32
|
+
name: 'elements-ranges',
|
|
33
|
+
control: 'text',
|
|
34
|
+
description: "Indica i valori per la selezione degli elementi per pagina"
|
|
35
35
|
},
|
|
36
36
|
showFirstAndLast: {
|
|
37
37
|
name: 'show-first-and-last',
|
|
38
38
|
control: 'boolean',
|
|
39
39
|
description: 'Indica se mostrare le frecce aggiuntive per navigare rapidamente nella prima o ultima pagina. Da preferire con un numero elevato di pagine.'
|
|
40
|
-
},
|
|
41
|
-
elPerPage: {
|
|
42
|
-
name: 'el-per-page',
|
|
43
|
-
control: 'number',
|
|
44
|
-
description: 'Indica il numero scelto di elementi per pagina'
|
|
45
40
|
}
|
|
46
41
|
}
|
|
47
42
|
};
|
|
@@ -78,10 +73,9 @@ PlaygroundPagTable.args = {
|
|
|
78
73
|
last: 10,
|
|
79
74
|
total: 100,
|
|
80
75
|
labelElementsPerPage: "Elementi per pagina",
|
|
81
|
-
elementsRanges:
|
|
76
|
+
elementsRanges: "10,20",
|
|
82
77
|
pagLabel: 'di',
|
|
83
78
|
showFirstAndLast: false,
|
|
84
|
-
elPerPage: 10
|
|
85
79
|
};
|
|
86
80
|
export const PaginationTableRidotto = TemplateWithListenerExample.bind({});
|
|
87
81
|
PaginationTableRidotto.args = {
|
|
@@ -89,10 +83,9 @@ PaginationTableRidotto.args = {
|
|
|
89
83
|
last: 10,
|
|
90
84
|
total: 100,
|
|
91
85
|
labelElementsPerPage: "Elementi per pagina",
|
|
92
|
-
elementsRanges:
|
|
86
|
+
elementsRanges: "10,20",
|
|
93
87
|
pagLabel: 'di',
|
|
94
88
|
showFirstAndLast: false,
|
|
95
|
-
elPerPage: 10
|
|
96
89
|
};
|
|
97
90
|
export const PaginationTableCompleto = TemplateWithListenerExample.bind({});
|
|
98
91
|
PaginationTableCompleto.args = {
|
|
@@ -100,9 +93,8 @@ PaginationTableCompleto.args = {
|
|
|
100
93
|
last: 10,
|
|
101
94
|
total: 100,
|
|
102
95
|
labelElementsPerPage: "Elementi per pagina",
|
|
103
|
-
elementsRanges:
|
|
96
|
+
elementsRanges: "10,20",
|
|
104
97
|
pagLabel: 'di',
|
|
105
98
|
showFirstAndLast: true,
|
|
106
|
-
elPerPage: 10
|
|
107
99
|
};
|
|
108
100
|
//# sourceMappingURL=jump-pagination-table.stories.js.map
|
package/dist/collection/components/jump-pagination-table/jump-pagination-table.stories.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jump-pagination-table.stories.js","sourceRoot":"","sources":["../../../src/components/jump-pagination-table/jump-pagination-table.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE1E,eAAe;IACb,KAAK,EAAE,uCAAuC;IAC9C,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,QAAQ,EAAC;YACP,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,uDAAuD;SACrE;QACD,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,sCAAsC;SACpD;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,uCAAuC;SACrD;QACD,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,mDAAmD;SACjE;QACD,oBAAoB,EAAE;YACpB,IAAI,EAAE,yBAAyB;YAC/B,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,iDAAiD;SAC/D;QACD,cAAc,EAAE;YACd,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"jump-pagination-table.stories.js","sourceRoot":"","sources":["../../../src/components/jump-pagination-table/jump-pagination-table.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE1E,eAAe;IACb,KAAK,EAAE,uCAAuC;IAC9C,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,QAAQ,EAAC;YACP,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,uDAAuD;SACrE;QACD,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,sCAAsC;SACpD;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,uCAAuC;SACrD;QACD,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,mDAAmD;SACjE;QACD,oBAAoB,EAAE;YACpB,IAAI,EAAE,yBAAyB;YAC/B,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,iDAAiD;SAC/D;QACD,cAAc,EAAE;YACd,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE,MAAM;YACf,WAAW,EAAC,4DAA4D;SACzE;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,6IAA6I;SAC3J;KACF;CACF,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,EAAE;IAChC,MAAM,UAAU,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,UAAU,CAAC,0BAA0B,UAAU,2BAA2B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BAAgB,EAAE,IAAI;CACvB,CAAC","sourcesContent":["import { generateAttributesFromArgs, formatHtml} from '../../utils/utils';\n\nexport default {\n title: 'Components/Pagination/PaginationTable',\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 first: {\n name: 'first',\n control: 'number',\n description: 'Indica il primo elemento della lista',\n },\n last: {\n name: 'last',\n control: 'number',\n description: 'Indica l\\'ultimo elemento della lista',\n },\n total: {\n name: 'total',\n control: 'number',\n description: 'Indica il numero totale di elementi disponibili. ',\n },\n labelElementsPerPage: {\n name: 'label-elements-per-page',\n control: 'text',\n description: 'Indica l\\'etichetta per gli elementi per pagina',\n },\n elementsRanges: {\n name: 'elements-ranges',\n control: 'text', \n description:\"Indica i valori per la selezione degli elementi per pagina\"\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 }\n};\n\nconst TemplatePagTable = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`<jump-pagination-table ${attributes}></jump-pagination-table>`);\n};\n\nconst TemplateWithListenerExample = (args, data) => {\n let id = data.id;\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`<jump-pagination-table ${attributes}></jump-pagination-table>\n <div>Stai visualizzando <span id=\"el-per-page\">X</span> elementi per volta</div>\n <div>Il primo elemento visualizzato è <span id=\"first-el\">X</span></div>\n <script>\n (function() {\n let container;\n container = document.querySelector('#story--${id}');\n container.querySelector('#el-per-page').innerText = ${args.elPerPage};\n container.querySelector('#first-el').innerText = ${args.first};\n\n container.querySelector('jump-pagination-table').addEventListener('jump-change-el-per-page', (ev) => {\n container.querySelector('#el-per-page').innerText = ev.detail.elPerPage;\n });\n\n container.querySelector('jump-pagination-table').addEventListener('jump-change-page', (ev) => {\n container.querySelector('#first-el').innerText = ev.detail.first;\n });\n })();\n </script>`);\n};\n\nexport const PlaygroundPagTable = TemplatePagTable.bind({});\nPlaygroundPagTable.args = {\n first: 1,\n last: 10,\n total: 100,\n labelElementsPerPage: \"Elementi per pagina\",\n elementsRanges: \"10,20\",\n pagLabel: 'di',\n showFirstAndLast: false,\n};\n\nexport const PaginationTableRidotto = TemplateWithListenerExample.bind({});\n\nPaginationTableRidotto.args = {\n first: 1,\n last: 10,\n total: 100,\n labelElementsPerPage: \"Elementi per pagina\",\n elementsRanges: \"10,20\",\n pagLabel: 'di',\n showFirstAndLast: false,\n};\n\nexport const PaginationTableCompleto = TemplateWithListenerExample.bind({});\n\nPaginationTableCompleto.args = {\n first: 1,\n last: 10,\n total: 100,\n labelElementsPerPage: \"Elementi per pagina\",\n elementsRanges: \"10,20\",\n pagLabel: 'di',\n showFirstAndLast: true,\n};"]}
|
|
@@ -11,8 +11,9 @@ const JumpPaginationTable$1 = /*@__PURE__*/ proxyCustomElement(class JumpPaginat
|
|
|
11
11
|
this.__registerHost();
|
|
12
12
|
this.changePage = createEvent(this, "jump-change-page", 7);
|
|
13
13
|
this.changeElPerPage = createEvent(this, "jump-change-el-per-page", 7);
|
|
14
|
-
this.elementsRanges =
|
|
15
|
-
this.
|
|
14
|
+
this.elementsRanges = "10,20,60,100";
|
|
15
|
+
this.elementsRangesArray = undefined;
|
|
16
|
+
this.elPerPage = undefined;
|
|
16
17
|
this.pagLabel = 'di';
|
|
17
18
|
this.labelElementsPerPage = 'Elementi per pagina';
|
|
18
19
|
this.total = 100;
|
|
@@ -20,6 +21,14 @@ const JumpPaginationTable$1 = /*@__PURE__*/ proxyCustomElement(class JumpPaginat
|
|
|
20
21
|
this.last = 10;
|
|
21
22
|
this.showFirstAndLast = false;
|
|
22
23
|
}
|
|
24
|
+
elementsRangesChanged(newValue, oldValue) {
|
|
25
|
+
console.log('dentro el');
|
|
26
|
+
if (newValue !== oldValue) {
|
|
27
|
+
this.elementsRangesArray = newValue.split(',').map(Number);
|
|
28
|
+
}
|
|
29
|
+
this.elementsRangesArray = [...this.elementsRangesArray];
|
|
30
|
+
console.log('elementsRangesChanged', newValue, oldValue);
|
|
31
|
+
}
|
|
23
32
|
elPerPageChanged(newValue, oldValue) {
|
|
24
33
|
if (newValue !== oldValue) {
|
|
25
34
|
// Riporta la paginazione allo stato iniziale
|
|
@@ -30,7 +39,8 @@ const JumpPaginationTable$1 = /*@__PURE__*/ proxyCustomElement(class JumpPaginat
|
|
|
30
39
|
}
|
|
31
40
|
/* -------------------- LYFECYCLE EVENTS ---------------------- */
|
|
32
41
|
componentWillLoad() {
|
|
33
|
-
this.
|
|
42
|
+
this.elementsRangesArray = this.elementsRanges.split(',').map(Number);
|
|
43
|
+
this.elPerPage = this.elementsRangesArray[0];
|
|
34
44
|
}
|
|
35
45
|
/* -------------------- @LISTEN ------------------------------- */
|
|
36
46
|
/* -------------------- @METHOD ------------------------------- */
|
|
@@ -70,36 +80,27 @@ const JumpPaginationTable$1 = /*@__PURE__*/ proxyCustomElement(class JumpPaginat
|
|
|
70
80
|
/* --------------------- RENDER ------------------------------- */
|
|
71
81
|
render() {
|
|
72
82
|
var _a;
|
|
73
|
-
return (h(Host, { key: '
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
// disabled={this.first === 1}
|
|
77
|
-
// >
|
|
78
|
-
// <jump-icon slot="prefix" name="chevrons-left"></jump-icon>
|
|
79
|
-
// </button>
|
|
80
|
-
h("jump-button", { key: 'c7a833acee791a25257e237d88aef4e5bf5b5cc8', onClick: () => this.doChangePage('first'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: 'ffb50e27e476c8ca8d58ff18ce30c96ff6330872', slot: "suffix", name: "chevrons-left" }), " "), h("jump-button", { key: '46bf715a0803deef866d90a1523675ab24c1793f', onClick: () => this.doChangePage('previous'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: '223bf0f161ffce6ee0e17fbae7b8467cae790be3', slot: "suffix", name: "chevron-left" }), " "), h("jump-button", { key: '97696457a54e5808a0c252eeda2c8d915bcfe2e8', onClick: () => this.doChangePage('next'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: '9e01f45cc02450c41bf3ffc2f14cfd6606ab5a96', slot: "suffix", name: "chevron-right" }), " "), this.showFirstAndLast &&
|
|
81
|
-
// <button
|
|
82
|
-
// onClick={() => this.doChangePage('last')}
|
|
83
|
-
// disabled={this.last === this.total}
|
|
84
|
-
// >
|
|
85
|
-
// <jump-icon slot="prefix" name="chevrons-right"></jump-icon>
|
|
86
|
-
// </button>
|
|
87
|
-
h("jump-button", { key: '05a745e26f5f14383e745a744c0c23e5598b0623', onClick: () => this.doChangePage('last'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: '0ba46ee7053a3aed0091c05a20444c767738dc2f', slot: "suffix", name: "chevrons-right" }), " "))))));
|
|
83
|
+
return (h(Host, { key: 'fd4a13e65dfbcc334ace661e61297ff05d78624d', class: "JumpPaginationTable" }, h("div", { key: 'ae50a5dbac84be7f7f02c5c93f1e7cbd73a1fc6f', class: "JumpPaginationTable__Wrapper" }, h("div", { key: '2eade4e3a54fb4c84f3c7718d827d6e5295508bf', class: "elementsPerPage" }, h("label", { key: '4211a782ce895731ed90d52c88a278ccf69e03fc', htmlFor: "elements" }, (_a = this.labelElementsPerPage) !== null && _a !== void 0 ? _a : 'Elements per page'), h("select", { key: '6ce02a5ad892bf1d6b48b3ccb2605e1e1de3416b', name: "elements", id: "elements", onChange: (e) => this.setElPerPage(e) }, this.elementsRangesArray.map((range) => (h("option", { value: range, selected: (this.elPerPage == range) && true }, range))))), h("div", { key: '915e8eefc53385620b2d554935ab6f81f9571407', class: "indicators" }, h("div", { key: '02b3867d0fe90a6408aced6bd7b639d92cec61a6', class: "elements" }, h("span", { key: 'e1d25f5be0f4fbdd995588642d1ba1583e90a280' }, h("span", { key: '775b964a3dcc29be4d914c9ff309f6809555683b' }, this.first), " - ", h("span", { key: '31886227817ee097c5594bc1a81f271ac185531c' }, this.last), " ", this.pagLabel, " ", h("span", { key: 'a6525640edea1672b429732d2e23c72b1fbacf04' }, this.total))), h("div", { key: '9231615ab10231842136b4d64ce2a5e87a502c3f', class: "arrow" }, this.showFirstAndLast &&
|
|
84
|
+
h("jump-button", { key: 'cd9d9073f37b561464dfe5209cb43bc351392b40', onClick: () => this.doChangePage('first'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: '48ece4b1628154ea80b33698c2de4a473e433d25', slot: "suffix", name: "chevrons-left" }), " "), h("jump-button", { key: '69c9b009244d96aa5c5e770d38ed9535330c1904', onClick: () => this.doChangePage('previous'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: 'd5b18f4b7809af2032b4c955c59b0de2fb81b1b0', slot: "suffix", name: "chevron-left" }), " "), h("jump-button", { key: '95bf121ea17a00e01f4d47c256191665850dfcb6', onClick: () => this.doChangePage('next'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: '64ac86934180ce2203c06472c00ec33334d128dd', slot: "suffix", name: "chevron-right" }), " "), this.showFirstAndLast &&
|
|
85
|
+
h("jump-button", { key: '2de71c60a69f5dc61088e2e4a27591e8b442967a', onClick: () => this.doChangePage('last'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: 'c2113c26705cfafe41c9cb5c92527856dc7ee433', slot: "suffix", name: "chevrons-right" }), " "))))));
|
|
88
86
|
}
|
|
89
87
|
static get watchers() { return {
|
|
88
|
+
"elementsRanges": ["elementsRangesChanged"],
|
|
90
89
|
"elPerPage": ["elPerPageChanged"]
|
|
91
90
|
}; }
|
|
92
91
|
static get style() { return JumpPaginationTableStyle0; }
|
|
93
92
|
}, [0, "jump-pagination-table", {
|
|
94
|
-
"elementsRanges": [
|
|
95
|
-
"elPerPage": [2, "el-per-page"],
|
|
93
|
+
"elementsRanges": [1, "elements-ranges"],
|
|
96
94
|
"pagLabel": [513, "pag-label"],
|
|
97
95
|
"labelElementsPerPage": [513, "label-elements-per-page"],
|
|
98
96
|
"total": [514],
|
|
99
97
|
"first": [514],
|
|
100
98
|
"last": [514],
|
|
101
|
-
"showFirstAndLast": [516, "show-first-and-last"]
|
|
99
|
+
"showFirstAndLast": [516, "show-first-and-last"],
|
|
100
|
+
"elementsRangesArray": [32],
|
|
101
|
+
"elPerPage": [32]
|
|
102
102
|
}, undefined, {
|
|
103
|
+
"elementsRanges": ["elementsRangesChanged"],
|
|
103
104
|
"elPerPage": ["elPerPageChanged"]
|
|
104
105
|
}]);
|
|
105
106
|
function defineCustomElement$1() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"jump-pagination-table.js","mappings":";;;;AAAA,MAAM,sBAAsB,GAAG,+wCAA+wC,CAAC;AAC/yC,kCAAe,sBAAsB;;MCMxBA,qBAAmB;;;;;;8BAa2B,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;yBAK9C,EAAE;wBAYc,IAAI;oCAKQ,qBAAqB;qBAKpC,GAAG;qBAKH,CAAC;oBAKF,EAAE;gCAKW,KAAK;;IAnC1D,gBAAgB,CAAC,QAAgB,EAAE,QAAgB;QACjD,IA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AAC,EAAE,OAAO,EAAC,SAAS,EAAC,IAAI,QAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,OAAO,gBAAY,oBAAe,EAAC,EAAE,EAAC,QAAQ,EAAC,QAAQ,QAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,SAAG,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,gBAAgB,GAAc,MAAe,CAErR,CACF,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["JumpPaginationTable"],"sources":["src/components/jump-pagination-table/jump-pagination-table.scss?tag=jump-pagination-table","src/components/jump-pagination-table/jump-pagination-table.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.JumpPaginationTable {\n --jump-pagination-table-label: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows-disabled: var(--neutral-grey-disabled); //mappare una variabile del design system\n\n font-family: var(--ff-primary);\n\n &__Wrapper {\n display: flex;\n justify-content: space-between;\n \n .elementsPerPage {\n display: flex;\n gap: 1rem;\n align-items: center;\n \n label {\n color: var(--jump-pagination-table-label);\n font-size: var(--fs-300);\n font-weight: normal;\n }\n }\n \n .indicators {\n font-size: var(--fs-400);\n font-weight: normal;\n display: flex;\n justify-content: space-between;\n gap: 20px;\n \n color: var(--jump-pagination-table-label);\n \n .arrow {\n color: var(--jump-pagination-table-arrows);\n display: flex;\n align-items: center;\n gap: 10px;\n \n button {\n background-color: transparent;\n border: none;\n cursor: pointer;\n padding: 0px;\n display: flex;\n align-items: center;\n }\n \n button:disabled {\n cursor: not-allowed;\n color: var(--jump-pagination-table-arrows-disabled);\n \n }\n }\n \n .elements {\n color: var(--jump-pagination-table-label);\n display: flex;\n align-items: center;\n gap: 5px;\n }\n }\n \n }\n}","import { Component, Event, EventEmitter, Watch, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'jump-pagination-table',\n styleUrl: 'jump-pagination-table.scss',\n shadow: false,\n})\nexport class JumpPaginationTable {\n\n /* ---------------------- OWN PROPERTIES ---------------------- */\n\n /* ---------------------- @ELEMENT ---------------------------- */\n\n /* ---------------------- @STATE ------------------------------ */\n\n /* ---------------------- @PROPERTIES ------------------------- */\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 * Number of elements per page selected\n */\n @Prop() elPerPage: number = 10;\n @Watch('elPerPage')\n elPerPageChanged(newValue: number, oldValue: number) {\n if (newValue !== oldValue) {\n // Riporta la paginazione allo stato iniziale\n this.first = 1;\n this.last = Math.min(this.total, newValue);\n }\n\n this.changeElPerPage.emit({ elPerPage: newValue });\n }\n\n @Prop({ reflect: true }) pagLabel: string = 'di'; // Identifica la label testuale di pagination. \n\n /**\n * Label for the elements per page select\n */\n @Prop({ reflect: true }) labelElementsPerPage: string = 'Elementi per pagina';\n\n /**\n * Total of elements\n */\n @Prop({ reflect: true }) total: number = 100; \n\n /**\n * First element of the page\n */\n @Prop({ reflect: true }) first: number = 1;\n\n /**\n * Last element of the page\n */\n @Prop({ reflect: true }) last: number = 10;\n\n /**\n * Show button to navigate so first e last page\n */\n @Prop({ reflect: true }) showFirstAndLast: boolean = false;\n\n /* ---------------------- @EVENTS ------------------------- */\n @Event({ eventName: 'jump-change-page' }) changePage: EventEmitter;\n @Event({ eventName: 'jump-change-el-per-page' }) changeElPerPage: EventEmitter;\n\n /* -------------------- LYFECYCLE EVENTS ---------------------- */\n componentWillLoad() {\n this.elPerPage = this.elementsRanges[0];\n }\n\n /* -------------------- @LISTEN ------------------------------- */\n\n /* -------------------- @METHOD ------------------------------- */\n\n /* -------------------- LOCAL METHODS ------------------------- */\n setElPerPage(e) {\n this.elPerPage = e.target.value;\n }\n\n doChangePage(dir) {\n let newFirst;\n let newLast;\n\n //TODO refactorare \n if (dir === 'first') {\n newFirst = 1;\n newLast = Math.min(this.total, this.elPerPage);\n } else if (dir === 'last') {\n newLast = this.total;\n newFirst = Math.max(1, this.total - this.elPerPage + 1);\n } else if (dir === 'previous') {\n newFirst = Math.max(1, this.first - this.elPerPage);\n newLast = Math.min(this.total, newFirst + this.elPerPage - 1);\n } else if (dir === 'next') {\n newLast = Math.min(this.total, this.last + this.elPerPage);\n newFirst = Math.max(1, newLast - this.elPerPage + 1);\n }\n\n this.first = newFirst;\n this.last = newLast;\n\n let details = {\n first: newFirst,\n last: newLast,\n direction: dir\n }\n\n this.changePage.emit(details);\n }\n\n /* --------------------- RENDER ------------------------------- */\n render() {\n return (\n <Host class=\"JumpPaginationTable\">\n <div class=\"JumpPaginationTable__Wrapper\">\n <div class=\"elementsPerPage\">\n <label htmlFor=\"elements\">{this.labelElementsPerPage ?? 'Elements per page'}</label>\n <select name=\"elements\" id=\"elements\" onChange={(e) => this.setElPerPage(e)}>\n {this.elementsRanges.map((range) => (\n <option value={range} selected={(this.elPerPage == range) && true}>{range}</option>\n ))}\n </select>\n </div> \n <div class=\"indicators\">\n <div class=\"elements\">\n <span>\n <span>{this.first}</span> - <span>{this.last}</span> {this.pagLabel} <span>{this.total}</span>\n </span>\n </div>\n <div class=\"arrow\">\n {this.showFirstAndLast &&\n // <button \n // onClick={() => this.doChangePage('first')}\n // disabled={this.first === 1}\n // >\n // <jump-icon slot=\"prefix\" name=\"chevrons-left\"></jump-icon>\n // </button>\n <jump-button onClick={() => this.doChangePage('first')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevrons-left\" ></jump-icon> </jump-button>\n }\n {/* <button\n onClick={() => this.doChangePage('previous')}\n disabled={this.first === 1}\n >\n <jump-icon slot=\"prefix\" name=\"chevron-left\"></jump-icon>\n </button> */}\n <jump-button onClick={() => this.doChangePage('previous')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevron-left\" ></jump-icon> </jump-button>\n <jump-button onClick={() => this.doChangePage('next')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevron-right\" ></jump-icon> </jump-button>\n {/* <button\n onClick={() => this.doChangePage('next')}\n disabled={this.last === this.total}\n >\n <jump-icon slot=\"prefix\" name=\"chevron-right\"></jump-icon>\n </button> */}\n {this.showFirstAndLast &&\n // <button\n // onClick={() => this.doChangePage('last')}\n // disabled={this.last === this.total}\n // >\n // <jump-icon slot=\"prefix\" name=\"chevrons-right\"></jump-icon>\n // </button>\n <jump-button onClick={() => this.doChangePage('last')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevrons-right\" ></jump-icon> </jump-button>\n }\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n}\n"],"version":3}
|
|
1
|
+
{"file":"jump-pagination-table.js","mappings":";;;;AAAA,MAAM,sBAAsB,GAAG,+wCAA+wC,CAAC;AAC/yC,kCAAe,sBAAsB;;MCMxBA,qBAAmB;;;;;;8BAaG,cAAc;;;wBA4BH,IAAI;oCAKQ,qBAAqB;qBAKpC,GAAG;qBAKH,CAAC;oBAKF,EAAE;gCAKW,KAAK;;IAjD1D,qBAAqB,CAAC,QAAQ,EAAE,QAAQ;QACtC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACzB,IAAG,QAAQ,KAAK,QAAQ,EAAE;YACxB,IAAI,CAAC,mBAAmB,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SAC1D;QACH,IAAI,CAAC,mBAAmB,GAAG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AAC,OAAO,gBAAY,oBAAe,EAAC,EAAE,EAAC,QAAQ,EAAC,QAAQ,QAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,SAAG,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,eAAe,GAAc,MAAe,EACrR,IAAI,CAAC,gBAAgB;YACpB,oEAAa,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,EAAC,SAAS,EAAC,IAAI,QAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,OAAO,gBAAY,oBAAe,EAAC,EAAE,EAAC,QAAQ,EAAC,QAAQ,QAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,SAAG,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,gBAAgB,GAAc,MAAe,CAErR,CACF,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["JumpPaginationTable"],"sources":["src/components/jump-pagination-table/jump-pagination-table.scss?tag=jump-pagination-table","src/components/jump-pagination-table/jump-pagination-table.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.JumpPaginationTable {\n --jump-pagination-table-label: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows-disabled: var(--neutral-grey-disabled); //mappare una variabile del design system\n\n font-family: var(--ff-primary);\n\n &__Wrapper {\n display: flex;\n justify-content: space-between;\n \n .elementsPerPage {\n display: flex;\n gap: 1rem;\n align-items: center;\n \n label {\n color: var(--jump-pagination-table-label);\n font-size: var(--fs-300);\n font-weight: normal;\n }\n }\n \n .indicators {\n font-size: var(--fs-400);\n font-weight: normal;\n display: flex;\n justify-content: space-between;\n gap: 20px;\n \n color: var(--jump-pagination-table-label);\n \n .arrow {\n color: var(--jump-pagination-table-arrows);\n display: flex;\n align-items: center;\n gap: 10px;\n \n button {\n background-color: transparent;\n border: none;\n cursor: pointer;\n padding: 0px;\n display: flex;\n align-items: center;\n }\n \n button:disabled {\n cursor: not-allowed;\n color: var(--jump-pagination-table-arrows-disabled);\n \n }\n }\n \n .elements {\n color: var(--jump-pagination-table-label);\n display: flex;\n align-items: center;\n gap: 5px;\n }\n }\n \n }\n}","import { Component, State, Event, EventEmitter, Watch, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'jump-pagination-table',\n styleUrl: 'jump-pagination-table.scss',\n shadow: false,\n})\nexport class JumpPaginationTable {\n\n /* ---------------------- OWN PROPERTIES ---------------------- */\n\n /* ---------------------- @ELEMENT ---------------------------- */\n\n /* ---------------------- @STATE ------------------------------ */\n\n /* ---------------------- @PROPERTIES ------------------------- */\n\n /**\n * Values for the elements per page select\n */\n @Prop() elementsRanges: string = \"10,20,60,100\";\n\n @State() elementsRangesArray: number[];\n @Watch('elementsRanges')\n elementsRangesChanged(newValue, oldValue) {\n console.log('dentro el');\n if(newValue !== oldValue) {\n this.elementsRangesArray = newValue.split(',').map(Number);\n }\n this.elementsRangesArray = [...this.elementsRangesArray]\n console.log('elementsRangesChanged', newValue, oldValue);\n }\n\n /**\n * Number of elements per page selected\n */\n @State() elPerPage: number;\n @Watch('elPerPage')\n elPerPageChanged(newValue: number, oldValue: number) {\n if (newValue !== oldValue) {\n // Riporta la paginazione allo stato iniziale\n this.first = 1;\n this.last = Math.min(this.total, newValue);\n }\n\n this.changeElPerPage.emit({ elPerPage: newValue });\n }\n\n @Prop({ reflect: true }) pagLabel: string = 'di'; // Identifica la label testuale di pagination. \n\n /**\n * Label for the elements per page select\n */\n @Prop({ reflect: true }) labelElementsPerPage: string = 'Elementi per pagina';\n\n /**\n * Total of elements\n */\n @Prop({ reflect: true }) total: number = 100; \n\n /**\n * First element of the page\n */\n @Prop({ reflect: true }) first: number = 1;\n\n /**\n * Last element of the page\n */\n @Prop({ reflect: true }) last: number = 10;\n\n /**\n * Show button to navigate so first e last page\n */\n @Prop({ reflect: true }) showFirstAndLast: boolean = false;\n\n /* ---------------------- @EVENTS ------------------------- */\n @Event({ eventName: 'jump-change-page' }) changePage: EventEmitter;\n @Event({ eventName: 'jump-change-el-per-page' }) changeElPerPage: EventEmitter;\n\n /* -------------------- LYFECYCLE EVENTS ---------------------- */\n componentWillLoad() {\n this.elementsRangesArray = this.elementsRanges.split(',').map(Number);\n this.elPerPage = this.elementsRangesArray[0];\n }\n\n /* -------------------- @LISTEN ------------------------------- */\n\n /* -------------------- @METHOD ------------------------------- */\n\n /* -------------------- LOCAL METHODS ------------------------- */\n setElPerPage(e) {\n this.elPerPage = e.target.value;\n }\n\n doChangePage(dir) {\n let newFirst;\n let newLast;\n\n //TODO refactorare \n if (dir === 'first') {\n newFirst = 1;\n newLast = Math.min(this.total, this.elPerPage);\n } else if (dir === 'last') {\n newLast = this.total;\n newFirst = Math.max(1, this.total - this.elPerPage + 1);\n } else if (dir === 'previous') {\n newFirst = Math.max(1, this.first - this.elPerPage);\n newLast = Math.min(this.total, newFirst + this.elPerPage - 1);\n } else if (dir === 'next') {\n newLast = Math.min(this.total, this.last + this.elPerPage);\n newFirst = Math.max(1, newLast - this.elPerPage + 1);\n }\n\n this.first = newFirst;\n this.last = newLast;\n\n let details = {\n first: newFirst,\n last: newLast,\n direction: dir\n }\n\n this.changePage.emit(details);\n }\n\n /* --------------------- RENDER ------------------------------- */\n render() {\n return (\n <Host class=\"JumpPaginationTable\">\n <div class=\"JumpPaginationTable__Wrapper\">\n <div class=\"elementsPerPage\">\n <label htmlFor=\"elements\">{this.labelElementsPerPage ?? 'Elements per page'}</label>\n <select name=\"elements\" id=\"elements\" onChange={(e) => this.setElPerPage(e)}>\n {this.elementsRangesArray.map((range) => (\n <option value={range} selected={(this.elPerPage == range) && true}>{range}</option>\n ))}\n </select>\n </div> \n <div class=\"indicators\">\n <div class=\"elements\">\n <span>\n <span>{this.first}</span> - <span>{this.last}</span> {this.pagLabel} <span>{this.total}</span>\n </span>\n </div>\n <div class=\"arrow\">\n {this.showFirstAndLast &&\n <jump-button onClick={() => this.doChangePage('first')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevrons-left\" ></jump-icon> </jump-button>\n }\n <jump-button onClick={() => this.doChangePage('previous')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevron-left\" ></jump-icon> </jump-button>\n <jump-button onClick={() => this.doChangePage('next')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevron-right\" ></jump-icon> </jump-button>\n {this.showFirstAndLast &&\n <jump-button onClick={() => this.doChangePage('last')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevrons-right\" ></jump-icon> </jump-button>\n }\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n}\n"],"version":3}
|
|
@@ -16,7 +16,7 @@ const patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["jump-button_2",[[1,"jump-button",{"disabled":[4],"variant":[1],"outline":[4],"size":[1],"full":[4],"pill":[4],"text":[4],"onlyIcon":[4,"only-icon"],"href":[1],"target":[1],"type":[1],"name":[1],"value":[1],"ariaLabel":[1,"aria-label"],"class":[1],"buttonId":[1,"button-id"]}],[1,"jump-icon",{"class":[1],"library":[1],"name":[1],"category":[1],"size":[1],"label":[1],"src":[1]}]]],["jump-card-ecommerce",[[1,"jump-card-ecommerce",{"onlyIconButton":[4,"only-icon-button"],"hasBackground":[4,"has-background"],"badge":[1],"favorite":[1540],"hasFavorite":[4,"has-favorite"],"favoriteBtnClass":[1,"favorite-btn-class"],"link":[1],"img":[1],"imgAlt":[1,"img-alt"],"hoverImg":[1,"hover-img"],"hoverImgAlt":[1,"hover-img-alt"],"videoSrc":[1,"video-src"],"notificationUrl":[1,"notification-url"],"notificationText":[1,"notification-text"],"productName":[1,"product-name"],"subtitle":[1],"productId":[1,"product-id"],"price":[2],"salePrice":[2,"sale-price"],"currency":[1],"outOfStock":[1540,"out-of-stock"],"outOfStockText":[1,"out-of-stock-text"],"addToCartText":[1,"add-to-cart-text"],"waitingListText":[1,"waiting-list-text"],"addToWaitingList":[4,"add-to-waiting-list"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32]},[[0,"jump-card-ecommerce-option-connected","addOption"]]]]],["jump-filter",[[1,"jump-filter",{"direction":[1],"filterHeading":[1,"filter-heading"],"filterButtonLabel":[1,"filter-button-label"],"filterButtonIcon":[1,"filter-button-icon"],"mobileThreshold":[2,"mobile-threshold"],"filters":[8],"activeFilters":[32],"showMobileFilters":[32],"isMobile":[32],"getFilters":[64]},[[0,"jump-filterchange","filterChangeHandler"],[9,"resize","handleResize"]]]]],["jump-filtergroup",[[1,"jump-filtergroup",{"name":[1],"title":[1],"otherLabel":[1,"other-label"],"lessLabel":[1,"less-label"],"maxElements":[2,"max-elements"],"variant":[1],"values":[32],"value":[32],"slotItems":[32],"inputs":[32],"showMore":[32],"getValues":[64],"getActiveAmount":[64],"getInputs":[64],"getName":[64]}]]],["jump-pagination",[[1,"jump-pagination",{"pagLabel":[1,"pag-label"],"last":[2],"showFirstAndLast":[4,"show-first-and-last"],"current":[32]},null,{"current":["watchcurrent"]}]]],["jump-pagination-table",[[0,"jump-pagination-table",{"elementsRanges":[
|
|
19
|
+
return bootstrapLazy([["jump-button_2",[[1,"jump-button",{"disabled":[4],"variant":[1],"outline":[4],"size":[1],"full":[4],"pill":[4],"text":[4],"onlyIcon":[4,"only-icon"],"href":[1],"target":[1],"type":[1],"name":[1],"value":[1],"ariaLabel":[1,"aria-label"],"class":[1],"buttonId":[1,"button-id"]}],[1,"jump-icon",{"class":[1],"library":[1],"name":[1],"category":[1],"size":[1],"label":[1],"src":[1]}]]],["jump-card-ecommerce",[[1,"jump-card-ecommerce",{"onlyIconButton":[4,"only-icon-button"],"hasBackground":[4,"has-background"],"badge":[1],"favorite":[1540],"hasFavorite":[4,"has-favorite"],"favoriteBtnClass":[1,"favorite-btn-class"],"link":[1],"img":[1],"imgAlt":[1,"img-alt"],"hoverImg":[1,"hover-img"],"hoverImgAlt":[1,"hover-img-alt"],"videoSrc":[1,"video-src"],"notificationUrl":[1,"notification-url"],"notificationText":[1,"notification-text"],"productName":[1,"product-name"],"subtitle":[1],"productId":[1,"product-id"],"price":[2],"salePrice":[2,"sale-price"],"currency":[1],"outOfStock":[1540,"out-of-stock"],"outOfStockText":[1,"out-of-stock-text"],"addToCartText":[1,"add-to-cart-text"],"waitingListText":[1,"waiting-list-text"],"addToWaitingList":[4,"add-to-waiting-list"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32]},[[0,"jump-card-ecommerce-option-connected","addOption"]]]]],["jump-filter",[[1,"jump-filter",{"direction":[1],"filterHeading":[1,"filter-heading"],"filterButtonLabel":[1,"filter-button-label"],"filterButtonIcon":[1,"filter-button-icon"],"mobileThreshold":[2,"mobile-threshold"],"filters":[8],"activeFilters":[32],"showMobileFilters":[32],"isMobile":[32],"getFilters":[64]},[[0,"jump-filterchange","filterChangeHandler"],[9,"resize","handleResize"]]]]],["jump-filtergroup",[[1,"jump-filtergroup",{"name":[1],"title":[1],"otherLabel":[1,"other-label"],"lessLabel":[1,"less-label"],"maxElements":[2,"max-elements"],"variant":[1],"values":[32],"value":[32],"slotItems":[32],"inputs":[32],"showMore":[32],"getValues":[64],"getActiveAmount":[64],"getInputs":[64],"getName":[64]}]]],["jump-pagination",[[1,"jump-pagination",{"pagLabel":[1,"pag-label"],"last":[2],"showFirstAndLast":[4,"show-first-and-last"],"current":[32]},null,{"current":["watchcurrent"]}]]],["jump-pagination-table",[[0,"jump-pagination-table",{"elementsRanges":[1,"elements-ranges"],"pagLabel":[513,"pag-label"],"labelElementsPerPage":[513,"label-elements-per-page"],"total":[514],"first":[514],"last":[514],"showFirstAndLast":[516,"show-first-and-last"],"elementsRangesArray":[32],"elPerPage":[32]},null,{"elementsRanges":["elementsRangesChanged"],"elPerPage":["elPerPageChanged"]}]]],["jump-quantity",[[65,"jump-quantity",{"min":[2],"max":[2],"step":[2],"label":[1],"type":[1],"variant":[1],"showButtons":[4,"show-buttons"],"value":[2],"getValue":[64],"reset":[64]},null,{"value":["onValueChange"]}]]],["jump-tab-item",[[1,"jump-tab-item",{"identifier":[1],"iconName":[1,"icon-name"],"iconPosition":[1,"icon-position"],"label":[1],"active":[4],"disabled":[4],"variant":[32]}]]],["jump-accordion",[[1,"jump-accordion"]]],["jump-card",[[4,"jump-card",{"horizontal":[4],"dark":[4],"shadow":[4],"border":[4],"borderRadius":[4,"border-radius"],"topBorderContentRadius":[4,"top-border-content-radius"],"boxed":[4],"roundedMedia":[4,"rounded-media"],"imgSrc":[1,"img-src"],"imgAlt":[1,"img-alt"],"videoSrc":[1,"video-src"]}]]],["jump-card-ecommerce-option",[[1,"jump-card-ecommerce-option",{"code":[1],"imgUrl":[1,"img-url"],"label":[1],"sku":[1],"taxonomy":[1]}]]],["jump-tab",[[1,"jump-tab",{"tabGroupName":[1,"tab-group-name"],"variant":[1]},[[0,"jump-change-active-tab","changeActiveTabHandler"]]]]],["jump-tab-panel",[[1,"jump-tab-panel",{"identifier":[1],"active":[4]}]]],["jump-badge",[[1,"jump-badge",{"label":[1],"variant":[513],"dimension":[513],"soft":[516],"outline":[516]}]]]], options);
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
//# sourceMappingURL=jump-design-system.js.map
|
|
@@ -8,8 +8,9 @@ const JumpPaginationTable = class {
|
|
|
8
8
|
registerInstance(this, hostRef);
|
|
9
9
|
this.changePage = createEvent(this, "jump-change-page", 7);
|
|
10
10
|
this.changeElPerPage = createEvent(this, "jump-change-el-per-page", 7);
|
|
11
|
-
this.elementsRanges =
|
|
12
|
-
this.
|
|
11
|
+
this.elementsRanges = "10,20,60,100";
|
|
12
|
+
this.elementsRangesArray = undefined;
|
|
13
|
+
this.elPerPage = undefined;
|
|
13
14
|
this.pagLabel = 'di';
|
|
14
15
|
this.labelElementsPerPage = 'Elementi per pagina';
|
|
15
16
|
this.total = 100;
|
|
@@ -17,6 +18,14 @@ const JumpPaginationTable = class {
|
|
|
17
18
|
this.last = 10;
|
|
18
19
|
this.showFirstAndLast = false;
|
|
19
20
|
}
|
|
21
|
+
elementsRangesChanged(newValue, oldValue) {
|
|
22
|
+
console.log('dentro el');
|
|
23
|
+
if (newValue !== oldValue) {
|
|
24
|
+
this.elementsRangesArray = newValue.split(',').map(Number);
|
|
25
|
+
}
|
|
26
|
+
this.elementsRangesArray = [...this.elementsRangesArray];
|
|
27
|
+
console.log('elementsRangesChanged', newValue, oldValue);
|
|
28
|
+
}
|
|
20
29
|
elPerPageChanged(newValue, oldValue) {
|
|
21
30
|
if (newValue !== oldValue) {
|
|
22
31
|
// Riporta la paginazione allo stato iniziale
|
|
@@ -27,7 +36,8 @@ const JumpPaginationTable = class {
|
|
|
27
36
|
}
|
|
28
37
|
/* -------------------- LYFECYCLE EVENTS ---------------------- */
|
|
29
38
|
componentWillLoad() {
|
|
30
|
-
this.
|
|
39
|
+
this.elementsRangesArray = this.elementsRanges.split(',').map(Number);
|
|
40
|
+
this.elPerPage = this.elementsRangesArray[0];
|
|
31
41
|
}
|
|
32
42
|
/* -------------------- @LISTEN ------------------------------- */
|
|
33
43
|
/* -------------------- @METHOD ------------------------------- */
|
|
@@ -67,23 +77,12 @@ const JumpPaginationTable = class {
|
|
|
67
77
|
/* --------------------- RENDER ------------------------------- */
|
|
68
78
|
render() {
|
|
69
79
|
var _a;
|
|
70
|
-
return (h(Host, { key: '
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
// disabled={this.first === 1}
|
|
74
|
-
// >
|
|
75
|
-
// <jump-icon slot="prefix" name="chevrons-left"></jump-icon>
|
|
76
|
-
// </button>
|
|
77
|
-
h("jump-button", { key: 'c7a833acee791a25257e237d88aef4e5bf5b5cc8', onClick: () => this.doChangePage('first'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: 'ffb50e27e476c8ca8d58ff18ce30c96ff6330872', slot: "suffix", name: "chevrons-left" }), " "), h("jump-button", { key: '46bf715a0803deef866d90a1523675ab24c1793f', onClick: () => this.doChangePage('previous'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: '223bf0f161ffce6ee0e17fbae7b8467cae790be3', slot: "suffix", name: "chevron-left" }), " "), h("jump-button", { key: '97696457a54e5808a0c252eeda2c8d915bcfe2e8', onClick: () => this.doChangePage('next'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: '9e01f45cc02450c41bf3ffc2f14cfd6606ab5a96', slot: "suffix", name: "chevron-right" }), " "), this.showFirstAndLast &&
|
|
78
|
-
// <button
|
|
79
|
-
// onClick={() => this.doChangePage('last')}
|
|
80
|
-
// disabled={this.last === this.total}
|
|
81
|
-
// >
|
|
82
|
-
// <jump-icon slot="prefix" name="chevrons-right"></jump-icon>
|
|
83
|
-
// </button>
|
|
84
|
-
h("jump-button", { key: '05a745e26f5f14383e745a744c0c23e5598b0623', onClick: () => this.doChangePage('last'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: '0ba46ee7053a3aed0091c05a20444c767738dc2f', slot: "suffix", name: "chevrons-right" }), " "))))));
|
|
80
|
+
return (h(Host, { key: 'fd4a13e65dfbcc334ace661e61297ff05d78624d', class: "JumpPaginationTable" }, h("div", { key: 'ae50a5dbac84be7f7f02c5c93f1e7cbd73a1fc6f', class: "JumpPaginationTable__Wrapper" }, h("div", { key: '2eade4e3a54fb4c84f3c7718d827d6e5295508bf', class: "elementsPerPage" }, h("label", { key: '4211a782ce895731ed90d52c88a278ccf69e03fc', htmlFor: "elements" }, (_a = this.labelElementsPerPage) !== null && _a !== void 0 ? _a : 'Elements per page'), h("select", { key: '6ce02a5ad892bf1d6b48b3ccb2605e1e1de3416b', name: "elements", id: "elements", onChange: (e) => this.setElPerPage(e) }, this.elementsRangesArray.map((range) => (h("option", { value: range, selected: (this.elPerPage == range) && true }, range))))), h("div", { key: '915e8eefc53385620b2d554935ab6f81f9571407', class: "indicators" }, h("div", { key: '02b3867d0fe90a6408aced6bd7b639d92cec61a6', class: "elements" }, h("span", { key: 'e1d25f5be0f4fbdd995588642d1ba1583e90a280' }, h("span", { key: '775b964a3dcc29be4d914c9ff309f6809555683b' }, this.first), " - ", h("span", { key: '31886227817ee097c5594bc1a81f271ac185531c' }, this.last), " ", this.pagLabel, " ", h("span", { key: 'a6525640edea1672b429732d2e23c72b1fbacf04' }, this.total))), h("div", { key: '9231615ab10231842136b4d64ce2a5e87a502c3f', class: "arrow" }, this.showFirstAndLast &&
|
|
81
|
+
h("jump-button", { key: 'cd9d9073f37b561464dfe5209cb43bc351392b40', onClick: () => this.doChangePage('first'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: '48ece4b1628154ea80b33698c2de4a473e433d25', slot: "suffix", name: "chevrons-left" }), " "), h("jump-button", { key: '69c9b009244d96aa5c5e770d38ed9535330c1904', onClick: () => this.doChangePage('previous'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: 'd5b18f4b7809af2032b4c955c59b0de2fb81b1b0', slot: "suffix", name: "chevron-left" }), " "), h("jump-button", { key: '95bf121ea17a00e01f4d47c256191665850dfcb6', onClick: () => this.doChangePage('next'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: '64ac86934180ce2203c06472c00ec33334d128dd', slot: "suffix", name: "chevron-right" }), " "), this.showFirstAndLast &&
|
|
82
|
+
h("jump-button", { key: '2de71c60a69f5dc61088e2e4a27591e8b442967a', onClick: () => this.doChangePage('last'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: 'c2113c26705cfafe41c9cb5c92527856dc7ee433', slot: "suffix", name: "chevrons-right" }), " "))))));
|
|
85
83
|
}
|
|
86
84
|
static get watchers() { return {
|
|
85
|
+
"elementsRanges": ["elementsRangesChanged"],
|
|
87
86
|
"elPerPage": ["elPerPageChanged"]
|
|
88
87
|
}; }
|
|
89
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"jump-pagination-table.entry.js","mappings":";;AAAA,MAAM,sBAAsB,GAAG,+wCAA+wC,CAAC;AAC/yC,kCAAe,sBAAsB;;MCMxB,mBAAmB;;;;;8BAa2B,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;yBAK9C,EAAE;wBAYc,IAAI;oCAKQ,qBAAqB;qBAKpC,GAAG;qBAKH,CAAC;oBAKF,EAAE;gCAKW,KAAK;;IAnC1D,gBAAgB,CAAC,QAAgB,EA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YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,EAAC,SAAS,EAAC,IAAI,QAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,OAAO,gBAAY,oBAAe,EAAC,EAAE,EAAC,QAAQ,EAAC,QAAQ,QAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,SAAG,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,gBAAgB,GAAc,MAAe,CAErR,CACF,CACF,CACD,EACP;KACH;;;;;;;;;","names":[],"sources":["src/components/jump-pagination-table/jump-pagination-table.scss?tag=jump-pagination-table","src/components/jump-pagination-table/jump-pagination-table.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.JumpPaginationTable {\n --jump-pagination-table-label: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows-disabled: var(--neutral-grey-disabled); //mappare una variabile del design system\n\n font-family: var(--ff-primary);\n\n &__Wrapper {\n display: flex;\n justify-content: space-between;\n \n .elementsPerPage {\n display: flex;\n gap: 1rem;\n align-items: center;\n \n label {\n color: var(--jump-pagination-table-label);\n font-size: var(--fs-300);\n font-weight: normal;\n }\n }\n \n .indicators {\n font-size: var(--fs-400);\n font-weight: normal;\n display: flex;\n justify-content: space-between;\n gap: 20px;\n \n color: var(--jump-pagination-table-label);\n \n .arrow {\n color: var(--jump-pagination-table-arrows);\n display: flex;\n align-items: center;\n gap: 10px;\n \n button {\n background-color: transparent;\n border: none;\n cursor: pointer;\n padding: 0px;\n display: flex;\n align-items: center;\n }\n \n button:disabled {\n cursor: not-allowed;\n color: var(--jump-pagination-table-arrows-disabled);\n \n }\n }\n \n .elements {\n color: var(--jump-pagination-table-label);\n display: flex;\n align-items: center;\n gap: 5px;\n }\n }\n \n }\n}","import { Component, Event, EventEmitter, Watch, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'jump-pagination-table',\n styleUrl: 'jump-pagination-table.scss',\n shadow: false,\n})\nexport class JumpPaginationTable {\n\n /* ---------------------- OWN PROPERTIES ---------------------- */\n\n /* ---------------------- @ELEMENT ---------------------------- */\n\n /* ---------------------- @STATE ------------------------------ */\n\n /* ---------------------- @PROPERTIES ------------------------- */\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 * Number of elements per page selected\n */\n @Prop() elPerPage: number = 10;\n @Watch('elPerPage')\n elPerPageChanged(newValue: number, oldValue: number) {\n if (newValue !== oldValue) {\n // Riporta la paginazione allo stato iniziale\n this.first = 1;\n this.last = Math.min(this.total, newValue);\n }\n\n this.changeElPerPage.emit({ elPerPage: newValue });\n }\n\n @Prop({ reflect: true }) pagLabel: string = 'di'; // Identifica la label testuale di pagination. \n\n /**\n * Label for the elements per page select\n */\n @Prop({ reflect: true }) labelElementsPerPage: string = 'Elementi per pagina';\n\n /**\n * Total of elements\n */\n @Prop({ reflect: true }) total: number = 100; \n\n /**\n * First element of the page\n */\n @Prop({ reflect: true }) first: number = 1;\n\n /**\n * Last element of the page\n */\n @Prop({ reflect: true }) last: number = 10;\n\n /**\n * Show button to navigate so first e last page\n */\n @Prop({ reflect: true }) showFirstAndLast: boolean = false;\n\n /* ---------------------- @EVENTS ------------------------- */\n @Event({ eventName: 'jump-change-page' }) changePage: EventEmitter;\n @Event({ eventName: 'jump-change-el-per-page' }) changeElPerPage: EventEmitter;\n\n /* -------------------- LYFECYCLE EVENTS ---------------------- */\n componentWillLoad() {\n this.elPerPage = this.elementsRanges[0];\n }\n\n /* -------------------- @LISTEN ------------------------------- */\n\n /* -------------------- @METHOD ------------------------------- */\n\n /* -------------------- LOCAL METHODS ------------------------- */\n setElPerPage(e) {\n this.elPerPage = e.target.value;\n }\n\n doChangePage(dir) {\n let newFirst;\n let newLast;\n\n //TODO refactorare \n if (dir === 'first') {\n newFirst = 1;\n newLast = Math.min(this.total, this.elPerPage);\n } else if (dir === 'last') {\n newLast = this.total;\n newFirst = Math.max(1, this.total - this.elPerPage + 1);\n } else if (dir === 'previous') {\n newFirst = Math.max(1, this.first - this.elPerPage);\n newLast = Math.min(this.total, newFirst + this.elPerPage - 1);\n } else if (dir === 'next') {\n newLast = Math.min(this.total, this.last + this.elPerPage);\n newFirst = Math.max(1, newLast - this.elPerPage + 1);\n }\n\n this.first = newFirst;\n this.last = newLast;\n\n let details = {\n first: newFirst,\n last: newLast,\n direction: dir\n }\n\n this.changePage.emit(details);\n }\n\n /* --------------------- RENDER ------------------------------- */\n render() {\n return (\n <Host class=\"JumpPaginationTable\">\n <div class=\"JumpPaginationTable__Wrapper\">\n <div class=\"elementsPerPage\">\n <label htmlFor=\"elements\">{this.labelElementsPerPage ?? 'Elements per page'}</label>\n <select name=\"elements\" id=\"elements\" onChange={(e) => this.setElPerPage(e)}>\n {this.elementsRanges.map((range) => (\n <option value={range} selected={(this.elPerPage == range) && true}>{range}</option>\n ))}\n </select>\n </div> \n <div class=\"indicators\">\n <div class=\"elements\">\n <span>\n <span>{this.first}</span> - <span>{this.last}</span> {this.pagLabel} <span>{this.total}</span>\n </span>\n </div>\n <div class=\"arrow\">\n {this.showFirstAndLast &&\n // <button \n // onClick={() => this.doChangePage('first')}\n // disabled={this.first === 1}\n // >\n // <jump-icon slot=\"prefix\" name=\"chevrons-left\"></jump-icon>\n // </button>\n <jump-button onClick={() => this.doChangePage('first')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevrons-left\" ></jump-icon> </jump-button>\n }\n {/* <button\n onClick={() => this.doChangePage('previous')}\n disabled={this.first === 1}\n >\n <jump-icon slot=\"prefix\" name=\"chevron-left\"></jump-icon>\n </button> */}\n <jump-button onClick={() => this.doChangePage('previous')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevron-left\" ></jump-icon> </jump-button>\n <jump-button onClick={() => this.doChangePage('next')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevron-right\" ></jump-icon> </jump-button>\n {/* <button\n onClick={() => this.doChangePage('next')}\n disabled={this.last === this.total}\n >\n <jump-icon slot=\"prefix\" name=\"chevron-right\"></jump-icon>\n </button> */}\n {this.showFirstAndLast &&\n // <button\n // onClick={() => this.doChangePage('last')}\n // disabled={this.last === this.total}\n // >\n // <jump-icon slot=\"prefix\" name=\"chevrons-right\"></jump-icon>\n // </button>\n <jump-button onClick={() => this.doChangePage('last')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevrons-right\" ></jump-icon> </jump-button>\n }\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n}\n"],"version":3}
|
|
1
|
+
{"file":"jump-pagination-table.entry.js","mappings":";;AAAA,MAAM,sBAAsB,GAAG,+wCAA+wC,CAAC;AAC/yC,kCAAe,sBAAsB;;MCMxB,mBAAmB;;;;;8BAaG,cAAc;;;wBA4BH,IAAI;oCAKQ,qBAAqB;qBAKpC,GAAG;qBAKH,CAAC;oBAKF,EAAE;gCAKW,KAAK;;IAjD1D,qBAAqB,CAAC,QAAQ,EAAE,QAAQ;QACtC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACzB,IAAG,QAAQ,KAAK,QAAQ,EAAE;YACxB,IAAI,CAAC,mBAAmB,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SAC1D;QACH,IAAI,CAAC,mBAAmB,GAAG,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC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AAC,QAAQ,EAAC,QAAQ,QAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,SAAG,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,eAAe,GAAc,MAAe,EACrR,IAAI,CAAC,gBAAgB;YACpB,oEAAa,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,EAAC,SAAS,EAAC,IAAI,QAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,OAAO,gBAAY,oBAAe,EAAC,EAAE,EAAC,QAAQ,EAAC,QAAQ,QAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,SAAG,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,gBAAgB,GAAc,MAAe,CAErR,CACF,CACF,CACD,EACP;KACH;;;;;;;;;;","names":[],"sources":["src/components/jump-pagination-table/jump-pagination-table.scss?tag=jump-pagination-table","src/components/jump-pagination-table/jump-pagination-table.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.JumpPaginationTable {\n --jump-pagination-table-label: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows-disabled: var(--neutral-grey-disabled); //mappare una variabile del design system\n\n font-family: var(--ff-primary);\n\n &__Wrapper {\n display: flex;\n justify-content: space-between;\n \n .elementsPerPage {\n display: flex;\n gap: 1rem;\n align-items: center;\n \n label {\n color: var(--jump-pagination-table-label);\n font-size: var(--fs-300);\n font-weight: normal;\n }\n }\n \n .indicators {\n font-size: var(--fs-400);\n font-weight: normal;\n display: flex;\n justify-content: space-between;\n gap: 20px;\n \n color: var(--jump-pagination-table-label);\n \n .arrow {\n color: var(--jump-pagination-table-arrows);\n display: flex;\n align-items: center;\n gap: 10px;\n \n button {\n background-color: transparent;\n border: none;\n cursor: pointer;\n padding: 0px;\n display: flex;\n align-items: center;\n }\n \n button:disabled {\n cursor: not-allowed;\n color: var(--jump-pagination-table-arrows-disabled);\n \n }\n }\n \n .elements {\n color: var(--jump-pagination-table-label);\n display: flex;\n align-items: center;\n gap: 5px;\n }\n }\n \n }\n}","import { Component, State, Event, EventEmitter, Watch, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'jump-pagination-table',\n styleUrl: 'jump-pagination-table.scss',\n shadow: false,\n})\nexport class JumpPaginationTable {\n\n /* ---------------------- OWN PROPERTIES ---------------------- */\n\n /* ---------------------- @ELEMENT ---------------------------- */\n\n /* ---------------------- @STATE ------------------------------ */\n\n /* ---------------------- @PROPERTIES ------------------------- */\n\n /**\n * Values for the elements per page select\n */\n @Prop() elementsRanges: string = \"10,20,60,100\";\n\n @State() elementsRangesArray: number[];\n @Watch('elementsRanges')\n elementsRangesChanged(newValue, oldValue) {\n console.log('dentro el');\n if(newValue !== oldValue) {\n this.elementsRangesArray = newValue.split(',').map(Number);\n }\n this.elementsRangesArray = [...this.elementsRangesArray]\n console.log('elementsRangesChanged', newValue, oldValue);\n }\n\n /**\n * Number of elements per page selected\n */\n @State() elPerPage: number;\n @Watch('elPerPage')\n elPerPageChanged(newValue: number, oldValue: number) {\n if (newValue !== oldValue) {\n // Riporta la paginazione allo stato iniziale\n this.first = 1;\n this.last = Math.min(this.total, newValue);\n }\n\n this.changeElPerPage.emit({ elPerPage: newValue });\n }\n\n @Prop({ reflect: true }) pagLabel: string = 'di'; // Identifica la label testuale di pagination. \n\n /**\n * Label for the elements per page select\n */\n @Prop({ reflect: true }) labelElementsPerPage: string = 'Elementi per pagina';\n\n /**\n * Total of elements\n */\n @Prop({ reflect: true }) total: number = 100; \n\n /**\n * First element of the page\n */\n @Prop({ reflect: true }) first: number = 1;\n\n /**\n * Last element of the page\n */\n @Prop({ reflect: true }) last: number = 10;\n\n /**\n * Show button to navigate so first e last page\n */\n @Prop({ reflect: true }) showFirstAndLast: boolean = false;\n\n /* ---------------------- @EVENTS ------------------------- */\n @Event({ eventName: 'jump-change-page' }) changePage: EventEmitter;\n @Event({ eventName: 'jump-change-el-per-page' }) changeElPerPage: EventEmitter;\n\n /* -------------------- LYFECYCLE EVENTS ---------------------- */\n componentWillLoad() {\n this.elementsRangesArray = this.elementsRanges.split(',').map(Number);\n this.elPerPage = this.elementsRangesArray[0];\n }\n\n /* -------------------- @LISTEN ------------------------------- */\n\n /* -------------------- @METHOD ------------------------------- */\n\n /* -------------------- LOCAL METHODS ------------------------- */\n setElPerPage(e) {\n this.elPerPage = e.target.value;\n }\n\n doChangePage(dir) {\n let newFirst;\n let newLast;\n\n //TODO refactorare \n if (dir === 'first') {\n newFirst = 1;\n newLast = Math.min(this.total, this.elPerPage);\n } else if (dir === 'last') {\n newLast = this.total;\n newFirst = Math.max(1, this.total - this.elPerPage + 1);\n } else if (dir === 'previous') {\n newFirst = Math.max(1, this.first - this.elPerPage);\n newLast = Math.min(this.total, newFirst + this.elPerPage - 1);\n } else if (dir === 'next') {\n newLast = Math.min(this.total, this.last + this.elPerPage);\n newFirst = Math.max(1, newLast - this.elPerPage + 1);\n }\n\n this.first = newFirst;\n this.last = newLast;\n\n let details = {\n first: newFirst,\n last: newLast,\n direction: dir\n }\n\n this.changePage.emit(details);\n }\n\n /* --------------------- RENDER ------------------------------- */\n render() {\n return (\n <Host class=\"JumpPaginationTable\">\n <div class=\"JumpPaginationTable__Wrapper\">\n <div class=\"elementsPerPage\">\n <label htmlFor=\"elements\">{this.labelElementsPerPage ?? 'Elements per page'}</label>\n <select name=\"elements\" id=\"elements\" onChange={(e) => this.setElPerPage(e)}>\n {this.elementsRangesArray.map((range) => (\n <option value={range} selected={(this.elPerPage == range) && true}>{range}</option>\n ))}\n </select>\n </div> \n <div class=\"indicators\">\n <div class=\"elements\">\n <span>\n <span>{this.first}</span> - <span>{this.last}</span> {this.pagLabel} <span>{this.total}</span>\n </span>\n </div>\n <div class=\"arrow\">\n {this.showFirstAndLast &&\n <jump-button onClick={() => this.doChangePage('first')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevrons-left\" ></jump-icon> </jump-button>\n }\n <jump-button onClick={() => this.doChangePage('previous')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevron-left\" ></jump-icon> </jump-button>\n <jump-button onClick={() => this.doChangePage('next')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevron-right\" ></jump-icon> </jump-button>\n {this.showFirstAndLast &&\n <jump-button onClick={() => this.doChangePage('last')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevrons-right\" ></jump-icon> </jump-button>\n }\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n}\n"],"version":3}
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["jump-button_2",[[1,"jump-button",{"disabled":[4],"variant":[1],"outline":[4],"size":[1],"full":[4],"pill":[4],"text":[4],"onlyIcon":[4,"only-icon"],"href":[1],"target":[1],"type":[1],"name":[1],"value":[1],"ariaLabel":[1,"aria-label"],"class":[1],"buttonId":[1,"button-id"]}],[1,"jump-icon",{"class":[1],"library":[1],"name":[1],"category":[1],"size":[1],"label":[1],"src":[1]}]]],["jump-card-ecommerce",[[1,"jump-card-ecommerce",{"onlyIconButton":[4,"only-icon-button"],"hasBackground":[4,"has-background"],"badge":[1],"favorite":[1540],"hasFavorite":[4,"has-favorite"],"favoriteBtnClass":[1,"favorite-btn-class"],"link":[1],"img":[1],"imgAlt":[1,"img-alt"],"hoverImg":[1,"hover-img"],"hoverImgAlt":[1,"hover-img-alt"],"videoSrc":[1,"video-src"],"notificationUrl":[1,"notification-url"],"notificationText":[1,"notification-text"],"productName":[1,"product-name"],"subtitle":[1],"productId":[1,"product-id"],"price":[2],"salePrice":[2,"sale-price"],"currency":[1],"outOfStock":[1540,"out-of-stock"],"outOfStockText":[1,"out-of-stock-text"],"addToCartText":[1,"add-to-cart-text"],"waitingListText":[1,"waiting-list-text"],"addToWaitingList":[4,"add-to-waiting-list"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32]},[[0,"jump-card-ecommerce-option-connected","addOption"]]]]],["jump-filter",[[1,"jump-filter",{"direction":[1],"filterHeading":[1,"filter-heading"],"filterButtonLabel":[1,"filter-button-label"],"filterButtonIcon":[1,"filter-button-icon"],"mobileThreshold":[2,"mobile-threshold"],"filters":[8],"activeFilters":[32],"showMobileFilters":[32],"isMobile":[32],"getFilters":[64]},[[0,"jump-filterchange","filterChangeHandler"],[9,"resize","handleResize"]]]]],["jump-filtergroup",[[1,"jump-filtergroup",{"name":[1],"title":[1],"otherLabel":[1,"other-label"],"lessLabel":[1,"less-label"],"maxElements":[2,"max-elements"],"variant":[1],"values":[32],"value":[32],"slotItems":[32],"inputs":[32],"showMore":[32],"getValues":[64],"getActiveAmount":[64],"getInputs":[64],"getName":[64]}]]],["jump-pagination",[[1,"jump-pagination",{"pagLabel":[1,"pag-label"],"last":[2],"showFirstAndLast":[4,"show-first-and-last"],"current":[32]},null,{"current":["watchcurrent"]}]]],["jump-pagination-table",[[0,"jump-pagination-table",{"elementsRanges":[
|
|
8
|
+
return bootstrapLazy([["jump-button_2",[[1,"jump-button",{"disabled":[4],"variant":[1],"outline":[4],"size":[1],"full":[4],"pill":[4],"text":[4],"onlyIcon":[4,"only-icon"],"href":[1],"target":[1],"type":[1],"name":[1],"value":[1],"ariaLabel":[1,"aria-label"],"class":[1],"buttonId":[1,"button-id"]}],[1,"jump-icon",{"class":[1],"library":[1],"name":[1],"category":[1],"size":[1],"label":[1],"src":[1]}]]],["jump-card-ecommerce",[[1,"jump-card-ecommerce",{"onlyIconButton":[4,"only-icon-button"],"hasBackground":[4,"has-background"],"badge":[1],"favorite":[1540],"hasFavorite":[4,"has-favorite"],"favoriteBtnClass":[1,"favorite-btn-class"],"link":[1],"img":[1],"imgAlt":[1,"img-alt"],"hoverImg":[1,"hover-img"],"hoverImgAlt":[1,"hover-img-alt"],"videoSrc":[1,"video-src"],"notificationUrl":[1,"notification-url"],"notificationText":[1,"notification-text"],"productName":[1,"product-name"],"subtitle":[1],"productId":[1,"product-id"],"price":[2],"salePrice":[2,"sale-price"],"currency":[1],"outOfStock":[1540,"out-of-stock"],"outOfStockText":[1,"out-of-stock-text"],"addToCartText":[1,"add-to-cart-text"],"waitingListText":[1,"waiting-list-text"],"addToWaitingList":[4,"add-to-waiting-list"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32]},[[0,"jump-card-ecommerce-option-connected","addOption"]]]]],["jump-filter",[[1,"jump-filter",{"direction":[1],"filterHeading":[1,"filter-heading"],"filterButtonLabel":[1,"filter-button-label"],"filterButtonIcon":[1,"filter-button-icon"],"mobileThreshold":[2,"mobile-threshold"],"filters":[8],"activeFilters":[32],"showMobileFilters":[32],"isMobile":[32],"getFilters":[64]},[[0,"jump-filterchange","filterChangeHandler"],[9,"resize","handleResize"]]]]],["jump-filtergroup",[[1,"jump-filtergroup",{"name":[1],"title":[1],"otherLabel":[1,"other-label"],"lessLabel":[1,"less-label"],"maxElements":[2,"max-elements"],"variant":[1],"values":[32],"value":[32],"slotItems":[32],"inputs":[32],"showMore":[32],"getValues":[64],"getActiveAmount":[64],"getInputs":[64],"getName":[64]}]]],["jump-pagination",[[1,"jump-pagination",{"pagLabel":[1,"pag-label"],"last":[2],"showFirstAndLast":[4,"show-first-and-last"],"current":[32]},null,{"current":["watchcurrent"]}]]],["jump-pagination-table",[[0,"jump-pagination-table",{"elementsRanges":[1,"elements-ranges"],"pagLabel":[513,"pag-label"],"labelElementsPerPage":[513,"label-elements-per-page"],"total":[514],"first":[514],"last":[514],"showFirstAndLast":[516,"show-first-and-last"],"elementsRangesArray":[32],"elPerPage":[32]},null,{"elementsRanges":["elementsRangesChanged"],"elPerPage":["elPerPageChanged"]}]]],["jump-quantity",[[65,"jump-quantity",{"min":[2],"max":[2],"step":[2],"label":[1],"type":[1],"variant":[1],"showButtons":[4,"show-buttons"],"value":[2],"getValue":[64],"reset":[64]},null,{"value":["onValueChange"]}]]],["jump-tab-item",[[1,"jump-tab-item",{"identifier":[1],"iconName":[1,"icon-name"],"iconPosition":[1,"icon-position"],"label":[1],"active":[4],"disabled":[4],"variant":[32]}]]],["jump-accordion",[[1,"jump-accordion"]]],["jump-card",[[4,"jump-card",{"horizontal":[4],"dark":[4],"shadow":[4],"border":[4],"borderRadius":[4,"border-radius"],"topBorderContentRadius":[4,"top-border-content-radius"],"boxed":[4],"roundedMedia":[4,"rounded-media"],"imgSrc":[1,"img-src"],"imgAlt":[1,"img-alt"],"videoSrc":[1,"video-src"]}]]],["jump-card-ecommerce-option",[[1,"jump-card-ecommerce-option",{"code":[1],"imgUrl":[1,"img-url"],"label":[1],"sku":[1],"taxonomy":[1]}]]],["jump-tab",[[1,"jump-tab",{"tabGroupName":[1,"tab-group-name"],"variant":[1]},[[0,"jump-change-active-tab","changeActiveTabHandler"]]]]],["jump-tab-panel",[[1,"jump-tab-panel",{"identifier":[1],"active":[4]}]]],["jump-badge",[[1,"jump-badge",{"label":[1],"variant":[513],"dimension":[513],"soft":[516],"outline":[516]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-4d6cc90d.js";export{s as setNonce}from"./p-4d6cc90d.js";import{g as a}from"./p-e1255160.js";const i=()=>{const t=import.meta.url;const a={};if(t!==""){a.resourcesUrl=new URL(".",t).href}return e(a)};i().then((async e=>{await a();return t([["p-c2bc6395",[[1,"jump-button",{disabled:[4],variant:[1],outline:[4],size:[1],full:[4],pill:[4],text:[4],onlyIcon:[4,"only-icon"],href:[1],target:[1],type:[1],name:[1],value:[1],ariaLabel:[1,"aria-label"],class:[1],buttonId:[1,"button-id"]}],[1,"jump-icon",{class:[1],library:[1],name:[1],category:[1],size:[1],label:[1],src:[1]}]]],["p-23fb306d",[[1,"jump-card-ecommerce",{onlyIconButton:[4,"only-icon-button"],hasBackground:[4,"has-background"],badge:[1],favorite:[1540],hasFavorite:[4,"has-favorite"],favoriteBtnClass:[1,"favorite-btn-class"],link:[1],img:[1],imgAlt:[1,"img-alt"],hoverImg:[1,"hover-img"],hoverImgAlt:[1,"hover-img-alt"],videoSrc:[1,"video-src"],notificationUrl:[1,"notification-url"],notificationText:[1,"notification-text"],productName:[1,"product-name"],subtitle:[1],productId:[1,"product-id"],price:[2],salePrice:[2,"sale-price"],currency:[1],outOfStock:[1540,"out-of-stock"],outOfStockText:[1,"out-of-stock-text"],addToCartText:[1,"add-to-cart-text"],waitingListText:[1,"waiting-list-text"],addToWaitingList:[4,"add-to-waiting-list"],addedToCart:[4,"added-to-cart"],endAddedToCart:[4,"end-added-to-cart"],variations:[32],selectedVariation:[32]},[[0,"jump-card-ecommerce-option-connected","addOption"]]]]],["p-529a09f6",[[1,"jump-filter",{direction:[1],filterHeading:[1,"filter-heading"],filterButtonLabel:[1,"filter-button-label"],filterButtonIcon:[1,"filter-button-icon"],mobileThreshold:[2,"mobile-threshold"],filters:[8],activeFilters:[32],showMobileFilters:[32],isMobile:[32],getFilters:[64]},[[0,"jump-filterchange","filterChangeHandler"],[9,"resize","handleResize"]]]]],["p-d1e411fd",[[1,"jump-filtergroup",{name:[1],title:[1],otherLabel:[1,"other-label"],lessLabel:[1,"less-label"],maxElements:[2,"max-elements"],variant:[1],values:[32],value:[32],slotItems:[32],inputs:[32],showMore:[32],getValues:[64],getActiveAmount:[64],getInputs:[64],getName:[64]}]]],["p-95460fa4",[[1,"jump-pagination",{pagLabel:[1,"pag-label"],last:[2],showFirstAndLast:[4,"show-first-and-last"],current:[32]},null,{current:["watchcurrent"]}]]],["p-
|
|
1
|
+
import{p as e,b as t}from"./p-4d6cc90d.js";export{s as setNonce}from"./p-4d6cc90d.js";import{g as a}from"./p-e1255160.js";const i=()=>{const t=import.meta.url;const a={};if(t!==""){a.resourcesUrl=new URL(".",t).href}return e(a)};i().then((async e=>{await a();return t([["p-c2bc6395",[[1,"jump-button",{disabled:[4],variant:[1],outline:[4],size:[1],full:[4],pill:[4],text:[4],onlyIcon:[4,"only-icon"],href:[1],target:[1],type:[1],name:[1],value:[1],ariaLabel:[1,"aria-label"],class:[1],buttonId:[1,"button-id"]}],[1,"jump-icon",{class:[1],library:[1],name:[1],category:[1],size:[1],label:[1],src:[1]}]]],["p-23fb306d",[[1,"jump-card-ecommerce",{onlyIconButton:[4,"only-icon-button"],hasBackground:[4,"has-background"],badge:[1],favorite:[1540],hasFavorite:[4,"has-favorite"],favoriteBtnClass:[1,"favorite-btn-class"],link:[1],img:[1],imgAlt:[1,"img-alt"],hoverImg:[1,"hover-img"],hoverImgAlt:[1,"hover-img-alt"],videoSrc:[1,"video-src"],notificationUrl:[1,"notification-url"],notificationText:[1,"notification-text"],productName:[1,"product-name"],subtitle:[1],productId:[1,"product-id"],price:[2],salePrice:[2,"sale-price"],currency:[1],outOfStock:[1540,"out-of-stock"],outOfStockText:[1,"out-of-stock-text"],addToCartText:[1,"add-to-cart-text"],waitingListText:[1,"waiting-list-text"],addToWaitingList:[4,"add-to-waiting-list"],addedToCart:[4,"added-to-cart"],endAddedToCart:[4,"end-added-to-cart"],variations:[32],selectedVariation:[32]},[[0,"jump-card-ecommerce-option-connected","addOption"]]]]],["p-529a09f6",[[1,"jump-filter",{direction:[1],filterHeading:[1,"filter-heading"],filterButtonLabel:[1,"filter-button-label"],filterButtonIcon:[1,"filter-button-icon"],mobileThreshold:[2,"mobile-threshold"],filters:[8],activeFilters:[32],showMobileFilters:[32],isMobile:[32],getFilters:[64]},[[0,"jump-filterchange","filterChangeHandler"],[9,"resize","handleResize"]]]]],["p-d1e411fd",[[1,"jump-filtergroup",{name:[1],title:[1],otherLabel:[1,"other-label"],lessLabel:[1,"less-label"],maxElements:[2,"max-elements"],variant:[1],values:[32],value:[32],slotItems:[32],inputs:[32],showMore:[32],getValues:[64],getActiveAmount:[64],getInputs:[64],getName:[64]}]]],["p-95460fa4",[[1,"jump-pagination",{pagLabel:[1,"pag-label"],last:[2],showFirstAndLast:[4,"show-first-and-last"],current:[32]},null,{current:["watchcurrent"]}]]],["p-37114ce3",[[0,"jump-pagination-table",{elementsRanges:[1,"elements-ranges"],pagLabel:[513,"pag-label"],labelElementsPerPage:[513,"label-elements-per-page"],total:[514],first:[514],last:[514],showFirstAndLast:[516,"show-first-and-last"],elementsRangesArray:[32],elPerPage:[32]},null,{elementsRanges:["elementsRangesChanged"],elPerPage:["elPerPageChanged"]}]]],["p-8628896f",[[65,"jump-quantity",{min:[2],max:[2],step:[2],label:[1],type:[1],variant:[1],showButtons:[4,"show-buttons"],value:[2],getValue:[64],reset:[64]},null,{value:["onValueChange"]}]]],["p-8efeaa79",[[1,"jump-tab-item",{identifier:[1],iconName:[1,"icon-name"],iconPosition:[1,"icon-position"],label:[1],active:[4],disabled:[4],variant:[32]}]]],["p-56609b82",[[1,"jump-accordion"]]],["p-c1665537",[[4,"jump-card",{horizontal:[4],dark:[4],shadow:[4],border:[4],borderRadius:[4,"border-radius"],topBorderContentRadius:[4,"top-border-content-radius"],boxed:[4],roundedMedia:[4,"rounded-media"],imgSrc:[1,"img-src"],imgAlt:[1,"img-alt"],videoSrc:[1,"video-src"]}]]],["p-a5aaa1dd",[[1,"jump-card-ecommerce-option",{code:[1],imgUrl:[1,"img-url"],label:[1],sku:[1],taxonomy:[1]}]]],["p-d2ee7b9b",[[1,"jump-tab",{tabGroupName:[1,"tab-group-name"],variant:[1]},[[0,"jump-change-active-tab","changeActiveTabHandler"]]]]],["p-5da7839d",[[1,"jump-tab-panel",{identifier:[1],active:[4]}]]],["p-27fa0ba4",[[1,"jump-badge",{label:[1],variant:[513],dimension:[513],soft:[516],outline:[516]}]]]],e)}));
|
|
2
2
|
//# sourceMappingURL=jump-design-system.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","async","options","globalScripts","bootstrapLazy","disabled","variant","outline","size","full","pill","text","onlyIcon","target","type","name","value","ariaLabel","class","buttonId","library","category","label","src","onlyIconButton","hasBackground","badge","favorite","hasFavorite","favoriteBtnClass","link","img","imgAlt","hoverImg","hoverImgAlt","videoSrc","notificationUrl","notificationText","productName","subtitle","productId","price","salePrice","currency","outOfStock","outOfStockText","addToCartText","waitingListText","addToWaitingList","addedToCart","endAddedToCart","variations","selectedVariation","direction","filterHeading","filterButtonLabel","filterButtonIcon","mobileThreshold","filters","activeFilters","showMobileFilters","isMobile","getFilters","title","otherLabel","lessLabel","maxElements","values","slotItems","inputs","showMore","getValues","getActiveAmount","getInputs","getName","pagLabel","last","showFirstAndLast","current","elementsRanges","
|
|
1
|
+
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","async","options","globalScripts","bootstrapLazy","disabled","variant","outline","size","full","pill","text","onlyIcon","target","type","name","value","ariaLabel","class","buttonId","library","category","label","src","onlyIconButton","hasBackground","badge","favorite","hasFavorite","favoriteBtnClass","link","img","imgAlt","hoverImg","hoverImgAlt","videoSrc","notificationUrl","notificationText","productName","subtitle","productId","price","salePrice","currency","outOfStock","outOfStockText","addToCartText","waitingListText","addToWaitingList","addedToCart","endAddedToCart","variations","selectedVariation","direction","filterHeading","filterButtonLabel","filterButtonIcon","mobileThreshold","filters","activeFilters","showMobileFilters","isMobile","getFilters","title","otherLabel","lessLabel","maxElements","values","slotItems","inputs","showMore","getValues","getActiveAmount","getInputs","getName","pagLabel","last","showFirstAndLast","current","elementsRanges","labelElementsPerPage","total","first","elementsRangesArray","elPerPage","min","max","step","showButtons","getValue","reset","identifier","iconName","iconPosition","active","horizontal","dark","shadow","border","borderRadius","topBorderContentRadius","boxed","roundedMedia","imgSrc","code","imgUrl","sku","taxonomy","tabGroupName","dimension","soft"],"sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.15.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"0HAKA,MAAMA,EAAe,KAajB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACnBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACrD,CACI,OAAOC,EAAeJ,EAAK,ECnB/BH,IAAeQ,MAAKC,MAAOC,UACnBC,IACN,OAAOC,EAAc,iCAA8B,CAAAC,SAAS,IAAAC,QAAA,IAAAC,QAAA,IAAAC,KAAA,IAAAC,KAAA,IAAAC,KAAA,IAAAC,KAAA,IAAAC,SAAA,gBAAAd,KAAA,IAAAe,OAAA,IAAAC,KAAA,IAAAC,KAAA,IAAAC,MAAA,IAAAC,UAAA,iBAAAC,MAAA,IAAAC,SAAA,kCAAAD,MAAA,IAAAE,QAAA,IAAAL,KAAA,IAAAM,SAAA,IAAAb,KAAA,IAAAc,MAAA,IAAAC,IAAA,iDAAAC,eAAA,uBAAAC,cAAA,qBAAAC,MAAA,IAAAC,SAAA,OAAAC,YAAA,mBAAAC,iBAAA,yBAAAC,KAAA,IAAAC,IAAA,IAAAC,OAAA,cAAAC,SAAA,gBAAAC,YAAA,oBAAAC,SAAA,gBAAAC,gBAAA,uBAAAC,iBAAA,wBAAAC,YAAA,mBAAAC,SAAA,IAAAC,UAAA,iBAAAC,MAAA,IA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A,qBAAAtG,QAAA,oGAAAqF,WAAA,IAAAG,OAAA,wCAAAxE,MAAA,IAAAhB,QAAA,MAAAuG,UAAA,MAAAC,KAAA,MAAAvG,QAAA,WAAAL,EAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as a,h as t,H as i}from"./p-4d6cc90d.js";const s=":host{display:block}.JumpPaginationTable{--jump-pagination-table-label:var(--neutral-grey-secondary);--jump-pagination-table-arrows:var(--neutral-grey-secondary);--jump-pagination-table-arrows-disabled:var(--neutral-grey-disabled);font-family:var(--ff-primary)}.JumpPaginationTable__Wrapper{display:flex;justify-content:space-between}.JumpPaginationTable__Wrapper .elementsPerPage{display:flex;gap:1rem;align-items:center}.JumpPaginationTable__Wrapper .elementsPerPage label{color:var(--jump-pagination-table-label);font-size:var(--fs-300);font-weight:normal}.JumpPaginationTable__Wrapper .indicators{font-size:var(--fs-400);font-weight:normal;display:flex;justify-content:space-between;gap:20px;color:var(--jump-pagination-table-label)}.JumpPaginationTable__Wrapper .indicators .arrow{color:var(--jump-pagination-table-arrows);display:flex;align-items:center;gap:10px}.JumpPaginationTable__Wrapper .indicators .arrow button{background-color:transparent;border:none;cursor:pointer;padding:0px;display:flex;align-items:center}.JumpPaginationTable__Wrapper .indicators .arrow button:disabled{cursor:not-allowed;color:var(--jump-pagination-table-arrows-disabled)}.JumpPaginationTable__Wrapper .indicators .elements{color:var(--jump-pagination-table-label);display:flex;align-items:center;gap:5px}";const n=s;const l=class{constructor(t){e(this,t);this.changePage=a(this,"jump-change-page",7);this.changeElPerPage=a(this,"jump-change-el-per-page",7);this.elementsRanges="10,20,60,100";this.elementsRangesArray=undefined;this.elPerPage=undefined;this.pagLabel="di";this.labelElementsPerPage="Elementi per pagina";this.total=100;this.first=1;this.last=10;this.showFirstAndLast=false}elementsRangesChanged(e,a){console.log("dentro el");if(e!==a){this.elementsRangesArray=e.split(",").map(Number)}this.elementsRangesArray=[...this.elementsRangesArray];console.log("elementsRangesChanged",e,a)}elPerPageChanged(e,a){if(e!==a){this.first=1;this.last=Math.min(this.total,e)}this.changeElPerPage.emit({elPerPage:e})}componentWillLoad(){this.elementsRangesArray=this.elementsRanges.split(",").map(Number);this.elPerPage=this.elementsRangesArray[0]}setElPerPage(e){this.elPerPage=e.target.value}doChangePage(e){let a;let t;if(e==="first"){a=1;t=Math.min(this.total,this.elPerPage)}else if(e==="last"){t=this.total;a=Math.max(1,this.total-this.elPerPage+1)}else if(e==="previous"){a=Math.max(1,this.first-this.elPerPage);t=Math.min(this.total,a+this.elPerPage-1)}else if(e==="next"){t=Math.min(this.total,this.last+this.elPerPage);a=Math.max(1,t-this.elPerPage+1)}this.first=a;this.last=t;let i={first:a,last:t,direction:e};this.changePage.emit(i)}render(){var e;return t(i,{key:"fd4a13e65dfbcc334ace661e61297ff05d78624d",class:"JumpPaginationTable"},t("div",{key:"ae50a5dbac84be7f7f02c5c93f1e7cbd73a1fc6f",class:"JumpPaginationTable__Wrapper"},t("div",{key:"2eade4e3a54fb4c84f3c7718d827d6e5295508bf",class:"elementsPerPage"},t("label",{key:"4211a782ce895731ed90d52c88a278ccf69e03fc",htmlFor:"elements"},(e=this.labelElementsPerPage)!==null&&e!==void 0?e:"Elements per page"),t("select",{key:"6ce02a5ad892bf1d6b48b3ccb2605e1e1de3416b",name:"elements",id:"elements",onChange:e=>this.setElPerPage(e)},this.elementsRangesArray.map((e=>t("option",{value:e,selected:this.elPerPage==e&&true},e))))),t("div",{key:"915e8eefc53385620b2d554935ab6f81f9571407",class:"indicators"},t("div",{key:"02b3867d0fe90a6408aced6bd7b639d92cec61a6",class:"elements"},t("span",{key:"e1d25f5be0f4fbdd995588642d1ba1583e90a280"},t("span",{key:"775b964a3dcc29be4d914c9ff309f6809555683b"},this.first)," - ",t("span",{key:"31886227817ee097c5594bc1a81f271ac185531c"},this.last)," ",this.pagLabel," ",t("span",{key:"a6525640edea1672b429732d2e23c72b1fbacf04"},this.total))),t("div",{key:"9231615ab10231842136b4d64ce2a5e87a502c3f",class:"arrow"},this.showFirstAndLast&&t("jump-button",{key:"cd9d9073f37b561464dfe5209cb43bc351392b40",onClick:()=>this.doChangePage("first"),variant:"primary",text:true,size:"small",name:"scopri",value:"value","aria-label":"Scopri di più",id:"button",onlyIcon:true,disabled:this.first===1}," ",t("jump-icon",{key:"48ece4b1628154ea80b33698c2de4a473e433d25",slot:"suffix",name:"chevrons-left"})," "),t("jump-button",{key:"69c9b009244d96aa5c5e770d38ed9535330c1904",onClick:()=>this.doChangePage("previous"),variant:"primary",text:true,size:"small",name:"scopri",value:"value","aria-label":"Scopri di più",id:"button",onlyIcon:true,disabled:this.first===1}," ",t("jump-icon",{key:"d5b18f4b7809af2032b4c955c59b0de2fb81b1b0",slot:"suffix",name:"chevron-left"})," "),t("jump-button",{key:"95bf121ea17a00e01f4d47c256191665850dfcb6",onClick:()=>this.doChangePage("next"),variant:"primary",text:true,size:"small",name:"scopri",value:"value","aria-label":"Scopri di più",id:"button",onlyIcon:true,disabled:this.last===this.total}," ",t("jump-icon",{key:"64ac86934180ce2203c06472c00ec33334d128dd",slot:"suffix",name:"chevron-right"})," "),this.showFirstAndLast&&t("jump-button",{key:"2de71c60a69f5dc61088e2e4a27591e8b442967a",onClick:()=>this.doChangePage("last"),variant:"primary",text:true,size:"small",name:"scopri",value:"value","aria-label":"Scopri di più",id:"button",onlyIcon:true,disabled:this.last===this.total}," ",t("jump-icon",{key:"c2113c26705cfafe41c9cb5c92527856dc7ee433",slot:"suffix",name:"chevrons-right"})," ")))))}static get watchers(){return{elementsRanges:["elementsRangesChanged"],elPerPage:["elPerPageChanged"]}}};l.style=n;export{l as jump_pagination_table};
|
|
2
|
+
//# sourceMappingURL=p-37114ce3.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["jumpPaginationTableCss","JumpPaginationTableStyle0","JumpPaginationTable","elementsRangesChanged","newValue","oldValue","console","log","this","elementsRangesArray","split","map","Number","elPerPageChanged","first","last","Math","min","total","changeElPerPage","emit","elPerPage","componentWillLoad","elementsRanges","setElPerPage","e","target","value","doChangePage","dir","newFirst","newLast","max","details","direction","changePage","render","h","Host","key","class","htmlFor","_a","labelElementsPerPage","name","id","onChange","range","selected","pagLabel","showFirstAndLast","onClick","variant","text","size","onlyIcon","disabled","slot"],"sources":["src/components/jump-pagination-table/jump-pagination-table.scss?tag=jump-pagination-table","src/components/jump-pagination-table/jump-pagination-table.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.JumpPaginationTable {\n --jump-pagination-table-label: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows-disabled: var(--neutral-grey-disabled); //mappare una variabile del design system\n\n font-family: var(--ff-primary);\n\n &__Wrapper {\n display: flex;\n justify-content: space-between;\n \n .elementsPerPage {\n display: flex;\n gap: 1rem;\n align-items: center;\n \n label {\n color: var(--jump-pagination-table-label);\n font-size: var(--fs-300);\n font-weight: normal;\n }\n }\n \n .indicators {\n font-size: var(--fs-400);\n font-weight: normal;\n display: flex;\n justify-content: space-between;\n gap: 20px;\n \n color: var(--jump-pagination-table-label);\n \n .arrow {\n color: var(--jump-pagination-table-arrows);\n display: flex;\n align-items: center;\n gap: 10px;\n \n button {\n background-color: transparent;\n border: none;\n cursor: pointer;\n padding: 0px;\n display: flex;\n align-items: center;\n }\n \n button:disabled {\n cursor: not-allowed;\n color: var(--jump-pagination-table-arrows-disabled);\n \n }\n }\n \n .elements {\n color: var(--jump-pagination-table-label);\n display: flex;\n align-items: center;\n gap: 5px;\n }\n }\n \n }\n}","import { Component, State, Event, EventEmitter, Watch, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'jump-pagination-table',\n styleUrl: 'jump-pagination-table.scss',\n shadow: false,\n})\nexport class JumpPaginationTable {\n\n /* ---------------------- OWN PROPERTIES ---------------------- */\n\n /* ---------------------- @ELEMENT ---------------------------- */\n\n /* ---------------------- @STATE ------------------------------ */\n\n /* ---------------------- @PROPERTIES ------------------------- */\n\n /**\n * Values for the elements per page select\n */\n @Prop() elementsRanges: string = \"10,20,60,100\";\n\n @State() elementsRangesArray: number[];\n @Watch('elementsRanges')\n elementsRangesChanged(newValue, oldValue) {\n console.log('dentro el');\n if(newValue !== oldValue) {\n this.elementsRangesArray = newValue.split(',').map(Number);\n }\n this.elementsRangesArray = [...this.elementsRangesArray]\n console.log('elementsRangesChanged', newValue, oldValue);\n }\n\n /**\n * Number of elements per page selected\n */\n @State() elPerPage: number;\n @Watch('elPerPage')\n elPerPageChanged(newValue: number, oldValue: number) {\n if (newValue !== oldValue) {\n // Riporta la paginazione allo stato iniziale\n this.first = 1;\n this.last = Math.min(this.total, newValue);\n }\n\n this.changeElPerPage.emit({ elPerPage: newValue });\n }\n\n @Prop({ reflect: true }) pagLabel: string = 'di'; // Identifica la label testuale di pagination. \n\n /**\n * Label for the elements per page select\n */\n @Prop({ reflect: true }) labelElementsPerPage: string = 'Elementi per pagina';\n\n /**\n * Total of elements\n */\n @Prop({ reflect: true }) total: number = 100; \n\n /**\n * First element of the page\n */\n @Prop({ reflect: true }) first: number = 1;\n\n /**\n * Last element of the page\n */\n @Prop({ reflect: true }) last: number = 10;\n\n /**\n * Show button to navigate so first e last page\n */\n @Prop({ reflect: true }) showFirstAndLast: boolean = false;\n\n /* ---------------------- @EVENTS ------------------------- */\n @Event({ eventName: 'jump-change-page' }) changePage: EventEmitter;\n @Event({ eventName: 'jump-change-el-per-page' }) changeElPerPage: EventEmitter;\n\n /* -------------------- LYFECYCLE EVENTS ---------------------- */\n componentWillLoad() {\n this.elementsRangesArray = this.elementsRanges.split(',').map(Number);\n this.elPerPage = this.elementsRangesArray[0];\n }\n\n /* -------------------- @LISTEN ------------------------------- */\n\n /* -------------------- @METHOD ------------------------------- */\n\n /* -------------------- LOCAL METHODS ------------------------- */\n setElPerPage(e) {\n this.elPerPage = e.target.value;\n }\n\n doChangePage(dir) {\n let newFirst;\n let newLast;\n\n //TODO refactorare \n if (dir === 'first') {\n newFirst = 1;\n newLast = Math.min(this.total, this.elPerPage);\n } else if (dir === 'last') {\n newLast = this.total;\n newFirst = Math.max(1, this.total - this.elPerPage + 1);\n } else if (dir === 'previous') {\n newFirst = Math.max(1, this.first - this.elPerPage);\n newLast = Math.min(this.total, newFirst + this.elPerPage - 1);\n } else if (dir === 'next') {\n newLast = Math.min(this.total, this.last + this.elPerPage);\n newFirst = Math.max(1, newLast - this.elPerPage + 1);\n }\n\n this.first = newFirst;\n this.last = newLast;\n\n let details = {\n first: newFirst,\n last: newLast,\n direction: dir\n }\n\n this.changePage.emit(details);\n }\n\n /* --------------------- RENDER ------------------------------- */\n render() {\n return (\n <Host class=\"JumpPaginationTable\">\n <div class=\"JumpPaginationTable__Wrapper\">\n <div class=\"elementsPerPage\">\n <label htmlFor=\"elements\">{this.labelElementsPerPage ?? 'Elements per page'}</label>\n <select name=\"elements\" id=\"elements\" onChange={(e) => this.setElPerPage(e)}>\n {this.elementsRangesArray.map((range) => (\n <option value={range} selected={(this.elPerPage == range) && true}>{range}</option>\n ))}\n </select>\n </div> \n <div class=\"indicators\">\n <div class=\"elements\">\n <span>\n <span>{this.first}</span> - <span>{this.last}</span> {this.pagLabel} <span>{this.total}</span>\n </span>\n </div>\n <div class=\"arrow\">\n {this.showFirstAndLast &&\n <jump-button onClick={() => this.doChangePage('first')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevrons-left\" ></jump-icon> </jump-button>\n }\n <jump-button onClick={() => this.doChangePage('previous')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevron-left\" ></jump-icon> </jump-button>\n <jump-button onClick={() => this.doChangePage('next')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevron-right\" ></jump-icon> </jump-button>\n {this.showFirstAndLast &&\n <jump-button onClick={() => this.doChangePage('last')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevrons-right\" ></jump-icon> </jump-button>\n }\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n}\n"],"mappings":"yDAAA,MAAMA,EAAyB,gxCAC/B,MAAAC,EAAeD,E,MCMFE,EAAmB,M,mJAaG,e,0EA4BW,K,0BAKY,sB,WAKf,I,WAKA,E,UAKD,G,sBAKa,K,CAjDrD,qBAAAC,CAAsBC,EAAUC,GAC9BC,QAAQC,IAAI,aACZ,GAAGH,IAAaC,EAAU,CACxBG,KAAKC,oBAAsBL,EAASM,MAAM,KAAKC,IAAIC,O,CAErDJ,KAAKC,oBAAsB,IAAID,KAAKC,qBACpCH,QAAQC,IAAI,wBAAyBH,EAAUC,E,CAQjD,gBAAAQ,CAAiBT,EAAkBC,GACjC,GAAID,IAAaC,EAAU,CAEzBG,KAAKM,MAAQ,EACbN,KAAKO,KAAOC,KAAKC,IAAIT,KAAKU,MAAOd,E,CAGnCI,KAAKW,gBAAgBC,KAAK,CAAEC,UAAWjB,G,CAmCzC,iBAAAkB,GACEd,KAAKC,oBAAsBD,KAAKe,eAAeb,MAAM,KAAKC,IAAIC,QAC9DJ,KAAKa,UAAYb,KAAKC,oBAAoB,E,CAQ5C,YAAAe,CAAaC,GACXjB,KAAKa,UAAYI,EAAEC,OAAOC,K,CAG5B,YAAAC,CAAaC,GACX,IAAIC,EACJ,IAAIC,EAGJ,GAAIF,IAAQ,QAAS,CACnBC,EAAW,EACXC,EAAUf,KAAKC,IAAIT,KAAKU,MAAOV,KAAKa,U,MAC/B,GAAIQ,IAAQ,OAAQ,CACzBE,EAAUvB,KAAKU,MACfY,EAAWd,KAAKg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
|
4
4
|
* Values for the elements per page select
|
|
5
5
|
*/
|
|
6
|
-
elementsRanges:
|
|
6
|
+
elementsRanges: string;
|
|
7
|
+
elementsRangesArray: number[];
|
|
8
|
+
elementsRangesChanged(newValue: any, oldValue: any): void;
|
|
7
9
|
/**
|
|
8
10
|
* Number of elements per page selected
|
|
9
11
|
*/
|
|
@@ -28,16 +28,11 @@ declare const _default: {
|
|
|
28
28
|
description: string;
|
|
29
29
|
};
|
|
30
30
|
elementsRanges: {
|
|
31
|
-
name: string;
|
|
32
|
-
control: string;
|
|
33
|
-
options: number[];
|
|
34
|
-
};
|
|
35
|
-
showFirstAndLast: {
|
|
36
31
|
name: string;
|
|
37
32
|
control: string;
|
|
38
33
|
description: string;
|
|
39
34
|
};
|
|
40
|
-
|
|
35
|
+
showFirstAndLast: {
|
|
41
36
|
name: string;
|
|
42
37
|
control: string;
|
|
43
38
|
description: string;
|
|
@@ -325,14 +325,10 @@ export namespace Components {
|
|
|
325
325
|
"showFirstAndLast": boolean;
|
|
326
326
|
}
|
|
327
327
|
interface JumpPaginationTable {
|
|
328
|
-
/**
|
|
329
|
-
* Number of elements per page selected
|
|
330
|
-
*/
|
|
331
|
-
"elPerPage": number;
|
|
332
328
|
/**
|
|
333
329
|
* Values for the elements per page select
|
|
334
330
|
*/
|
|
335
|
-
"elementsRanges":
|
|
331
|
+
"elementsRanges": string;
|
|
336
332
|
/**
|
|
337
333
|
* First element of the page
|
|
338
334
|
*/
|
|
@@ -951,14 +947,10 @@ declare namespace LocalJSX {
|
|
|
951
947
|
"showFirstAndLast"?: boolean;
|
|
952
948
|
}
|
|
953
949
|
interface JumpPaginationTable {
|
|
954
|
-
/**
|
|
955
|
-
* Number of elements per page selected
|
|
956
|
-
*/
|
|
957
|
-
"elPerPage"?: number;
|
|
958
950
|
/**
|
|
959
951
|
* Values for the elements per page select
|
|
960
952
|
*/
|
|
961
|
-
"elementsRanges"?:
|
|
953
|
+
"elementsRanges"?: string;
|
|
962
954
|
/**
|
|
963
955
|
* First element of the page
|
|
964
956
|
*/
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,c as a,h as t,H as i}from"./p-4d6cc90d.js";const s=":host{display:block}.JumpPaginationTable{--jump-pagination-table-label:var(--neutral-grey-secondary);--jump-pagination-table-arrows:var(--neutral-grey-secondary);--jump-pagination-table-arrows-disabled:var(--neutral-grey-disabled);font-family:var(--ff-primary)}.JumpPaginationTable__Wrapper{display:flex;justify-content:space-between}.JumpPaginationTable__Wrapper .elementsPerPage{display:flex;gap:1rem;align-items:center}.JumpPaginationTable__Wrapper .elementsPerPage label{color:var(--jump-pagination-table-label);font-size:var(--fs-300);font-weight:normal}.JumpPaginationTable__Wrapper .indicators{font-size:var(--fs-400);font-weight:normal;display:flex;justify-content:space-between;gap:20px;color:var(--jump-pagination-table-label)}.JumpPaginationTable__Wrapper .indicators .arrow{color:var(--jump-pagination-table-arrows);display:flex;align-items:center;gap:10px}.JumpPaginationTable__Wrapper .indicators .arrow button{background-color:transparent;border:none;cursor:pointer;padding:0px;display:flex;align-items:center}.JumpPaginationTable__Wrapper .indicators .arrow button:disabled{cursor:not-allowed;color:var(--jump-pagination-table-arrows-disabled)}.JumpPaginationTable__Wrapper .indicators .elements{color:var(--jump-pagination-table-label);display:flex;align-items:center;gap:5px}";const n=s;const r=class{constructor(t){e(this,t);this.changePage=a(this,"jump-change-page",7);this.changeElPerPage=a(this,"jump-change-el-per-page",7);this.elementsRanges=[10,20,60,100];this.elPerPage=10;this.pagLabel="di";this.labelElementsPerPage="Elementi per pagina";this.total=100;this.first=1;this.last=10;this.showFirstAndLast=false}elPerPageChanged(e,a){if(e!==a){this.first=1;this.last=Math.min(this.total,e)}this.changeElPerPage.emit({elPerPage:e})}componentWillLoad(){this.elPerPage=this.elementsRanges[0]}setElPerPage(e){this.elPerPage=e.target.value}doChangePage(e){let a;let t;if(e==="first"){a=1;t=Math.min(this.total,this.elPerPage)}else if(e==="last"){t=this.total;a=Math.max(1,this.total-this.elPerPage+1)}else if(e==="previous"){a=Math.max(1,this.first-this.elPerPage);t=Math.min(this.total,a+this.elPerPage-1)}else if(e==="next"){t=Math.min(this.total,this.last+this.elPerPage);a=Math.max(1,t-this.elPerPage+1)}this.first=a;this.last=t;let i={first:a,last:t,direction:e};this.changePage.emit(i)}render(){var e;return t(i,{key:"35e491be212d92ad5236fa808401b00519805464",class:"JumpPaginationTable"},t("div",{key:"3d983450f3128aa27d7aaf71d88059c2286b78de",class:"JumpPaginationTable__Wrapper"},t("div",{key:"18012e3b71c78c1f4b5fae8f8a3f0e62be9ce605",class:"elementsPerPage"},t("label",{key:"e5af13dfc62132a04bbf83968a17a32e25ed2db7",htmlFor:"elements"},(e=this.labelElementsPerPage)!==null&&e!==void 0?e:"Elements per page"),t("select",{key:"813734540e10b51a533511f11e3c3c7b280dd323",name:"elements",id:"elements",onChange:e=>this.setElPerPage(e)},this.elementsRanges.map((e=>t("option",{value:e,selected:this.elPerPage==e&&true},e))))),t("div",{key:"260bf5e7c2775970b04d382ccb4fd14080588b94",class:"indicators"},t("div",{key:"44da392904dea45319a1179c418cb690ccbe5c49",class:"elements"},t("span",{key:"785cb75ecd13082ca489f5ee74397c1eb41ebfbf"},t("span",{key:"a5914c44df81c108034edf298860ced791c1c600"},this.first)," - ",t("span",{key:"c2e32a38e9bf3843a0881acd4792746a559718d3"},this.last)," ",this.pagLabel," ",t("span",{key:"d30a564a486c4d06b2996b326b86ef85765064c8"},this.total))),t("div",{key:"8193f04ee380f418b5b477ef7ca40e4de18e6b46",class:"arrow"},this.showFirstAndLast&&t("jump-button",{key:"c7a833acee791a25257e237d88aef4e5bf5b5cc8",onClick:()=>this.doChangePage("first"),variant:"primary",text:true,size:"small",name:"scopri",value:"value","aria-label":"Scopri di più",id:"button",onlyIcon:true,disabled:this.first===1}," ",t("jump-icon",{key:"ffb50e27e476c8ca8d58ff18ce30c96ff6330872",slot:"suffix",name:"chevrons-left"})," "),t("jump-button",{key:"46bf715a0803deef866d90a1523675ab24c1793f",onClick:()=>this.doChangePage("previous"),variant:"primary",text:true,size:"small",name:"scopri",value:"value","aria-label":"Scopri di più",id:"button",onlyIcon:true,disabled:this.first===1}," ",t("jump-icon",{key:"223bf0f161ffce6ee0e17fbae7b8467cae790be3",slot:"suffix",name:"chevron-left"})," "),t("jump-button",{key:"97696457a54e5808a0c252eeda2c8d915bcfe2e8",onClick:()=>this.doChangePage("next"),variant:"primary",text:true,size:"small",name:"scopri",value:"value","aria-label":"Scopri di più",id:"button",onlyIcon:true,disabled:this.last===this.total}," ",t("jump-icon",{key:"9e01f45cc02450c41bf3ffc2f14cfd6606ab5a96",slot:"suffix",name:"chevron-right"})," "),this.showFirstAndLast&&t("jump-button",{key:"05a745e26f5f14383e745a744c0c23e5598b0623",onClick:()=>this.doChangePage("last"),variant:"primary",text:true,size:"small",name:"scopri",value:"value","aria-label":"Scopri di più",id:"button",onlyIcon:true,disabled:this.last===this.total}," ",t("jump-icon",{key:"0ba46ee7053a3aed0091c05a20444c767738dc2f",slot:"suffix",name:"chevrons-right"})," ")))))}static get watchers(){return{elPerPage:["elPerPageChanged"]}}};r.style=n;export{r as jump_pagination_table};
|
|
2
|
-
//# sourceMappingURL=p-594b15ee.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["jumpPaginationTableCss","JumpPaginationTableStyle0","JumpPaginationTable","elPerPageChanged","newValue","oldValue","this","first","last","Math","min","total","changeElPerPage","emit","elPerPage","componentWillLoad","elementsRanges","setElPerPage","e","target","value","doChangePage","dir","newFirst","newLast","max","details","direction","changePage","render","h","Host","key","class","htmlFor","_a","labelElementsPerPage","name","id","onChange","map","range","selected","pagLabel","showFirstAndLast","onClick","variant","text","size","onlyIcon","disabled","slot"],"sources":["src/components/jump-pagination-table/jump-pagination-table.scss?tag=jump-pagination-table","src/components/jump-pagination-table/jump-pagination-table.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.JumpPaginationTable {\n --jump-pagination-table-label: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows: var(--neutral-grey-secondary);\n --jump-pagination-table-arrows-disabled: var(--neutral-grey-disabled); //mappare una variabile del design system\n\n font-family: var(--ff-primary);\n\n &__Wrapper {\n display: flex;\n justify-content: space-between;\n \n .elementsPerPage {\n display: flex;\n gap: 1rem;\n align-items: center;\n \n label {\n color: var(--jump-pagination-table-label);\n font-size: var(--fs-300);\n font-weight: normal;\n }\n }\n \n .indicators {\n font-size: var(--fs-400);\n font-weight: normal;\n display: flex;\n justify-content: space-between;\n gap: 20px;\n \n color: var(--jump-pagination-table-label);\n \n .arrow {\n color: var(--jump-pagination-table-arrows);\n display: flex;\n align-items: center;\n gap: 10px;\n \n button {\n background-color: transparent;\n border: none;\n cursor: pointer;\n padding: 0px;\n display: flex;\n align-items: center;\n }\n \n button:disabled {\n cursor: not-allowed;\n color: var(--jump-pagination-table-arrows-disabled);\n \n }\n }\n \n .elements {\n color: var(--jump-pagination-table-label);\n display: flex;\n align-items: center;\n gap: 5px;\n }\n }\n \n }\n}","import { Component, Event, EventEmitter, Watch, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'jump-pagination-table',\n styleUrl: 'jump-pagination-table.scss',\n shadow: false,\n})\nexport class JumpPaginationTable {\n\n /* ---------------------- OWN PROPERTIES ---------------------- */\n\n /* ---------------------- @ELEMENT ---------------------------- */\n\n /* ---------------------- @STATE ------------------------------ */\n\n /* ---------------------- @PROPERTIES ------------------------- */\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 * Number of elements per page selected\n */\n @Prop() elPerPage: number = 10;\n @Watch('elPerPage')\n elPerPageChanged(newValue: number, oldValue: number) {\n if (newValue !== oldValue) {\n // Riporta la paginazione allo stato iniziale\n this.first = 1;\n this.last = Math.min(this.total, newValue);\n }\n\n this.changeElPerPage.emit({ elPerPage: newValue });\n }\n\n @Prop({ reflect: true }) pagLabel: string = 'di'; // Identifica la label testuale di pagination. \n\n /**\n * Label for the elements per page select\n */\n @Prop({ reflect: true }) labelElementsPerPage: string = 'Elementi per pagina';\n\n /**\n * Total of elements\n */\n @Prop({ reflect: true }) total: number = 100; \n\n /**\n * First element of the page\n */\n @Prop({ reflect: true }) first: number = 1;\n\n /**\n * Last element of the page\n */\n @Prop({ reflect: true }) last: number = 10;\n\n /**\n * Show button to navigate so first e last page\n */\n @Prop({ reflect: true }) showFirstAndLast: boolean = false;\n\n /* ---------------------- @EVENTS ------------------------- */\n @Event({ eventName: 'jump-change-page' }) changePage: EventEmitter;\n @Event({ eventName: 'jump-change-el-per-page' }) changeElPerPage: EventEmitter;\n\n /* -------------------- LYFECYCLE EVENTS ---------------------- */\n componentWillLoad() {\n this.elPerPage = this.elementsRanges[0];\n }\n\n /* -------------------- @LISTEN ------------------------------- */\n\n /* -------------------- @METHOD ------------------------------- */\n\n /* -------------------- LOCAL METHODS ------------------------- */\n setElPerPage(e) {\n this.elPerPage = e.target.value;\n }\n\n doChangePage(dir) {\n let newFirst;\n let newLast;\n\n //TODO refactorare \n if (dir === 'first') {\n newFirst = 1;\n newLast = Math.min(this.total, this.elPerPage);\n } else if (dir === 'last') {\n newLast = this.total;\n newFirst = Math.max(1, this.total - this.elPerPage + 1);\n } else if (dir === 'previous') {\n newFirst = Math.max(1, this.first - this.elPerPage);\n newLast = Math.min(this.total, newFirst + this.elPerPage - 1);\n } else if (dir === 'next') {\n newLast = Math.min(this.total, this.last + this.elPerPage);\n newFirst = Math.max(1, newLast - this.elPerPage + 1);\n }\n\n this.first = newFirst;\n this.last = newLast;\n\n let details = {\n first: newFirst,\n last: newLast,\n direction: dir\n }\n\n this.changePage.emit(details);\n }\n\n /* --------------------- RENDER ------------------------------- */\n render() {\n return (\n <Host class=\"JumpPaginationTable\">\n <div class=\"JumpPaginationTable__Wrapper\">\n <div class=\"elementsPerPage\">\n <label htmlFor=\"elements\">{this.labelElementsPerPage ?? 'Elements per page'}</label>\n <select name=\"elements\" id=\"elements\" onChange={(e) => this.setElPerPage(e)}>\n {this.elementsRanges.map((range) => (\n <option value={range} selected={(this.elPerPage == range) && true}>{range}</option>\n ))}\n </select>\n </div> \n <div class=\"indicators\">\n <div class=\"elements\">\n <span>\n <span>{this.first}</span> - <span>{this.last}</span> {this.pagLabel} <span>{this.total}</span>\n </span>\n </div>\n <div class=\"arrow\">\n {this.showFirstAndLast &&\n // <button \n // onClick={() => this.doChangePage('first')}\n // disabled={this.first === 1}\n // >\n // <jump-icon slot=\"prefix\" name=\"chevrons-left\"></jump-icon>\n // </button>\n <jump-button onClick={() => this.doChangePage('first')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevrons-left\" ></jump-icon> </jump-button>\n }\n {/* <button\n onClick={() => this.doChangePage('previous')}\n disabled={this.first === 1}\n >\n <jump-icon slot=\"prefix\" name=\"chevron-left\"></jump-icon>\n </button> */}\n <jump-button onClick={() => this.doChangePage('previous')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.first === 1}> <jump-icon slot=\"suffix\" name=\"chevron-left\" ></jump-icon> </jump-button>\n <jump-button onClick={() => this.doChangePage('next')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevron-right\" ></jump-icon> </jump-button>\n {/* <button\n onClick={() => this.doChangePage('next')}\n disabled={this.last === this.total}\n >\n <jump-icon slot=\"prefix\" name=\"chevron-right\"></jump-icon>\n </button> */}\n {this.showFirstAndLast &&\n // <button\n // onClick={() => this.doChangePage('last')}\n // disabled={this.last === this.total}\n // >\n // <jump-icon slot=\"prefix\" name=\"chevrons-right\"></jump-icon>\n // </button>\n <jump-button onClick={() => this.doChangePage('last')} variant=\"primary\" text size=\"small\" name=\"scopri\" value=\"value\" aria-label=\"Scopri di più\" id=\"button\" onlyIcon disabled={this.last === this.total}> <jump-icon slot=\"suffix\" name=\"chevrons-right\" ></jump-icon> </jump-button>\n }\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n}\n"],"mappings":"yDAAA,MAAMA,EAAyB,gxCAC/B,MAAAC,EAAeD,E,MCMFE,EAAmB,M,mJAa2B,CAAC,GAAI,GAAI,GAAI,K,eAK1C,G,cAYgB,K,0BAKY,sB,WAKf,I,WAKA,E,UAKD,G,sBAKa,K,CAnCrD,gBAAAC,CAAiBC,EAAkBC,GACjC,GAAID,IAAaC,EAAU,CAEzBC,KAAKC,MAAQ,EACbD,KAAKE,KAAOC,KAAKC,IAAIJ,KAAKK,MAAOP,E,CAGnCE,KAAKM,gBAAgBC,KAAK,CAAEC,UAAWV,G,CAmCzC,iBAAAW,GACET,KAAKQ,UAAYR,KAAKU,eAAe,E,CAQvC,YAAAC,CAAaC,GACXZ,KAAKQ,UAAYI,EAAEC,OAAOC,K,CAG5B,YAAAC,CAAaC,GACX,IAAIC,EACJ,IAAIC,EAGJ,GAAIF,IAAQ,QAAS,CACnBC,EAAW,EACXC,EAAUf,KAAKC,IAAIJ,KAAKK,MAAOL,KAAKQ,U,MAC/B,GAAIQ,IAAQ,OAAQ,CACzBE,EAAUlB,KAAKK,MACfY,EAAWd,KAAKgB,IAAI,EAAGnB,KAAKK,MAAQL,KAAKQ,UAAY,E,MAChD,GAAIQ,IAAQ,WAAY,CAC7BC,EAAWd,KAAKgB,IAAI,EAAGnB,KAAKC,MAAQD,KAAKQ,WACzCU,EAAUf,KAAKC,IAAIJ,KAAKK,MAAOY,EAAWjB,KAAKQ,UAAY,E,MACtD,GAAIQ,IAAQ,OAAQ,CACzBE,EAAUf,KAAKC,IAAIJ,KAAKK,MAAOL,KAAKE,KAAOF,KAAKQ,WAChDS,EAAWd,KAAKgB,IAAI,EAAGD,EAAUlB,KAAKQ,UAAY,E,CAGpD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