@jumpgroup/jump-design-system 0.3.71 → 0.3.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/cjs/jump-design-system.cjs.js +1 -1
  2. package/dist/cjs/jump-filter-range.cjs.entry.js +138 -0
  3. package/dist/cjs/jump-filter-range.cjs.entry.js.map +1 -0
  4. package/dist/cjs/jump-filter-select.cjs.entry.js +1 -1
  5. package/dist/cjs/jump-filter-switch.cjs.entry.js +1 -1
  6. package/dist/cjs/jump-filtergroup.cjs.entry.js +3 -3
  7. package/dist/cjs/jump-navbar.cjs.entry.js +5 -5
  8. package/dist/cjs/jump-pagination-table.cjs.entry.js +3 -3
  9. package/dist/cjs/jump-pagination.cjs.entry.js +3 -3
  10. package/dist/cjs/jump-quantity.cjs.entry.js +3 -3
  11. package/dist/cjs/jump-search-bar-dropdown-item.cjs.entry.js +1 -1
  12. package/dist/cjs/jump-search-bar-mobile.cjs.entry.js +4 -4
  13. package/dist/cjs/jump-side-cart-example.cjs.entry.js +1 -1
  14. package/dist/cjs/jump-tab-item.cjs.entry.js +2 -2
  15. package/dist/cjs/jump-tab-panel.cjs.entry.js +1 -1
  16. package/dist/cjs/jump-tab.cjs.entry.js +1 -1
  17. package/dist/cjs/loader.cjs.js +1 -1
  18. package/dist/collection/collection-manifest.json +1 -0
  19. package/dist/collection/components/jump-filter-range/jump-filter-range.css +99 -0
  20. package/dist/collection/components/jump-filter-range/jump-filter-range.js +408 -0
  21. package/dist/collection/components/jump-filter-range/jump-filter-range.js.map +1 -0
  22. package/dist/collection/components/jump-filter-range/jump-filter-range.stories.js +90 -0
  23. package/dist/collection/components/jump-filter-range/jump-filter-range.stories.js.map +1 -0
  24. package/dist/collection/components/jump-filter-select/jump-filter-select.js +1 -1
  25. package/dist/collection/components/jump-filter-switch/jump-filter-switch.js +1 -1
  26. package/dist/collection/components/jump-filtergroup/jump-filtergroup.js +3 -3
  27. package/dist/collection/components/jump-navbar/jump-navbar.js +5 -5
  28. package/dist/collection/components/jump-pagination/jump-pagination.js +3 -3
  29. package/dist/collection/components/jump-pagination-table/jump-pagination-table.js +3 -3
  30. package/dist/collection/components/jump-quantity/jump-quantity.js +3 -3
  31. package/dist/collection/components/jump-search-bar-dropdown-item/jump-search-bar-dropdown-item.js +1 -1
  32. package/dist/collection/components/jump-search-bar-mobile/jump-search-bar-mobile.js +4 -4
  33. package/dist/collection/components/jump-side-cart/jump-side-cart.example.js +1 -1
  34. package/dist/collection/components/jump-tab/jump-tab.js +1 -1
  35. package/dist/collection/components/jump-tab-item/jump-tab-item.js +2 -2
  36. package/dist/collection/components/jump-tab-panel/jump-tab-panel.js +1 -1
  37. package/dist/components/jump-filter-range.d.ts +11 -0
  38. package/dist/components/jump-filter-range.js +170 -0
  39. package/dist/components/jump-filter-range.js.map +1 -0
  40. package/dist/components/jump-filter-select.js +1 -1
  41. package/dist/components/jump-filter-switch.js +1 -1
  42. package/dist/components/jump-filtergroup.js +3 -3
  43. package/dist/components/jump-navbar.js +5 -5
  44. package/dist/components/jump-pagination-table.js +3 -3
  45. package/dist/components/jump-pagination.js +3 -3
  46. package/dist/components/jump-quantity.js +3 -3
  47. package/dist/components/jump-search-bar-dropdown-item.js +1 -1
  48. package/dist/components/jump-search-bar-mobile.js +4 -4
  49. package/dist/components/jump-side-cart-example.js +1 -1
  50. package/dist/components/jump-tab-item.js +2 -2
  51. package/dist/components/jump-tab-panel.js +1 -1
  52. package/dist/components/jump-tab.js +1 -1
  53. package/dist/esm/jump-design-system.js +1 -1
  54. package/dist/esm/jump-filter-range.entry.js +134 -0
  55. package/dist/esm/jump-filter-range.entry.js.map +1 -0
  56. package/dist/esm/jump-filter-select.entry.js +1 -1
  57. package/dist/esm/jump-filter-switch.entry.js +1 -1
  58. package/dist/esm/jump-filtergroup.entry.js +3 -3
  59. package/dist/esm/jump-navbar.entry.js +5 -5
  60. package/dist/esm/jump-pagination-table.entry.js +3 -3
  61. package/dist/esm/jump-pagination.entry.js +3 -3
  62. package/dist/esm/jump-quantity.entry.js +3 -3
  63. package/dist/esm/jump-search-bar-dropdown-item.entry.js +1 -1
  64. package/dist/esm/jump-search-bar-mobile.entry.js +4 -4
  65. package/dist/esm/jump-side-cart-example.entry.js +1 -1
  66. package/dist/esm/jump-tab-item.entry.js +2 -2
  67. package/dist/esm/jump-tab-panel.entry.js +1 -1
  68. package/dist/esm/jump-tab.entry.js +1 -1
  69. package/dist/esm/loader.js +1 -1
  70. package/dist/jump-design-system/jump-design-system.esm.js +1 -1
  71. package/dist/jump-design-system/jump-design-system.esm.js.map +1 -1
  72. package/dist/jump-design-system/{p-2e274d20.entry.js → p-048d87ee.entry.js} +2 -2
  73. package/dist/jump-design-system/{p-9279b124.entry.js → p-1f824808.entry.js} +2 -2
  74. package/dist/jump-design-system/{p-617c7cd7.entry.js → p-48bb1cbf.entry.js} +2 -2
  75. package/dist/jump-design-system/{p-fa2a10bf.entry.js → p-5092836a.entry.js} +2 -2
  76. package/dist/jump-design-system/{p-35f2032b.entry.js → p-5fb2a919.entry.js} +2 -2
  77. package/dist/jump-design-system/{p-19c6ab3f.entry.js → p-6134b84b.entry.js} +2 -2
  78. package/dist/jump-design-system/p-64024e67.entry.js +2 -0
  79. package/dist/jump-design-system/{p-4706eba4.entry.js → p-6e497dd6.entry.js} +2 -2
  80. package/dist/jump-design-system/{p-089b9c5c.entry.js → p-916742f5.entry.js} +2 -2
  81. package/dist/jump-design-system/p-9964d664.entry.js +2 -0
  82. package/dist/jump-design-system/p-9964d664.entry.js.map +1 -0
  83. package/dist/jump-design-system/{p-7a2bc23d.entry.js → p-ae1435a6.entry.js} +2 -2
  84. package/dist/jump-design-system/{p-0cdca5df.entry.js → p-b03b8328.entry.js} +2 -2
  85. package/dist/jump-design-system/{p-0432b242.entry.js → p-cdc53aae.entry.js} +2 -2
  86. package/dist/jump-design-system/{p-b8b28d8b.entry.js → p-d40c487f.entry.js} +2 -2
  87. package/dist/jump-design-system-elements.json +45 -0
  88. package/dist/types/components/jump-filter-range/jump-filter-range.d.ts +72 -0
  89. package/dist/types/components/jump-filter-range/jump-filter-range.stories.d.ts +46 -0
  90. package/dist/types/components.d.ts +124 -0
  91. package/package.json +1 -1
  92. package/dist/jump-design-system/p-cb9ab473.entry.js +0 -2
  93. /package/dist/jump-design-system/{p-2e274d20.entry.js.map → p-048d87ee.entry.js.map} +0 -0
  94. /package/dist/jump-design-system/{p-9279b124.entry.js.map → p-1f824808.entry.js.map} +0 -0
  95. /package/dist/jump-design-system/{p-617c7cd7.entry.js.map → p-48bb1cbf.entry.js.map} +0 -0
  96. /package/dist/jump-design-system/{p-fa2a10bf.entry.js.map → p-5092836a.entry.js.map} +0 -0
  97. /package/dist/jump-design-system/{p-35f2032b.entry.js.map → p-5fb2a919.entry.js.map} +0 -0
  98. /package/dist/jump-design-system/{p-19c6ab3f.entry.js.map → p-6134b84b.entry.js.map} +0 -0
  99. /package/dist/jump-design-system/{p-cb9ab473.entry.js.map → p-64024e67.entry.js.map} +0 -0
  100. /package/dist/jump-design-system/{p-4706eba4.entry.js.map → p-6e497dd6.entry.js.map} +0 -0
  101. /package/dist/jump-design-system/{p-089b9c5c.entry.js.map → p-916742f5.entry.js.map} +0 -0
  102. /package/dist/jump-design-system/{p-7a2bc23d.entry.js.map → p-ae1435a6.entry.js.map} +0 -0
  103. /package/dist/jump-design-system/{p-0cdca5df.entry.js.map → p-b03b8328.entry.js.map} +0 -0
  104. /package/dist/jump-design-system/{p-0432b242.entry.js.map → p-cdc53aae.entry.js.map} +0 -0
  105. /package/dist/jump-design-system/{p-b8b28d8b.entry.js.map → p-d40c487f.entry.js.map} +0 -0
