@jumpgroup/jump-design-system 0.3.68 → 0.3.69

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.
@@ -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"],"hasSlotAddToCart":[4,"has-slot-add-to-cart"],"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],"addToCartColor":[1,"add-to-cart-color"],"badgeColor":[1,"badge-color"],"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],"setPrice":[64]},[[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],"showCount":[4,"show-count"],"offCanvasOverlay":[4,"off-canvas-overlay"],"activeFilters":[32],"showMobileFilters":[32],"isMobile":[32],"offCanvasClasses":[32],"getFilters":[64]},[[0,"jump-filterchange","filterChangeHandler"],[9,"resize","handleResize"]],{"showMobileFilters":["watchHandler"]}]]],["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-navbar.cjs",[[1,"jump-navbar",{"logo":[16],"navItems":[16],"secondaryNavItems":[16],"mobileThreshold":[2,"mobile-threshold"],"type":[1],"navPosition":[1,"nav-position"],"megaMenuAlignment":[1,"mega-menu-alignment"],"sticky":[4],"stickyThreshold":[2,"sticky-threshold"],"mobileLogo":[16],"user":[16],"isMobile":[32]},[[9,"resize","handleResize"]]]]],["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"],"elPerPage":[2,"el-per-page"],"pagLabel":[513,"pag-label"],"labelElementsPerPage":[513,"label-elements-per-page"],"total":[514],"first":[514],"last":[514],"showFirstAndLast":[516,"show-first-and-last"],"elementsRangesArray":[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],"internalValue":[32],"getValue":[64],"setMax":[64],"reset":[64]},null,{"value":["onValueChange"]}]]],["jump-search-bar.cjs",[[1,"jump-search-bar",{"placeholder":[1],"noResultText":[1,"no-result-text"],"loadingText":[1,"loading-text"],"resultsText":[1,"results-text"],"showAllResText":[1,"show-all-res-text"],"identifier":[1],"debounceTime":[2,"debounce-time"],"variant":[1],"withBtn":[4,"with-btn"],"recentsTitle":[1,"recents-title"],"recents":[16],"results":[16],"dropdown":[4],"linearIconOnly":[4,"linear-icon-only"],"dropdownPosition":[1,"dropdown-position"],"dropdownVisible":[32],"searchValue":[32],"resType":[32],"innerResults":[32],"totalResults":[32],"isExpanded":[32],"setResults":[64]},[[0,"jump-search-bar-dropdown-item-connected","addOption"]],{"searchValue":["searchValueChanged"]}]]],["jump-search-bar-mobile.cjs",[[1,"jump-search-bar-mobile",{"identifier":[1],"placeholder":[1],"recents":[16],"recentsTitle":[1,"recents-title"],"debounceTime":[2,"debounce-time"],"loadingText":[1,"loading-text"],"noResultText":[1,"no-result-text"],"results":[16],"resultsText":[1,"results-text"],"showAllResText":[1,"show-all-res-text"],"isOpen":[32],"innerResults":[32],"totalResults":[32],"resType":[32],"searchValue":[32],"setResults":[64]},[[0,"jump-search-bar-dropdown-item-connected","addOption"]],{"searchValue":["searchValueChanged"]}]]],["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-filter-select.cjs",[[1,"jump-filter-select",{"value":[1537],"placeholder":[1],"label":[1],"options":[1],"disabled":[516],"multiple":[4],"required":[4],"loading":[4],"open":[32],"hasSlottedOptions":[32],"getSelectedValue":[64],"getSelectedOption":[64],"setValue":[64]}]]],["jump-filter-switch.cjs",[[1,"jump-filter-switch",{"value":[1],"label":[1],"name":[1],"checked":[1540],"disabled":[516],"values":[32],"setValue":[64],"isChecked":[64],"getValues":[64],"getName":[64]},null,{"checked":["checkedChanged"]}]]],["jump-search-bar-dropdown-item.cjs",[[1,"jump-search-bar-dropdown-item",{"value":[1],"img":[1],"href":[1],"details":[32]}]]],["jump-tab.cjs",[[1,"jump-tab",{"disabled":[4],"alignment":[1],"fullBorder":[4,"full-border"],"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"],"hasSlotAddToCart":[4,"has-slot-add-to-cart"],"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],"addToCartColor":[1,"add-to-cart-color"],"badgeColor":[1,"badge-color"],"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],"setPrice":[64]},[[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],"showCount":[4,"show-count"],"offCanvasOverlay":[4,"off-canvas-overlay"],"activeFilters":[32],"showMobileFilters":[32],"isMobile":[32],"offCanvasClasses":[32],"getFilters":[64]},[[0,"jump-filterchange","filterChangeHandler"],[9,"resize","handleResize"]],{"showMobileFilters":["watchHandler"]}]]],["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-navbar.cjs",[[1,"jump-navbar",{"logo":[16],"navItems":[16],"secondaryNavItems":[16],"mobileThreshold":[2,"mobile-threshold"],"type":[1],"navPosition":[1,"nav-position"],"megaMenuAlignment":[1,"mega-menu-alignment"],"sticky":[4],"stickyThreshold":[2,"sticky-threshold"],"mobileLogo":[16],"user":[16],"isMobile":[32]},[[9,"resize","handleResize"]]]]],["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"],"elPerPage":[2,"el-per-page"],"pagLabel":[513,"pag-label"],"labelElementsPerPage":[513,"label-elements-per-page"],"total":[514],"first":[514],"last":[514],"showFirstAndLast":[516,"show-first-and-last"],"elementsRangesArray":[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],"internalValue":[32],"getValue":[64],"setMax":[64],"reset":[64]},null,{"value":["onValueChange"]}]]],["jump-search-bar.cjs",[[1,"jump-search-bar",{"placeholder":[1],"noResultText":[1,"no-result-text"],"loadingText":[1,"loading-text"],"resultsText":[1,"results-text"],"showAllResText":[1,"show-all-res-text"],"identifier":[1],"debounceTime":[2,"debounce-time"],"variant":[1],"withBtn":[4,"with-btn"],"recentsTitle":[1,"recents-title"],"recents":[16],"results":[16],"dropdown":[4],"linearIconOnly":[4,"linear-icon-only"],"dropdownPosition":[1,"dropdown-position"],"dropdownVisible":[32],"searchValue":[32],"resType":[32],"innerResults":[32],"totalResults":[32],"isExpanded":[32],"setResults":[64]},[[0,"jump-search-bar-dropdown-item-connected","addOption"]],{"searchValue":["searchValueChanged"]}]]],["jump-search-bar-mobile.cjs",[[1,"jump-search-bar-mobile",{"identifier":[1],"placeholder":[1],"recents":[16],"recentsTitle":[1,"recents-title"],"debounceTime":[2,"debounce-time"],"loadingText":[1,"loading-text"],"noResultText":[1,"no-result-text"],"results":[16],"resultsText":[1,"results-text"],"showAllResText":[1,"show-all-res-text"],"isOpen":[32],"innerResults":[32],"totalResults":[32],"resType":[32],"searchValue":[32],"setResults":[64]},[[0,"jump-search-bar-dropdown-item-connected","addOption"]],{"searchValue":["searchValueChanged"]}]]],["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-filter-select.cjs",[[1,"jump-filter-select",{"value":[1537],"placeholder":[1],"label":[1],"name":[1],"options":[1],"disabled":[516],"multiple":[4],"required":[4],"loading":[4],"open":[32],"hasSlottedOptions":[32],"values":[32],"getSelectedValue":[64],"getSelectedOption":[64],"getValues":[64],"getName":[64],"setValue":[64]}]]],["jump-filter-switch.cjs",[[1,"jump-filter-switch",{"value":[1],"label":[1],"name":[1],"checked":[1540],"disabled":[516],"values":[32],"setValue":[64],"isChecked":[64],"getValues":[64],"getName":[64]},null,{"checked":["checkedChanged"]}]]],["jump-search-bar-dropdown-item.cjs",[[1,"jump-search-bar-dropdown-item",{"value":[1],"img":[1],"href":[1],"details":[32]}]]],["jump-tab.cjs",[[1,"jump-tab",{"disabled":[4],"alignment":[1],"fullBorder":[4,"full-border"],"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;
@@ -10,6 +10,7 @@ export class JumpFilterSelect {
10
10
  this.value = undefined;
11
11
  this.placeholder = 'Seleziona un\'opzione';
12
12
  this.label = undefined;
13
+ this.name = 'select-filter';
13
14
  this.options = [];
14
15
  this.disabled = false;
15
16
  this.multiple = false;
@@ -17,6 +18,7 @@ export class JumpFilterSelect {
17
18
  this.loading = false;
18
19
  this.open = false;
19
20
  this.hasSlottedOptions = false;
21
+ this.values = [];
20
22
  }
21
23
  /**
22
24
  * Controlla se ci sono opzioni definite come slot
@@ -41,8 +43,16 @@ export class JumpFilterSelect {
41
43
  }
42
44
  return this.options;
43
45
  }
46
+ /**
47
+ * Aggiorna l'array dei valori in base al valore selezionato
48
+ */
49
+ updateValues() {
50
+ this.values = this.value ? [this.value] : [];
51
+ }
44
52
  componentDidLoad() {
45
53
  this.listenSLChange();
54
+ // Inizializza l'array dei valori
55
+ this.updateValues();
46
56
  }
47
57
  /**
48
58
  * Ascolta gli eventi di cambio selezione dal select Shoelace
@@ -54,14 +64,23 @@ export class JumpFilterSelect {
54
64
  return;
55
65
  }
56
66
  this.value = event.target.value;
67
+ this.updateValues();
57
68
  const optionsArray = this.getOptionsArray();
58
69
  const selectedOption = optionsArray.find(option => option.value === this.value);
59
- const eventData = {
70
+ // Evento specifico per il componente select
71
+ const selectEventData = {
72
+ value: this.value,
73
+ selectedOption
74
+ };
75
+ this.selectionChange.emit(selectEventData);
76
+ // Evento standard per il sistema di filtri
77
+ const filterEventData = {
78
+ name: this.name,
79
+ values: this.values,
60
80
  value: this.value,
61
81
  selectedOption
62
82
  };
63
- this.selectionChange.emit(eventData);
64
- this.selectionFilterChange.emit(eventData);
83
+ this.selectionFilterChange.emit(filterEventData);
65
84
  });
66
85
  }
67
86
  }
@@ -80,6 +99,20 @@ export class JumpFilterSelect {
80
99
  const optionsArray = this.getOptionsArray();
81
100
  return optionsArray.find(option => option.value === this.value);
82
101
  }
102
+ /**
103
+ * Metodo pubblico per ottenere i valori selezionati come array
104
+ * @returns Array contenente il valore selezionato o un array vuoto
105
+ */
106
+ async getValues() {
107
+ return this.values;
108
+ }
109
+ /**
110
+ * Metodo pubblico per ottenere il nome del filtro
111
+ * @returns Il nome del filtro
112
+ */
113
+ async getName() {
114
+ return this.name;
115
+ }
83
116
  /**
84
117
  * Metodo pubblico per impostare programmaticamente il valore selezionato
85
118
  * @param newValue - Il nuovo valore da selezionare
@@ -87,7 +120,18 @@ export class JumpFilterSelect {
87
120
  * @returns Il nuovo valore impostato
88
121
  */
89
122
  async setValue(newValue, emitEvent = true) {
123
+ // Se il componente è disabilitato, non fare nulla
124
+ if (this.disabled) {
125
+ return this.value;
126
+ }
127
+ // Salva il valore precedente per l'evento
128
+ const oldValue = this.value;
129
+ // Non fare nulla se il valore non è cambiato
130
+ if (oldValue === newValue) {
131
+ return this.value;
132
+ }
90
133
  this.value = newValue;
134
+ this.updateValues();
91
135
  // Aggiorna anche il valore dell'elemento sl-select interno
92
136
  if (this.el) {
93
137
  this.el.value = newValue;
@@ -96,19 +140,36 @@ export class JumpFilterSelect {
96
140
  if (emitEvent) {
97
141
  const optionsArray = this.getOptionsArray();
98
142
  const selectedOption = optionsArray.find(option => option.value === this.value);
99
- const eventData = {
143
+ // Evento specifico per il componente select
144
+ const selectEventData = {
100
145
  value: this.value,
146
+ oldValue: oldValue,
101
147
  selectedOption,
102
148
  programmatic: true // Flag per indicare che il cambio è avvenuto programmaticamente
103
149
  };
104
- this.selectionChange.emit(eventData);
105
- this.selectionFilterChange.emit(eventData);
150
+ this.selectionChange.emit(selectEventData);
151
+ // Evento standard per il sistema di filtri
152
+ const filterEventData = {
153
+ name: this.name,
154
+ values: this.values,
155
+ value: this.value,
156
+ oldValue: oldValue,
157
+ selectedOption,
158
+ programmatic: true
159
+ };
160
+ this.selectionFilterChange.emit(filterEventData);
161
+ // Evento specifico per cambio programmato
162
+ this.valueChange.emit({
163
+ value: this.value,
164
+ oldValue: oldValue,
165
+ selectedOption
166
+ });
106
167
  }
107
168
  return this.value;
108
169
  }
109
170
  render() {
110
171
  const optionsArray = this.getOptionsArray();
111
- return (h(Host, { key: '3bbb46b827ae88ce31d6c1da17fc75b6da4269ec', ref: (host) => (this.host = host) }, this.label && (h("div", { key: 'c0d89bc2668692fe9920a20aaf45a5ad9989d7b2', class: "select-label" }, this.label)), h("sl-select", { key: '299284224f4981547900d0bcb215747ebc17d22c', value: this.value, placeholder: this.placeholder, disabled: this.disabled, multiple: this.multiple, required: this.required, loading: this.loading, ref: (el) => (this.el = el) }, !this.hasSlottedOptions && optionsArray.map(option => (h("sl-option", { value: option.value }, option.label))), h("slot", { key: 'f481903e85538e396e4d270e4545dbd8024ed7ef' }))));
172
+ return (h(Host, { key: '26ecef5862a3d5ef1d903ac9dad378027841d78c', ref: (host) => (this.host = host) }, this.label && (h("div", { key: '24bc20afb81ebe4b760889b3be866cc4c94b43f4', class: "select-label" }, this.label)), h("sl-select", { key: '7b578cf8ab02dd40df93848af918c51f7061bbbe', value: this.value, placeholder: this.placeholder, disabled: this.disabled, multiple: this.multiple, required: this.required, loading: this.loading, ref: (el) => (this.el = el) }, !this.hasSlottedOptions && optionsArray.map(option => (h("sl-option", { value: option.value }, option.label))), h("slot", { key: 'dc85029632cf9c9f6b00b72c4f9a83a8281e25dc' }))));
112
173
  }
113
174
  static get is() { return "jump-filter-select"; }
114
175
  static get encapsulation() { return "shadow"; }
@@ -176,6 +237,24 @@ export class JumpFilterSelect {
176
237
  "attribute": "label",
177
238
  "reflect": false
178
239
  },
240
+ "name": {
241
+ "type": "string",
242
+ "mutable": false,
243
+ "complexType": {
244
+ "original": "string",
245
+ "resolved": "string",
246
+ "references": {}
247
+ },
248
+ "required": false,
249
+ "optional": false,
250
+ "docs": {
251
+ "tags": [],
252
+ "text": "Nome identificativo del filtro, utilizzato negli eventi"
253
+ },
254
+ "attribute": "name",
255
+ "reflect": false,
256
+ "defaultValue": "'select-filter'"
257
+ },
179
258
  "options": {
180
259
  "type": "string",
181
260
  "mutable": false,
@@ -271,7 +350,8 @@ export class JumpFilterSelect {
271
350
  static get states() {
272
351
  return {
273
352
  "open": {},
274
- "hasSlottedOptions": {}
353
+ "hasSlottedOptions": {},
354
+ "values": {}
275
355
  };
276
356
  }
277
357
  static get events() {
@@ -305,6 +385,21 @@ export class JumpFilterSelect {
305
385
  "resolved": "any",
306
386
  "references": {}
307
387
  }
388
+ }, {
389
+ "method": "valueChange",
390
+ "name": "jump-select-value-change",
391
+ "bubbles": true,
392
+ "cancelable": true,
393
+ "composed": true,
394
+ "docs": {
395
+ "tags": [],
396
+ "text": "Evento emesso quando il valore viene cambiato programmaticamente"
397
+ },
398
+ "complexType": {
399
+ "original": "any",
400
+ "resolved": "any",
401
+ "references": {}
402
+ }
308
403
  }];
309
404
  }
310
405
  static get methods() {
@@ -349,6 +444,46 @@ export class JumpFilterSelect {
349
444
  }]
350
445
  }
351
446
  },
447
+ "getValues": {
448
+ "complexType": {
449
+ "signature": "() => Promise<string[]>",
450
+ "parameters": [],
451
+ "references": {
452
+ "Promise": {
453
+ "location": "global",
454
+ "id": "global::Promise"
455
+ }
456
+ },
457
+ "return": "Promise<string[]>"
458
+ },
459
+ "docs": {
460
+ "text": "Metodo pubblico per ottenere i valori selezionati come array",
461
+ "tags": [{
462
+ "name": "returns",
463
+ "text": "Array contenente il valore selezionato o un array vuoto"
464
+ }]
465
+ }
466
+ },
467
+ "getName": {
468
+ "complexType": {
469
+ "signature": "() => Promise<string>",
470
+ "parameters": [],
471
+ "references": {
472
+ "Promise": {
473
+ "location": "global",
474
+ "id": "global::Promise"
475
+ }
476
+ },
477
+ "return": "Promise<string>"
478
+ },
479
+ "docs": {
480
+ "text": "Metodo pubblico per ottenere il nome del filtro",
481
+ "tags": [{
482
+ "name": "returns",
483
+ "text": "Il nome del filtro"
484
+ }]
485
+ }
486
+ },
352
487
  "setValue": {
353
488
  "complexType": {
354
489
  "signature": "(newValue: string, emitEvent?: boolean) => Promise<string>",
@@ -1 +1 @@
1
- {"version":3,"file":"jump-filter-select.js","sourceRoot":"","sources":["../../../src/components/jump-filter-select/jump-filter-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,2DAA2D,CAAC;AACnE,OAAO,2DAA2D,CAAC;AAEnE;;;GAGG;AAMH,MAAM,OAAO,gBAAgB;;;2BAQG,uBAAuB;;uBAMU,EAAE;wBAGpB,KAAK;wBAGtB,KAAK;wBAGL,KAAK;uBAGN,KAAK;oBAGP,KAAK;iCAGQ,KAAK;;IAQ3C;;OAEG;IACH,mBAAmB;QACjB,6DAA6D;QAC7D,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;QAC9C,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,IA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,CAAC;QAE5C,OAAO,CACL,EAAC,IAAI,qDAAC,GAAG,EAAE,CAAC,IAAiB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjD,IAAI,CAAC,KAAK,IAAI,CACb,4DAAK,KAAK,EAAC,cAAc,IAAE,IAAI,CAAC,KAAK,CAAO,CAC7C;YACD,kEACE,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,GAAG,EAAE,CAAC,EAAO,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;gBAG/B,CAAC,IAAI,CAAC,iBAAiB,IAAI,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CACrD,iBAAW,KAAK,EAAE,MAAM,CAAC,KAAK,IAAG,MAAM,CAAC,KAAK,CAAa,CAC3D,CAAC;gBAGF,8DAAa,CACH,CACP,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter, Method, State, Element } from '@stencil/core';\nimport '@shoelace-style/shoelace/dist/components/select/select.js';\nimport '@shoelace-style/shoelace/dist/components/option/option.js';\n\n/**\n * Componente select per filtri con supporto per opzioni e stato\n * @slot - Contenitore per elementi sl-option quando le opzioni sono definite come figli\n */\n@Component({\n tag: 'jump-filter-select',\n styleUrl: 'jump-filter-select.scss',\n shadow: true,\n})\nexport class JumpFilterSelect {\n /** Riferimento all'elemento host */\n @Element() hostElement: HTMLElement;\n\n /** Il valore selezionato */\n @Prop({ reflect: true, mutable: true }) value: string;\n\n /** Il placeholder da mostrare quando nessun valore è selezionato */\n @Prop() placeholder: string = 'Seleziona un\\'opzione';\n\n /** L'etichetta del select */\n @Prop() label: string;\n\n /** Opzioni del select come array di oggetti {value, label} o come stringa JSON */\n @Prop() options: string | { value: string; label: string }[] = [];\n\n /** Stato del select (disabilitato) */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Flag per indicare se è possibile selezionare più opzioni */\n @Prop() multiple: boolean = false;\n\n /** Flag per indicare se la selezione è obbligatoria */\n @Prop() required: boolean = false;\n\n /** Flag per indicare se il select è in stato di caricamento */\n @Prop() loading: boolean = false;\n\n /** Stato interno per gestire l'apertura del dropdown */\n @State() open: boolean = false;\n\n /** Flag per determinare se sono presenti opzioni come slot */\n @State() hasSlottedOptions: boolean = false;\n\n /** Riferimento all'elemento host */\n host: HTMLElement;\n\n /** Riferimento all'elemento sl-select interno */\n el: any;\n\n /**\n * Controlla se ci sono opzioni definite come slot\n */\n componentWillRender() {\n // Verifica se ci sono elementi sl-option definiti come figli\n const slotNodes = this.hostElement.childNodes;\n this.hasSlottedOptions = Array.from(slotNodes).some(node =>\n node.nodeName && node.nodeName.toLowerCase() === 'sl-option'\n );\n }\n\n /**\n * Converte le opzioni da string o array a array di oggetti\n */\n private getOptionsArray(): { value: string; label: string }[] {\n if (typeof this.options === 'string') {\n try {\n return JSON.parse(this.options);\n } catch (e) {\n console.error('Errore nel parsing delle opzioni:', e);\n return [];\n }\n }\n return this.options;\n }\n\n componentDidLoad() {\n this.listenSLChange();\n }\n\n /**\n * Ascolta gli eventi di cambio selezione dal select Shoelace\n */\n listenSLChange() {\n if (this.host) {\n this.host.addEventListener('sl-change', (event: any) => {\n if (this.disabled) {\n return;\n }\n\n this.value = event.target.value;\n\n const optionsArray = this.getOptionsArray();\n const selectedOption = optionsArray.find(option => option.value === this.value);\n\n const eventData = {\n value: this.value,\n selectedOption\n };\n\n this.selectionChange.emit(eventData);\n this.selectionFilterChange.emit(eventData);\n });\n }\n }\n\n /**\n * Evento emesso quando cambia la selezione\n */\n @Event({ eventName: 'jump-select-change' }) selectionChange: EventEmitter;\n @Event({ eventName: 'jump-filterchange' }) selectionFilterChange: EventEmitter;\n\n /**\n * Metodo pubblico per ottenere il valore selezionato\n * @returns Il valore attualmente selezionato\n */\n @Method()\n async getSelectedValue() {\n return this.value;\n }\n\n /**\n * Metodo pubblico per ottenere l'opzione selezionata\n * @returns L'opzione attualmente selezionata come oggetto {value, label}\n */\n @Method()\n async getSelectedOption() {\n const optionsArray = this.getOptionsArray();\n return optionsArray.find(option => option.value === this.value);\n }\n\n /**\n * Metodo pubblico per impostare programmaticamente il valore selezionato\n * @param newValue - Il nuovo valore da selezionare\n * @param emitEvent - Se emettere l'evento di cambio (default: true)\n * @returns Il nuovo valore impostato\n */\n @Method()\n async setValue(newValue: string, emitEvent: boolean = true) {\n this.value = newValue;\n\n // Aggiorna anche il valore dell'elemento sl-select interno\n if (this.el) {\n this.el.value = newValue;\n }\n\n // Emetti l'evento di cambio se richiesto\n if (emitEvent) {\n const optionsArray = this.getOptionsArray();\n const selectedOption = optionsArray.find(option => option.value === this.value);\n\n const eventData = {\n value: this.value,\n selectedOption,\n programmatic: true // Flag per indicare che il cambio è avvenuto programmaticamente\n };\n\n this.selectionChange.emit(eventData);\n this.selectionFilterChange.emit(eventData);\n }\n\n return this.value;\n }\n\n render() {\n const optionsArray = this.getOptionsArray();\n\n return (\n <Host ref={(host: HTMLElement) => (this.host = host)}>\n {this.label && (\n <div class=\"select-label\">{this.label}</div>\n )}\n <sl-select\n value={this.value}\n placeholder={this.placeholder}\n disabled={this.disabled}\n multiple={this.multiple}\n required={this.required}\n loading={this.loading}\n ref={(el: any) => (this.el = el)}\n >\n {/* Renderizza le opzioni dalla prop options solo se non ci sono sl-option nello slot */}\n {!this.hasSlottedOptions && optionsArray.map(option => (\n <sl-option value={option.value}>{option.label}</sl-option>\n ))}\n\n {/* Slot per le opzioni definite come figli */}\n <slot></slot>\n </sl-select>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"jump-filter-select.js","sourceRoot":"","sources":["../../../src/components/jump-filter-select/jump-filter-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,2DAA2D,CAAC;AACnE,OAAO,2DAA2D,CAAC;AAEnE;;;GAGG;AAMH,MAAM,OAAO,gBAAgB;;;2BAQG,uBAAuB;;oBAM9B,eAAe;uBAGyB,EAAE;wBAGpB,KAAK;wBAGtB,KAAK;wBAGL,KAAK;uBAGN,KAAK;oBAGP,KAAK;iCAGQ,KAAK;sBAGf,EAAE;;IAQ9B;;OAEG;IACH,mBAAmB;QACjB,6DAA6D;QAC7D,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;QAC9C,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACzD,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,WAAW,CAC7D,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,eAAe;QACrB,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACrC,IAAI,CAAC;gBACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAClC,CAAC;YAAC,OAAO,CAA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EAAE,IAAI,CAAC,KAAK,EACjB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,GAAG,EAAE,CAAC,EAAO,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;gBAG/B,CAAC,IAAI,CAAC,iBAAiB,IAAI,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CACrD,iBAAW,KAAK,EAAE,MAAM,CAAC,KAAK,IAAG,MAAM,CAAC,KAAK,CAAa,CAC3D,CAAC;gBAGF,8DAAa,CACH,CACP,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter, Method, State, Element } from '@stencil/core';\nimport '@shoelace-style/shoelace/dist/components/select/select.js';\nimport '@shoelace-style/shoelace/dist/components/option/option.js';\n\n/**\n * Componente select per filtri con supporto per opzioni e stato\n * @slot - Contenitore per elementi sl-option quando le opzioni sono definite come figli\n */\n@Component({\n tag: 'jump-filter-select',\n styleUrl: 'jump-filter-select.scss',\n shadow: true,\n})\nexport class JumpFilterSelect {\n /** Riferimento all'elemento host */\n @Element() hostElement: HTMLElement;\n\n /** Il valore selezionato */\n @Prop({ reflect: true, mutable: true }) value: string;\n\n /** Il placeholder da mostrare quando nessun valore è selezionato */\n @Prop() placeholder: string = 'Seleziona un\\'opzione';\n\n /** L'etichetta del select */\n @Prop() label: string;\n\n /** Nome identificativo del filtro, utilizzato negli eventi */\n @Prop() name: string = 'select-filter';\n \n /** Opzioni del select come array di oggetti {value, label} o come stringa JSON */\n @Prop() options: string | { value: string; label: string }[] = [];\n\n /** Stato del select (disabilitato) */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Flag per indicare se è possibile selezionare più opzioni */\n @Prop() multiple: boolean = false;\n\n /** Flag per indicare se la selezione è obbligatoria */\n @Prop() required: boolean = false;\n\n /** Flag per indicare se il select è in stato di caricamento */\n @Prop() loading: boolean = false;\n\n /** Stato interno per gestire l'apertura del dropdown */\n @State() open: boolean = false;\n\n /** Flag per determinare se sono presenti opzioni come slot */\n @State() hasSlottedOptions: boolean = false;\n \n /** Stato interno per tenere traccia dei valori selezionati come array per compatibilità con gli altri filtri */\n @State() values: string[] = [];\n\n /** Riferimento all'elemento host */\n host: HTMLElement;\n\n /** Riferimento all'elemento sl-select interno */\n el: any;\n\n /**\n * Controlla se ci sono opzioni definite come slot\n */\n componentWillRender() {\n // Verifica se ci sono elementi sl-option definiti come figli\n const slotNodes = this.hostElement.childNodes;\n this.hasSlottedOptions = Array.from(slotNodes).some(node =>\n node.nodeName && node.nodeName.toLowerCase() === 'sl-option'\n );\n }\n\n /**\n * Converte le opzioni da string o array a array di oggetti\n */\n private getOptionsArray(): { value: string; label: string }[] {\n if (typeof this.options === 'string') {\n try {\n return JSON.parse(this.options);\n } catch (e) {\n console.error('Errore nel parsing delle opzioni:', e);\n return [];\n }\n }\n return this.options;\n }\n \n /**\n * Aggiorna l'array dei valori in base al valore selezionato\n */\n private updateValues() {\n this.values = this.value ? [this.value] : [];\n }\n\n componentDidLoad() {\n this.listenSLChange();\n // Inizializza l'array dei valori\n this.updateValues();\n }\n\n /**\n * Ascolta gli eventi di cambio selezione dal select Shoelace\n */\n listenSLChange() {\n if (this.host) {\n this.host.addEventListener('sl-change', (event: any) => {\n if (this.disabled) {\n return;\n }\n\n this.value = event.target.value;\n this.updateValues();\n \n const optionsArray = this.getOptionsArray();\n const selectedOption = optionsArray.find(option => option.value === this.value);\n \n // Evento specifico per il componente select\n const selectEventData = {\n value: this.value,\n selectedOption\n };\n this.selectionChange.emit(selectEventData);\n \n // Evento standard per il sistema di filtri\n const filterEventData = {\n name: this.name,\n values: this.values,\n value: this.value,\n selectedOption\n };\n this.selectionFilterChange.emit(filterEventData);\n });\n }\n }\n\n /**\n * Evento emesso quando cambia la selezione\n */\n @Event({ eventName: 'jump-select-change' }) selectionChange: EventEmitter;\n @Event({ eventName: 'jump-filterchange' }) selectionFilterChange: EventEmitter;\n /**\n * Evento emesso quando il valore viene cambiato programmaticamente\n */\n @Event({ eventName: 'jump-select-value-change' }) valueChange: EventEmitter;\n\n /**\n * Metodo pubblico per ottenere il valore selezionato\n * @returns Il valore attualmente selezionato\n */\n @Method()\n async getSelectedValue() {\n return this.value;\n }\n\n /**\n * Metodo pubblico per ottenere l'opzione selezionata\n * @returns L'opzione attualmente selezionata come oggetto {value, label}\n */\n @Method()\n async getSelectedOption() {\n const optionsArray = this.getOptionsArray();\n return optionsArray.find(option => option.value === this.value);\n }\n \n /**\n * Metodo pubblico per ottenere i valori selezionati come array\n * @returns Array contenente il valore selezionato o un array vuoto\n */\n @Method()\n async getValues() {\n return this.values;\n }\n \n /**\n * Metodo pubblico per ottenere il nome del filtro\n * @returns Il nome del filtro\n */\n @Method()\n async getName() {\n return this.name;\n }\n\n /**\n * Metodo pubblico per impostare programmaticamente il valore selezionato\n * @param newValue - Il nuovo valore da selezionare\n * @param emitEvent - Se emettere l'evento di cambio (default: true)\n * @returns Il nuovo valore impostato\n */\n @Method()\n async setValue(newValue: string, emitEvent: boolean = true) {\n // Se il componente è disabilitato, non fare nulla\n if (this.disabled) {\n return this.value;\n }\n \n // Salva il valore precedente per l'evento\n const oldValue = this.value;\n \n // Non fare nulla se il valore non è cambiato\n if (oldValue === newValue) {\n return this.value;\n }\n \n this.value = newValue;\n this.updateValues();\n \n // Aggiorna anche il valore dell'elemento sl-select interno\n if (this.el) {\n this.el.value = newValue;\n }\n \n // Emetti l'evento di cambio se richiesto\n if (emitEvent) {\n const optionsArray = this.getOptionsArray();\n const selectedOption = optionsArray.find(option => option.value === this.value);\n \n // Evento specifico per il componente select\n const selectEventData = {\n value: this.value,\n oldValue: oldValue,\n selectedOption,\n programmatic: true // Flag per indicare che il cambio è avvenuto programmaticamente\n };\n this.selectionChange.emit(selectEventData);\n \n // Evento standard per il sistema di filtri\n const filterEventData = {\n name: this.name,\n values: this.values,\n value: this.value,\n oldValue: oldValue,\n selectedOption,\n programmatic: true\n };\n this.selectionFilterChange.emit(filterEventData);\n \n // Evento specifico per cambio programmato\n this.valueChange.emit({\n value: this.value,\n oldValue: oldValue,\n selectedOption\n });\n }\n\n return this.value;\n }\n\n render() {\n const optionsArray = this.getOptionsArray();\n\n return (\n <Host ref={(host: HTMLElement) => (this.host = host)}>\n {this.label && (\n <div class=\"select-label\">{this.label}</div>\n )}\n <sl-select\n value={this.value}\n placeholder={this.placeholder}\n disabled={this.disabled}\n multiple={this.multiple}\n required={this.required}\n loading={this.loading}\n ref={(el: any) => (this.el = el)}\n >\n {/* Renderizza le opzioni dalla prop options solo se non ci sono sl-option nello slot */}\n {!this.hasSlottedOptions && optionsArray.map(option => (\n <sl-option value={option.value}>{option.label}</sl-option>\n ))}\n\n {/* Slot per le opzioni definite come figli */}\n <slot></slot>\n </sl-select>\n </Host>\n );\n }\n}\n"]}
@@ -4118,9 +4118,11 @@ const JumpFilterSelect$1 = /*@__PURE__*/ proxyCustomElement(class JumpFilterSele
4118
4118
  this.__attachShadow();
4119
4119
  this.selectionChange = createEvent(this, "jump-select-change", 7);
4120
4120
  this.selectionFilterChange = createEvent(this, "jump-filterchange", 7);
4121
+ this.valueChange = createEvent(this, "jump-select-value-change", 7);
4121
4122
  this.value = undefined;
4122
4123
  this.placeholder = 'Seleziona un\'opzione';
4123
4124
  this.label = undefined;
4125
+ this.name = 'select-filter';
4124
4126
  this.options = [];
4125
4127
  this.disabled = false;
4126
4128
  this.multiple = false;
@@ -4128,6 +4130,7 @@ const JumpFilterSelect$1 = /*@__PURE__*/ proxyCustomElement(class JumpFilterSele
4128
4130
  this.loading = false;
4129
4131
  this.open = false;
4130
4132
  this.hasSlottedOptions = false;
4133
+ this.values = [];
4131
4134
  }
4132
4135
  /**
4133
4136
  * Controlla se ci sono opzioni definite come slot
@@ -4152,8 +4155,16 @@ const JumpFilterSelect$1 = /*@__PURE__*/ proxyCustomElement(class JumpFilterSele
4152
4155
  }
4153
4156
  return this.options;
4154
4157
  }
4158
+ /**
4159
+ * Aggiorna l'array dei valori in base al valore selezionato
4160
+ */
4161
+ updateValues() {
4162
+ this.values = this.value ? [this.value] : [];
4163
+ }
4155
4164
  componentDidLoad() {
4156
4165
  this.listenSLChange();
4166
+ // Inizializza l'array dei valori
4167
+ this.updateValues();
4157
4168
  }
4158
4169
  /**
4159
4170
  * Ascolta gli eventi di cambio selezione dal select Shoelace
@@ -4165,14 +4176,23 @@ const JumpFilterSelect$1 = /*@__PURE__*/ proxyCustomElement(class JumpFilterSele
4165
4176
  return;
4166
4177
  }
4167
4178
  this.value = event.target.value;
4179
+ this.updateValues();
4168
4180
  const optionsArray = this.getOptionsArray();
4169
4181
  const selectedOption = optionsArray.find(option => option.value === this.value);
4170
- const eventData = {
4182
+ // Evento specifico per il componente select
4183
+ const selectEventData = {
4184
+ value: this.value,
4185
+ selectedOption
4186
+ };
4187
+ this.selectionChange.emit(selectEventData);
4188
+ // Evento standard per il sistema di filtri
4189
+ const filterEventData = {
4190
+ name: this.name,
4191
+ values: this.values,
4171
4192
  value: this.value,
4172
4193
  selectedOption
4173
4194
  };
4174
- this.selectionChange.emit(eventData);
4175
- this.selectionFilterChange.emit(eventData);
4195
+ this.selectionFilterChange.emit(filterEventData);
4176
4196
  });
4177
4197
  }
4178
4198
  }
@@ -4191,6 +4211,20 @@ const JumpFilterSelect$1 = /*@__PURE__*/ proxyCustomElement(class JumpFilterSele
4191
4211
  const optionsArray = this.getOptionsArray();
4192
4212
  return optionsArray.find(option => option.value === this.value);
4193
4213
  }
4214
+ /**
4215
+ * Metodo pubblico per ottenere i valori selezionati come array
4216
+ * @returns Array contenente il valore selezionato o un array vuoto
4217
+ */
4218
+ async getValues() {
4219
+ return this.values;
4220
+ }
4221
+ /**
4222
+ * Metodo pubblico per ottenere il nome del filtro
4223
+ * @returns Il nome del filtro
4224
+ */
4225
+ async getName() {
4226
+ return this.name;
4227
+ }
4194
4228
  /**
4195
4229
  * Metodo pubblico per impostare programmaticamente il valore selezionato
4196
4230
  * @param newValue - Il nuovo valore da selezionare
@@ -4198,7 +4232,18 @@ const JumpFilterSelect$1 = /*@__PURE__*/ proxyCustomElement(class JumpFilterSele
4198
4232
  * @returns Il nuovo valore impostato
4199
4233
  */
4200
4234
  async setValue(newValue, emitEvent = true) {
4235
+ // Se il componente è disabilitato, non fare nulla
4236
+ if (this.disabled) {
4237
+ return this.value;
4238
+ }
4239
+ // Salva il valore precedente per l'evento
4240
+ const oldValue = this.value;
4241
+ // Non fare nulla se il valore non è cambiato
4242
+ if (oldValue === newValue) {
4243
+ return this.value;
4244
+ }
4201
4245
  this.value = newValue;
4246
+ this.updateValues();
4202
4247
  // Aggiorna anche il valore dell'elemento sl-select interno
4203
4248
  if (this.el) {
4204
4249
  this.el.value = newValue;
@@ -4207,19 +4252,36 @@ const JumpFilterSelect$1 = /*@__PURE__*/ proxyCustomElement(class JumpFilterSele
4207
4252
  if (emitEvent) {
4208
4253
  const optionsArray = this.getOptionsArray();
4209
4254
  const selectedOption = optionsArray.find(option => option.value === this.value);
4210
- const eventData = {
4255
+ // Evento specifico per il componente select
4256
+ const selectEventData = {
4211
4257
  value: this.value,
4258
+ oldValue: oldValue,
4212
4259
  selectedOption,
4213
4260
  programmatic: true // Flag per indicare che il cambio è avvenuto programmaticamente
4214
4261
  };
4215
- this.selectionChange.emit(eventData);
4216
- this.selectionFilterChange.emit(eventData);
4262
+ this.selectionChange.emit(selectEventData);
4263
+ // Evento standard per il sistema di filtri
4264
+ const filterEventData = {
4265
+ name: this.name,
4266
+ values: this.values,
4267
+ value: this.value,
4268
+ oldValue: oldValue,
4269
+ selectedOption,
4270
+ programmatic: true
4271
+ };
4272
+ this.selectionFilterChange.emit(filterEventData);
4273
+ // Evento specifico per cambio programmato
4274
+ this.valueChange.emit({
4275
+ value: this.value,
4276
+ oldValue: oldValue,
4277
+ selectedOption
4278
+ });
4217
4279
  }
4218
4280
  return this.value;
4219
4281
  }
4220
4282
  render() {
4221
4283
  const optionsArray = this.getOptionsArray();
4222
- return (h(Host, { key: '3bbb46b827ae88ce31d6c1da17fc75b6da4269ec', ref: (host) => (this.host = host) }, this.label && (h("div", { key: 'c0d89bc2668692fe9920a20aaf45a5ad9989d7b2', class: "select-label" }, this.label)), h("sl-select", { key: '299284224f4981547900d0bcb215747ebc17d22c', value: this.value, placeholder: this.placeholder, disabled: this.disabled, multiple: this.multiple, required: this.required, loading: this.loading, ref: (el) => (this.el = el) }, !this.hasSlottedOptions && optionsArray.map(option => (h("sl-option", { value: option.value }, option.label))), h("slot", { key: 'f481903e85538e396e4d270e4545dbd8024ed7ef' }))));
4284
+ return (h(Host, { key: '26ecef5862a3d5ef1d903ac9dad378027841d78c', ref: (host) => (this.host = host) }, this.label && (h("div", { key: '24bc20afb81ebe4b760889b3be866cc4c94b43f4', class: "select-label" }, this.label)), h("sl-select", { key: '7b578cf8ab02dd40df93848af918c51f7061bbbe', value: this.value, placeholder: this.placeholder, disabled: this.disabled, multiple: this.multiple, required: this.required, loading: this.loading, ref: (el) => (this.el = el) }, !this.hasSlottedOptions && optionsArray.map(option => (h("sl-option", { value: option.value }, option.label))), h("slot", { key: 'dc85029632cf9c9f6b00b72c4f9a83a8281e25dc' }))));
4223
4285
  }
4224
4286
  get hostElement() { return this; }
4225
4287
  static get style() { return JumpFilterSelectStyle0; }
@@ -4227,6 +4289,7 @@ const JumpFilterSelect$1 = /*@__PURE__*/ proxyCustomElement(class JumpFilterSele
4227
4289
  "value": [1537],
4228
4290
  "placeholder": [1],
4229
4291
  "label": [1],
4292
+ "name": [1],
4230
4293
  "options": [1],
4231
4294
  "disabled": [516],
4232
4295
  "multiple": [4],
@@ -4234,8 +4297,11 @@ const JumpFilterSelect$1 = /*@__PURE__*/ proxyCustomElement(class JumpFilterSele
4234
4297
  "loading": [4],
4235
4298
  "open": [32],
4236
4299
  "hasSlottedOptions": [32],
4300
+ "values": [32],
4237
4301
  "getSelectedValue": [64],
4238
4302
  "getSelectedOption": [64],
4303
+ "getValues": [64],
4304
+ "getName": [64],
4239
4305
  "setValue": [64]
4240
4306
  }]);
4241
4307
  function defineCustomElement$1() {