@jumpgroup/jump-design-system 0.3.25 → 0.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/jump-design-system.cjs.js +1 -1
- package/dist/cjs/jump-filtergroup.cjs.entry.js +25 -15
- package/dist/cjs/jump-filtergroup.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/jump-filtergroup/jump-filtergroup.css +23 -11
- package/dist/collection/components/jump-filtergroup/jump-filtergroup.js +28 -14
- package/dist/collection/components/jump-filtergroup/jump-filtergroup.js.map +1 -1
- package/dist/components/jump-filtergroup.js +28 -15
- package/dist/components/jump-filtergroup.js.map +1 -1
- package/dist/esm/jump-design-system.js +1 -1
- package/dist/esm/jump-filtergroup.entry.js +25 -15
- package/dist/esm/jump-filtergroup.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-273ff8ec.entry.js +2 -0
- package/dist/jump-design-system/p-273ff8ec.entry.js.map +1 -0
- package/dist/types/components/jump-filtergroup/jump-filtergroup.d.ts +3 -1
- package/package.json +1 -1
- package/dist/jump-design-system/p-fa75b346.entry.js +0 -2
- package/dist/jump-design-system/p-fa75b346.entry.js.map +0 -1
|
@@ -19,7 +19,7 @@ var 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"],"hasSlotForFavorite":[4,"has-slot-for-favorite"],"favoriteHref":[1,"favorite-href"],"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"],"isMini":[4,"is-mini"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32],"priceFormatted":[32],"salePriceFormatted":[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],"heading":[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-accordion.cjs",[[1,"jump-accordion",{"variant":[1],"summary":[1],"disabled":[4],"open":[516],"icon":[1],"identifier":[1]},[[0,"sl-show","handleShow"]]]]],["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-group.cjs",[[1,"jump-accordion-group",{"variant":[1],"groupIdentifier":[1,"group-identifier"]}]]],["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-filter-checkbox.cjs",[[1,"jump-filter-checkbox",{"value":[1],"label":[1],"checked":[516],"count":[8],"isChecked":[64]}]]],["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);
|
|
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"],"hasSlotForFavorite":[4,"has-slot-for-favorite"],"favoriteHref":[1,"favorite-href"],"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"],"isMini":[4,"is-mini"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32],"priceFormatted":[32],"salePriceFormatted":[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],"heading":[1],"otherLabel":[1,"other-label"],"lessLabel":[1,"less-label"],"maxElements":[2,"max-elements"],"variant":[1],"label":[32],"values":[32],"value":[32],"slotItems":[32],"inputs":[32],"showMore":[32],"getValues":[64],"getActiveAmount":[64],"getInputs":[64],"getName":[64]},null,{"showMore":["watchShowMore"]}]]],["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-accordion.cjs",[[1,"jump-accordion",{"variant":[1],"summary":[1],"disabled":[4],"open":[516],"icon":[1],"identifier":[1]},[[0,"sl-show","handleShow"]]]]],["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-group.cjs",[[1,"jump-accordion-group",{"variant":[1],"groupIdentifier":[1,"group-identifier"]}]]],["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-filter-checkbox.cjs",[[1,"jump-filter-checkbox",{"value":[1],"label":[1],"checked":[516],"count":[8],"isChecked":[64]}]]],["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;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-86f59981.js');
|
|
6
6
|
|
|
7
|
-
const jumpFiltergroupCss = ":host{--hidden-display:none;display:block}:host h5{font-family:var(--
|
|
7
|
+
const jumpFiltergroupCss = ":host{--hidden-display:none;--font-family:var(--ff-primary, \"Inter\"), serif;--font-size:var(--fs-400, 16px);--line-height:var(--lh-300, 1.2);--font-weight:var(--fw-900, 700);--color:var(--neutral-grey-primary, #282828);--distance-items:.25rem;display:block}:host h5{font-family:var(--font-family);font-size:var(--font-size);line-height:var(--line-height);font-weight:var(--font-weight);color:var(--color);margin:0 0 var(--distance-items, 0.25rem)}:host slot{display:flex;flex-direction:column;margin-bottom:1rem}:host ::slotted(.item){max-height:500px;transition:all 0.3s ease-in-out;margin-top:var(--distance-items, 0.25rem);display:flex;align-items:center;justify-content:flex-start;gap:0.25rem}:host ::slotted(.hidden){max-height:0;overflow:hidden}";
|
|
8
8
|
const JumpFiltergroupStyle0 = jumpFiltergroupCss;
|
|
9
9
|
|
|
10
10
|
const JumpFiltergroup = class {
|
|
@@ -17,11 +17,15 @@ const JumpFiltergroup = class {
|
|
|
17
17
|
this.lessLabel = 'Mostra meno';
|
|
18
18
|
this.maxElements = 8;
|
|
19
19
|
this.variant = 'default';
|
|
20
|
+
this.label = this.otherLabel;
|
|
20
21
|
this.values = [];
|
|
21
22
|
this.value = '';
|
|
22
23
|
this.slotItems = undefined;
|
|
23
24
|
this.inputs = [];
|
|
24
|
-
this.showMore =
|
|
25
|
+
this.showMore = false;
|
|
26
|
+
}
|
|
27
|
+
watchShowMore(newValue) {
|
|
28
|
+
this.label = newValue ? this.lessLabel : this.otherLabel;
|
|
25
29
|
}
|
|
26
30
|
async getValues() {
|
|
27
31
|
return this.values;
|
|
@@ -35,19 +39,21 @@ const JumpFiltergroup = class {
|
|
|
35
39
|
async getName() {
|
|
36
40
|
return this.name;
|
|
37
41
|
}
|
|
38
|
-
toggleHiddenItems(
|
|
42
|
+
toggleHiddenItems() {
|
|
39
43
|
this.slotItemsWrapper.assignedElements().forEach((item, index) => {
|
|
40
|
-
if (index > this.maxElements
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
if (index > this.maxElements) {
|
|
45
|
+
if (this.showMore) {
|
|
46
|
+
item.classList.remove('hidden');
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
item.classList.add('hidden');
|
|
50
|
+
}
|
|
45
51
|
}
|
|
46
52
|
});
|
|
47
53
|
}
|
|
48
54
|
handleShowMore() {
|
|
49
55
|
this.showMore = !this.showMore;
|
|
50
|
-
this.toggleHiddenItems(
|
|
56
|
+
this.toggleHiddenItems();
|
|
51
57
|
}
|
|
52
58
|
handleChange(event) {
|
|
53
59
|
const target = event.target;
|
|
@@ -103,11 +109,12 @@ const JumpFiltergroup = class {
|
|
|
103
109
|
this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));
|
|
104
110
|
let index = 0;
|
|
105
111
|
this.slotItems.forEach((item) => {
|
|
112
|
+
item.classList.add('item');
|
|
106
113
|
if (index > this.maxElements) {
|
|
107
|
-
|
|
108
|
-
item.style.display = 'none';
|
|
114
|
+
item.classList.add('hidden');
|
|
109
115
|
}
|
|
110
|
-
if (item.tagName
|
|
116
|
+
//if (item.tagName start with jump-
|
|
117
|
+
if (item.tagName === 'INPUT' || item.tagName === 'SELECT' || item.tagName.startsWith('JUMP-') || item.tagName === 'LABEL') {
|
|
111
118
|
this.inputs.push(item);
|
|
112
119
|
if (item.tagName === 'INPUT' && item.type === 'radio') {
|
|
113
120
|
item.name = this.name;
|
|
@@ -129,11 +136,14 @@ const JumpFiltergroup = class {
|
|
|
129
136
|
//this.toggleHiddenItems();
|
|
130
137
|
}
|
|
131
138
|
render() {
|
|
132
|
-
return (index.h(index.Host, { key: '
|
|
133
|
-
index.h("jump-button", { key: '
|
|
139
|
+
return (index.h(index.Host, { key: '7d3b79b574cb9b46501ea0482c6d3cc1fbb98e1f' }, this.heading && index.h("h5", { key: '68f2dd39f94fb905d9ea151cfbf946080abf1883' }, this.heading), index.h("div", { key: '3975c6ca04b3bd077eef48dd93311299c4cb2308', class: "filterGroup" }, index.h("slot", { key: 'c45798ed4fa32dc7baa18aa183740b5ad589b87b', ref: (el) => (this.slotItemsWrapper = el) })), this.inputs.length > this.maxElements &&
|
|
140
|
+
index.h("jump-button", { key: '068c3456f098fd7d58f943964338ff0416507797', variant: "primary", size: "small", text: true, name: this.label, "aria-label": this.label, ref: (showMoreBtn) => {
|
|
134
141
|
this.showMoreBtn = showMoreBtn;
|
|
135
|
-
}, onClick: () => this.handleShowMore() }, this.
|
|
142
|
+
}, onClick: () => this.handleShowMore() }, this.label, index.h("jump-icon", { key: '7e0b01f499ff2af6948120711d09f84dd70e4039', slot: "suffix", name: !this.showMore ? 'chevron-down' : 'chevron-up' }))));
|
|
136
143
|
}
|
|
144
|
+
static get watchers() { return {
|
|
145
|
+
"showMore": ["watchShowMore"]
|
|
146
|
+
}; }
|
|
137
147
|
};
|
|
138
148
|
JumpFiltergroup.style = JumpFiltergroupStyle0;
|
|
139
149
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"jump-filtergroup.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,kBAAkB,GAAG,yTAAyT,CAAC;AACrV,8BAAe,kBAAkB;;MCMpB,eAAe;;;;oBACH,UAAU;uBACP,mBAAmB;0BAChB,cAAc;yBACf,aAAa;2BACX,CAAC;uBAEY,SAAS;sBAExB,EAAE;qBACL,EAAE;;sBAEJ,EAAE;wBACI,IAAI;;IAQjC,MAAM,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;KACpB;IAGD,MAAM,eAAe;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;KAC3B;IAGD,MAAM,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;KACpB;IAGD,MAAM,OAAO;QACX,OAAO,IAAI,CAAC,IAAI,CAAC;KAClB;IAED,iBAAiB,CAAC,OAAO,GAAG,IAAI;QAC9B,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK;YAC3D,IAAI,KAAK,GAAG,IAAI,CAAC,WAAW,IAAI,CAAC,OAAO,EAAE;gBACxC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;aAC7C;iBAAM;gBACL,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;aAChD;SACF,CAAC,CAAC;KACJ;IAED,cAAc;QACZ,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KACvC;IAED,YAAY,CAAC,KAAY;QACvB,MAAM,MAAM,GAAG,KAA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,GAAG,IAAI,CAAC,SAAS,EACjDA,wEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAG,cAAc,GAAG,YAAY,GAAc,CAC9E,CAEX,EACP;KACH;;;;;;","names":["h","Host"],"sources":["src/components/jump-filtergroup/jump-filtergroup.scss?tag=jump-filtergroup&encapsulation=shadow","src/components/jump-filtergroup/jump-filtergroup.tsx"],"sourcesContent":[":host {\n --hidden-display: none;\n\n display: block;\n\n h5{\n font-family: var(--ff-primary), serif;\n font-size: var(--fs-400);\n line-height: var(--lh-300);\n font-weight: var(--fw-900);\n }\n\n slot {\n display: flex;\n flex-direction: column;\n gap: .25rem;\n margin-bottom: 1rem;\n }\n\n}\n\n*[data-hide=\"true\"] {\n display: var(--hidden-display);\n}\n\nh5 {\n margin: 0 0 .25rem;\n}\n\n//TODO: capire perché non prende questo stile\n\n\n","import { Component, Host, h, Prop, State, Event, Method } from '@stencil/core';\n\n@Component({\n tag: 'jump-filtergroup',\n styleUrl: 'jump-filtergroup.scss',\n shadow: true,\n})\nexport class JumpFiltergroup {\n @Prop() name: string = 'tax-name';\n @Prop() heading: string = 'Titolo del filtro';\n @Prop() otherLabel: string = 'Mostra altro';\n @Prop() lessLabel: string = 'Mostra meno';\n @Prop() maxElements: number = 8;\n //TODO: Add Accordion variant within jump-acccordion component\n @Prop() variant: 'accordion' | 'default' = 'default';\n\n @State() values: string[] = [];\n @State() value: string = '';\n @State() slotItems: any;\n @State() inputs: any = [];\n @State() showMore: boolean = true;\n\n @Event({ eventName: 'jump-filterchange' }) change;\n\n slotItemsWrapper: HTMLSlotElement;\n showMoreBtn: HTMLElement;\n\n @Method('getValues')\n async getValues() {\n return this.values;\n }\n\n @Method('getActiveAmount')\n async getActiveAmount() {\n return this.values.length;\n }\n\n @Method('getInputs')\n async getInputs() {\n return this.inputs;\n }\n\n @Method('getName')\n async getName() {\n return this.name;\n }\n\n toggleHiddenItems(showAll = true) {\n this.slotItemsWrapper.assignedElements().forEach((item, index) => {\n if (index > this.maxElements && !showAll) {\n item.setAttribute('style', 'display: none');\n } else {\n item.setAttribute('style', 'display: initial');\n }\n });\n }\n\n handleShowMore() {\n this.showMore = !this.showMore;\n this.toggleHiddenItems(this.showMore);\n }\n\n handleChange(event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const newValue = target.value;\n\n if (target.tagName === 'INPUT') {\n if (target.type === 'checkbox') {\n // @ts-ignore\n if (target.checked) {\n this.values.push(newValue);\n } else {\n const index = this.values.indexOf(newValue);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n } else if (target.type === 'radio') {\n // Se è un input radio selezionato, imposta il valore e aggiorna this.values\n this.value = newValue;\n this.values = [newValue]; // Assicurati che this.values contenga solo il valore selezionato\n }\n } else if (target.tagName === 'SELECT') {\n // Se è un select, aggiorna semplicemente il valore\n this.value = newValue;\n this.values = [newValue];\n }\n\n // Emit event con i valori aggiornati\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n handleCheckboxChange(event: CustomEvent) {\n if (event.detail.checked && !this.values.includes(event.detail.value)) {\n this.values.push(event.detail.value);\n } else if (!event.detail.checked && this.values.includes(event.detail.value)) {\n const index = this.values.indexOf(event.detail.value);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n componentDidLoad() {\n this.slotItems = this.slotItemsWrapper.assignedElements();\n this.slotItemsWrapper.addEventListener('change', this.handleChange.bind(this));\n this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));\n\n let index = 0;\n this.slotItems.forEach((item) => {\n if (index > this.maxElements) {\n //item.setAttribute('data-hide', 'true');\n item.style.display = 'none';\n }\n if (item.tagName === 'INPUT' || item.tagName === 'SELECT') {\n this.inputs.push(item);\n if (item.tagName === 'INPUT' && item.type === 'radio') {\n item.name = this.name;\n }\n } else {\n const inputs = item.querySelectorAll('input, select');\n if (inputs.length > 0) {\n inputs.forEach((input) => {\n this.inputs.push(input);\n\n if (input.tagName === 'INPUT' && input.type === 'radio') {\n input.name = this.name;\n }\n });\n }\n }\n index++;\n });\n\n //this.toggleHiddenItems();\n }\n\n render() {\n return (\n <Host>\n {this.heading && <h5>{this.heading}</h5>}\n <div class=\"filterGroup\">\n <slot ref={(el) => (this.slotItemsWrapper = el as HTMLSlotElement)}></slot>\n </div>\n {this.inputs.length > this.maxElements &&\n <jump-button variant=\"primary\" size=\"small\" text name={this.showMore ? this.otherLabel : this.lessLabel}\n aria-label={this.showMore ? this.otherLabel : this.lessLabel}\n ref={(showMoreBtn) => {\n this.showMoreBtn = showMoreBtn;\n }}\n onClick={() => this.handleShowMore()}>\n {this.showMore ? this.otherLabel : this.lessLabel}\n <jump-icon slot=\"suffix\" name={this.showMore ? 'chevron-down' : 'chevron-up'}></jump-icon>\n </jump-button>\n }\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"jump-filtergroup.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,kBAAkB,GAAG,mvBAAmvB,CAAC;AAC/wB,8BAAe,kBAAkB;;MCMpB,eAAe;;;;oBACH,UAAU;uBACP,mBAAmB;0BAChB,cAAc;yBACf,aAAa;2BACX,CAAC;uBAEY,SAAS;qBAE3B,IAAI,CAAC,UAAU;sBACZ,EAAE;qBACL,EAAE;;sBAEJ,EAAE;wBACI,KAAK;;IAQlC,aAAa,CAAC,QAAiB;QAC7B,IAAI,CAAC,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;KAC1D;IAGD,MAAM,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;KACpB;IAGD,MAAM,eAAe;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;KAC3B;IAGD,MAAM,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;KACpB;IAGD,MAAM,OAAO;QACX,OAAO,IAAI,CAAC,IAA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AC,CAAC;;KAGJ;IAED,MAAM;QACJ,QACEA,QAACC,UAAI,uDACF,IAAI,CAAC,OAAO,IAAID,mEAAK,IAAI,CAAC,OAAO,CAAM,EACxCA,kEAAK,KAAK,EAAC,aAAa,IACtBA,mEAAM,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,gBAAgB,GAAG,EAAqB,CAAC,GAAS,CACvE,EACL,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW;YACpCA,0EAAa,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,QAAC,IAAI,EAAE,IAAI,CAAC,KAAK,gBACxC,IAAI,CAAC,KAAK,EACtB,GAAG,EAAE,CAAC,WAAW;oBACf,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;iBAChC,EACD,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,IAC9C,IAAI,CAAC,KAAK,EACXA,wEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,CAAC,IAAI,CAAC,QAAQ,GAAG,cAAc,GAAG,YAAY,GAAc,CAC/E,CAEX,EACP;KACH;;;;;;;;;","names":["h","Host"],"sources":["src/components/jump-filtergroup/jump-filtergroup.scss?tag=jump-filtergroup&encapsulation=shadow","src/components/jump-filtergroup/jump-filtergroup.tsx"],"sourcesContent":[":host {\n --hidden-display: none;\n --font-family: var(--ff-primary, 'Inter'), serif;\n --font-size: var(--fs-400, 16px);\n --line-height: var(--lh-300, 1.2);\n --font-weight: var(--fw-900, 700);\n --color: var(--neutral-grey-primary, #282828);\n --distance-items: .25rem;\n\n display: block;\n\n h5 {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: var(--line-height);\n font-weight: var(--font-weight);\n color: var(--color);\n margin: 0 0 var(--distance-items, .25rem);\n }\n\n slot {\n display: flex;\n flex-direction: column;\n margin-bottom: 1rem;\n }\n\n ::slotted(.item) {\n max-height: 500px;\n transition: all 0.3s ease-in-out;\n margin-top: var(--distance-items, .25rem);\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: .25rem;\n }\n\n ::slotted(.hidden) {\n max-height: 0;\n overflow: hidden;\n }\n}\n\n\n","import { Component, Host, h, Prop, State, Event, Method, Watch } from '@stencil/core';\n\n@Component({\n tag: 'jump-filtergroup',\n styleUrl: 'jump-filtergroup.scss',\n shadow: true,\n})\nexport class JumpFiltergroup {\n @Prop() name: string = 'tax-name';\n @Prop() heading: string = 'Titolo del filtro';\n @Prop() otherLabel: string = 'Mostra altro';\n @Prop() lessLabel: string = 'Mostra meno';\n @Prop() maxElements: number = 8;\n //TODO: Add Accordion variant within jump-acccordion component\n @Prop() variant: 'accordion' | 'default' = 'default';\n\n @State() label: string = this.otherLabel;\n @State() values: string[] = [];\n @State() value: string = '';\n @State() slotItems: any;\n @State() inputs: any = [];\n @State() showMore: boolean = false;\n\n @Event({ eventName: 'jump-filterchange' }) change;\n\n slotItemsWrapper: HTMLSlotElement;\n showMoreBtn: HTMLElement;\n\n @Watch('showMore')\n watchShowMore(newValue: boolean) {\n this.label = newValue ? this.lessLabel : this.otherLabel;\n }\n\n @Method('getValues')\n async getValues() {\n return this.values;\n }\n\n @Method('getActiveAmount')\n async getActiveAmount() {\n return this.values.length;\n }\n\n @Method('getInputs')\n async getInputs() {\n return this.inputs;\n }\n\n @Method('getName')\n async getName() {\n return this.name;\n }\n\n toggleHiddenItems() {\n this.slotItemsWrapper.assignedElements().forEach((item, index) => {\n if (index > this.maxElements) {\n if (this.showMore) {\n item.classList.remove('hidden');\n } else {\n item.classList.add('hidden');\n }\n }\n });\n }\n\n handleShowMore() {\n this.showMore = !this.showMore;\n this.toggleHiddenItems();\n }\n\n handleChange(event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const newValue = target.value;\n\n if (target.tagName === 'INPUT') {\n if (target.type === 'checkbox') {\n // @ts-ignore\n if (target.checked) {\n this.values.push(newValue);\n } else {\n const index = this.values.indexOf(newValue);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n } else if (target.type === 'radio') {\n // Se è un input radio selezionato, imposta il valore e aggiorna this.values\n this.value = newValue;\n this.values = [newValue]; // Assicurati che this.values contenga solo il valore selezionato\n }\n } else if (target.tagName === 'SELECT') {\n // Se è un select, aggiorna semplicemente il valore\n this.value = newValue;\n this.values = [newValue];\n }\n\n // Emit event con i valori aggiornati\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n handleCheckboxChange(event: CustomEvent) {\n if (event.detail.checked && !this.values.includes(event.detail.value)) {\n this.values.push(event.detail.value);\n } else if (!event.detail.checked && this.values.includes(event.detail.value)) {\n const index = this.values.indexOf(event.detail.value);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n componentDidLoad() {\n this.slotItems = this.slotItemsWrapper.assignedElements();\n this.slotItemsWrapper.addEventListener('change', this.handleChange.bind(this));\n this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));\n\n let index = 0;\n this.slotItems.forEach((item) => {\n item.classList.add('item');\n if (index > this.maxElements) {\n item.classList.add('hidden');\n }\n //if (item.tagName start with jump-\n if (item.tagName === 'INPUT' || item.tagName === 'SELECT' || item.tagName.startsWith('JUMP-') || item.tagName === 'LABEL') {\n this.inputs.push(item);\n if (item.tagName === 'INPUT' && item.type === 'radio') {\n item.name = this.name;\n }\n } else {\n const inputs = item.querySelectorAll('input, select');\n if (inputs.length > 0) {\n inputs.forEach((input) => {\n this.inputs.push(input);\n\n if (input.tagName === 'INPUT' && input.type === 'radio') {\n input.name = this.name;\n }\n });\n }\n }\n index++;\n });\n\n //this.toggleHiddenItems();\n }\n\n render() {\n return (\n <Host>\n {this.heading && <h5>{this.heading}</h5>}\n <div class=\"filterGroup\">\n <slot ref={(el) => (this.slotItemsWrapper = el as HTMLSlotElement)}></slot>\n </div>\n {this.inputs.length > this.maxElements &&\n <jump-button variant=\"primary\" size=\"small\" text name={this.label}\n aria-label={this.label}\n ref={(showMoreBtn) => {\n this.showMoreBtn = showMoreBtn;\n }}\n onClick={() => this.handleShowMore()}>\n {this.label}\n <jump-icon slot=\"suffix\" name={!this.showMore ? 'chevron-down' : 'chevron-up'}></jump-icon>\n </jump-button>\n }\n </Host>\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"],"hasSlotForFavorite":[4,"has-slot-for-favorite"],"favoriteHref":[1,"favorite-href"],"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"],"isMini":[4,"is-mini"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32],"priceFormatted":[32],"salePriceFormatted":[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],"heading":[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-accordion.cjs",[[1,"jump-accordion",{"variant":[1],"summary":[1],"disabled":[4],"open":[516],"icon":[1],"identifier":[1]},[[0,"sl-show","handleShow"]]]]],["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-group.cjs",[[1,"jump-accordion-group",{"variant":[1],"groupIdentifier":[1,"group-identifier"]}]]],["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-filter-checkbox.cjs",[[1,"jump-filter-checkbox",{"value":[1],"label":[1],"checked":[516],"count":[8],"isChecked":[64]}]]],["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);
|
|
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"],"hasSlotForFavorite":[4,"has-slot-for-favorite"],"favoriteHref":[1,"favorite-href"],"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"],"isMini":[4,"is-mini"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32],"priceFormatted":[32],"salePriceFormatted":[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],"heading":[1],"otherLabel":[1,"other-label"],"lessLabel":[1,"less-label"],"maxElements":[2,"max-elements"],"variant":[1],"label":[32],"values":[32],"value":[32],"slotItems":[32],"inputs":[32],"showMore":[32],"getValues":[64],"getActiveAmount":[64],"getInputs":[64],"getName":[64]},null,{"showMore":["watchShowMore"]}]]],["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-accordion.cjs",[[1,"jump-accordion",{"variant":[1],"summary":[1],"disabled":[4],"open":[516],"icon":[1],"identifier":[1]},[[0,"sl-show","handleShow"]]]]],["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-group.cjs",[[1,"jump-accordion-group",{"variant":[1],"groupIdentifier":[1,"group-identifier"]}]]],["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-filter-checkbox.cjs",[[1,"jump-filter-checkbox",{"value":[1],"label":[1],"checked":[516],"count":[8],"isChecked":[64]}]]],["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,24 +1,36 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
--hidden-display: none;
|
|
3
|
+
--font-family: var(--ff-primary, "Inter"), serif;
|
|
4
|
+
--font-size: var(--fs-400, 16px);
|
|
5
|
+
--line-height: var(--lh-300, 1.2);
|
|
6
|
+
--font-weight: var(--fw-900, 700);
|
|
7
|
+
--color: var(--neutral-grey-primary, #282828);
|
|
8
|
+
--distance-items: .25rem;
|
|
3
9
|
display: block;
|
|
4
10
|
}
|
|
5
11
|
:host h5 {
|
|
6
|
-
font-family: var(--
|
|
7
|
-
font-size: var(--
|
|
8
|
-
line-height: var(--
|
|
9
|
-
font-weight: var(--
|
|
12
|
+
font-family: var(--font-family);
|
|
13
|
+
font-size: var(--font-size);
|
|
14
|
+
line-height: var(--line-height);
|
|
15
|
+
font-weight: var(--font-weight);
|
|
16
|
+
color: var(--color);
|
|
17
|
+
margin: 0 0 var(--distance-items, 0.25rem);
|
|
10
18
|
}
|
|
11
19
|
:host slot {
|
|
12
20
|
display: flex;
|
|
13
21
|
flex-direction: column;
|
|
14
|
-
gap: 0.25rem;
|
|
15
22
|
margin-bottom: 1rem;
|
|
16
23
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
:host ::slotted(.item) {
|
|
25
|
+
max-height: 500px;
|
|
26
|
+
transition: all 0.3s ease-in-out;
|
|
27
|
+
margin-top: var(--distance-items, 0.25rem);
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: flex-start;
|
|
31
|
+
gap: 0.25rem;
|
|
20
32
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
33
|
+
:host ::slotted(.hidden) {
|
|
34
|
+
max-height: 0;
|
|
35
|
+
overflow: hidden;
|
|
24
36
|
}
|
|
@@ -7,11 +7,15 @@ export class JumpFiltergroup {
|
|
|
7
7
|
this.lessLabel = 'Mostra meno';
|
|
8
8
|
this.maxElements = 8;
|
|
9
9
|
this.variant = 'default';
|
|
10
|
+
this.label = this.otherLabel;
|
|
10
11
|
this.values = [];
|
|
11
12
|
this.value = '';
|
|
12
13
|
this.slotItems = undefined;
|
|
13
14
|
this.inputs = [];
|
|
14
|
-
this.showMore =
|
|
15
|
+
this.showMore = false;
|
|
16
|
+
}
|
|
17
|
+
watchShowMore(newValue) {
|
|
18
|
+
this.label = newValue ? this.lessLabel : this.otherLabel;
|
|
15
19
|
}
|
|
16
20
|
async getValues() {
|
|
17
21
|
return this.values;
|
|
@@ -25,19 +29,21 @@ export class JumpFiltergroup {
|
|
|
25
29
|
async getName() {
|
|
26
30
|
return this.name;
|
|
27
31
|
}
|
|
28
|
-
toggleHiddenItems(
|
|
32
|
+
toggleHiddenItems() {
|
|
29
33
|
this.slotItemsWrapper.assignedElements().forEach((item, index) => {
|
|
30
|
-
if (index > this.maxElements
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
if (index > this.maxElements) {
|
|
35
|
+
if (this.showMore) {
|
|
36
|
+
item.classList.remove('hidden');
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
item.classList.add('hidden');
|
|
40
|
+
}
|
|
35
41
|
}
|
|
36
42
|
});
|
|
37
43
|
}
|
|
38
44
|
handleShowMore() {
|
|
39
45
|
this.showMore = !this.showMore;
|
|
40
|
-
this.toggleHiddenItems(
|
|
46
|
+
this.toggleHiddenItems();
|
|
41
47
|
}
|
|
42
48
|
handleChange(event) {
|
|
43
49
|
const target = event.target;
|
|
@@ -93,11 +99,12 @@ export class JumpFiltergroup {
|
|
|
93
99
|
this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));
|
|
94
100
|
let index = 0;
|
|
95
101
|
this.slotItems.forEach((item) => {
|
|
102
|
+
item.classList.add('item');
|
|
96
103
|
if (index > this.maxElements) {
|
|
97
|
-
|
|
98
|
-
item.style.display = 'none';
|
|
104
|
+
item.classList.add('hidden');
|
|
99
105
|
}
|
|
100
|
-
if (item.tagName
|
|
106
|
+
//if (item.tagName start with jump-
|
|
107
|
+
if (item.tagName === 'INPUT' || item.tagName === 'SELECT' || item.tagName.startsWith('JUMP-') || item.tagName === 'LABEL') {
|
|
101
108
|
this.inputs.push(item);
|
|
102
109
|
if (item.tagName === 'INPUT' && item.type === 'radio') {
|
|
103
110
|
item.name = this.name;
|
|
@@ -119,10 +126,10 @@ export class JumpFiltergroup {
|
|
|
119
126
|
//this.toggleHiddenItems();
|
|
120
127
|
}
|
|
121
128
|
render() {
|
|
122
|
-
return (h(Host, { key: '
|
|
123
|
-
h("jump-button", { key: '
|
|
129
|
+
return (h(Host, { key: '7d3b79b574cb9b46501ea0482c6d3cc1fbb98e1f' }, this.heading && h("h5", { key: '68f2dd39f94fb905d9ea151cfbf946080abf1883' }, this.heading), h("div", { key: '3975c6ca04b3bd077eef48dd93311299c4cb2308', class: "filterGroup" }, h("slot", { key: 'c45798ed4fa32dc7baa18aa183740b5ad589b87b', ref: (el) => (this.slotItemsWrapper = el) })), this.inputs.length > this.maxElements &&
|
|
130
|
+
h("jump-button", { key: '068c3456f098fd7d58f943964338ff0416507797', variant: "primary", size: "small", text: true, name: this.label, "aria-label": this.label, ref: (showMoreBtn) => {
|
|
124
131
|
this.showMoreBtn = showMoreBtn;
|
|
125
|
-
}, onClick: () => this.handleShowMore() }, this.
|
|
132
|
+
}, onClick: () => this.handleShowMore() }, this.label, h("jump-icon", { key: '7e0b01f499ff2af6948120711d09f84dd70e4039', slot: "suffix", name: !this.showMore ? 'chevron-down' : 'chevron-up' }))));
|
|
126
133
|
}
|
|
127
134
|
static get is() { return "jump-filtergroup"; }
|
|
128
135
|
static get encapsulation() { return "shadow"; }
|
|
@@ -250,6 +257,7 @@ export class JumpFiltergroup {
|
|
|
250
257
|
}
|
|
251
258
|
static get states() {
|
|
252
259
|
return {
|
|
260
|
+
"label": {},
|
|
253
261
|
"values": {},
|
|
254
262
|
"value": {},
|
|
255
263
|
"slotItems": {},
|
|
@@ -347,5 +355,11 @@ export class JumpFiltergroup {
|
|
|
347
355
|
}
|
|
348
356
|
};
|
|
349
357
|
}
|
|
358
|
+
static get watchers() {
|
|
359
|
+
return [{
|
|
360
|
+
"propName": "showMore",
|
|
361
|
+
"methodName": "watchShowMore"
|
|
362
|
+
}];
|
|
363
|
+
}
|
|
350
364
|
}
|
|
351
365
|
//# sourceMappingURL=jump-filtergroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jump-filtergroup.js","sourceRoot":"","sources":["../../../src/components/jump-filtergroup/jump-filtergroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAO/E,MAAM,OAAO,eAAe;;oBACH,UAAU;uBACP,mBAAmB;0BAChB,cAAc;yBACf,aAAa;2BACX,CAAC;uBAEY,SAAS;sBAExB,EAAE;qBACL,EAAE;;sBAEJ,EAAE;wBACI,IAAI;;IAQjC,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAC5B,CAAC;IAGD,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,iBAAiB,CAAC,OAAO,GAAG,IAAI;QAC9B,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAC/D,IAAI,KAAK,GAAG,IAAI,CAAC,WAAW,IAAI,CAAC,OAAO,EAAE,CAAC;gBACzC,IAAI,CAAC,YAAY,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Event, Method } from '@stencil/core';\n\n@Component({\n tag: 'jump-filtergroup',\n styleUrl: 'jump-filtergroup.scss',\n shadow: true,\n})\nexport class JumpFiltergroup {\n @Prop() name: string = 'tax-name';\n @Prop() heading: string = 'Titolo del filtro';\n @Prop() otherLabel: string = 'Mostra altro';\n @Prop() lessLabel: string = 'Mostra meno';\n @Prop() maxElements: number = 8;\n //TODO: Add Accordion variant within jump-acccordion component\n @Prop() variant: 'accordion' | 'default' = 'default';\n\n @State() values: string[] = [];\n @State() value: string = '';\n @State() slotItems: any;\n @State() inputs: any = [];\n @State() showMore: boolean = true;\n\n @Event({ eventName: 'jump-filterchange' }) change;\n\n slotItemsWrapper: HTMLSlotElement;\n showMoreBtn: HTMLElement;\n\n @Method('getValues')\n async getValues() {\n return this.values;\n }\n\n @Method('getActiveAmount')\n async getActiveAmount() {\n return this.values.length;\n }\n\n @Method('getInputs')\n async getInputs() {\n return this.inputs;\n }\n\n @Method('getName')\n async getName() {\n return this.name;\n }\n\n toggleHiddenItems(showAll = true) {\n this.slotItemsWrapper.assignedElements().forEach((item, index) => {\n if (index > this.maxElements && !showAll) {\n item.setAttribute('style', 'display: none');\n } else {\n item.setAttribute('style', 'display: initial');\n }\n });\n }\n\n handleShowMore() {\n this.showMore = !this.showMore;\n this.toggleHiddenItems(this.showMore);\n }\n\n handleChange(event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const newValue = target.value;\n\n if (target.tagName === 'INPUT') {\n if (target.type === 'checkbox') {\n // @ts-ignore\n if (target.checked) {\n this.values.push(newValue);\n } else {\n const index = this.values.indexOf(newValue);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n } else if (target.type === 'radio') {\n // Se è un input radio selezionato, imposta il valore e aggiorna this.values\n this.value = newValue;\n this.values = [newValue]; // Assicurati che this.values contenga solo il valore selezionato\n }\n } else if (target.tagName === 'SELECT') {\n // Se è un select, aggiorna semplicemente il valore\n this.value = newValue;\n this.values = [newValue];\n }\n\n // Emit event con i valori aggiornati\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n handleCheckboxChange(event: CustomEvent) {\n if (event.detail.checked && !this.values.includes(event.detail.value)) {\n this.values.push(event.detail.value);\n } else if (!event.detail.checked && this.values.includes(event.detail.value)) {\n const index = this.values.indexOf(event.detail.value);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n componentDidLoad() {\n this.slotItems = this.slotItemsWrapper.assignedElements();\n this.slotItemsWrapper.addEventListener('change', this.handleChange.bind(this));\n this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));\n\n let index = 0;\n this.slotItems.forEach((item) => {\n if (index > this.maxElements) {\n //item.setAttribute('data-hide', 'true');\n item.style.display = 'none';\n }\n if (item.tagName === 'INPUT' || item.tagName === 'SELECT') {\n this.inputs.push(item);\n if (item.tagName === 'INPUT' && item.type === 'radio') {\n item.name = this.name;\n }\n } else {\n const inputs = item.querySelectorAll('input, select');\n if (inputs.length > 0) {\n inputs.forEach((input) => {\n this.inputs.push(input);\n\n if (input.tagName === 'INPUT' && input.type === 'radio') {\n input.name = this.name;\n }\n });\n }\n }\n index++;\n });\n\n //this.toggleHiddenItems();\n }\n\n render() {\n return (\n <Host>\n {this.heading && <h5>{this.heading}</h5>}\n <div class=\"filterGroup\">\n <slot ref={(el) => (this.slotItemsWrapper = el as HTMLSlotElement)}></slot>\n </div>\n {this.inputs.length > this.maxElements &&\n <jump-button variant=\"primary\" size=\"small\" text name={this.showMore ? this.otherLabel : this.lessLabel}\n aria-label={this.showMore ? this.otherLabel : this.lessLabel}\n ref={(showMoreBtn) => {\n this.showMoreBtn = showMoreBtn;\n }}\n onClick={() => this.handleShowMore()}>\n {this.showMore ? this.otherLabel : this.lessLabel}\n <jump-icon slot=\"suffix\" name={this.showMore ? 'chevron-down' : 'chevron-up'}></jump-icon>\n </jump-button>\n }\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"jump-filtergroup.js","sourceRoot":"","sources":["../../../src/components/jump-filtergroup/jump-filtergroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOtF,MAAM,OAAO,eAAe;;oBACH,UAAU;uBACP,mBAAmB;0BAChB,cAAc;yBACf,aAAa;2BACX,CAAC;uBAEY,SAAS;qBAE3B,IAAI,CAAC,UAAU;sBACZ,EAAE;qBACL,EAAE;;sBAEJ,EAAE;wBACI,KAAK;;IAQlC,aAAa,CAAC,QAAiB;QAC7B,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;IAC3D,CAAC;IAGD,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAC5B,CAAC;IAGD,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAC/D,IAAI,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;gBAC7B,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;oBAClB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAClC,CAAC;qBA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-filtergroup',\n styleUrl: 'jump-filtergroup.scss',\n shadow: true,\n})\nexport class JumpFiltergroup {\n @Prop() name: string = 'tax-name';\n @Prop() heading: string = 'Titolo del filtro';\n @Prop() otherLabel: string = 'Mostra altro';\n @Prop() lessLabel: string = 'Mostra meno';\n @Prop() maxElements: number = 8;\n //TODO: Add Accordion variant within jump-acccordion component\n @Prop() variant: 'accordion' | 'default' = 'default';\n\n @State() label: string = this.otherLabel;\n @State() values: string[] = [];\n @State() value: string = '';\n @State() slotItems: any;\n @State() inputs: any = [];\n @State() showMore: boolean = false;\n\n @Event({ eventName: 'jump-filterchange' }) change;\n\n slotItemsWrapper: HTMLSlotElement;\n showMoreBtn: HTMLElement;\n\n @Watch('showMore')\n watchShowMore(newValue: boolean) {\n this.label = newValue ? this.lessLabel : this.otherLabel;\n }\n\n @Method('getValues')\n async getValues() {\n return this.values;\n }\n\n @Method('getActiveAmount')\n async getActiveAmount() {\n return this.values.length;\n }\n\n @Method('getInputs')\n async getInputs() {\n return this.inputs;\n }\n\n @Method('getName')\n async getName() {\n return this.name;\n }\n\n toggleHiddenItems() {\n this.slotItemsWrapper.assignedElements().forEach((item, index) => {\n if (index > this.maxElements) {\n if (this.showMore) {\n item.classList.remove('hidden');\n } else {\n item.classList.add('hidden');\n }\n }\n });\n }\n\n handleShowMore() {\n this.showMore = !this.showMore;\n this.toggleHiddenItems();\n }\n\n handleChange(event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const newValue = target.value;\n\n if (target.tagName === 'INPUT') {\n if (target.type === 'checkbox') {\n // @ts-ignore\n if (target.checked) {\n this.values.push(newValue);\n } else {\n const index = this.values.indexOf(newValue);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n } else if (target.type === 'radio') {\n // Se è un input radio selezionato, imposta il valore e aggiorna this.values\n this.value = newValue;\n this.values = [newValue]; // Assicurati che this.values contenga solo il valore selezionato\n }\n } else if (target.tagName === 'SELECT') {\n // Se è un select, aggiorna semplicemente il valore\n this.value = newValue;\n this.values = [newValue];\n }\n\n // Emit event con i valori aggiornati\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n handleCheckboxChange(event: CustomEvent) {\n if (event.detail.checked && !this.values.includes(event.detail.value)) {\n this.values.push(event.detail.value);\n } else if (!event.detail.checked && this.values.includes(event.detail.value)) {\n const index = this.values.indexOf(event.detail.value);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n componentDidLoad() {\n this.slotItems = this.slotItemsWrapper.assignedElements();\n this.slotItemsWrapper.addEventListener('change', this.handleChange.bind(this));\n this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));\n\n let index = 0;\n this.slotItems.forEach((item) => {\n item.classList.add('item');\n if (index > this.maxElements) {\n item.classList.add('hidden');\n }\n //if (item.tagName start with jump-\n if (item.tagName === 'INPUT' || item.tagName === 'SELECT' || item.tagName.startsWith('JUMP-') || item.tagName === 'LABEL') {\n this.inputs.push(item);\n if (item.tagName === 'INPUT' && item.type === 'radio') {\n item.name = this.name;\n }\n } else {\n const inputs = item.querySelectorAll('input, select');\n if (inputs.length > 0) {\n inputs.forEach((input) => {\n this.inputs.push(input);\n\n if (input.tagName === 'INPUT' && input.type === 'radio') {\n input.name = this.name;\n }\n });\n }\n }\n index++;\n });\n\n //this.toggleHiddenItems();\n }\n\n render() {\n return (\n <Host>\n {this.heading && <h5>{this.heading}</h5>}\n <div class=\"filterGroup\">\n <slot ref={(el) => (this.slotItemsWrapper = el as HTMLSlotElement)}></slot>\n </div>\n {this.inputs.length > this.maxElements &&\n <jump-button variant=\"primary\" size=\"small\" text name={this.label}\n aria-label={this.label}\n ref={(showMoreBtn) => {\n this.showMoreBtn = showMoreBtn;\n }}\n onClick={() => this.handleShowMore()}>\n {this.label}\n <jump-icon slot=\"suffix\" name={!this.showMore ? 'chevron-down' : 'chevron-up'}></jump-icon>\n </jump-button>\n }\n </Host>\n );\n }\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { d as defineCustomElement$3 } from './jump-button2.js';
|
|
3
3
|
import { d as defineCustomElement$2 } from './jump-icon2.js';
|
|
4
4
|
|
|
5
|
-
const jumpFiltergroupCss = ":host{--hidden-display:none;display:block}:host h5{font-family:var(--
|
|
5
|
+
const jumpFiltergroupCss = ":host{--hidden-display:none;--font-family:var(--ff-primary, \"Inter\"), serif;--font-size:var(--fs-400, 16px);--line-height:var(--lh-300, 1.2);--font-weight:var(--fw-900, 700);--color:var(--neutral-grey-primary, #282828);--distance-items:.25rem;display:block}:host h5{font-family:var(--font-family);font-size:var(--font-size);line-height:var(--line-height);font-weight:var(--font-weight);color:var(--color);margin:0 0 var(--distance-items, 0.25rem)}:host slot{display:flex;flex-direction:column;margin-bottom:1rem}:host ::slotted(.item){max-height:500px;transition:all 0.3s ease-in-out;margin-top:var(--distance-items, 0.25rem);display:flex;align-items:center;justify-content:flex-start;gap:0.25rem}:host ::slotted(.hidden){max-height:0;overflow:hidden}";
|
|
6
6
|
const JumpFiltergroupStyle0 = jumpFiltergroupCss;
|
|
7
7
|
|
|
8
8
|
const JumpFiltergroup$1 = /*@__PURE__*/ proxyCustomElement(class JumpFiltergroup extends HTMLElement {
|
|
@@ -17,11 +17,15 @@ const JumpFiltergroup$1 = /*@__PURE__*/ proxyCustomElement(class JumpFiltergroup
|
|
|
17
17
|
this.lessLabel = 'Mostra meno';
|
|
18
18
|
this.maxElements = 8;
|
|
19
19
|
this.variant = 'default';
|
|
20
|
+
this.label = this.otherLabel;
|
|
20
21
|
this.values = [];
|
|
21
22
|
this.value = '';
|
|
22
23
|
this.slotItems = undefined;
|
|
23
24
|
this.inputs = [];
|
|
24
|
-
this.showMore =
|
|
25
|
+
this.showMore = false;
|
|
26
|
+
}
|
|
27
|
+
watchShowMore(newValue) {
|
|
28
|
+
this.label = newValue ? this.lessLabel : this.otherLabel;
|
|
25
29
|
}
|
|
26
30
|
async getValues() {
|
|
27
31
|
return this.values;
|
|
@@ -35,19 +39,21 @@ const JumpFiltergroup$1 = /*@__PURE__*/ proxyCustomElement(class JumpFiltergroup
|
|
|
35
39
|
async getName() {
|
|
36
40
|
return this.name;
|
|
37
41
|
}
|
|
38
|
-
toggleHiddenItems(
|
|
42
|
+
toggleHiddenItems() {
|
|
39
43
|
this.slotItemsWrapper.assignedElements().forEach((item, index) => {
|
|
40
|
-
if (index > this.maxElements
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
if (index > this.maxElements) {
|
|
45
|
+
if (this.showMore) {
|
|
46
|
+
item.classList.remove('hidden');
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
item.classList.add('hidden');
|
|
50
|
+
}
|
|
45
51
|
}
|
|
46
52
|
});
|
|
47
53
|
}
|
|
48
54
|
handleShowMore() {
|
|
49
55
|
this.showMore = !this.showMore;
|
|
50
|
-
this.toggleHiddenItems(
|
|
56
|
+
this.toggleHiddenItems();
|
|
51
57
|
}
|
|
52
58
|
handleChange(event) {
|
|
53
59
|
const target = event.target;
|
|
@@ -103,11 +109,12 @@ const JumpFiltergroup$1 = /*@__PURE__*/ proxyCustomElement(class JumpFiltergroup
|
|
|
103
109
|
this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));
|
|
104
110
|
let index = 0;
|
|
105
111
|
this.slotItems.forEach((item) => {
|
|
112
|
+
item.classList.add('item');
|
|
106
113
|
if (index > this.maxElements) {
|
|
107
|
-
|
|
108
|
-
item.style.display = 'none';
|
|
114
|
+
item.classList.add('hidden');
|
|
109
115
|
}
|
|
110
|
-
if (item.tagName
|
|
116
|
+
//if (item.tagName start with jump-
|
|
117
|
+
if (item.tagName === 'INPUT' || item.tagName === 'SELECT' || item.tagName.startsWith('JUMP-') || item.tagName === 'LABEL') {
|
|
111
118
|
this.inputs.push(item);
|
|
112
119
|
if (item.tagName === 'INPUT' && item.type === 'radio') {
|
|
113
120
|
item.name = this.name;
|
|
@@ -129,11 +136,14 @@ const JumpFiltergroup$1 = /*@__PURE__*/ proxyCustomElement(class JumpFiltergroup
|
|
|
129
136
|
//this.toggleHiddenItems();
|
|
130
137
|
}
|
|
131
138
|
render() {
|
|
132
|
-
return (h(Host, { key: '
|
|
133
|
-
h("jump-button", { key: '
|
|
139
|
+
return (h(Host, { key: '7d3b79b574cb9b46501ea0482c6d3cc1fbb98e1f' }, this.heading && h("h5", { key: '68f2dd39f94fb905d9ea151cfbf946080abf1883' }, this.heading), h("div", { key: '3975c6ca04b3bd077eef48dd93311299c4cb2308', class: "filterGroup" }, h("slot", { key: 'c45798ed4fa32dc7baa18aa183740b5ad589b87b', ref: (el) => (this.slotItemsWrapper = el) })), this.inputs.length > this.maxElements &&
|
|
140
|
+
h("jump-button", { key: '068c3456f098fd7d58f943964338ff0416507797', variant: "primary", size: "small", text: true, name: this.label, "aria-label": this.label, ref: (showMoreBtn) => {
|
|
134
141
|
this.showMoreBtn = showMoreBtn;
|
|
135
|
-
}, onClick: () => this.handleShowMore() }, this.
|
|
142
|
+
}, onClick: () => this.handleShowMore() }, this.label, h("jump-icon", { key: '7e0b01f499ff2af6948120711d09f84dd70e4039', slot: "suffix", name: !this.showMore ? 'chevron-down' : 'chevron-up' }))));
|
|
136
143
|
}
|
|
144
|
+
static get watchers() { return {
|
|
145
|
+
"showMore": ["watchShowMore"]
|
|
146
|
+
}; }
|
|
137
147
|
static get style() { return JumpFiltergroupStyle0; }
|
|
138
148
|
}, [1, "jump-filtergroup", {
|
|
139
149
|
"name": [1],
|
|
@@ -142,6 +152,7 @@ const JumpFiltergroup$1 = /*@__PURE__*/ proxyCustomElement(class JumpFiltergroup
|
|
|
142
152
|
"lessLabel": [1, "less-label"],
|
|
143
153
|
"maxElements": [2, "max-elements"],
|
|
144
154
|
"variant": [1],
|
|
155
|
+
"label": [32],
|
|
145
156
|
"values": [32],
|
|
146
157
|
"value": [32],
|
|
147
158
|
"slotItems": [32],
|
|
@@ -151,6 +162,8 @@ const JumpFiltergroup$1 = /*@__PURE__*/ proxyCustomElement(class JumpFiltergroup
|
|
|
151
162
|
"getActiveAmount": [64],
|
|
152
163
|
"getInputs": [64],
|
|
153
164
|
"getName": [64]
|
|
165
|
+
}, undefined, {
|
|
166
|
+
"showMore": ["watchShowMore"]
|
|
154
167
|
}]);
|
|
155
168
|
function defineCustomElement$1() {
|
|
156
169
|
if (typeof customElements === "undefined") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"jump-filtergroup.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,yTAAyT,CAAC;AACrV,8BAAe,kBAAkB;;MCMpBA,iBAAe;;;;;;oBACH,UAAU;uBACP,mBAAmB;0BAChB,cAAc;yBACf,aAAa;2BACX,CAAC;uBAEY,SAAS;sBAExB,EAAE;qBACL,EAAE;;sBAEJ,EAAE;wBACI,IAAI;;IAQjC,MAAM,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;KACpB;IAGD,MAAM,eAAe;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;KAC3B;IAGD,MAAM,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;KACpB;IAGD,MAAM,OAAO;QACX,OAAO,IAAI,CAAC,IAAI,CAAC;KAClB;IAED,iBAAiB,CAAC,OAAO,GAAG,IAAI;QAC9B,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK;YAC3D,IAAI,KAAK,GAAG,IAAI,CAAC,WAAW,IAAI,CAAC,OAAO,EAAE;gBACxC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;aAC7C;iBAAM;gBACL,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;aAChD;SACF,CAAC,CAAC;KACJ;IAED,cAAc;QACZ,IAA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GAAG,EAAE,CAAC,WAAW;oBACf,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;iBAChC,EACD,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,IAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,EACjD,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAG,cAAc,GAAG,YAAY,GAAc,CAC9E,CAEX,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["JumpFiltergroup"],"sources":["src/components/jump-filtergroup/jump-filtergroup.scss?tag=jump-filtergroup&encapsulation=shadow","src/components/jump-filtergroup/jump-filtergroup.tsx"],"sourcesContent":[":host {\n --hidden-display: none;\n\n display: block;\n\n h5{\n font-family: var(--ff-primary), serif;\n font-size: var(--fs-400);\n line-height: var(--lh-300);\n font-weight: var(--fw-900);\n }\n\n slot {\n display: flex;\n flex-direction: column;\n gap: .25rem;\n margin-bottom: 1rem;\n }\n\n}\n\n*[data-hide=\"true\"] {\n display: var(--hidden-display);\n}\n\nh5 {\n margin: 0 0 .25rem;\n}\n\n//TODO: capire perché non prende questo stile\n\n\n","import { Component, Host, h, Prop, State, Event, Method } from '@stencil/core';\n\n@Component({\n tag: 'jump-filtergroup',\n styleUrl: 'jump-filtergroup.scss',\n shadow: true,\n})\nexport class JumpFiltergroup {\n @Prop() name: string = 'tax-name';\n @Prop() heading: string = 'Titolo del filtro';\n @Prop() otherLabel: string = 'Mostra altro';\n @Prop() lessLabel: string = 'Mostra meno';\n @Prop() maxElements: number = 8;\n //TODO: Add Accordion variant within jump-acccordion component\n @Prop() variant: 'accordion' | 'default' = 'default';\n\n @State() values: string[] = [];\n @State() value: string = '';\n @State() slotItems: any;\n @State() inputs: any = [];\n @State() showMore: boolean = true;\n\n @Event({ eventName: 'jump-filterchange' }) change;\n\n slotItemsWrapper: HTMLSlotElement;\n showMoreBtn: HTMLElement;\n\n @Method('getValues')\n async getValues() {\n return this.values;\n }\n\n @Method('getActiveAmount')\n async getActiveAmount() {\n return this.values.length;\n }\n\n @Method('getInputs')\n async getInputs() {\n return this.inputs;\n }\n\n @Method('getName')\n async getName() {\n return this.name;\n }\n\n toggleHiddenItems(showAll = true) {\n this.slotItemsWrapper.assignedElements().forEach((item, index) => {\n if (index > this.maxElements && !showAll) {\n item.setAttribute('style', 'display: none');\n } else {\n item.setAttribute('style', 'display: initial');\n }\n });\n }\n\n handleShowMore() {\n this.showMore = !this.showMore;\n this.toggleHiddenItems(this.showMore);\n }\n\n handleChange(event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const newValue = target.value;\n\n if (target.tagName === 'INPUT') {\n if (target.type === 'checkbox') {\n // @ts-ignore\n if (target.checked) {\n this.values.push(newValue);\n } else {\n const index = this.values.indexOf(newValue);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n } else if (target.type === 'radio') {\n // Se è un input radio selezionato, imposta il valore e aggiorna this.values\n this.value = newValue;\n this.values = [newValue]; // Assicurati che this.values contenga solo il valore selezionato\n }\n } else if (target.tagName === 'SELECT') {\n // Se è un select, aggiorna semplicemente il valore\n this.value = newValue;\n this.values = [newValue];\n }\n\n // Emit event con i valori aggiornati\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n handleCheckboxChange(event: CustomEvent) {\n if (event.detail.checked && !this.values.includes(event.detail.value)) {\n this.values.push(event.detail.value);\n } else if (!event.detail.checked && this.values.includes(event.detail.value)) {\n const index = this.values.indexOf(event.detail.value);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n componentDidLoad() {\n this.slotItems = this.slotItemsWrapper.assignedElements();\n this.slotItemsWrapper.addEventListener('change', this.handleChange.bind(this));\n this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));\n\n let index = 0;\n this.slotItems.forEach((item) => {\n if (index > this.maxElements) {\n //item.setAttribute('data-hide', 'true');\n item.style.display = 'none';\n }\n if (item.tagName === 'INPUT' || item.tagName === 'SELECT') {\n this.inputs.push(item);\n if (item.tagName === 'INPUT' && item.type === 'radio') {\n item.name = this.name;\n }\n } else {\n const inputs = item.querySelectorAll('input, select');\n if (inputs.length > 0) {\n inputs.forEach((input) => {\n this.inputs.push(input);\n\n if (input.tagName === 'INPUT' && input.type === 'radio') {\n input.name = this.name;\n }\n });\n }\n }\n index++;\n });\n\n //this.toggleHiddenItems();\n }\n\n render() {\n return (\n <Host>\n {this.heading && <h5>{this.heading}</h5>}\n <div class=\"filterGroup\">\n <slot ref={(el) => (this.slotItemsWrapper = el as HTMLSlotElement)}></slot>\n </div>\n {this.inputs.length > this.maxElements &&\n <jump-button variant=\"primary\" size=\"small\" text name={this.showMore ? this.otherLabel : this.lessLabel}\n aria-label={this.showMore ? this.otherLabel : this.lessLabel}\n ref={(showMoreBtn) => {\n this.showMoreBtn = showMoreBtn;\n }}\n onClick={() => this.handleShowMore()}>\n {this.showMore ? this.otherLabel : this.lessLabel}\n <jump-icon slot=\"suffix\" name={this.showMore ? 'chevron-down' : 'chevron-up'}></jump-icon>\n </jump-button>\n }\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"jump-filtergroup.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,mvBAAmvB,CAAC;AAC/wB,8BAAe,kBAAkB;;MCMpBA,iBAAe;;;;;;oBACH,UAAU;uBACP,mBAAmB;0BAChB,cAAc;yBACf,aAAa;2BACX,CAAC;uBAEY,SAAS;qBAE3B,IAAI,CAAC,UAAU;sBACZ,EAAE;qBACL,EAAE;;sBAEJ,EAAE;wBACI,KAAK;;IAQlC,aAAa,CAAC,QAAiB;QAC7B,IAAI,CAAC,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;KAC1D;IAGD,MAAM,SAAS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AAC,CAAC;wBAExB,IAAI,KAAK,CAAC,OAAO,KAAK,OAAO,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;4BACvD,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;yBACxB;qBACF,CAAC,CAAC;iBACJ;aACF;YACD,KAAK,EAAE,CAAC;SACT,CAAC,CAAC;;KAGJ;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uDACF,IAAI,CAAC,OAAO,IAAI,6DAAK,IAAI,CAAC,OAAO,CAAM,EACxC,4DAAK,KAAK,EAAC,aAAa,IACtB,6DAAM,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,gBAAgB,GAAG,EAAqB,CAAC,GAAS,CACvE,EACL,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW;YACpC,oEAAa,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,QAAC,IAAI,EAAE,IAAI,CAAC,KAAK,gBACxC,IAAI,CAAC,KAAK,EACtB,GAAG,EAAE,CAAC,WAAW;oBACf,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;iBAChC,EACD,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,IAC9C,IAAI,CAAC,KAAK,EACX,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,CAAC,IAAI,CAAC,QAAQ,GAAG,cAAc,GAAG,YAAY,GAAc,CAC/E,CAEX,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["JumpFiltergroup"],"sources":["src/components/jump-filtergroup/jump-filtergroup.scss?tag=jump-filtergroup&encapsulation=shadow","src/components/jump-filtergroup/jump-filtergroup.tsx"],"sourcesContent":[":host {\n --hidden-display: none;\n --font-family: var(--ff-primary, 'Inter'), serif;\n --font-size: var(--fs-400, 16px);\n --line-height: var(--lh-300, 1.2);\n --font-weight: var(--fw-900, 700);\n --color: var(--neutral-grey-primary, #282828);\n --distance-items: .25rem;\n\n display: block;\n\n h5 {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: var(--line-height);\n font-weight: var(--font-weight);\n color: var(--color);\n margin: 0 0 var(--distance-items, .25rem);\n }\n\n slot {\n display: flex;\n flex-direction: column;\n margin-bottom: 1rem;\n }\n\n ::slotted(.item) {\n max-height: 500px;\n transition: all 0.3s ease-in-out;\n margin-top: var(--distance-items, .25rem);\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: .25rem;\n }\n\n ::slotted(.hidden) {\n max-height: 0;\n overflow: hidden;\n }\n}\n\n\n","import { Component, Host, h, Prop, State, Event, Method, Watch } from '@stencil/core';\n\n@Component({\n tag: 'jump-filtergroup',\n styleUrl: 'jump-filtergroup.scss',\n shadow: true,\n})\nexport class JumpFiltergroup {\n @Prop() name: string = 'tax-name';\n @Prop() heading: string = 'Titolo del filtro';\n @Prop() otherLabel: string = 'Mostra altro';\n @Prop() lessLabel: string = 'Mostra meno';\n @Prop() maxElements: number = 8;\n //TODO: Add Accordion variant within jump-acccordion component\n @Prop() variant: 'accordion' | 'default' = 'default';\n\n @State() label: string = this.otherLabel;\n @State() values: string[] = [];\n @State() value: string = '';\n @State() slotItems: any;\n @State() inputs: any = [];\n @State() showMore: boolean = false;\n\n @Event({ eventName: 'jump-filterchange' }) change;\n\n slotItemsWrapper: HTMLSlotElement;\n showMoreBtn: HTMLElement;\n\n @Watch('showMore')\n watchShowMore(newValue: boolean) {\n this.label = newValue ? this.lessLabel : this.otherLabel;\n }\n\n @Method('getValues')\n async getValues() {\n return this.values;\n }\n\n @Method('getActiveAmount')\n async getActiveAmount() {\n return this.values.length;\n }\n\n @Method('getInputs')\n async getInputs() {\n return this.inputs;\n }\n\n @Method('getName')\n async getName() {\n return this.name;\n }\n\n toggleHiddenItems() {\n this.slotItemsWrapper.assignedElements().forEach((item, index) => {\n if (index > this.maxElements) {\n if (this.showMore) {\n item.classList.remove('hidden');\n } else {\n item.classList.add('hidden');\n }\n }\n });\n }\n\n handleShowMore() {\n this.showMore = !this.showMore;\n this.toggleHiddenItems();\n }\n\n handleChange(event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const newValue = target.value;\n\n if (target.tagName === 'INPUT') {\n if (target.type === 'checkbox') {\n // @ts-ignore\n if (target.checked) {\n this.values.push(newValue);\n } else {\n const index = this.values.indexOf(newValue);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n } else if (target.type === 'radio') {\n // Se è un input radio selezionato, imposta il valore e aggiorna this.values\n this.value = newValue;\n this.values = [newValue]; // Assicurati che this.values contenga solo il valore selezionato\n }\n } else if (target.tagName === 'SELECT') {\n // Se è un select, aggiorna semplicemente il valore\n this.value = newValue;\n this.values = [newValue];\n }\n\n // Emit event con i valori aggiornati\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n handleCheckboxChange(event: CustomEvent) {\n if (event.detail.checked && !this.values.includes(event.detail.value)) {\n this.values.push(event.detail.value);\n } else if (!event.detail.checked && this.values.includes(event.detail.value)) {\n const index = this.values.indexOf(event.detail.value);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n componentDidLoad() {\n this.slotItems = this.slotItemsWrapper.assignedElements();\n this.slotItemsWrapper.addEventListener('change', this.handleChange.bind(this));\n this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));\n\n let index = 0;\n this.slotItems.forEach((item) => {\n item.classList.add('item');\n if (index > this.maxElements) {\n item.classList.add('hidden');\n }\n //if (item.tagName start with jump-\n if (item.tagName === 'INPUT' || item.tagName === 'SELECT' || item.tagName.startsWith('JUMP-') || item.tagName === 'LABEL') {\n this.inputs.push(item);\n if (item.tagName === 'INPUT' && item.type === 'radio') {\n item.name = this.name;\n }\n } else {\n const inputs = item.querySelectorAll('input, select');\n if (inputs.length > 0) {\n inputs.forEach((input) => {\n this.inputs.push(input);\n\n if (input.tagName === 'INPUT' && input.type === 'radio') {\n input.name = this.name;\n }\n });\n }\n }\n index++;\n });\n\n //this.toggleHiddenItems();\n }\n\n render() {\n return (\n <Host>\n {this.heading && <h5>{this.heading}</h5>}\n <div class=\"filterGroup\">\n <slot ref={(el) => (this.slotItemsWrapper = el as HTMLSlotElement)}></slot>\n </div>\n {this.inputs.length > this.maxElements &&\n <jump-button variant=\"primary\" size=\"small\" text name={this.label}\n aria-label={this.label}\n ref={(showMoreBtn) => {\n this.showMoreBtn = showMoreBtn;\n }}\n onClick={() => this.handleShowMore()}>\n {this.label}\n <jump-icon slot=\"suffix\" name={!this.showMore ? 'chevron-down' : 'chevron-up'}></jump-icon>\n </jump-button>\n }\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -16,7 +16,7 @@ var 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"],"hasSlotForFavorite":[4,"has-slot-for-favorite"],"favoriteHref":[1,"favorite-href"],"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"],"isMini":[4,"is-mini"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32],"priceFormatted":[32],"salePriceFormatted":[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],"heading":[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-accordion",[[1,"jump-accordion",{"variant":[1],"summary":[1],"disabled":[4],"open":[516],"icon":[1],"identifier":[1]},[[0,"sl-show","handleShow"]]]]],["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-group",[[1,"jump-accordion-group",{"variant":[1],"groupIdentifier":[1,"group-identifier"]}]]],["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-filter-checkbox",[[1,"jump-filter-checkbox",{"value":[1],"label":[1],"checked":[516],"count":[8],"isChecked":[64]}]]],["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);
|
|
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"],"hasSlotForFavorite":[4,"has-slot-for-favorite"],"favoriteHref":[1,"favorite-href"],"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"],"isMini":[4,"is-mini"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32],"priceFormatted":[32],"salePriceFormatted":[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],"heading":[1],"otherLabel":[1,"other-label"],"lessLabel":[1,"less-label"],"maxElements":[2,"max-elements"],"variant":[1],"label":[32],"values":[32],"value":[32],"slotItems":[32],"inputs":[32],"showMore":[32],"getValues":[64],"getActiveAmount":[64],"getInputs":[64],"getName":[64]},null,{"showMore":["watchShowMore"]}]]],["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-accordion",[[1,"jump-accordion",{"variant":[1],"summary":[1],"disabled":[4],"open":[516],"icon":[1],"identifier":[1]},[[0,"sl-show","handleShow"]]]]],["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-group",[[1,"jump-accordion-group",{"variant":[1],"groupIdentifier":[1,"group-identifier"]}]]],["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-filter-checkbox",[[1,"jump-filter-checkbox",{"value":[1],"label":[1],"checked":[516],"count":[8],"isChecked":[64]}]]],["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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-a94d133e.js';
|
|
2
2
|
|
|
3
|
-
const jumpFiltergroupCss = ":host{--hidden-display:none;display:block}:host h5{font-family:var(--
|
|
3
|
+
const jumpFiltergroupCss = ":host{--hidden-display:none;--font-family:var(--ff-primary, \"Inter\"), serif;--font-size:var(--fs-400, 16px);--line-height:var(--lh-300, 1.2);--font-weight:var(--fw-900, 700);--color:var(--neutral-grey-primary, #282828);--distance-items:.25rem;display:block}:host h5{font-family:var(--font-family);font-size:var(--font-size);line-height:var(--line-height);font-weight:var(--font-weight);color:var(--color);margin:0 0 var(--distance-items, 0.25rem)}:host slot{display:flex;flex-direction:column;margin-bottom:1rem}:host ::slotted(.item){max-height:500px;transition:all 0.3s ease-in-out;margin-top:var(--distance-items, 0.25rem);display:flex;align-items:center;justify-content:flex-start;gap:0.25rem}:host ::slotted(.hidden){max-height:0;overflow:hidden}";
|
|
4
4
|
const JumpFiltergroupStyle0 = jumpFiltergroupCss;
|
|
5
5
|
|
|
6
6
|
const JumpFiltergroup = class {
|
|
@@ -13,11 +13,15 @@ const JumpFiltergroup = class {
|
|
|
13
13
|
this.lessLabel = 'Mostra meno';
|
|
14
14
|
this.maxElements = 8;
|
|
15
15
|
this.variant = 'default';
|
|
16
|
+
this.label = this.otherLabel;
|
|
16
17
|
this.values = [];
|
|
17
18
|
this.value = '';
|
|
18
19
|
this.slotItems = undefined;
|
|
19
20
|
this.inputs = [];
|
|
20
|
-
this.showMore =
|
|
21
|
+
this.showMore = false;
|
|
22
|
+
}
|
|
23
|
+
watchShowMore(newValue) {
|
|
24
|
+
this.label = newValue ? this.lessLabel : this.otherLabel;
|
|
21
25
|
}
|
|
22
26
|
async getValues() {
|
|
23
27
|
return this.values;
|
|
@@ -31,19 +35,21 @@ const JumpFiltergroup = class {
|
|
|
31
35
|
async getName() {
|
|
32
36
|
return this.name;
|
|
33
37
|
}
|
|
34
|
-
toggleHiddenItems(
|
|
38
|
+
toggleHiddenItems() {
|
|
35
39
|
this.slotItemsWrapper.assignedElements().forEach((item, index) => {
|
|
36
|
-
if (index > this.maxElements
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
if (index > this.maxElements) {
|
|
41
|
+
if (this.showMore) {
|
|
42
|
+
item.classList.remove('hidden');
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
item.classList.add('hidden');
|
|
46
|
+
}
|
|
41
47
|
}
|
|
42
48
|
});
|
|
43
49
|
}
|
|
44
50
|
handleShowMore() {
|
|
45
51
|
this.showMore = !this.showMore;
|
|
46
|
-
this.toggleHiddenItems(
|
|
52
|
+
this.toggleHiddenItems();
|
|
47
53
|
}
|
|
48
54
|
handleChange(event) {
|
|
49
55
|
const target = event.target;
|
|
@@ -99,11 +105,12 @@ const JumpFiltergroup = class {
|
|
|
99
105
|
this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));
|
|
100
106
|
let index = 0;
|
|
101
107
|
this.slotItems.forEach((item) => {
|
|
108
|
+
item.classList.add('item');
|
|
102
109
|
if (index > this.maxElements) {
|
|
103
|
-
|
|
104
|
-
item.style.display = 'none';
|
|
110
|
+
item.classList.add('hidden');
|
|
105
111
|
}
|
|
106
|
-
if (item.tagName
|
|
112
|
+
//if (item.tagName start with jump-
|
|
113
|
+
if (item.tagName === 'INPUT' || item.tagName === 'SELECT' || item.tagName.startsWith('JUMP-') || item.tagName === 'LABEL') {
|
|
107
114
|
this.inputs.push(item);
|
|
108
115
|
if (item.tagName === 'INPUT' && item.type === 'radio') {
|
|
109
116
|
item.name = this.name;
|
|
@@ -125,11 +132,14 @@ const JumpFiltergroup = class {
|
|
|
125
132
|
//this.toggleHiddenItems();
|
|
126
133
|
}
|
|
127
134
|
render() {
|
|
128
|
-
return (h(Host, { key: '
|
|
129
|
-
h("jump-button", { key: '
|
|
135
|
+
return (h(Host, { key: '7d3b79b574cb9b46501ea0482c6d3cc1fbb98e1f' }, this.heading && h("h5", { key: '68f2dd39f94fb905d9ea151cfbf946080abf1883' }, this.heading), h("div", { key: '3975c6ca04b3bd077eef48dd93311299c4cb2308', class: "filterGroup" }, h("slot", { key: 'c45798ed4fa32dc7baa18aa183740b5ad589b87b', ref: (el) => (this.slotItemsWrapper = el) })), this.inputs.length > this.maxElements &&
|
|
136
|
+
h("jump-button", { key: '068c3456f098fd7d58f943964338ff0416507797', variant: "primary", size: "small", text: true, name: this.label, "aria-label": this.label, ref: (showMoreBtn) => {
|
|
130
137
|
this.showMoreBtn = showMoreBtn;
|
|
131
|
-
}, onClick: () => this.handleShowMore() }, this.
|
|
138
|
+
}, onClick: () => this.handleShowMore() }, this.label, h("jump-icon", { key: '7e0b01f499ff2af6948120711d09f84dd70e4039', slot: "suffix", name: !this.showMore ? 'chevron-down' : 'chevron-up' }))));
|
|
132
139
|
}
|
|
140
|
+
static get watchers() { return {
|
|
141
|
+
"showMore": ["watchShowMore"]
|
|
142
|
+
}; }
|
|
133
143
|
};
|
|
134
144
|
JumpFiltergroup.style = JumpFiltergroupStyle0;
|
|
135
145
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"jump-filtergroup.entry.js","mappings":";;AAAA,MAAM,kBAAkB,GAAG,yTAAyT,CAAC;AACrV,8BAAe,kBAAkB;;MCMpB,eAAe;;;;oBACH,UAAU;uBACP,mBAAmB;0BAChB,cAAc;yBACf,aAAa;2BACX,CAAC;uBAEY,SAAS;sBAExB,EAAE;qBACL,EAAE;;sBAEJ,EAAE;wBACI,IAAI;;IAQjC,MAAM,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;KACpB;IAGD,MAAM,eAAe;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;KAC3B;IAGD,MAAM,SAAS;QACb,OAAO,IAAI,CA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AAO,IAAI,6DAAK,IAAI,CAAC,OAAO,CAAM,EACxC,4DAAK,KAAK,EAAC,aAAa,IACtB,6DAAM,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,gBAAgB,GAAG,EAAqB,CAAC,GAAS,CACvE,EACL,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW;YACpC,oEAAa,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,QAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,gBAC9E,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,EAC5D,GAAG,EAAE,CAAC,WAAW;oBACf,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;iBAChC,EACD,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,IAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,EACjD,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAG,cAAc,GAAG,YAAY,GAAc,CAC9E,CAEX,EACP;KACH;;;;;;","names":[],"sources":["src/components/jump-filtergroup/jump-filtergroup.scss?tag=jump-filtergroup&encapsulation=shadow","src/components/jump-filtergroup/jump-filtergroup.tsx"],"sourcesContent":[":host {\n --hidden-display: none;\n\n display: block;\n\n h5{\n font-family: var(--ff-primary), serif;\n font-size: var(--fs-400);\n line-height: var(--lh-300);\n font-weight: var(--fw-900);\n }\n\n slot {\n display: flex;\n flex-direction: column;\n gap: .25rem;\n margin-bottom: 1rem;\n }\n\n}\n\n*[data-hide=\"true\"] {\n display: var(--hidden-display);\n}\n\nh5 {\n margin: 0 0 .25rem;\n}\n\n//TODO: capire perché non prende questo stile\n\n\n","import { Component, Host, h, Prop, State, Event, Method } from '@stencil/core';\n\n@Component({\n tag: 'jump-filtergroup',\n styleUrl: 'jump-filtergroup.scss',\n shadow: true,\n})\nexport class JumpFiltergroup {\n @Prop() name: string = 'tax-name';\n @Prop() heading: string = 'Titolo del filtro';\n @Prop() otherLabel: string = 'Mostra altro';\n @Prop() lessLabel: string = 'Mostra meno';\n @Prop() maxElements: number = 8;\n //TODO: Add Accordion variant within jump-acccordion component\n @Prop() variant: 'accordion' | 'default' = 'default';\n\n @State() values: string[] = [];\n @State() value: string = '';\n @State() slotItems: any;\n @State() inputs: any = [];\n @State() showMore: boolean = true;\n\n @Event({ eventName: 'jump-filterchange' }) change;\n\n slotItemsWrapper: HTMLSlotElement;\n showMoreBtn: HTMLElement;\n\n @Method('getValues')\n async getValues() {\n return this.values;\n }\n\n @Method('getActiveAmount')\n async getActiveAmount() {\n return this.values.length;\n }\n\n @Method('getInputs')\n async getInputs() {\n return this.inputs;\n }\n\n @Method('getName')\n async getName() {\n return this.name;\n }\n\n toggleHiddenItems(showAll = true) {\n this.slotItemsWrapper.assignedElements().forEach((item, index) => {\n if (index > this.maxElements && !showAll) {\n item.setAttribute('style', 'display: none');\n } else {\n item.setAttribute('style', 'display: initial');\n }\n });\n }\n\n handleShowMore() {\n this.showMore = !this.showMore;\n this.toggleHiddenItems(this.showMore);\n }\n\n handleChange(event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const newValue = target.value;\n\n if (target.tagName === 'INPUT') {\n if (target.type === 'checkbox') {\n // @ts-ignore\n if (target.checked) {\n this.values.push(newValue);\n } else {\n const index = this.values.indexOf(newValue);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n } else if (target.type === 'radio') {\n // Se è un input radio selezionato, imposta il valore e aggiorna this.values\n this.value = newValue;\n this.values = [newValue]; // Assicurati che this.values contenga solo il valore selezionato\n }\n } else if (target.tagName === 'SELECT') {\n // Se è un select, aggiorna semplicemente il valore\n this.value = newValue;\n this.values = [newValue];\n }\n\n // Emit event con i valori aggiornati\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n handleCheckboxChange(event: CustomEvent) {\n if (event.detail.checked && !this.values.includes(event.detail.value)) {\n this.values.push(event.detail.value);\n } else if (!event.detail.checked && this.values.includes(event.detail.value)) {\n const index = this.values.indexOf(event.detail.value);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n componentDidLoad() {\n this.slotItems = this.slotItemsWrapper.assignedElements();\n this.slotItemsWrapper.addEventListener('change', this.handleChange.bind(this));\n this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));\n\n let index = 0;\n this.slotItems.forEach((item) => {\n if (index > this.maxElements) {\n //item.setAttribute('data-hide', 'true');\n item.style.display = 'none';\n }\n if (item.tagName === 'INPUT' || item.tagName === 'SELECT') {\n this.inputs.push(item);\n if (item.tagName === 'INPUT' && item.type === 'radio') {\n item.name = this.name;\n }\n } else {\n const inputs = item.querySelectorAll('input, select');\n if (inputs.length > 0) {\n inputs.forEach((input) => {\n this.inputs.push(input);\n\n if (input.tagName === 'INPUT' && input.type === 'radio') {\n input.name = this.name;\n }\n });\n }\n }\n index++;\n });\n\n //this.toggleHiddenItems();\n }\n\n render() {\n return (\n <Host>\n {this.heading && <h5>{this.heading}</h5>}\n <div class=\"filterGroup\">\n <slot ref={(el) => (this.slotItemsWrapper = el as HTMLSlotElement)}></slot>\n </div>\n {this.inputs.length > this.maxElements &&\n <jump-button variant=\"primary\" size=\"small\" text name={this.showMore ? this.otherLabel : this.lessLabel}\n aria-label={this.showMore ? this.otherLabel : this.lessLabel}\n ref={(showMoreBtn) => {\n this.showMoreBtn = showMoreBtn;\n }}\n onClick={() => this.handleShowMore()}>\n {this.showMore ? this.otherLabel : this.lessLabel}\n <jump-icon slot=\"suffix\" name={this.showMore ? 'chevron-down' : 'chevron-up'}></jump-icon>\n </jump-button>\n }\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"jump-filtergroup.entry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IAAI,EAAE,CAAC,IAAI,CAAC,QAAQ,GAAG,cAAc,GAAG,YAAY,GAAc,CAC/E,CAEX,EACP;KACH;;;;;;;;;","names":[],"sources":["src/components/jump-filtergroup/jump-filtergroup.scss?tag=jump-filtergroup&encapsulation=shadow","src/components/jump-filtergroup/jump-filtergroup.tsx"],"sourcesContent":[":host {\n --hidden-display: none;\n --font-family: var(--ff-primary, 'Inter'), serif;\n --font-size: var(--fs-400, 16px);\n --line-height: var(--lh-300, 1.2);\n --font-weight: var(--fw-900, 700);\n --color: var(--neutral-grey-primary, #282828);\n --distance-items: .25rem;\n\n display: block;\n\n h5 {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: var(--line-height);\n font-weight: var(--font-weight);\n color: var(--color);\n margin: 0 0 var(--distance-items, .25rem);\n }\n\n slot {\n display: flex;\n flex-direction: column;\n margin-bottom: 1rem;\n }\n\n ::slotted(.item) {\n max-height: 500px;\n transition: all 0.3s ease-in-out;\n margin-top: var(--distance-items, .25rem);\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: .25rem;\n }\n\n ::slotted(.hidden) {\n max-height: 0;\n overflow: hidden;\n }\n}\n\n\n","import { Component, Host, h, Prop, State, Event, Method, Watch } from '@stencil/core';\n\n@Component({\n tag: 'jump-filtergroup',\n styleUrl: 'jump-filtergroup.scss',\n shadow: true,\n})\nexport class JumpFiltergroup {\n @Prop() name: string = 'tax-name';\n @Prop() heading: string = 'Titolo del filtro';\n @Prop() otherLabel: string = 'Mostra altro';\n @Prop() lessLabel: string = 'Mostra meno';\n @Prop() maxElements: number = 8;\n //TODO: Add Accordion variant within jump-acccordion component\n @Prop() variant: 'accordion' | 'default' = 'default';\n\n @State() label: string = this.otherLabel;\n @State() values: string[] = [];\n @State() value: string = '';\n @State() slotItems: any;\n @State() inputs: any = [];\n @State() showMore: boolean = false;\n\n @Event({ eventName: 'jump-filterchange' }) change;\n\n slotItemsWrapper: HTMLSlotElement;\n showMoreBtn: HTMLElement;\n\n @Watch('showMore')\n watchShowMore(newValue: boolean) {\n this.label = newValue ? this.lessLabel : this.otherLabel;\n }\n\n @Method('getValues')\n async getValues() {\n return this.values;\n }\n\n @Method('getActiveAmount')\n async getActiveAmount() {\n return this.values.length;\n }\n\n @Method('getInputs')\n async getInputs() {\n return this.inputs;\n }\n\n @Method('getName')\n async getName() {\n return this.name;\n }\n\n toggleHiddenItems() {\n this.slotItemsWrapper.assignedElements().forEach((item, index) => {\n if (index > this.maxElements) {\n if (this.showMore) {\n item.classList.remove('hidden');\n } else {\n item.classList.add('hidden');\n }\n }\n });\n }\n\n handleShowMore() {\n this.showMore = !this.showMore;\n this.toggleHiddenItems();\n }\n\n handleChange(event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const newValue = target.value;\n\n if (target.tagName === 'INPUT') {\n if (target.type === 'checkbox') {\n // @ts-ignore\n if (target.checked) {\n this.values.push(newValue);\n } else {\n const index = this.values.indexOf(newValue);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n } else if (target.type === 'radio') {\n // Se è un input radio selezionato, imposta il valore e aggiorna this.values\n this.value = newValue;\n this.values = [newValue]; // Assicurati che this.values contenga solo il valore selezionato\n }\n } else if (target.tagName === 'SELECT') {\n // Se è un select, aggiorna semplicemente il valore\n this.value = newValue;\n this.values = [newValue];\n }\n\n // Emit event con i valori aggiornati\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n handleCheckboxChange(event: CustomEvent) {\n if (event.detail.checked && !this.values.includes(event.detail.value)) {\n this.values.push(event.detail.value);\n } else if (!event.detail.checked && this.values.includes(event.detail.value)) {\n const index = this.values.indexOf(event.detail.value);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n componentDidLoad() {\n this.slotItems = this.slotItemsWrapper.assignedElements();\n this.slotItemsWrapper.addEventListener('change', this.handleChange.bind(this));\n this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));\n\n let index = 0;\n this.slotItems.forEach((item) => {\n item.classList.add('item');\n if (index > this.maxElements) {\n item.classList.add('hidden');\n }\n //if (item.tagName start with jump-\n if (item.tagName === 'INPUT' || item.tagName === 'SELECT' || item.tagName.startsWith('JUMP-') || item.tagName === 'LABEL') {\n this.inputs.push(item);\n if (item.tagName === 'INPUT' && item.type === 'radio') {\n item.name = this.name;\n }\n } else {\n const inputs = item.querySelectorAll('input, select');\n if (inputs.length > 0) {\n inputs.forEach((input) => {\n this.inputs.push(input);\n\n if (input.tagName === 'INPUT' && input.type === 'radio') {\n input.name = this.name;\n }\n });\n }\n }\n index++;\n });\n\n //this.toggleHiddenItems();\n }\n\n render() {\n return (\n <Host>\n {this.heading && <h5>{this.heading}</h5>}\n <div class=\"filterGroup\">\n <slot ref={(el) => (this.slotItemsWrapper = el as HTMLSlotElement)}></slot>\n </div>\n {this.inputs.length > this.maxElements &&\n <jump-button variant=\"primary\" size=\"small\" text name={this.label}\n aria-label={this.label}\n ref={(showMoreBtn) => {\n this.showMoreBtn = showMoreBtn;\n }}\n onClick={() => this.handleShowMore()}>\n {this.label}\n <jump-icon slot=\"suffix\" name={!this.showMore ? 'chevron-down' : 'chevron-up'}></jump-icon>\n </jump-button>\n }\n </Host>\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"],"hasSlotForFavorite":[4,"has-slot-for-favorite"],"favoriteHref":[1,"favorite-href"],"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"],"isMini":[4,"is-mini"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32],"priceFormatted":[32],"salePriceFormatted":[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],"heading":[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-accordion",[[1,"jump-accordion",{"variant":[1],"summary":[1],"disabled":[4],"open":[516],"icon":[1],"identifier":[1]},[[0,"sl-show","handleShow"]]]]],["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-group",[[1,"jump-accordion-group",{"variant":[1],"groupIdentifier":[1,"group-identifier"]}]]],["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-filter-checkbox",[[1,"jump-filter-checkbox",{"value":[1],"label":[1],"checked":[516],"count":[8],"isChecked":[64]}]]],["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);
|
|
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"],"hasSlotForFavorite":[4,"has-slot-for-favorite"],"favoriteHref":[1,"favorite-href"],"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"],"isMini":[4,"is-mini"],"addedToCart":[4,"added-to-cart"],"endAddedToCart":[4,"end-added-to-cart"],"variations":[32],"selectedVariation":[32],"priceFormatted":[32],"salePriceFormatted":[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],"heading":[1],"otherLabel":[1,"other-label"],"lessLabel":[1,"less-label"],"maxElements":[2,"max-elements"],"variant":[1],"label":[32],"values":[32],"value":[32],"slotItems":[32],"inputs":[32],"showMore":[32],"getValues":[64],"getActiveAmount":[64],"getInputs":[64],"getName":[64]},null,{"showMore":["watchShowMore"]}]]],["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-accordion",[[1,"jump-accordion",{"variant":[1],"summary":[1],"disabled":[4],"open":[516],"icon":[1],"identifier":[1]},[[0,"sl-show","handleShow"]]]]],["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-group",[[1,"jump-accordion-group",{"variant":[1],"groupIdentifier":[1,"group-identifier"]}]]],["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-filter-checkbox",[[1,"jump-filter-checkbox",{"value":[1],"label":[1],"checked":[516],"count":[8],"isChecked":[64]}]]],["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-d4c681a4.js";export{s as setNonce}from"./p-d4c681a4.js";import{g as a}from"./p-e1255160.js";var 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-b72b9130",[[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-52754e07",[[1,"jump-card-ecommerce",{onlyIconButton:[4,"only-icon-button"],hasBackground:[4,"has-background"],badge:[1],favorite:[1540],hasFavorite:[4,"has-favorite"],hasSlotForFavorite:[4,"has-slot-for-favorite"],favoriteHref:[1,"favorite-href"],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"],isMini:[4,"is-mini"],addedToCart:[4,"added-to-cart"],endAddedToCart:[4,"end-added-to-cart"],variations:[32],selectedVariation:[32],priceFormatted:[32],salePriceFormatted:[32]},[[0,"jump-card-ecommerce-option-connected","addOption"]]]]],["p-93c35d1f",[[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-
|
|
1
|
+
import{p as e,b as t}from"./p-d4c681a4.js";export{s as setNonce}from"./p-d4c681a4.js";import{g as a}from"./p-e1255160.js";var 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-b72b9130",[[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-52754e07",[[1,"jump-card-ecommerce",{onlyIconButton:[4,"only-icon-button"],hasBackground:[4,"has-background"],badge:[1],favorite:[1540],hasFavorite:[4,"has-favorite"],hasSlotForFavorite:[4,"has-slot-for-favorite"],favoriteHref:[1,"favorite-href"],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"],isMini:[4,"is-mini"],addedToCart:[4,"added-to-cart"],endAddedToCart:[4,"end-added-to-cart"],variations:[32],selectedVariation:[32],priceFormatted:[32],salePriceFormatted:[32]},[[0,"jump-card-ecommerce-option-connected","addOption"]]]]],["p-93c35d1f",[[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-273ff8ec",[[1,"jump-filtergroup",{name:[1],heading:[1],otherLabel:[1,"other-label"],lessLabel:[1,"less-label"],maxElements:[2,"max-elements"],variant:[1],label:[32],values:[32],value:[32],slotItems:[32],inputs:[32],showMore:[32],getValues:[64],getActiveAmount:[64],getInputs:[64],getName:[64]},null,{showMore:["watchShowMore"]}]]],["p-d1553b58",[[1,"jump-pagination",{pagLabel:[1,"pag-label"],last:[2],showFirstAndLast:[4,"show-first-and-last"],current:[32]},null,{current:["watchcurrent"]}]]],["p-d1586b59",[[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-91d68f85",[[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-8e0e49fb",[[1,"jump-accordion",{variant:[1],summary:[1],disabled:[4],open:[516],icon:[1],identifier:[1]},[[0,"sl-show","handleShow"]]]]],["p-701fa0cf",[[1,"jump-tab-item",{identifier:[1],iconName:[1,"icon-name"],iconPosition:[1,"icon-position"],label:[1],active:[4],disabled:[4],variant:[32]}]]],["p-34cd550e",[[1,"jump-accordion-group",{variant:[1],groupIdentifier:[1,"group-identifier"]}]]],["p-6872b29d",[[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-aedff4de",[[1,"jump-card-ecommerce-option",{code:[1],imgUrl:[1,"img-url"],label:[1],sku:[1],taxonomy:[1]}]]],["p-0f44f465",[[1,"jump-filter-checkbox",{value:[1],label:[1],checked:[516],count:[8],isChecked:[64]}]]],["p-99739ce5",[[1,"jump-tab",{tabGroupName:[1,"tab-group-name"],variant:[1]},[[0,"jump-change-active-tab","changeActiveTabHandler"]]]]],["p-4eda6db0",[[1,"jump-tab-panel",{identifier:[1],active:[4]}]]],["p-7e81b433",[[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","hasSlotForFavorite","favoriteHref","link","img","imgAlt","hoverImg","hoverImgAlt","videoSrc","notificationUrl","notificationText","productName","subtitle","productId","price","salePrice","currency","outOfStock","outOfStockText","addToCartText","waitingListText","addToWaitingList","isMini","addedToCart","endAddedToCart","variations","selectedVariation","priceFormatted","salePriceFormatted","direction","filterHeading","filterButtonLabel","filterButtonIcon","mobileThreshold","filters","activeFilters","showMobileFilters","isMobile","getFilters","heading","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","summary","open","icon","identifier","iconName","iconPosition","active","groupIdentifier","horizontal","dark","shadow","border","borderRadius","topBorderContentRadius","boxed","roundedMedia","imgSrc","code","imgUrl","sku","taxonomy","checked","count","isChecked","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.18.2 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || 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};\nvar 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 if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\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":"0HAOA,IAAIA,EAAe,KAUjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACrBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACjD,CACE,OAAOC,EAAeJ,EAAK,EClB7BH,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,mBAAA,4BAAAC,aAAA,oBAAAC,KAAA,IAAAC,IAAA,IAAAC,OAAA,cAAAC,SAAA,gBAAAC,YAAA,oBAAAC,SAAA,gBAAAC,gBAAA,uBAAAC,iBAAA,wBAAAC,YAAA,mBAAAC,SAAA,IAAAC,UAAA,iBAAAC,MAAA,IAAAC,UAAA,iBAAAC,SAAA,IAAAC,WAAA,sBAAAC,eAAA,wBAAAC,cAAA,uBAAAC,gBAAA,wBAAAC,iBAAA,0BAAAC,OAAA,cAAAC,YAAA,oBAAAC,eAAA,wBAAAC,WAAA,KAAAC,kBAAA,KAAAC,eAAA,KAAAC,mBAAA,mGAAAC,UAAA,IAAAC,cAAA,qBAAAC,kBAAA,0BAAAC,iBAAA,yBAAAC,gBAAA,uBAAAC,QAAA,IAAAC,cAAA,KAAAC,kBAAA,KAAAC,SAAA,KAAAC,WAAA,2HAAAnD,KAAA,IAAAoD,QAAA,IAAAC,WAAA,kBAAAC,UAAA,iBAAAC,YAAA,mBAAAhE,QAAA,
|
|
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","hasSlotForFavorite","favoriteHref","link","img","imgAlt","hoverImg","hoverImgAlt","videoSrc","notificationUrl","notificationText","productName","subtitle","productId","price","salePrice","currency","outOfStock","outOfStockText","addToCartText","waitingListText","addToWaitingList","isMini","addedToCart","endAddedToCart","variations","selectedVariation","priceFormatted","salePriceFormatted","direction","filterHeading","filterButtonLabel","filterButtonIcon","mobileThreshold","filters","activeFilters","showMobileFilters","isMobile","getFilters","heading","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","summary","open","icon","identifier","iconName","iconPosition","active","groupIdentifier","horizontal","dark","shadow","border","borderRadius","topBorderContentRadius","boxed","roundedMedia","imgSrc","code","imgUrl","sku","taxonomy","checked","count","isChecked","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.18.2 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || 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};\nvar 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 if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\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 bootstr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,QAAA,WAAAL,EAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as i,h as s,H as e}from"./p-d4c681a4.js";const h=':host{--hidden-display:none;--font-family:var(--ff-primary, "Inter"), serif;--font-size:var(--fs-400, 16px);--line-height:var(--lh-300, 1.2);--font-weight:var(--fw-900, 700);--color:var(--neutral-grey-primary, #282828);--distance-items:.25rem;display:block}:host h5{font-family:var(--font-family);font-size:var(--font-size);line-height:var(--line-height);font-weight:var(--font-weight);color:var(--color);margin:0 0 var(--distance-items, 0.25rem)}:host slot{display:flex;flex-direction:column;margin-bottom:1rem}:host ::slotted(.item){max-height:500px;transition:all 0.3s ease-in-out;margin-top:var(--distance-items, 0.25rem);display:flex;align-items:center;justify-content:flex-start;gap:0.25rem}:host ::slotted(.hidden){max-height:0;overflow:hidden}';const a=h;const n=class{constructor(s){t(this,s);this.change=i(this,"jump-filterchange",7);this.name="tax-name";this.heading="Titolo del filtro";this.otherLabel="Mostra altro";this.lessLabel="Mostra meno";this.maxElements=8;this.variant="default";this.label=this.otherLabel;this.values=[];this.value="";this.slotItems=undefined;this.inputs=[];this.showMore=false}watchShowMore(t){this.label=t?this.lessLabel:this.otherLabel}async getValues(){return this.values}async getActiveAmount(){return this.values.length}async getInputs(){return this.inputs}async getName(){return this.name}toggleHiddenItems(){this.slotItemsWrapper.assignedElements().forEach(((t,i)=>{if(i>this.maxElements){if(this.showMore){t.classList.remove("hidden")}else{t.classList.add("hidden")}}}))}handleShowMore(){this.showMore=!this.showMore;this.toggleHiddenItems()}handleChange(t){const i=t.target;const s=i.value;if(i.tagName==="INPUT"){if(i.type==="checkbox"){if(i.checked){this.values.push(s)}else{const t=this.values.indexOf(s);if(t!==-1){this.values.splice(t,1)}}}else if(i.type==="radio"){this.value=s;this.values=[s]}}else if(i.tagName==="SELECT"){this.value=s;this.values=[s]}this.change.emit({name:this.name,values:this.values})}handleCheckboxChange(t){if(t.detail.checked&&!this.values.includes(t.detail.value)){this.values.push(t.detail.value)}else if(!t.detail.checked&&this.values.includes(t.detail.value)){const i=this.values.indexOf(t.detail.value);if(i!==-1){this.values.splice(i,1)}}this.change.emit({name:this.name,values:this.values})}componentDidLoad(){this.slotItems=this.slotItemsWrapper.assignedElements();this.slotItemsWrapper.addEventListener("change",this.handleChange.bind(this));this.slotItemsWrapper.addEventListener("jump-checkbox-change",this.handleCheckboxChange.bind(this));let t=0;this.slotItems.forEach((i=>{i.classList.add("item");if(t>this.maxElements){i.classList.add("hidden")}if(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName.startsWith("JUMP-")||i.tagName==="LABEL"){this.inputs.push(i);if(i.tagName==="INPUT"&&i.type==="radio"){i.name=this.name}}else{const t=i.querySelectorAll("input, select");if(t.length>0){t.forEach((t=>{this.inputs.push(t);if(t.tagName==="INPUT"&&t.type==="radio"){t.name=this.name}}))}}t++}))}render(){return s(e,{key:"7d3b79b574cb9b46501ea0482c6d3cc1fbb98e1f"},this.heading&&s("h5",{key:"68f2dd39f94fb905d9ea151cfbf946080abf1883"},this.heading),s("div",{key:"3975c6ca04b3bd077eef48dd93311299c4cb2308",class:"filterGroup"},s("slot",{key:"c45798ed4fa32dc7baa18aa183740b5ad589b87b",ref:t=>this.slotItemsWrapper=t})),this.inputs.length>this.maxElements&&s("jump-button",{key:"068c3456f098fd7d58f943964338ff0416507797",variant:"primary",size:"small",text:true,name:this.label,"aria-label":this.label,ref:t=>{this.showMoreBtn=t},onClick:()=>this.handleShowMore()},this.label,s("jump-icon",{key:"7e0b01f499ff2af6948120711d09f84dd70e4039",slot:"suffix",name:!this.showMore?"chevron-down":"chevron-up"})))}static get watchers(){return{showMore:["watchShowMore"]}}};n.style=a;export{n as jump_filtergroup};
|
|
2
|
+
//# sourceMappingURL=p-273ff8ec.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["jumpFiltergroupCss","JumpFiltergroupStyle0","JumpFiltergroup","this","otherLabel","watchShowMore","newValue","label","lessLabel","getValues","values","getActiveAmount","length","getInputs","inputs","getName","name","toggleHiddenItems","slotItemsWrapper","assignedElements","forEach","item","index","maxElements","showMore","classList","remove","add","handleShowMore","handleChange","event","target","value","tagName","type","checked","push","indexOf","splice","change","emit","handleCheckboxChange","detail","includes","componentDidLoad","slotItems","addEventListener","bind","startsWith","querySelectorAll","input","render","h","Host","key","heading","class","ref","el","variant","size","text","showMoreBtn","onClick","slot"],"sources":["src/components/jump-filtergroup/jump-filtergroup.scss?tag=jump-filtergroup&encapsulation=shadow","src/components/jump-filtergroup/jump-filtergroup.tsx"],"sourcesContent":[":host {\n --hidden-display: none;\n --font-family: var(--ff-primary, 'Inter'), serif;\n --font-size: var(--fs-400, 16px);\n --line-height: var(--lh-300, 1.2);\n --font-weight: var(--fw-900, 700);\n --color: var(--neutral-grey-primary, #282828);\n --distance-items: .25rem;\n\n display: block;\n\n h5 {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: var(--line-height);\n font-weight: var(--font-weight);\n color: var(--color);\n margin: 0 0 var(--distance-items, .25rem);\n }\n\n slot {\n display: flex;\n flex-direction: column;\n margin-bottom: 1rem;\n }\n\n ::slotted(.item) {\n max-height: 500px;\n transition: all 0.3s ease-in-out;\n margin-top: var(--distance-items, .25rem);\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: .25rem;\n }\n\n ::slotted(.hidden) {\n max-height: 0;\n overflow: hidden;\n }\n}\n\n\n","import { Component, Host, h, Prop, State, Event, Method, Watch } from '@stencil/core';\n\n@Component({\n tag: 'jump-filtergroup',\n styleUrl: 'jump-filtergroup.scss',\n shadow: true,\n})\nexport class JumpFiltergroup {\n @Prop() name: string = 'tax-name';\n @Prop() heading: string = 'Titolo del filtro';\n @Prop() otherLabel: string = 'Mostra altro';\n @Prop() lessLabel: string = 'Mostra meno';\n @Prop() maxElements: number = 8;\n //TODO: Add Accordion variant within jump-acccordion component\n @Prop() variant: 'accordion' | 'default' = 'default';\n\n @State() label: string = this.otherLabel;\n @State() values: string[] = [];\n @State() value: string = '';\n @State() slotItems: any;\n @State() inputs: any = [];\n @State() showMore: boolean = false;\n\n @Event({ eventName: 'jump-filterchange' }) change;\n\n slotItemsWrapper: HTMLSlotElement;\n showMoreBtn: HTMLElement;\n\n @Watch('showMore')\n watchShowMore(newValue: boolean) {\n this.label = newValue ? this.lessLabel : this.otherLabel;\n }\n\n @Method('getValues')\n async getValues() {\n return this.values;\n }\n\n @Method('getActiveAmount')\n async getActiveAmount() {\n return this.values.length;\n }\n\n @Method('getInputs')\n async getInputs() {\n return this.inputs;\n }\n\n @Method('getName')\n async getName() {\n return this.name;\n }\n\n toggleHiddenItems() {\n this.slotItemsWrapper.assignedElements().forEach((item, index) => {\n if (index > this.maxElements) {\n if (this.showMore) {\n item.classList.remove('hidden');\n } else {\n item.classList.add('hidden');\n }\n }\n });\n }\n\n handleShowMore() {\n this.showMore = !this.showMore;\n this.toggleHiddenItems();\n }\n\n handleChange(event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const newValue = target.value;\n\n if (target.tagName === 'INPUT') {\n if (target.type === 'checkbox') {\n // @ts-ignore\n if (target.checked) {\n this.values.push(newValue);\n } else {\n const index = this.values.indexOf(newValue);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n } else if (target.type === 'radio') {\n // Se è un input radio selezionato, imposta il valore e aggiorna this.values\n this.value = newValue;\n this.values = [newValue]; // Assicurati che this.values contenga solo il valore selezionato\n }\n } else if (target.tagName === 'SELECT') {\n // Se è un select, aggiorna semplicemente il valore\n this.value = newValue;\n this.values = [newValue];\n }\n\n // Emit event con i valori aggiornati\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n handleCheckboxChange(event: CustomEvent) {\n if (event.detail.checked && !this.values.includes(event.detail.value)) {\n this.values.push(event.detail.value);\n } else if (!event.detail.checked && this.values.includes(event.detail.value)) {\n const index = this.values.indexOf(event.detail.value);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n componentDidLoad() {\n this.slotItems = this.slotItemsWrapper.assignedElements();\n this.slotItemsWrapper.addEventListener('change', this.handleChange.bind(this));\n this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));\n\n let index = 0;\n this.slotItems.forEach((item) => {\n item.classList.add('item');\n if (index > this.maxElements) {\n item.classList.add('hidden');\n }\n //if (item.tagName start with jump-\n if (item.tagName === 'INPUT' || item.tagName === 'SELECT' || item.tagName.startsWith('JUMP-') || item.tagName === 'LABEL') {\n this.inputs.push(item);\n if (item.tagName === 'INPUT' && item.type === 'radio') {\n item.name = this.name;\n }\n } else {\n const inputs = item.querySelectorAll('input, select');\n if (inputs.length > 0) {\n inputs.forEach((input) => {\n this.inputs.push(input);\n\n if (input.tagName === 'INPUT' && input.type === 'radio') {\n input.name = this.name;\n }\n });\n }\n }\n index++;\n });\n\n //this.toggleHiddenItems();\n }\n\n render() {\n return (\n <Host>\n {this.heading && <h5>{this.heading}</h5>}\n <div class=\"filterGroup\">\n <slot ref={(el) => (this.slotItemsWrapper = el as HTMLSlotElement)}></slot>\n </div>\n {this.inputs.length > this.maxElements &&\n <jump-button variant=\"primary\" size=\"small\" text name={this.label}\n aria-label={this.label}\n ref={(showMoreBtn) => {\n this.showMoreBtn = showMoreBtn;\n }}\n onClick={() => this.handleShowMore()}>\n {this.label}\n <jump-icon slot=\"suffix\" name={!this.showMore ? 'chevron-down' : 'chevron-up'}></jump-icon>\n </jump-button>\n }\n </Host>\n );\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAqB,kvBAC3B,MAAAC,EAAeD,E,MCMFE,EAAe,M,6EACH,W,aACG,oB,gBACG,e,eACD,c,iBACE,E,aAEa,U,WAElBC,KAAKC,W,YACF,G,WACH,G,qCAEF,G,cACM,K,CAQ7B,aAAAC,CAAcC,GACZH,KAAKI,MAAQD,EAAWH,KAAKK,UAAYL,KAAKC,U,CAIhD,eAAMK,GACJ,OAAON,KAAK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,aACzB6B,EAAA,eAAAE,IAAA,2CAAaK,QAAQ,UAAUC,KAAK,QAAQC,KAAI,KAAC7C,KAAMb,KAAKI,MAAK,aACxCJ,KAAKI,MACjBkD,IAAMK,IACJ3D,KAAK2D,YAAcA,CAAW,EAEhCC,QAAS,IAAM5D,KAAKyB,kBAC9BzB,KAAKI,MACN6C,EAAA,aAAAE,IAAA,2CAAWU,KAAK,SAAShD,MAAOb,KAAKqB,SAAW,eAAiB,gB"}
|
|
@@ -5,6 +5,7 @@ export declare class JumpFiltergroup {
|
|
|
5
5
|
lessLabel: string;
|
|
6
6
|
maxElements: number;
|
|
7
7
|
variant: 'accordion' | 'default';
|
|
8
|
+
label: string;
|
|
8
9
|
values: string[];
|
|
9
10
|
value: string;
|
|
10
11
|
slotItems: any;
|
|
@@ -13,11 +14,12 @@ export declare class JumpFiltergroup {
|
|
|
13
14
|
change: any;
|
|
14
15
|
slotItemsWrapper: HTMLSlotElement;
|
|
15
16
|
showMoreBtn: HTMLElement;
|
|
17
|
+
watchShowMore(newValue: boolean): void;
|
|
16
18
|
getValues(): Promise<string[]>;
|
|
17
19
|
getActiveAmount(): Promise<number>;
|
|
18
20
|
getInputs(): Promise<any>;
|
|
19
21
|
getName(): Promise<string>;
|
|
20
|
-
toggleHiddenItems(
|
|
22
|
+
toggleHiddenItems(): void;
|
|
21
23
|
handleShowMore(): void;
|
|
22
24
|
handleChange(event: Event): void;
|
|
23
25
|
handleCheckboxChange(event: CustomEvent): void;
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e}from"./p-d4c681a4.js";const h=":host{--hidden-display:none;display:block}:host h5{font-family:var(--ff-primary), serif;font-size:var(--fs-400);line-height:var(--lh-300);font-weight:var(--fw-900)}:host slot{display:flex;flex-direction:column;gap:0.25rem;margin-bottom:1rem}*[data-hide=true]{display:var(--hidden-display)}h5{margin:0 0 0.25rem}";const a=h;const n=class{constructor(s){t(this,s);this.change=i(this,"jump-filterchange",7);this.name="tax-name";this.heading="Titolo del filtro";this.otherLabel="Mostra altro";this.lessLabel="Mostra meno";this.maxElements=8;this.variant="default";this.values=[];this.value="";this.slotItems=undefined;this.inputs=[];this.showMore=true}async getValues(){return this.values}async getActiveAmount(){return this.values.length}async getInputs(){return this.inputs}async getName(){return this.name}toggleHiddenItems(t=true){this.slotItemsWrapper.assignedElements().forEach(((i,s)=>{if(s>this.maxElements&&!t){i.setAttribute("style","display: none")}else{i.setAttribute("style","display: initial")}}))}handleShowMore(){this.showMore=!this.showMore;this.toggleHiddenItems(this.showMore)}handleChange(t){const i=t.target;const s=i.value;if(i.tagName==="INPUT"){if(i.type==="checkbox"){if(i.checked){this.values.push(s)}else{const t=this.values.indexOf(s);if(t!==-1){this.values.splice(t,1)}}}else if(i.type==="radio"){this.value=s;this.values=[s]}}else if(i.tagName==="SELECT"){this.value=s;this.values=[s]}this.change.emit({name:this.name,values:this.values})}handleCheckboxChange(t){if(t.detail.checked&&!this.values.includes(t.detail.value)){this.values.push(t.detail.value)}else if(!t.detail.checked&&this.values.includes(t.detail.value)){const i=this.values.indexOf(t.detail.value);if(i!==-1){this.values.splice(i,1)}}this.change.emit({name:this.name,values:this.values})}componentDidLoad(){this.slotItems=this.slotItemsWrapper.assignedElements();this.slotItemsWrapper.addEventListener("change",this.handleChange.bind(this));this.slotItemsWrapper.addEventListener("jump-checkbox-change",this.handleCheckboxChange.bind(this));let t=0;this.slotItems.forEach((i=>{if(t>this.maxElements){i.style.display="none"}if(i.tagName==="INPUT"||i.tagName==="SELECT"){this.inputs.push(i);if(i.tagName==="INPUT"&&i.type==="radio"){i.name=this.name}}else{const t=i.querySelectorAll("input, select");if(t.length>0){t.forEach((t=>{this.inputs.push(t);if(t.tagName==="INPUT"&&t.type==="radio"){t.name=this.name}}))}}t++}))}render(){return s(e,{key:"045985358fca061c90927a20b4c151cfd2fa9f99"},this.heading&&s("h5",{key:"8555c17428efebcc4fe267556d058f344821125c"},this.heading),s("div",{key:"7053c6a0eb8df8242e7eec49c1eb08c81354b1d6",class:"filterGroup"},s("slot",{key:"22bef57eb5de8599d85950c8c54fd2d4b33380a1",ref:t=>this.slotItemsWrapper=t})),this.inputs.length>this.maxElements&&s("jump-button",{key:"59007765335212a6c5377dd74ed0111d8d19e290",variant:"primary",size:"small",text:true,name:this.showMore?this.otherLabel:this.lessLabel,"aria-label":this.showMore?this.otherLabel:this.lessLabel,ref:t=>{this.showMoreBtn=t},onClick:()=>this.handleShowMore()},this.showMore?this.otherLabel:this.lessLabel,s("jump-icon",{key:"cdb2ebb1458763cfd456eaf223213802a449ba96",slot:"suffix",name:this.showMore?"chevron-down":"chevron-up"})))}};n.style=a;export{n as jump_filtergroup};
|
|
2
|
-
//# sourceMappingURL=p-fa75b346.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["jumpFiltergroupCss","JumpFiltergroupStyle0","JumpFiltergroup","getValues","this","values","getActiveAmount","length","getInputs","inputs","getName","name","toggleHiddenItems","showAll","slotItemsWrapper","assignedElements","forEach","item","index","maxElements","setAttribute","handleShowMore","showMore","handleChange","event","target","newValue","value","tagName","type","checked","push","indexOf","splice","change","emit","handleCheckboxChange","detail","includes","componentDidLoad","slotItems","addEventListener","bind","style","display","querySelectorAll","input","render","h","Host","key","heading","class","ref","el","variant","size","text","otherLabel","lessLabel","showMoreBtn","onClick","slot"],"sources":["src/components/jump-filtergroup/jump-filtergroup.scss?tag=jump-filtergroup&encapsulation=shadow","src/components/jump-filtergroup/jump-filtergroup.tsx"],"sourcesContent":[":host {\n --hidden-display: none;\n\n display: block;\n\n h5{\n font-family: var(--ff-primary), serif;\n font-size: var(--fs-400);\n line-height: var(--lh-300);\n font-weight: var(--fw-900);\n }\n\n slot {\n display: flex;\n flex-direction: column;\n gap: .25rem;\n margin-bottom: 1rem;\n }\n\n}\n\n*[data-hide=\"true\"] {\n display: var(--hidden-display);\n}\n\nh5 {\n margin: 0 0 .25rem;\n}\n\n//TODO: capire perché non prende questo stile\n\n\n","import { Component, Host, h, Prop, State, Event, Method } from '@stencil/core';\n\n@Component({\n tag: 'jump-filtergroup',\n styleUrl: 'jump-filtergroup.scss',\n shadow: true,\n})\nexport class JumpFiltergroup {\n @Prop() name: string = 'tax-name';\n @Prop() heading: string = 'Titolo del filtro';\n @Prop() otherLabel: string = 'Mostra altro';\n @Prop() lessLabel: string = 'Mostra meno';\n @Prop() maxElements: number = 8;\n //TODO: Add Accordion variant within jump-acccordion component\n @Prop() variant: 'accordion' | 'default' = 'default';\n\n @State() values: string[] = [];\n @State() value: string = '';\n @State() slotItems: any;\n @State() inputs: any = [];\n @State() showMore: boolean = true;\n\n @Event({ eventName: 'jump-filterchange' }) change;\n\n slotItemsWrapper: HTMLSlotElement;\n showMoreBtn: HTMLElement;\n\n @Method('getValues')\n async getValues() {\n return this.values;\n }\n\n @Method('getActiveAmount')\n async getActiveAmount() {\n return this.values.length;\n }\n\n @Method('getInputs')\n async getInputs() {\n return this.inputs;\n }\n\n @Method('getName')\n async getName() {\n return this.name;\n }\n\n toggleHiddenItems(showAll = true) {\n this.slotItemsWrapper.assignedElements().forEach((item, index) => {\n if (index > this.maxElements && !showAll) {\n item.setAttribute('style', 'display: none');\n } else {\n item.setAttribute('style', 'display: initial');\n }\n });\n }\n\n handleShowMore() {\n this.showMore = !this.showMore;\n this.toggleHiddenItems(this.showMore);\n }\n\n handleChange(event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const newValue = target.value;\n\n if (target.tagName === 'INPUT') {\n if (target.type === 'checkbox') {\n // @ts-ignore\n if (target.checked) {\n this.values.push(newValue);\n } else {\n const index = this.values.indexOf(newValue);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n } else if (target.type === 'radio') {\n // Se è un input radio selezionato, imposta il valore e aggiorna this.values\n this.value = newValue;\n this.values = [newValue]; // Assicurati che this.values contenga solo il valore selezionato\n }\n } else if (target.tagName === 'SELECT') {\n // Se è un select, aggiorna semplicemente il valore\n this.value = newValue;\n this.values = [newValue];\n }\n\n // Emit event con i valori aggiornati\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n handleCheckboxChange(event: CustomEvent) {\n if (event.detail.checked && !this.values.includes(event.detail.value)) {\n this.values.push(event.detail.value);\n } else if (!event.detail.checked && this.values.includes(event.detail.value)) {\n const index = this.values.indexOf(event.detail.value);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n componentDidLoad() {\n this.slotItems = this.slotItemsWrapper.assignedElements();\n this.slotItemsWrapper.addEventListener('change', this.handleChange.bind(this));\n this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));\n\n let index = 0;\n this.slotItems.forEach((item) => {\n if (index > this.maxElements) {\n //item.setAttribute('data-hide', 'true');\n item.style.display = 'none';\n }\n if (item.tagName === 'INPUT' || item.tagName === 'SELECT') {\n this.inputs.push(item);\n if (item.tagName === 'INPUT' && item.type === 'radio') {\n item.name = this.name;\n }\n } else {\n const inputs = item.querySelectorAll('input, select');\n if (inputs.length > 0) {\n inputs.forEach((input) => {\n this.inputs.push(input);\n\n if (input.tagName === 'INPUT' && input.type === 'radio') {\n input.name = this.name;\n }\n });\n }\n }\n index++;\n });\n\n //this.toggleHiddenItems();\n }\n\n render() {\n return (\n <Host>\n {this.heading && <h5>{this.heading}</h5>}\n <div class=\"filterGroup\">\n <slot ref={(el) => (this.slotItemsWrapper = el as HTMLSlotElement)}></slot>\n </div>\n {this.inputs.length > this.maxElements &&\n <jump-button variant=\"primary\" size=\"small\" text name={this.showMore ? this.otherLabel : this.lessLabel}\n aria-label={this.showMore ? this.otherLabel : this.lessLabel}\n ref={(showMoreBtn) => {\n this.showMoreBtn = showMoreBtn;\n }}\n onClick={() => this.handleShowMore()}>\n {this.showMore ? this.otherLabel : this.lessLabel}\n <jump-icon slot=\"suffix\" name={this.showMore ? 'chevron-down' : 'chevron-up'}></jump-icon>\n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