@@ -0,0 +1,99 @@
1
+ :host {
2
+ --jump-range-track-height: 4px;
3
+ --jump-range-thumb-color: var(--neutral-white, #ffffff);
4
+ --jump-range-thumb-size: 18px;
5
+ --jump-range-fill-color: var(--secondary-standard, #5e79ba);
6
+ --jump-range-track-color: var(--gray-ultralight, #f8f8f8);
7
+ display: block;
8
+ width: 100%;
9
+ }
10
+
11
+ :host(.is-disabled) {
12
+ opacity: 0.5;
13
+ cursor: not-allowed;
14
+ --jump-range-fill-color: var(--gray-light, #e0e0e0);
15
+ }
16
+
17
+ .label-container {
18
+ display: flex;
19
+ justify-content: space-between;
20
+ margin-bottom: 0.75rem;
21
+ font-size: 0.9em;
22
+ color: #333;
23
+ }
24
+
25
+ .slider-container {
26
+ position: relative;
27
+ height: var(--jump-range-thumb-size);
28
+ display: flex;
29
+ align-items: center;
30
+ }
31
+
32
+ .slider-track,
33
+ .slider-fill {
34
+ position: absolute;
35
+ left: 0;
36
+ height: var(--jump-range-track-height);
37
+ border-radius: var(--jump-range-track-height);
38
+ width: 100%;
39
+ }
40
+
41
+ .slider-track {
42
+ background-color: var(--jump-range-track-color);
43
+ z-index: 1;
44
+ }
45
+
46
+ .slider-fill {
47
+ background-color: var(--jump-range-fill-color);
48
+ z-index: 2;
49
+ }
50
+
51
+ .range-input {
52
+ -webkit-appearance: none;
53
+ -moz-appearance: none;
54
+ appearance: none;
55
+ position: absolute;
56
+ width: 100%;
57
+ height: var(--jump-range-thumb-size);
58
+ background: transparent;
59
+ pointer-events: none;
60
+ margin: 0;
61
+ z-index: 3;
62
+ }
63
+
64
+ input[type=range]::-webkit-slider-thumb {
65
+ -webkit-appearance: none;
66
+ height: var(--jump-range-thumb-size);
67
+ width: var(--jump-range-thumb-size);
68
+ border-radius: 50%;
69
+ background: var(--jump-range-thumb-color);
70
+ border: 1px solid #ccc;
71
+ cursor: pointer;
72
+ pointer-events: auto;
73
+ margin-top: calc((var(--jump-range-thumb-size) - var(--jump-range-track-height)) / -2);
74
+ }
75
+
76
+ input[type=range]::-moz-range-thumb {
77
+ -moz-appearance: none;
78
+ height: var(--jump-range-thumb-size);
79
+ width: var(--jump-range-thumb-size);
80
+ border-radius: 50%;
81
+ background: var(--jump-range-thumb-color);
82
+ border: 1px solid #ccc;
83
+ cursor: pointer;
84
+ pointer-events: auto;
85
+ }
86
+
87
+ input[type=range]::-webkit-slider-runnable-track {
88
+ -webkit-appearance: none;
89
+ height: var(--jump-range-track-height);
90
+ background: transparent;
91
+ border: none;
92
+ }
93
+
94
+ input[type=range]::-moz-range-track {
95
+ -moz-appearance: none;
96
+ height: var(--jump-range-track-height);
97
+ background: transparent;
98
+ border: none;
99
+ }
@@ -0,0 +1,408 @@
1
+ import { Host, h } from "@stencil/core";
2
+ // La distanza minima tra i due slider, per evitare che si sovrappongano.
3
+ const MIN_GAP = 0;
4
+ export class JumpFilterRange {
5
+ constructor() {
6
+ /**
7
+ * Gestisce l'aggiornamento in tempo reale dello slider MINIMO.
8
+ * Aggiorna solo lo stato interno per un feedback visivo immediato.
9
+ */
10
+ this.handleMinInput = (event) => {
11
+ const input = event.target;
12
+ let newMinVal = parseInt(input.value, 10);
13
+ if (newMinVal > this.maxVal - MIN_GAP) {
14
+ newMinVal = this.maxVal - MIN_GAP;
15
+ input.value = newMinVal.toString();
16
+ }
17
+ this.minVal = newMinVal;
18
+ };
19
+ /**
20
+ * Gestisce l'aggiornamento in tempo reale dello slider MASSIMO.
21
+ * Aggiorna solo lo stato interno per un feedback visivo immediato.
22
+ */
23
+ this.handleMaxInput = (event) => {
24
+ const input = event.target;
25
+ let newMaxVal = parseInt(input.value, 10);
26
+ if (newMaxVal < this.minVal + MIN_GAP) {
27
+ newMaxVal = this.minVal + MIN_GAP;
28
+ input.value = newMaxVal.toString();
29
+ }
30
+ this.maxVal = newMaxVal;
31
+ };
32
+ /**
33
+ * Eseguito quando l'utente rilascia lo slider (evento onChange).
34
+ * Consolida il valore e emette l'evento finale.
35
+ */
36
+ this.handleCommit = () => {
37
+ console.log('Committing values:', this.minVal, this.maxVal);
38
+ const currentValues = [this.minVal, this.maxVal];
39
+ this.value = currentValues; // Sincronizza la prop
40
+ this.filterChange.emit({
41
+ name: this.name,
42
+ values: currentValues,
43
+ });
44
+ };
45
+ this.name = 'range-filter';
46
+ this.labelMinBefore = 'Min:';
47
+ this.labelMinAfter = '';
48
+ this.labelMaxBefore = 'Max:';
49
+ this.labelMaxAfter = '';
50
+ this.min = 0;
51
+ this.max = 100;
52
+ this.step = 1;
53
+ this.value = [];
54
+ this.disabled = false;
55
+ this.minVal = undefined;
56
+ this.maxVal = undefined;
57
+ }
58
+ valueWatcher(newValue) {
59
+ this.setComponentValues(newValue);
60
+ }
61
+ componentWillLoad() {
62
+ this.setComponentValues(this.value);
63
+ }
64
+ /**
65
+ * Imposta i valori interni del componente partendo da un array.
66
+ */
67
+ setComponentValues(values) {
68
+ if (values && values.length === 2) {
69
+ this.minVal = values[0];
70
+ this.maxVal = values[1];
71
+ }
72
+ else {
73
+ // Fallback ai valori di default se l'input non è valido
74
+ this.minVal = this.min;
75
+ this.maxVal = this.max;
76
+ }
77
+ // Sincronizza la prop `value` con lo stato interno
78
+ this.value = [this.minVal, this.maxVal];
79
+ }
80
+ /**
81
+ * Calcola lo stile per la barra di riempimento tra i due slider.
82
+ */
83
+ getFillStyle() {
84
+ const range = this.max - this.min;
85
+ if (range === 0)
86
+ return { left: '0%', width: '0%' };
87
+ const leftPercent = ((this.minVal - this.min) / range) * 100;
88
+ const rightPercent = ((this.maxVal - this.min) / range) * 100;
89
+ return { left: `${leftPercent}%`, width: `${rightPercent - leftPercent}%` };
90
+ }
91
+ /**
92
+ * Metodo pubblico per impostare il valore del filtro programmaticamente.
93
+ */
94
+ async setValue(values, emitEvent = true) {
95
+ if (this.disabled || !values || values.length !== 2) {
96
+ return this.getValues();
97
+ }
98
+ this.setComponentValues(values);
99
+ if (emitEvent) {
100
+ this.handleCommit();
101
+ }
102
+ return this.getValues();
103
+ }
104
+ /**
105
+ * Metodo pubblico per ottenere il valore corrente.
106
+ */
107
+ async getValues() {
108
+ return [this.minVal, this.maxVal];
109
+ }
110
+ /**
111
+ * Metodo pubblico per ottenere il nome del filtro.
112
+ */
113
+ async getName() {
114
+ return this.name;
115
+ }
116
+ render() {
117
+ return (h(Host, { key: '22efb08a200fb221558e31357db3ceb790b2ec62', class: { 'is-disabled': this.disabled } }, h("div", { key: '73a3d09acc2e4b05d06c1723487d7091da6979bf', class: "label-container" }, h("label", { key: '56c91ea288e74ebccf7c4969dfd1a74a56cfc99f', class: "label-min" }, this.labelMinBefore, " ", this.minVal, this.labelMinAfter), h("label", { key: 'fc374dc83e2b75648b58a3d2a444193c48db91a9', class: "label-max" }, this.labelMaxBefore, " ", this.maxVal, this.labelMaxAfter)), h("div", { key: '8ed46accf743cbef63dd0fa854b35c4f92f968ad', class: "slider-container" }, h("div", { key: 'ce33b796cad574e5094de1689aaab19ed82d6ddf', class: "slider-track" }), h("div", { key: '68495fbe0c68db2fc22884af8b62189b88270b4e', class: "slider-fill", style: this.getFillStyle() }), h("input", { key: 'c640ab76cd1b4c3a61354a813d5633e0b4234112', type: "range", min: this.min, max: this.max, step: this.step, value: this.minVal, onInput: this.handleMinInput, onChange: this.handleCommit, disabled: this.disabled, class: "range-input", "aria-label": this.labelMinBefore }), h("input", { key: 'd77b371d8be9fec561a5e9f447249aac4e4d252a', type: "range", min: this.min, max: this.max, step: this.step, value: this.maxVal, onInput: this.handleMaxInput, onChange: this.handleCommit, disabled: this.disabled, class: "range-input", "aria-label": this.labelMaxBefore }))));
118
+ }
119
+ static get is() { return "jump-filter-range"; }
120
+ static get encapsulation() { return "shadow"; }
121
+ static get originalStyleUrls() {
122
+ return {
123
+ "$": ["jump-filter-range.scss"]
124
+ };
125
+ }
126
+ static get styleUrls() {
127
+ return {
128
+ "$": ["jump-filter-range.css"]
129
+ };
130
+ }
131
+ static get properties() {
132
+ return {
133
+ "name": {
134
+ "type": "string",
135
+ "mutable": false,
136
+ "complexType": {
137
+ "original": "string",
138
+ "resolved": "string",
139
+ "references": {}
140
+ },
141
+ "required": false,
142
+ "optional": false,
143
+ "docs": {
144
+ "tags": [],
145
+ "text": "Nome identificativo del filtro, utilizzato nell'evento finale."
146
+ },
147
+ "attribute": "name",
148
+ "reflect": false,
149
+ "defaultValue": "'range-filter'"
150
+ },
151
+ "labelMinBefore": {
152
+ "type": "string",
153
+ "mutable": false,
154
+ "complexType": {
155
+ "original": "string",
156
+ "resolved": "string",
157
+ "references": {}
158
+ },
159
+ "required": false,
160
+ "optional": false,
161
+ "docs": {
162
+ "tags": [],
163
+ "text": "Testo da mostrare prima del valore minimo."
164
+ },
165
+ "attribute": "label-min-before",
166
+ "reflect": false,
167
+ "defaultValue": "'Min:'"
168
+ },
169
+ "labelMinAfter": {
170
+ "type": "string",
171
+ "mutable": false,
172
+ "complexType": {
173
+ "original": "string",
174
+ "resolved": "string",
175
+ "references": {}
176
+ },
177
+ "required": false,
178
+ "optional": false,
179
+ "docs": {
180
+ "tags": [],
181
+ "text": "Testo da mostrare dopo il valore minimo (es. unit\u00E0 di misura)."
182
+ },
183
+ "attribute": "label-min-after",
184
+ "reflect": false,
185
+ "defaultValue": "''"
186
+ },
187
+ "labelMaxBefore": {
188
+ "type": "string",
189
+ "mutable": false,
190
+ "complexType": {
191
+ "original": "string",
192
+ "resolved": "string",
193
+ "references": {}
194
+ },
195
+ "required": false,
196
+ "optional": false,
197
+ "docs": {
198
+ "tags": [],
199
+ "text": "Testo da mostrare prima del valore massimo."
200
+ },
201
+ "attribute": "label-max-before",
202
+ "reflect": false,
203
+ "defaultValue": "'Max:'"
204
+ },
205
+ "labelMaxAfter": {
206
+ "type": "string",
207
+ "mutable": false,
208
+ "complexType": {
209
+ "original": "string",
210
+ "resolved": "string",
211
+ "references": {}
212
+ },
213
+ "required": false,
214
+ "optional": false,
215
+ "docs": {
216
+ "tags": [],
217
+ "text": "Testo da mostrare dopo il valore massimo (es. unit\u00E0 di misura)."
218
+ },
219
+ "attribute": "label-max-after",
220
+ "reflect": false,
221
+ "defaultValue": "''"
222
+ },
223
+ "min": {
224
+ "type": "number",
225
+ "mutable": false,
226
+ "complexType": {
227
+ "original": "number",
228
+ "resolved": "number",
229
+ "references": {}
230
+ },
231
+ "required": false,
232
+ "optional": false,
233
+ "docs": {
234
+ "tags": [],
235
+ "text": "Il valore minimo possibile per lo slider."
236
+ },
237
+ "attribute": "min",
238
+ "reflect": false,
239
+ "defaultValue": "0"
240
+ },
241
+ "max": {
242
+ "type": "number",
243
+ "mutable": false,
244
+ "complexType": {
245
+ "original": "number",
246
+ "resolved": "number",
247
+ "references": {}
248
+ },
249
+ "required": false,
250
+ "optional": false,
251
+ "docs": {
252
+ "tags": [],
253
+ "text": "Il valore massimo possibile per lo slider."
254
+ },
255
+ "attribute": "max",
256
+ "reflect": false,
257
+ "defaultValue": "100"
258
+ },
259
+ "step": {
260
+ "type": "number",
261
+ "mutable": false,
262
+ "complexType": {
263
+ "original": "number",
264
+ "resolved": "number",
265
+ "references": {}
266
+ },
267
+ "required": false,
268
+ "optional": false,
269
+ "docs": {
270
+ "tags": [],
271
+ "text": "L'incremento tra i valori dello slider."
272
+ },
273
+ "attribute": "step",
274
+ "reflect": false,
275
+ "defaultValue": "1"
276
+ },
277
+ "value": {
278
+ "type": "unknown",
279
+ "mutable": true,
280
+ "complexType": {
281
+ "original": "number[]",
282
+ "resolved": "number[]",
283
+ "references": {}
284
+ },
285
+ "required": false,
286
+ "optional": false,
287
+ "docs": {
288
+ "tags": [],
289
+ "text": "I valori iniziali dello slider, come array [min, max]."
290
+ },
291
+ "defaultValue": "[]"
292
+ },
293
+ "disabled": {
294
+ "type": "boolean",
295
+ "mutable": false,
296
+ "complexType": {
297
+ "original": "boolean",
298
+ "resolved": "boolean",
299
+ "references": {}
300
+ },
301
+ "required": false,
302
+ "optional": false,
303
+ "docs": {
304
+ "tags": [],
305
+ "text": "Stato disabilitato dello slider."
306
+ },
307
+ "attribute": "disabled",
308
+ "reflect": true,
309
+ "defaultValue": "false"
310
+ }
311
+ };
312
+ }
313
+ static get states() {
314
+ return {
315
+ "minVal": {},
316
+ "maxVal": {}
317
+ };
318
+ }
319
+ static get events() {
320
+ return [{
321
+ "method": "filterChange",
322
+ "name": "jump-filterchange",
323
+ "bubbles": true,
324
+ "cancelable": true,
325
+ "composed": true,
326
+ "docs": {
327
+ "tags": [],
328
+ "text": "Evento emesso SOLO quando l'utente ha terminato la selezione (al rilascio del mouse).\nIdeale per lanciare chiamate API o ricalcoli onerosi."
329
+ },
330
+ "complexType": {
331
+ "original": "{ name: string; values: number[] }",
332
+ "resolved": "{ name: string; values: number[]; }",
333
+ "references": {}
334
+ }
335
+ }];
336
+ }
337
+ static get methods() {
338
+ return {
339
+ "setValue": {
340
+ "complexType": {
341
+ "signature": "(values: number[], emitEvent?: boolean) => Promise<number[]>",
342
+ "parameters": [{
343
+ "name": "values",
344
+ "type": "number[]",
345
+ "docs": ""
346
+ }, {
347
+ "name": "emitEvent",
348
+ "type": "boolean",
349
+ "docs": ""
350
+ }],
351
+ "references": {
352
+ "Promise": {
353
+ "location": "global",
354
+ "id": "global::Promise"
355
+ }
356
+ },
357
+ "return": "Promise<number[]>"
358
+ },
359
+ "docs": {
360
+ "text": "Metodo pubblico per impostare il valore del filtro programmaticamente.",
361
+ "tags": []
362
+ }
363
+ },
364
+ "getValues": {
365
+ "complexType": {
366
+ "signature": "() => Promise<number[]>",
367
+ "parameters": [],
368
+ "references": {
369
+ "Promise": {
370
+ "location": "global",
371
+ "id": "global::Promise"
372
+ }
373
+ },
374
+ "return": "Promise<number[]>"
375
+ },
376
+ "docs": {
377
+ "text": "Metodo pubblico per ottenere il valore corrente.",
378
+ "tags": []
379
+ }
380
+ },
381
+ "getName": {
382
+ "complexType": {
383
+ "signature": "() => Promise<string>",
384
+ "parameters": [],
385
+ "references": {
386
+ "Promise": {
387
+ "location": "global",
388
+ "id": "global::Promise"
389
+ }
390
+ },
391
+ "return": "Promise<string>"
392
+ },
393
+ "docs": {
394
+ "text": "Metodo pubblico per ottenere il nome del filtro.",
395
+ "tags": []
396
+ }
397
+ }
398
+ };
399
+ }
400
+ static get elementRef() { return "host"; }
401
+ static get watchers() {
402
+ return [{
403
+ "propName": "value",
404
+ "methodName": "valueWatcher"
405
+ }];
406
+ }
407
+ }
408
+ //# sourceMappingURL=jump-filter-range.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jump-filter-range.js","sourceRoot":"","sources":["../../../src/components/jump-filter-range/jump-filter-range.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7G,yEAAyE;AACzE,MAAM,OAAO,GAAG,CAAC,CAAC;AAOlB,MAAM,OAAO,eAAe;;QA6D1B;;;WAGG;QACK,mBAAc,GAAG,CAAC,KAAY,EAAE,EAAE;YACxC,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;YAC/C,IAAI,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAE1C,IAAI,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,CAAC;gBACtC,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;gBAClC,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;YACrC,CAAC;YACD,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QAC1B,CAAC,CAAC;QAEF;;;WAGG;QACK,mBAAc,GAAG,CAAC,KAAY,EAAE,EAAE;YACxC,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;YAC/C,IAAI,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAE1C,IAAI,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,CAAC;gBACtC,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;gBAClC,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;YACrC,CAAC;YACD,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QAC1B,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter, Method, State, Watch, Element } from '@stencil/core';\n\n// La distanza minima tra i due slider, per evitare che si sovrappongano.\nconst MIN_GAP = 0;\n\n@Component({\n tag: 'jump-filter-range',\n styleUrl: 'jump-filter-range.scss',\n shadow: true,\n})\nexport class JumpFilterRange {\n @Element() host: HTMLElement;\n\n /** Nome identificativo del filtro, utilizzato nell'evento finale. */\n @Prop() name: string = 'range-filter';\n\n /** Testo da mostrare prima del valore minimo. */\n @Prop() labelMinBefore: string = 'Min:';\n /** Testo da mostrare dopo il valore minimo (es. unità di misura). */\n @Prop() labelMinAfter: string = '';\n\n /** Testo da mostrare prima del valore massimo. */\n @Prop() labelMaxBefore: string = 'Max:';\n /** Testo da mostrare dopo il valore massimo (es. unità di misura). */\n @Prop() labelMaxAfter: string = '';\n\n /** Il valore minimo possibile per lo slider. */\n @Prop() min: number = 0;\n /** Il valore massimo possibile per lo slider. */\n @Prop() max: number = 100;\n /** L'incremento tra i valori dello slider. */\n @Prop() step: number = 1;\n /** I valori iniziali dello slider, come array [min, max]. */\n @Prop({ mutable: true }) value: number[] = [];\n /** Stato disabilitato dello slider. */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n @State() minVal: number;\n @State() maxVal: number;\n\n /**\n * Evento emesso SOLO quando l'utente ha terminato la selezione (al rilascio del mouse).\n * Ideale per lanciare chiamate API o ricalcoli onerosi.\n */\n @Event({ eventName: 'jump-filterchange' }) filterChange: EventEmitter<{ name: string; values: number[] }>;\n\n @Watch('value')\n valueWatcher(newValue: number[]) {\n this.setComponentValues(newValue);\n }\n\n componentWillLoad() {\n this.setComponentValues(this.value);\n }\n\n /**\n * Imposta i valori interni del componente partendo da un array.\n */\n private setComponentValues(values: number[]) {\n if (values && values.length === 2) {\n this.minVal = values[0];\n this.maxVal = values[1];\n } else {\n // Fallback ai valori di default se l'input non è valido\n this.minVal = this.min;\n this.maxVal = this.max;\n }\n // Sincronizza la prop `value` con lo stato interno\n this.value = [this.minVal, this.maxVal];\n }\n\n /**\n * Gestisce l'aggiornamento in tempo reale dello slider MINIMO.\n * Aggiorna solo lo stato interno per un feedback visivo immediato.\n */\n private handleMinInput = (event: Event) => {\n const input = event.target as HTMLInputElement;\n let newMinVal = parseInt(input.value, 10);\n\n if (newMinVal > this.maxVal - MIN_GAP) {\n newMinVal = this.maxVal - MIN_GAP;\n input.value = newMinVal.toString();\n }\n this.minVal = newMinVal;\n };\n\n /**\n * Gestisce l'aggiornamento in tempo reale dello slider MASSIMO.\n * Aggiorna solo lo stato interno per un feedback visivo immediato.\n */\n private handleMaxInput = (event: Event) => {\n const input = event.target as HTMLInputElement;\n let newMaxVal = parseInt(input.value, 10);\n\n if (newMaxVal < this.minVal + MIN_GAP) {\n newMaxVal = this.minVal + MIN_GAP;\n input.value = newMaxVal.toString();\n }\n this.maxVal = newMaxVal;\n };\n\n /**\n * Eseguito quando l'utente rilascia lo slider (evento onChange).\n * Consolida il valore e emette l'evento finale.\n */\n private handleCommit = () => {\n console.log('Committing values:', this.minVal, this.maxVal);\n const currentValues = [this.minVal, this.maxVal];\n this.value = currentValues; // Sincronizza la prop\n this.filterChange.emit({\n name: this.name,\n values: currentValues,\n });\n };\n\n /**\n * Calcola lo stile per la barra di riempimento tra i due slider.\n */\n private getFillStyle() {\n const range = this.max - this.min;\n if (range === 0) return { left: '0%', width: '0%' };\n\n const leftPercent = ((this.minVal - this.min) / range) * 100;\n const rightPercent = ((this.maxVal - this.min) / range) * 100;\n return { left: `${leftPercent}%`, width: `${rightPercent - leftPercent}%` };\n }\n\n /**\n * Metodo pubblico per impostare il valore del filtro programmaticamente.\n */\n @Method()\n async setValue(values: number[], emitEvent: boolean = true): Promise<number[]> {\n if (this.disabled || !values || values.length !== 2) {\n return this.getValues();\n }\n this.setComponentValues(values);\n if (emitEvent) {\n this.handleCommit();\n }\n return this.getValues();\n }\n\n /**\n * Metodo pubblico per ottenere il valore corrente.\n */\n @Method()\n async getValues(): Promise<number[]> {\n return [this.minVal, this.maxVal];\n }\n\n /**\n * Metodo pubblico per ottenere il nome del filtro.\n */\n @Method()\n async getName(): Promise<string> {\n return this.name;\n }\n\n render() {\n return (\n <Host class={{ 'is-disabled': this.disabled }}>\n <div class=\"label-container\">\n <label class=\"label-min\">\n {this.labelMinBefore} {this.minVal}{this.labelMinAfter}\n </label>\n <label class=\"label-max\">\n {this.labelMaxBefore} {this.maxVal}{this.labelMaxAfter}\n </label>\n </div>\n <div class=\"slider-container\">\n <div class=\"slider-track\"></div>\n <div class=\"slider-fill\" style={this.getFillStyle()}></div>\n <input\n type=\"range\"\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.minVal}\n onInput={this.handleMinInput}\n onChange={this.handleCommit}\n disabled={this.disabled}\n class=\"range-input\"\n aria-label={this.labelMinBefore}\n />\n <input\n type=\"range\"\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.maxVal}\n onInput={this.handleMaxInput}\n onChange={this.handleCommit}\n disabled={this.disabled}\n class=\"range-input\"\n aria-label={this.labelMaxBefore}\n />\n </div>\n </Host>\n );\n }\n}"]}
@@ -0,0 +1,90 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s)
4
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { generateAttributesFromArgs, formatHtml } from "../../utils/utils";
14
+ export default {
15
+ title: 'Components/Filters/JumpFilterRange',
16
+ tags: ['autodocs'],
17
+ argTypes: {
18
+ name: { control: 'text' },
19
+ labelMinBefore: { control: 'text', description: "Testo prima del valore minimo." },
20
+ labelMinAfter: { control: 'text', description: "Testo dopo il valore minimo (es. €)." },
21
+ labelMaxBefore: { control: 'text', description: "Testo prima del valore massimo." },
22
+ labelMaxAfter: { control: 'text', description: "Testo dopo il valore massimo (es. €)." },
23
+ min: { control: 'number' },
24
+ max: { control: 'number' },
25
+ step: { control: 'number' },
26
+ value: { control: 'object' },
27
+ disabled: { control: 'boolean' },
28
+ },
29
+ };
30
+ const Template = (args) => {
31
+ const { value } = args, rest = __rest(args, ["value"]);
32
+ const attributes = generateAttributesFromArgs(rest);
33
+ const valueAttribute = value ? `value='${JSON.stringify(value)}'` : '';
34
+ return formatHtml(`<jump-filter-range ${attributes} ${valueAttribute}></jump-filter-range>`);
35
+ };
36
+ export const Default = Template.bind({});
37
+ Default.args = {
38
+ name: 'default-range',
39
+ labelMinBefore: 'Min:',
40
+ labelMinAfter: '',
41
+ labelMaxBefore: 'Max:',
42
+ labelMaxAfter: '',
43
+ min: 0,
44
+ max: 100,
45
+ step: 1,
46
+ value: [25, 75],
47
+ disabled: false,
48
+ };
49
+ // --- NUOVA STORIA AGGIUNTA ---
50
+ export const PriceRange = Template.bind({});
51
+ PriceRange.args = {
52
+ name: 'price-filter',
53
+ labelMinBefore: 'Prezzo da',
54
+ labelMinAfter: '€',
55
+ labelMaxBefore: 'a',
56
+ labelMaxAfter: '€',
57
+ min: 0,
58
+ max: 1500,
59
+ step: 10,
60
+ value: [250, 900],
61
+ disabled: false, // Come richiesto, non è disabilitato
62
+ };
63
+ // -----------------------------
64
+ export const Percentage = Template.bind({});
65
+ Percentage.args = {
66
+ name: 'satisfaction-range',
67
+ labelMinBefore: 'Soddisfazione da',
68
+ labelMinAfter: '%',
69
+ labelMaxBefore: 'a',
70
+ labelMaxAfter: '%',
71
+ min: 0,
72
+ max: 100,
73
+ step: 1,
74
+ value: [20, 80],
75
+ };
76
+ export const OnlyValues = Template.bind({});
77
+ OnlyValues.args = {
78
+ name: 'satisfaction-range',
79
+ labelMinBefore: '',
80
+ labelMinAfter: '',
81
+ labelMaxBefore: '',
82
+ labelMaxAfter: '',
83
+ min: 0,
84
+ max: 100,
85
+ step: 1,
86
+ value: [20, 80],
87
+ };
88
+ export const Disabled = Template.bind({});
89
+ Disabled.args = Object.assign(Object.assign({}, PriceRange.args), { name: 'disabled-price-filter', disabled: true });
90
+ //# sourceMappingURL=jump-filter-range.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jump-filter-range.stories.js","sourceRoot":"","sources":["../../../src/components/jump-filter-range/jump-filter-range.stories.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE3E,eAAe;IACb,KAAK,EAAE,oCAAoC;IAC3C,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QACzB,cAAc,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,gCAAgC,EAAE;QAClF,aAAa,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,sCAAsC,EAAE;QACvF,cAAc,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,iCAAiC,EAAE;QACnF,aAAa,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,uCAAuC,EAAE;QACxF,GAAG,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC1B,GAAG,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC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AAG,EAAE,IAAI;IACT,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;IACjB,QAAQ,EAAE,KAAK,EAAE,qCAAqC;CACvD,CAAC;AACF,gCAAgC;AAEhC,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,UAAU,CAAC,IAAI,GAAG;IAChB,IAAI,EAAE,oBAAoB;IAC1B,cAAc,EAAE,kBAAkB;IAClC,aAAa,EAAE,GAAG;IAClB,cAAc,EAAE,GAAG;IACnB,aAAa,EAAE,GAAG;IAClB,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,GAAG;IACR,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,UAAU,CAAC,IAAI,GAAG;IAChB,IAAI,EAAE,oBAAoB;IAC1B,cAAc,EAAE,EAAE;IAClB,aAAa,EAAE,EAAE;IACjB,cAAc,EAAE,EAAE;IAClB,aAAa,EAAE,EAAE;IACjB,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,GAAG;IACR,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,mCAER,UAAU,CAAC,IAAI,KAClB,IAAI,EAAE,uBAAuB,EAC7B,QAAQ,EAAE,IAAI,GACf,CAAC","sourcesContent":["import { generateAttributesFromArgs, formatHtml } from '../../utils/utils';\n\nexport default {\n title: 'Components/Filters/JumpFilterRange',\n tags: ['autodocs'],\n argTypes: {\n name: { control: 'text' },\n labelMinBefore: { control: 'text', description: \"Testo prima del valore minimo.\" },\n labelMinAfter: { control: 'text', description: \"Testo dopo il valore minimo (es. €).\" },\n labelMaxBefore: { control: 'text', description: \"Testo prima del valore massimo.\" },\n labelMaxAfter: { control: 'text', description: \"Testo dopo il valore massimo (es. €).\" },\n min: { control: 'number' },\n max: { control: 'number' },\n step: { control: 'number' },\n value: { control: 'object' },\n disabled: { control: 'boolean' },\n },\n};\n\nconst Template = (args) => {\n const { value, ...rest } = args;\n const attributes = generateAttributesFromArgs(rest);\n const valueAttribute = value ? `value='${JSON.stringify(value)}'` : '';\n return formatHtml(`<jump-filter-range ${attributes} ${valueAttribute}></jump-filter-range>`);\n};\n\nexport const Default = Template.bind({});\nDefault.args = {\n name: 'default-range',\n labelMinBefore: 'Min:',\n labelMinAfter: '',\n labelMaxBefore: 'Max:',\n labelMaxAfter: '',\n min: 0,\n max: 100,\n step: 1,\n value: [25, 75],\n disabled: false,\n};\n\n// --- NUOVA STORIA AGGIUNTA ---\nexport const PriceRange = Template.bind({});\nPriceRange.args = {\n name: 'price-filter',\n labelMinBefore: 'Prezzo da',\n labelMinAfter: '€',\n labelMaxBefore: 'a',\n labelMaxAfter: '€',\n min: 0,\n max: 1500,\n step: 10,\n value: [250, 900],\n disabled: false, // Come richiesto, non è disabilitato\n};\n// -----------------------------\n\nexport const Percentage = Template.bind({});\nPercentage.args = {\n name: 'satisfaction-range',\n labelMinBefore: 'Soddisfazione da',\n labelMinAfter: '%',\n labelMaxBefore: 'a',\n labelMaxAfter: '%',\n min: 0,\n max: 100,\n step: 1,\n value: [20, 80],\n};\n\nexport const OnlyValues = Template.bind({});\nOnlyValues.args = {\n name: 'satisfaction-range',\n labelMinBefore: '',\n labelMinAfter: '',\n labelMaxBefore: '',\n labelMaxAfter: '',\n min: 0,\n max: 100,\n step: 1,\n value: [20, 80],\n};\n\nexport const Disabled = Template.bind({});\nDisabled.args = {\n // Usiamo i valori di PriceRange ma in stato disabilitato\n ...PriceRange.args,\n name: 'disabled-price-filter',\n disabled: true,\n};"]}
@@ -169,7 +169,7 @@ export class JumpFilterSelect {
169
169
  }
170
170
  render() {
171
171
  const optionsArray = this.getOptionsArray();
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' }))));
172
+ return (h(Host, { key: 'b20f199ca8f48e9e3c068605a752a3c0d4e890f7', ref: (host) => (this.host = host) }, this.label && (h("div", { key: '040d2a5c5c97ed1a1fef948d00c260224adcf1da', class: "select-label" }, this.label)), h("sl-select", { key: '79b62f0c01b8a75a9bdd357395896db1c6ed0c1b', 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: '7f4e8595fe45ddbd9d5957e819a06667e819f322' }))));
173
173
  }
174
174
  static get is() { return "jump-filter-select"; }
175
175
  static get encapsulation() { return "shadow"; }
@@ -138,7 +138,7 @@ export class JumpFilterSwitch {
138
138
  return this.name;
139
139
  }
140
140
  render() {
141
- return (h(Host, { key: '5aaeb4633e6b9392d4adc3c461d1842ec3a90173', ref: (host) => (this.host = host) }, this.value && this.label && (h("sl-switch", { key: 'd261e71b29afd307de4941f8e81e71d47246e036', value: this.value, ref: (el) => (this.el = el), checked: this.checked, disabled: this.disabled }, this.label))));
141
+ return (h(Host, { key: 'f7e5939637497219f44aa6ba22acb4a68937d019', ref: (host) => (this.host = host) }, this.value && this.label && (h("sl-switch", { key: '4025228df5c5b4ef987d8ee70cb613ef9c993d9b', value: this.value, ref: (el) => (this.el = el), checked: this.checked, disabled: this.disabled }, this.label))));
142
142
  }
143
143
  static get is() { return "jump-filter-switch"; }
144
144
  static get encapsulation() { return "shadow"; }