@jumpgroup/jump-design-system 0.3.67 → 0.3.68
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-filter-switch.cjs.entry.js +105 -5
- package/dist/cjs/jump-filter-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/jump-filter-switch/jump-filter-switch.js +220 -6
- package/dist/collection/components/jump-filter-switch/jump-filter-switch.js.map +1 -1
- package/dist/components/jump-filter-switch.js +114 -7
- package/dist/components/jump-filter-switch.js.map +1 -1
- package/dist/esm/jump-design-system.js +1 -1
- package/dist/esm/jump-filter-switch.entry.js +105 -5
- package/dist/esm/jump-filter-switch.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-7c06855a.entry.js → p-79c78037.entry.js} +4 -4
- package/dist/jump-design-system/p-79c78037.entry.js.map +1 -0
- package/dist/jump-design-system-elements.json +4 -0
- package/dist/types/components/jump-filter-switch/jump-filter-switch.d.ts +33 -0
- package/dist/types/components.d.ts +30 -0
- package/package.json +1 -1
- package/dist/jump-design-system/p-7c06855a.entry.js.map +0 -1
|
@@ -8,11 +8,38 @@ export class JumpFilterSwitch {
|
|
|
8
8
|
constructor() {
|
|
9
9
|
this.value = undefined;
|
|
10
10
|
this.label = undefined;
|
|
11
|
+
this.name = 'switch-filter';
|
|
11
12
|
this.checked = false;
|
|
12
13
|
this.disabled = false;
|
|
14
|
+
this.values = [];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Watch sulla proprietà checked per reagire ai cambiamenti esterni
|
|
18
|
+
*/
|
|
19
|
+
checkedChanged(newValue, oldValue) {
|
|
20
|
+
if (newValue !== oldValue) {
|
|
21
|
+
// Aggiorna l'elemento sl-switch
|
|
22
|
+
if (this.el) {
|
|
23
|
+
this.el.checked = newValue;
|
|
24
|
+
}
|
|
25
|
+
// Aggiorna i valori
|
|
26
|
+
this.updateValues();
|
|
27
|
+
}
|
|
13
28
|
}
|
|
14
29
|
componentDidLoad() {
|
|
15
30
|
this.listenSLChange();
|
|
31
|
+
// Inizializza i valori in base allo stato del checkbox
|
|
32
|
+
this.updateValues();
|
|
33
|
+
// Se è stato passato un valore di checked, applica lo stato all'elemento sl-switch
|
|
34
|
+
if (this.el && this.checked) {
|
|
35
|
+
this.el.checked = this.checked;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Aggiorna l'array dei valori in base allo stato del checkbox
|
|
40
|
+
*/
|
|
41
|
+
updateValues() {
|
|
42
|
+
this.values = this.checked && this.value ? [this.value] : [];
|
|
16
43
|
}
|
|
17
44
|
/**
|
|
18
45
|
* Ascolta gli eventi di cambio stato dal switch Shoelace
|
|
@@ -25,14 +52,69 @@ export class JumpFilterSwitch {
|
|
|
25
52
|
return;
|
|
26
53
|
}
|
|
27
54
|
this.checked = !this.checked;
|
|
28
|
-
|
|
55
|
+
this.updateValues();
|
|
56
|
+
// Evento specifico per il componente switch
|
|
57
|
+
const switchEventData = {
|
|
29
58
|
value: this.value,
|
|
30
|
-
checked: this.checked
|
|
59
|
+
checked: this.checked
|
|
60
|
+
};
|
|
61
|
+
this.toggleCheckbox.emit(switchEventData);
|
|
62
|
+
// Evento standard per il sistema di filtri
|
|
63
|
+
const filterEventData = {
|
|
64
|
+
name: this.name,
|
|
65
|
+
values: this.values,
|
|
66
|
+
checked: this.checked
|
|
31
67
|
};
|
|
32
|
-
this.
|
|
33
|
-
|
|
68
|
+
this.toggleCheckboxFilterChange.emit(filterEventData);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Metodo pubblico per impostare programmaticamente lo stato del switch
|
|
74
|
+
* @param checked - Il nuovo stato del switch (true = acceso, false = spento)
|
|
75
|
+
* @param emitEvent - Se emettere eventi di cambio stato (default: true)
|
|
76
|
+
* @returns {Promise<boolean>} Il nuovo stato del switch
|
|
77
|
+
*/
|
|
78
|
+
async setValue(checked, emitEvent = true) {
|
|
79
|
+
// Se il component è disabilitato, non fare nulla
|
|
80
|
+
if (this.disabled) {
|
|
81
|
+
return this.checked;
|
|
82
|
+
}
|
|
83
|
+
// Salva il valore precedente per l'evento
|
|
84
|
+
const oldValue = this.checked;
|
|
85
|
+
// Imposta il nuovo valore
|
|
86
|
+
this.checked = checked;
|
|
87
|
+
// Aggiorna l'elemento sl-switch interno
|
|
88
|
+
if (this.el) {
|
|
89
|
+
this.el.checked = checked;
|
|
90
|
+
}
|
|
91
|
+
// Aggiorna l'array dei valori
|
|
92
|
+
this.updateValues();
|
|
93
|
+
// Emetti eventi se richiesto
|
|
94
|
+
if (emitEvent && oldValue !== checked) {
|
|
95
|
+
// Evento specifico per il componente switch
|
|
96
|
+
const switchEventData = {
|
|
97
|
+
value: this.value,
|
|
98
|
+
checked: this.checked,
|
|
99
|
+
programmatic: true
|
|
100
|
+
};
|
|
101
|
+
this.toggleCheckbox.emit(switchEventData);
|
|
102
|
+
// Evento standard per il sistema di filtri
|
|
103
|
+
const filterEventData = {
|
|
104
|
+
name: this.name,
|
|
105
|
+
values: this.values,
|
|
106
|
+
checked: this.checked,
|
|
107
|
+
programmatic: true
|
|
108
|
+
};
|
|
109
|
+
this.toggleCheckboxFilterChange.emit(filterEventData);
|
|
110
|
+
// Evento specifico per cambio valore programmato
|
|
111
|
+
this.valueChange.emit({
|
|
112
|
+
value: this.value,
|
|
113
|
+
checked: this.checked,
|
|
114
|
+
oldChecked: oldValue
|
|
34
115
|
});
|
|
35
116
|
}
|
|
117
|
+
return this.checked;
|
|
36
118
|
}
|
|
37
119
|
/**
|
|
38
120
|
* Metodo pubblico per verificare lo stato corrente del switch
|
|
@@ -41,8 +123,22 @@ export class JumpFilterSwitch {
|
|
|
41
123
|
async isChecked() {
|
|
42
124
|
return this.checked;
|
|
43
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Metodo pubblico per ottenere i valori selezionati
|
|
128
|
+
* @returns {string[]} Array contenente il valore se selezionato, altrimenti array vuoto
|
|
129
|
+
*/
|
|
130
|
+
async getValues() {
|
|
131
|
+
return this.values;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Metodo pubblico per ottenere il nome del filtro
|
|
135
|
+
* @returns {string} Il nome del filtro
|
|
136
|
+
*/
|
|
137
|
+
async getName() {
|
|
138
|
+
return this.name;
|
|
139
|
+
}
|
|
44
140
|
render() {
|
|
45
|
-
return (h(Host, { key: '
|
|
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))));
|
|
46
142
|
}
|
|
47
143
|
static get is() { return "jump-filter-switch"; }
|
|
48
144
|
static get encapsulation() { return "shadow"; }
|
|
@@ -92,9 +188,27 @@ export class JumpFilterSwitch {
|
|
|
92
188
|
"attribute": "label",
|
|
93
189
|
"reflect": false
|
|
94
190
|
},
|
|
191
|
+
"name": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"mutable": false,
|
|
194
|
+
"complexType": {
|
|
195
|
+
"original": "string",
|
|
196
|
+
"resolved": "string",
|
|
197
|
+
"references": {}
|
|
198
|
+
},
|
|
199
|
+
"required": false,
|
|
200
|
+
"optional": false,
|
|
201
|
+
"docs": {
|
|
202
|
+
"tags": [],
|
|
203
|
+
"text": "Nome identificativo del filtro, utilizzato negli eventi"
|
|
204
|
+
},
|
|
205
|
+
"attribute": "name",
|
|
206
|
+
"reflect": false,
|
|
207
|
+
"defaultValue": "'switch-filter'"
|
|
208
|
+
},
|
|
95
209
|
"checked": {
|
|
96
210
|
"type": "boolean",
|
|
97
|
-
"mutable":
|
|
211
|
+
"mutable": true,
|
|
98
212
|
"complexType": {
|
|
99
213
|
"original": "boolean",
|
|
100
214
|
"resolved": "boolean",
|
|
@@ -130,6 +244,11 @@ export class JumpFilterSwitch {
|
|
|
130
244
|
}
|
|
131
245
|
};
|
|
132
246
|
}
|
|
247
|
+
static get states() {
|
|
248
|
+
return {
|
|
249
|
+
"values": {}
|
|
250
|
+
};
|
|
251
|
+
}
|
|
133
252
|
static get events() {
|
|
134
253
|
return [{
|
|
135
254
|
"method": "toggleCheckbox",
|
|
@@ -161,10 +280,59 @@ export class JumpFilterSwitch {
|
|
|
161
280
|
"resolved": "any",
|
|
162
281
|
"references": {}
|
|
163
282
|
}
|
|
283
|
+
}, {
|
|
284
|
+
"method": "valueChange",
|
|
285
|
+
"name": "jump-switch-value-change",
|
|
286
|
+
"bubbles": true,
|
|
287
|
+
"cancelable": true,
|
|
288
|
+
"composed": true,
|
|
289
|
+
"docs": {
|
|
290
|
+
"tags": [],
|
|
291
|
+
"text": "Evento emesso quando il valore viene cambiato programmaticamente"
|
|
292
|
+
},
|
|
293
|
+
"complexType": {
|
|
294
|
+
"original": "any",
|
|
295
|
+
"resolved": "any",
|
|
296
|
+
"references": {}
|
|
297
|
+
}
|
|
164
298
|
}];
|
|
165
299
|
}
|
|
166
300
|
static get methods() {
|
|
167
301
|
return {
|
|
302
|
+
"setValue": {
|
|
303
|
+
"complexType": {
|
|
304
|
+
"signature": "(checked: boolean, emitEvent?: boolean) => Promise<boolean>",
|
|
305
|
+
"parameters": [{
|
|
306
|
+
"name": "checked",
|
|
307
|
+
"type": "boolean",
|
|
308
|
+
"docs": "- Il nuovo stato del switch (true = acceso, false = spento)"
|
|
309
|
+
}, {
|
|
310
|
+
"name": "emitEvent",
|
|
311
|
+
"type": "boolean",
|
|
312
|
+
"docs": "- Se emettere eventi di cambio stato (default: true)"
|
|
313
|
+
}],
|
|
314
|
+
"references": {
|
|
315
|
+
"Promise": {
|
|
316
|
+
"location": "global",
|
|
317
|
+
"id": "global::Promise"
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
"return": "Promise<boolean>"
|
|
321
|
+
},
|
|
322
|
+
"docs": {
|
|
323
|
+
"text": "Metodo pubblico per impostare programmaticamente lo stato del switch",
|
|
324
|
+
"tags": [{
|
|
325
|
+
"name": "param",
|
|
326
|
+
"text": "checked - Il nuovo stato del switch (true = acceso, false = spento)"
|
|
327
|
+
}, {
|
|
328
|
+
"name": "param",
|
|
329
|
+
"text": "emitEvent - Se emettere eventi di cambio stato (default: true)"
|
|
330
|
+
}, {
|
|
331
|
+
"name": "returns",
|
|
332
|
+
"text": "Il nuovo stato del switch"
|
|
333
|
+
}]
|
|
334
|
+
}
|
|
335
|
+
},
|
|
168
336
|
"isChecked": {
|
|
169
337
|
"complexType": {
|
|
170
338
|
"signature": "() => Promise<boolean>",
|
|
@@ -184,8 +352,54 @@ export class JumpFilterSwitch {
|
|
|
184
352
|
"text": "Lo stato corrente del switch (true = acceso, false = spento)"
|
|
185
353
|
}]
|
|
186
354
|
}
|
|
355
|
+
},
|
|
356
|
+
"getValues": {
|
|
357
|
+
"complexType": {
|
|
358
|
+
"signature": "() => Promise<string[]>",
|
|
359
|
+
"parameters": [],
|
|
360
|
+
"references": {
|
|
361
|
+
"Promise": {
|
|
362
|
+
"location": "global",
|
|
363
|
+
"id": "global::Promise"
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
"return": "Promise<string[]>"
|
|
367
|
+
},
|
|
368
|
+
"docs": {
|
|
369
|
+
"text": "Metodo pubblico per ottenere i valori selezionati",
|
|
370
|
+
"tags": [{
|
|
371
|
+
"name": "returns",
|
|
372
|
+
"text": "Array contenente il valore se selezionato, altrimenti array vuoto"
|
|
373
|
+
}]
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
"getName": {
|
|
377
|
+
"complexType": {
|
|
378
|
+
"signature": "() => Promise<string>",
|
|
379
|
+
"parameters": [],
|
|
380
|
+
"references": {
|
|
381
|
+
"Promise": {
|
|
382
|
+
"location": "global",
|
|
383
|
+
"id": "global::Promise"
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
"return": "Promise<string>"
|
|
387
|
+
},
|
|
388
|
+
"docs": {
|
|
389
|
+
"text": "Metodo pubblico per ottenere il nome del filtro",
|
|
390
|
+
"tags": [{
|
|
391
|
+
"name": "returns",
|
|
392
|
+
"text": "Il nome del filtro"
|
|
393
|
+
}]
|
|
394
|
+
}
|
|
187
395
|
}
|
|
188
396
|
};
|
|
189
397
|
}
|
|
398
|
+
static get watchers() {
|
|
399
|
+
return [{
|
|
400
|
+
"propName": "checked",
|
|
401
|
+
"methodName": "checkedChanged"
|
|
402
|
+
}];
|
|
403
|
+
}
|
|
190
404
|
}
|
|
191
405
|
//# sourceMappingURL=jump-filter-switch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jump-filter-switch.js","sourceRoot":"","sources":["../../../src/components/jump-filter-switch/jump-filter-switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"jump-filter-switch.js","sourceRoot":"","sources":["../../../src/components/jump-filter-switch/jump-filter-switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,2DAA2D,CAAC;AAEnE;;;GAGG;AAMH,MAAM,OAAO,gBAAgB;;;;oBAQJ,eAAe;uBAGqB,KAAK;wBAGnB,KAAK;sBAGtB,EAAE;;IAE9B;;OAEG;IAEH,cAAc,CAAC,QAAiB,EAAE,QAAiB;QACjD,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC1B,gCAAgC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["import { Component, Host, Prop, h, Event, EventEmitter, Watch, Method, State } from '@stencil/core';\nimport '@shoelace-style/shoelace/dist/components/switch/switch.js';\n\n/**\n * Componente switch per filtri con supporto per label e stato\n * @slot - Contenuto opzionale da mostrare accanto al switch (alternativo alla label)\n */\n@Component({\n tag: 'jump-filter-switch',\n styleUrl: 'jump-filter-switch.scss',\n shadow: true,\n})\nexport class JumpFilterSwitch {\n /** Il valore associato al switch */\n @Prop() value: string;\n\n /** La label da mostrare accanto al switch */\n @Prop() label: string;\n\n /** Nome identificativo del filtro, utilizzato negli eventi */\n @Prop() name: string = 'switch-filter';\n\n /** Stato del switch (acceso/spento) */\n @Prop({ reflect: true, mutable: true }) checked: boolean = false;\n\n /** Stato del switch (disabilitato) */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Stato interno per tenere traccia dei valori selezionati */\n @State() values: string[] = [];\n\n /**\n * Watch sulla proprietà checked per reagire ai cambiamenti esterni\n */\n @Watch('checked')\n checkedChanged(newValue: boolean, oldValue: boolean) {\n if (newValue !== oldValue) {\n // Aggiorna l'elemento sl-switch\n if (this.el) {\n this.el.checked = newValue;\n }\n\n // Aggiorna i valori\n this.updateValues();\n }\n }\n\n /** Riferimento all'elemento host */\n host: HTMLElement;\n\n /** Riferimento all'elemento sl-switch interno */\n el: any; // Usiamo any per evitare problemi di tipo con le proprietà specifiche di sl-switch\n\n componentDidLoad() {\n this.listenSLChange();\n // Inizializza i valori in base allo stato del checkbox\n this.updateValues();\n\n // Se è stato passato un valore di checked, applica lo stato all'elemento sl-switch\n if (this.el && this.checked) {\n this.el.checked = this.checked;\n }\n }\n\n /**\n * Aggiorna l'array dei valori in base allo stato del checkbox\n */\n private updateValues() {\n this.values = this.checked && this.value ? [this.value] : [];\n }\n\n /**\n * Ascolta gli eventi di cambio stato dal switch Shoelace\n */\n listenSLChange() {\n if (this.host) {\n this.host.addEventListener('sl-change', () => {\n // Ignora l'evento se lo switch è disabilitato\n if (this.disabled) {\n return;\n }\n\n this.checked = !this.checked;\n this.updateValues();\n\n // Evento specifico per il componente switch\n const switchEventData = {\n value: this.value,\n checked: this.checked\n };\n this.toggleCheckbox.emit(switchEventData);\n\n // Evento standard per il sistema di filtri\n const filterEventData = {\n name: this.name,\n values: this.values,\n checked: this.checked\n };\n this.toggleCheckboxFilterChange.emit(filterEventData);\n });\n }\n }\n\n /**\n * Metodo pubblico per impostare programmaticamente lo stato del switch\n * @param checked - Il nuovo stato del switch (true = acceso, false = spento)\n * @param emitEvent - Se emettere eventi di cambio stato (default: true)\n * @returns {Promise<boolean>} Il nuovo stato del switch\n */\n @Method()\n async setValue(checked: boolean, emitEvent: boolean = true): Promise<boolean> {\n // Se il component è disabilitato, non fare nulla\n if (this.disabled) {\n return this.checked;\n }\n\n // Salva il valore precedente per l'evento\n const oldValue = this.checked;\n\n // Imposta il nuovo valore\n this.checked = checked;\n\n // Aggiorna l'elemento sl-switch interno\n if (this.el) {\n this.el.checked = checked;\n }\n\n // Aggiorna l'array dei valori\n this.updateValues();\n\n // Emetti eventi se richiesto\n if (emitEvent && oldValue !== checked) {\n // Evento specifico per il componente switch\n const switchEventData = {\n value: this.value,\n checked: this.checked,\n programmatic: true\n };\n this.toggleCheckbox.emit(switchEventData);\n\n // Evento standard per il sistema di filtri\n const filterEventData = {\n name: this.name,\n values: this.values,\n checked: this.checked,\n programmatic: true\n };\n this.toggleCheckboxFilterChange.emit(filterEventData);\n\n // Evento specifico per cambio valore programmato\n this.valueChange.emit({\n value: this.value,\n checked: this.checked,\n oldChecked: oldValue\n });\n }\n\n return this.checked;\n }\n\n /**\n * Evento emesso quando cambia lo stato del switch\n */\n @Event({ eventName: 'jump-switch-change' }) toggleCheckbox: EventEmitter;\n @Event({ eventName: 'jump-filterchange' }) toggleCheckboxFilterChange: EventEmitter;\n /**\n * Evento emesso quando il valore viene cambiato programmaticamente\n */\n @Event({ eventName: 'jump-switch-value-change' }) valueChange: EventEmitter;\n\n /**\n * Metodo pubblico per verificare lo stato corrente del switch\n * @returns {boolean} Lo stato corrente del switch (true = acceso, false = spento)\n */\n @Method()\n async isChecked() {\n return this.checked;\n }\n\n /**\n * Metodo pubblico per ottenere i valori selezionati\n * @returns {string[]} Array contenente il valore se selezionato, altrimenti 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 {string} Il nome del filtro\n */\n @Method()\n async getName() {\n return this.name;\n }\n\n render() {\n return (\n <Host ref={(host: HTMLElement) => (this.host = host)}>\n {this.value && this.label && (\n <sl-switch\n value={this.value}\n ref={(el: any) => (this.el = el)}\n checked={this.checked}\n disabled={this.disabled}\n >\n {this.label}\n </sl-switch>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -394,13 +394,41 @@ const JumpFilterSwitch$1 = /*@__PURE__*/ proxyCustomElement(class JumpFilterSwit
|
|
|
394
394
|
this.__attachShadow();
|
|
395
395
|
this.toggleCheckbox = createEvent(this, "jump-switch-change", 7);
|
|
396
396
|
this.toggleCheckboxFilterChange = createEvent(this, "jump-filterchange", 7);
|
|
397
|
+
this.valueChange = createEvent(this, "jump-switch-value-change", 7);
|
|
397
398
|
this.value = undefined;
|
|
398
399
|
this.label = undefined;
|
|
400
|
+
this.name = 'switch-filter';
|
|
399
401
|
this.checked = false;
|
|
400
402
|
this.disabled = false;
|
|
403
|
+
this.values = [];
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Watch sulla proprietà checked per reagire ai cambiamenti esterni
|
|
407
|
+
*/
|
|
408
|
+
checkedChanged(newValue, oldValue) {
|
|
409
|
+
if (newValue !== oldValue) {
|
|
410
|
+
// Aggiorna l'elemento sl-switch
|
|
411
|
+
if (this.el) {
|
|
412
|
+
this.el.checked = newValue;
|
|
413
|
+
}
|
|
414
|
+
// Aggiorna i valori
|
|
415
|
+
this.updateValues();
|
|
416
|
+
}
|
|
401
417
|
}
|
|
402
418
|
componentDidLoad() {
|
|
403
419
|
this.listenSLChange();
|
|
420
|
+
// Inizializza i valori in base allo stato del checkbox
|
|
421
|
+
this.updateValues();
|
|
422
|
+
// Se è stato passato un valore di checked, applica lo stato all'elemento sl-switch
|
|
423
|
+
if (this.el && this.checked) {
|
|
424
|
+
this.el.checked = this.checked;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Aggiorna l'array dei valori in base allo stato del checkbox
|
|
429
|
+
*/
|
|
430
|
+
updateValues() {
|
|
431
|
+
this.values = this.checked && this.value ? [this.value] : [];
|
|
404
432
|
}
|
|
405
433
|
/**
|
|
406
434
|
* Ascolta gli eventi di cambio stato dal switch Shoelace
|
|
@@ -413,14 +441,69 @@ const JumpFilterSwitch$1 = /*@__PURE__*/ proxyCustomElement(class JumpFilterSwit
|
|
|
413
441
|
return;
|
|
414
442
|
}
|
|
415
443
|
this.checked = !this.checked;
|
|
416
|
-
|
|
444
|
+
this.updateValues();
|
|
445
|
+
// Evento specifico per il componente switch
|
|
446
|
+
const switchEventData = {
|
|
417
447
|
value: this.value,
|
|
418
|
-
checked: this.checked
|
|
448
|
+
checked: this.checked
|
|
419
449
|
};
|
|
420
|
-
this.toggleCheckbox.emit(
|
|
421
|
-
|
|
450
|
+
this.toggleCheckbox.emit(switchEventData);
|
|
451
|
+
// Evento standard per il sistema di filtri
|
|
452
|
+
const filterEventData = {
|
|
453
|
+
name: this.name,
|
|
454
|
+
values: this.values,
|
|
455
|
+
checked: this.checked
|
|
456
|
+
};
|
|
457
|
+
this.toggleCheckboxFilterChange.emit(filterEventData);
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Metodo pubblico per impostare programmaticamente lo stato del switch
|
|
463
|
+
* @param checked - Il nuovo stato del switch (true = acceso, false = spento)
|
|
464
|
+
* @param emitEvent - Se emettere eventi di cambio stato (default: true)
|
|
465
|
+
* @returns {Promise<boolean>} Il nuovo stato del switch
|
|
466
|
+
*/
|
|
467
|
+
async setValue(checked, emitEvent = true) {
|
|
468
|
+
// Se il component è disabilitato, non fare nulla
|
|
469
|
+
if (this.disabled) {
|
|
470
|
+
return this.checked;
|
|
471
|
+
}
|
|
472
|
+
// Salva il valore precedente per l'evento
|
|
473
|
+
const oldValue = this.checked;
|
|
474
|
+
// Imposta il nuovo valore
|
|
475
|
+
this.checked = checked;
|
|
476
|
+
// Aggiorna l'elemento sl-switch interno
|
|
477
|
+
if (this.el) {
|
|
478
|
+
this.el.checked = checked;
|
|
479
|
+
}
|
|
480
|
+
// Aggiorna l'array dei valori
|
|
481
|
+
this.updateValues();
|
|
482
|
+
// Emetti eventi se richiesto
|
|
483
|
+
if (emitEvent && oldValue !== checked) {
|
|
484
|
+
// Evento specifico per il componente switch
|
|
485
|
+
const switchEventData = {
|
|
486
|
+
value: this.value,
|
|
487
|
+
checked: this.checked,
|
|
488
|
+
programmatic: true
|
|
489
|
+
};
|
|
490
|
+
this.toggleCheckbox.emit(switchEventData);
|
|
491
|
+
// Evento standard per il sistema di filtri
|
|
492
|
+
const filterEventData = {
|
|
493
|
+
name: this.name,
|
|
494
|
+
values: this.values,
|
|
495
|
+
checked: this.checked,
|
|
496
|
+
programmatic: true
|
|
497
|
+
};
|
|
498
|
+
this.toggleCheckboxFilterChange.emit(filterEventData);
|
|
499
|
+
// Evento specifico per cambio valore programmato
|
|
500
|
+
this.valueChange.emit({
|
|
501
|
+
value: this.value,
|
|
502
|
+
checked: this.checked,
|
|
503
|
+
oldChecked: oldValue
|
|
422
504
|
});
|
|
423
505
|
}
|
|
506
|
+
return this.checked;
|
|
424
507
|
}
|
|
425
508
|
/**
|
|
426
509
|
* Metodo pubblico per verificare lo stato corrente del switch
|
|
@@ -429,16 +512,40 @@ const JumpFilterSwitch$1 = /*@__PURE__*/ proxyCustomElement(class JumpFilterSwit
|
|
|
429
512
|
async isChecked() {
|
|
430
513
|
return this.checked;
|
|
431
514
|
}
|
|
515
|
+
/**
|
|
516
|
+
* Metodo pubblico per ottenere i valori selezionati
|
|
517
|
+
* @returns {string[]} Array contenente il valore se selezionato, altrimenti array vuoto
|
|
518
|
+
*/
|
|
519
|
+
async getValues() {
|
|
520
|
+
return this.values;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Metodo pubblico per ottenere il nome del filtro
|
|
524
|
+
* @returns {string} Il nome del filtro
|
|
525
|
+
*/
|
|
526
|
+
async getName() {
|
|
527
|
+
return this.name;
|
|
528
|
+
}
|
|
432
529
|
render() {
|
|
433
|
-
return (h(Host, { key: '
|
|
530
|
+
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))));
|
|
434
531
|
}
|
|
532
|
+
static get watchers() { return {
|
|
533
|
+
"checked": ["checkedChanged"]
|
|
534
|
+
}; }
|
|
435
535
|
static get style() { return JumpFilterSwitchStyle0; }
|
|
436
536
|
}, [1, "jump-filter-switch", {
|
|
437
537
|
"value": [1],
|
|
438
538
|
"label": [1],
|
|
439
|
-
"
|
|
539
|
+
"name": [1],
|
|
540
|
+
"checked": [1540],
|
|
440
541
|
"disabled": [516],
|
|
441
|
-
"
|
|
542
|
+
"values": [32],
|
|
543
|
+
"setValue": [64],
|
|
544
|
+
"isChecked": [64],
|
|
545
|
+
"getValues": [64],
|
|
546
|
+
"getName": [64]
|
|
547
|
+
}, undefined, {
|
|
548
|
+
"checked": ["checkedChanged"]
|
|
442
549
|
}]);
|
|
443
550
|
function defineCustomElement$1() {
|
|
444
551
|
if (typeof customElements === "undefined") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"jump-filter-switch.js","mappings":";;;;;;AAAA;AAEA,IAAI,qBAAqB,GAAGA,CAAG,CAAC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;ACrID,IAAI,QAAQ,GAAG,cAAc,eAAe,CAAC;AAC7C,EAAE,WAAW,GAAG;AAChB,IAAI,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;AACxB,IAAI,IAAI,CAAC,qBAAqB,GAAG,IAAI,qBAAqB,CAAC,IAAI,EAAE;AACjE,MAAM,KAAK,EAAE,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC;AAC1E,MAAM,YAAY,EAAE,CAAC,OAAO,KAAK,OAAO,CAAC,cAAc;AACvD,MAAM,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,GAAG,OAAO;AAC/D,KAAK,CAAC,CAAC;AACP,IAAI,IAAI,CAAC,iBAAiB,GAAG,I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lD,gBAAgB;QACd,IAAI,CAAC,cAAc,EAAE,CAAC;KACvB;;;;IAKD,cAAc;QACZ,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE;;gBAEtC,IAAI,IAAI,CAAC,QAAQ,EAAE;oBACjB,OAAO;iBACR;gBAED,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;gBAE7B,MAAM,SAAS,GAAG;oBAChB,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,OAAO,EAAE,IAAI,CAAC,OAAO;iBACtB,CAAC;gBAEF,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBACpC,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aACjD,CAAC,CAAC;SACJ;KACF;;;;;IAaD,MAAM,SAAS;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;KACrB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,GAAG,EAAE,CAAC,IAAiB,MAAM,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IACjD,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,KACvB,kEACE,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,GAAG,EAAE,CAAC,EAAO,MAAM,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,EAChC,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAEtB,IAAI,CAAC,KAAK,CACD,CACb,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["css","html","classMap","ifDefined","live","query","state","property","JumpFilterSwitch"],"sources":["node_modules/@shoelace-style/shoelace/dist/chunks/chunk.EU44RQUN.js","node_modules/@shoelace-style/shoelace/dist/chunks/chunk.S33XS33R.js","node_modules/@shoelace-style/shoelace/dist/chunks/chunk.TUJRSXNR.js","src/components/jump-filter-switch/jump-filter-switch.scss?tag=jump-filter-switch&encapsulation=shadow","src/components/jump-filter-switch/jump-filter-switch.tsx"],"sourcesContent":["// src/components/switch/switch.styles.ts\nimport { css } from \"lit\";\nvar switch_styles_default = css`\n :host {\n display: inline-block;\n }\n\n :host([size='small']) {\n --height: var(--sl-toggle-size-small);\n --thumb-size: calc(var(--sl-toggle-size-small) + 4px);\n --width: calc(var(--height) * 2);\n\n font-size: var(--sl-input-font-size-small);\n }\n\n :host([size='medium']) {\n --height: var(--sl-toggle-size-medium);\n --thumb-size: calc(var(--sl-toggle-size-medium) + 4px);\n --width: calc(var(--height) * 2);\n\n font-size: var(--sl-input-font-size-medium);\n }\n\n :host([size='large']) {\n --height: var(--sl-toggle-size-large);\n --thumb-size: calc(var(--sl-toggle-size-large) + 4px);\n --width: calc(var(--height) * 2);\n\n font-size: var(--sl-input-font-size-large);\n }\n\n .switch {\n position: relative;\n display: inline-flex;\n align-items: center;\n font-family: var(--sl-input-font-family);\n font-size: inherit;\n font-weight: var(--sl-input-font-weight);\n color: var(--sl-input-label-color);\n vertical-align: middle;\n cursor: pointer;\n }\n\n .switch__control {\n flex: 0 0 auto;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--width);\n height: var(--height);\n background-color: var(--sl-color-neutral-400);\n border: solid var(--sl-input-border-width) var(--sl-color-neutral-400);\n border-radius: var(--height);\n transition:\n var(--sl-transition-fast) border-color,\n var(--sl-transition-fast) background-color;\n }\n\n .switch__control .switch__thumb {\n width: var(--thumb-size);\n height: var(--thumb-size);\n background-color: var(--sl-color-neutral-0);\n border-radius: 50%;\n border: solid var(--sl-input-border-width) var(--sl-color-neutral-400);\n translate: calc((var(--width) - var(--height)) / -2);\n transition:\n var(--sl-transition-fast) translate ease,\n var(--sl-transition-fast) background-color,\n var(--sl-transition-fast) border-color,\n var(--sl-transition-fast) box-shadow;\n }\n\n .switch__input {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n\n /* Hover */\n .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {\n background-color: var(--sl-color-neutral-400);\n border-color: var(--sl-color-neutral-400);\n }\n\n .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb {\n background-color: var(--sl-color-neutral-0);\n border-color: var(--sl-color-neutral-400);\n }\n\n /* Focus */\n .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {\n background-color: var(--sl-color-neutral-400);\n border-color: var(--sl-color-neutral-400);\n }\n\n .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {\n background-color: var(--sl-color-neutral-0);\n border-color: var(--sl-color-primary-600);\n outline: var(--sl-focus-ring);\n outline-offset: var(--sl-focus-ring-offset);\n }\n\n /* Checked */\n .switch--checked .switch__control {\n background-color: var(--sl-color-primary-600);\n border-color: var(--sl-color-primary-600);\n }\n\n .switch--checked .switch__control .switch__thumb {\n background-color: var(--sl-color-neutral-0);\n border-color: var(--sl-color-primary-600);\n translate: calc((var(--width) - var(--height)) / 2);\n }\n\n /* Checked + hover */\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover {\n background-color: var(--sl-color-primary-600);\n border-color: var(--sl-color-primary-600);\n }\n\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb {\n background-color: var(--sl-color-neutral-0);\n border-color: var(--sl-color-primary-600);\n }\n\n /* Checked + focus */\n .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {\n background-color: var(--sl-color-primary-600);\n border-color: var(--sl-color-primary-600);\n }\n\n .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {\n background-color: var(--sl-color-neutral-0);\n border-color: var(--sl-color-primary-600);\n outline: var(--sl-focus-ring);\n outline-offset: var(--sl-focus-ring-offset);\n }\n\n /* Disabled */\n .switch--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .switch__label {\n display: inline-block;\n line-height: var(--height);\n margin-inline-start: 0.5em;\n user-select: none;\n -webkit-user-select: none;\n }\n\n :host([required]) .switch__label::after {\n content: var(--sl-input-required-content);\n color: var(--sl-input-required-content-color);\n margin-inline-start: var(--sl-input-required-content-offset);\n }\n\n @media (forced-colors: active) {\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb,\n .switch--checked .switch__control .switch__thumb {\n background-color: ButtonText;\n }\n }\n`;\n\nexport {\n switch_styles_default\n};\n","import {\n switch_styles_default\n} from \"./chunk.EU44RQUN.js\";\nimport {\n defaultValue\n} from \"./chunk.GI7VDIWX.js\";\nimport {\n form_control_styles_default\n} from \"./chunk.SI4ACBFK.js\";\nimport {\n FormControlController\n} from \"./chunk.KWPBDQ6I.js\";\nimport {\n HasSlotController\n} from \"./chunk.NYIIDP5N.js\";\nimport {\n watch\n} from \"./chunk.2FB5TK5H.js\";\nimport {\n component_styles_default\n} from \"./chunk.TUVJKY7S.js\";\nimport {\n ShoelaceElement\n} from \"./chunk.SFSTXCXC.js\";\nimport {\n __decorateClass\n} from \"./chunk.IFDWM6P4.js\";\n\n// src/components/switch/switch.component.ts\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { html } from \"lit\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { property, query, state } from \"lit/decorators.js\";\nvar SlSwitch = class extends ShoelaceElement {\n constructor() {\n super(...arguments);\n this.formControlController = new FormControlController(this, {\n value: (control) => control.checked ? control.value || \"on\" : void 0,\n defaultValue: (control) => control.defaultChecked,\n setValue: (control, checked) => control.checked = checked\n });\n this.hasSlotController = new HasSlotController(this, \"help-text\");\n this.hasFocus = false;\n this.title = \"\";\n this.name = \"\";\n this.size = \"medium\";\n this.disabled = false;\n this.checked = false;\n this.defaultChecked = false;\n this.form = \"\";\n this.required = false;\n this.helpText = \"\";\n }\n /** Gets the validity state object */\n get validity() {\n return this.input.validity;\n }\n /** Gets the validation message */\n get validationMessage() {\n return this.input.validationMessage;\n }\n firstUpdated() {\n this.formControlController.updateValidity();\n }\n handleBlur() {\n this.hasFocus = false;\n this.emit(\"sl-blur\");\n }\n handleInput() {\n this.emit(\"sl-input\");\n }\n handleInvalid(event) {\n this.formControlController.setValidity(false);\n this.formControlController.emitInvalidEvent(event);\n }\n handleClick() {\n this.checked = !this.checked;\n this.emit(\"sl-change\");\n }\n handleFocus() {\n this.hasFocus = true;\n this.emit(\"sl-focus\");\n }\n handleKeyDown(event) {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n this.checked = false;\n this.emit(\"sl-change\");\n this.emit(\"sl-input\");\n }\n if (event.key === \"ArrowRight\") {\n event.preventDefault();\n this.checked = true;\n this.emit(\"sl-change\");\n this.emit(\"sl-input\");\n }\n }\n handleCheckedChange() {\n this.input.checked = this.checked;\n this.formControlController.updateValidity();\n }\n handleDisabledChange() {\n this.formControlController.setValidity(true);\n }\n /** Simulates a click on the switch. */\n click() {\n this.input.click();\n }\n /** Sets focus on the switch. */\n focus(options) {\n this.input.focus(options);\n }\n /** Removes focus from the switch. */\n blur() {\n this.input.blur();\n }\n /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */\n checkValidity() {\n return this.input.checkValidity();\n }\n /** Gets the associated form, if one exists. */\n getForm() {\n return this.formControlController.getForm();\n }\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n reportValidity() {\n return this.input.reportValidity();\n }\n /** Sets a custom validation message. Pass an empty string to restore validity. */\n setCustomValidity(message) {\n this.input.setCustomValidity(message);\n this.formControlController.updateValidity();\n }\n render() {\n const hasHelpTextSlot = this.hasSlotController.test(\"help-text\");\n const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;\n return html`\n <div\n class=${classMap({\n \"form-control\": true,\n \"form-control--small\": this.size === \"small\",\n \"form-control--medium\": this.size === \"medium\",\n \"form-control--large\": this.size === \"large\",\n \"form-control--has-help-text\": hasHelpText\n })}\n >\n <label\n part=\"base\"\n class=${classMap({\n switch: true,\n \"switch--checked\": this.checked,\n \"switch--disabled\": this.disabled,\n \"switch--focused\": this.hasFocus,\n \"switch--small\": this.size === \"small\",\n \"switch--medium\": this.size === \"medium\",\n \"switch--large\": this.size === \"large\"\n })}\n >\n <input\n class=\"switch__input\"\n type=\"checkbox\"\n title=${this.title}\n name=${this.name}\n value=${ifDefined(this.value)}\n .checked=${live(this.checked)}\n .disabled=${this.disabled}\n .required=${this.required}\n role=\"switch\"\n aria-checked=${this.checked ? \"true\" : \"false\"}\n aria-describedby=\"help-text\"\n @click=${this.handleClick}\n @input=${this.handleInput}\n @invalid=${this.handleInvalid}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n @keydown=${this.handleKeyDown}\n />\n\n <span part=\"control\" class=\"switch__control\">\n <span part=\"thumb\" class=\"switch__thumb\"></span>\n </span>\n\n <div part=\"label\" class=\"switch__label\">\n <slot></slot>\n </div>\n </label>\n\n <div\n aria-hidden=${hasHelpText ? \"false\" : \"true\"}\n class=\"form-control__help-text\"\n id=\"help-text\"\n part=\"form-control-help-text\"\n >\n <slot name=\"help-text\">${this.helpText}</slot>\n </div>\n </div>\n `;\n }\n};\nSlSwitch.styles = [component_styles_default, form_control_styles_default, switch_styles_default];\n__decorateClass([\n query('input[type=\"checkbox\"]')\n], SlSwitch.prototype, \"input\", 2);\n__decorateClass([\n state()\n], SlSwitch.prototype, \"hasFocus\", 2);\n__decorateClass([\n property()\n], SlSwitch.prototype, \"title\", 2);\n__decorateClass([\n property()\n], SlSwitch.prototype, \"name\", 2);\n__decorateClass([\n property()\n], SlSwitch.prototype, \"value\", 2);\n__decorateClass([\n property({ reflect: true })\n], SlSwitch.prototype, \"size\", 2);\n__decorateClass([\n property({ type: Boolean, reflect: true })\n], SlSwitch.prototype, \"disabled\", 2);\n__decorateClass([\n property({ type: Boolean, reflect: true })\n], SlSwitch.prototype, \"checked\", 2);\n__decorateClass([\n defaultValue(\"checked\")\n], SlSwitch.prototype, \"defaultChecked\", 2);\n__decorateClass([\n property({ reflect: true })\n], SlSwitch.prototype, \"form\", 2);\n__decorateClass([\n property({ type: Boolean, reflect: true })\n], SlSwitch.prototype, \"required\", 2);\n__decorateClass([\n property({ attribute: \"help-text\" })\n], SlSwitch.prototype, \"helpText\", 2);\n__decorateClass([\n watch(\"checked\", { waitUntilFirstUpdate: true })\n], SlSwitch.prototype, \"handleCheckedChange\", 1);\n__decorateClass([\n watch(\"disabled\", { waitUntilFirstUpdate: true })\n], SlSwitch.prototype, \"handleDisabledChange\", 1);\n\nexport {\n SlSwitch\n};\n","import {\n SlSwitch\n} from \"./chunk.S33XS33R.js\";\n\n// src/components/switch/switch.ts\nvar switch_default = SlSwitch;\nSlSwitch.define(\"sl-switch\");\n\nexport {\n switch_default\n};\n","@import '../../../node_modules/@shoelace-style/shoelace/dist/themes/light.css';\n\n:host {\n /* Definizione delle variabili per il nostro componente */\n --jump-switch-width: 36px;\n --jump-switch-height: 20px;\n --jump-switch-thumb-size: 14px;\n --jump-switch-thumb-color: var(--neutral-white, #ffffff);\n --jump-switch-active-color: var(--secondary-standard, #5e79ba);\n --jump-switch-inactive-color: var(--neutral-grey-disabled, #cbcbcb);\n --jump-switch-disabled-opacity: 0.5;\n --jump-switch-font-family: var(--ff-primary, 'Inter', sans-serif);\n --jump-switch-font-size: 16px;\n --jump-switch-font-weight: normal;\n --jump-switch-label-color: var(--neutral-black, #000000);\n\n display: flex;\n align-items: center;\n width: 100%;\n\n /* Stile diretto per Shoelace switch */\n sl-switch::part(base) {\n width: 100%;\n font-family: var(--jump-switch-font-family);\n font-size: var(--jump-switch-font-size);\n font-weight: var(--jump-switch-font-weight);\n color: var(--jump-switch-label-color);\n }\n\n sl-switch::part(control) {\n width: var(--jump-switch-width) !important;\n height: var(--jump-switch-height) !important;\n background-color: var(--jump-switch-inactive-color) !important;\n border-color: var(--jump-switch-inactive-color) !important;\n }\n\n sl-switch::part(thumb) {\n width: var(--jump-switch-thumb-size) !important;\n height: var(--jump-switch-thumb-size) !important;\n background-color: var(--jump-switch-thumb-color) !important;\n border-color: var(--jump-switch-thumb-color) !important;\n }\n\n sl-switch[checked]::part(control) {\n background-color: var(--jump-switch-active-color) !important;\n border-color: var(--jump-switch-active-color) !important;\n }\n\n sl-switch::part(label) {\n margin-left: 8px;\n }\n\n sl-switch[disabled] {\n opacity: var(--jump-switch-disabled-opacity);\n cursor: not-allowed;\n }\n\n /* Stile per il contatore */\n .count {\n margin-left: auto;\n color: var(--neutral-grey-secondary, #707070);\n font-size: 0.85em;\n }\n}\n","import { Component, Host, Prop, h, Event, EventEmitter, Method } from '@stencil/core';\nimport '@shoelace-style/shoelace/dist/components/switch/switch.js';\n\n/**\n * Componente switch per filtri con supporto per label e stato\n * @slot - Contenuto opzionale da mostrare accanto al switch (alternativo alla label)\n */\n@Component({\n tag: 'jump-filter-switch',\n styleUrl: 'jump-filter-switch.scss',\n shadow: true,\n})\nexport class JumpFilterSwitch {\n /** Il valore associato al switch */\n @Prop() value: string;\n\n /** La label da mostrare accanto al switch */\n @Prop() label: string;\n\n /** Stato del switch (acceso/spento) */\n @Prop({ reflect: true }) checked: boolean = false;\n\n /** Stato del switch (disabilitato) */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Riferimento all'elemento host */\n host: HTMLElement;\n\n /** Riferimento all'elemento sl-switch interno */\n el: any; // Usiamo any per evitare problemi di tipo con le proprietà specifiche di sl-switch\n\n componentDidLoad() {\n this.listenSLChange();\n }\n\n /**\n * Ascolta gli eventi di cambio stato dal switch Shoelace\n */\n listenSLChange() {\n if (this.host) {\n this.host.addEventListener('sl-change', () => {\n // Ignora l'evento se lo switch è disabilitato\n if (this.disabled) {\n return;\n }\n\n this.checked = !this.checked;\n\n const eventData = {\n value: this.value,\n checked: this.checked,\n };\n\n this.toggleCheckbox.emit(eventData);\n this.toggleCheckboxFilterChange.emit(eventData);\n });\n }\n }\n\n /**\n * Evento emesso quando cambia lo stato del switch\n */\n @Event({ eventName: 'jump-switch-change' }) toggleCheckbox: EventEmitter;\n @Event({ eventName: 'jump-filterchange' }) toggleCheckboxFilterChange: EventEmitter;\n\n /**\n * Metodo pubblico per verificare lo stato corrente del switch\n * @returns {boolean} Lo stato corrente del switch (true = acceso, false = spento)\n */\n @Method()\n async isChecked() {\n return this.checked;\n }\n\n render() {\n return (\n <Host ref={(host: HTMLElement) => (this.host = host)}>\n {this.value && this.label && (\n <sl-switch\n value={this.value}\n ref={(el: any) => (this.el = el)}\n checked={this.checked}\n disabled={this.disabled}\n >\n {this.label}\n </sl-switch>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"jump-filter-switch.js","mappings":";;;;;;AAAA;AAEA,IAAI,qBAAqB,GAAGA,CAAG,CAAC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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e,CAAC,CAAC;;YAG1C,MAAM,eAAe,GAAG;gBACtB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,YAAY,EAAE,IAAI;aACnB,CAAC;YACF,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;;YAGtD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;gBACpB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,UAAU,EAAE,QAAQ;aACrB,CAAC,CAAC;SACJ;QAED,OAAO,IAAI,CAAC,OAAO,CAAC;KACrB;;;;;IAiBD,MAAM,SAAS;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;KACrB;;;;;IAOD,MAAM,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;KACpB;;;;;IAOD,MAAM,OAAO;QACX,OAAO,IAAI,CAAC,IAAI,CAAC;KAClB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,GAAG,EAAE,CAAC,IAAiB,MAAM,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IACjD,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,KACvB,kEACE,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,GAAG,EAAE,CAAC,EAAO,MAAM,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,EAChC,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAEtB,IAAI,CAAC,KAAK,CACD,CACb,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["css","html","classMap","ifDefined","live","query","state","property","JumpFilterSwitch"],"sources":["node_modules/@shoelace-style/shoelace/dist/chunks/chunk.EU44RQUN.js","node_modules/@shoelace-style/shoelace/dist/chunks/chunk.S33XS33R.js","node_modules/@shoelace-style/shoelace/dist/chunks/chunk.TUJRSXNR.js","src/components/jump-filter-switch/jump-filter-switch.scss?tag=jump-filter-switch&encapsulation=shadow","src/components/jump-filter-switch/jump-filter-switch.tsx"],"sourcesContent":["// src/components/switch/switch.styles.ts\nimport { css } from \"lit\";\nvar switch_styles_default = css`\n :host {\n display: inline-block;\n }\n\n :host([size='small']) {\n --height: var(--sl-toggle-size-small);\n --thumb-size: calc(var(--sl-toggle-size-small) + 4px);\n --width: calc(var(--height) * 2);\n\n font-size: var(--sl-input-font-size-small);\n }\n\n :host([size='medium']) {\n --height: var(--sl-toggle-size-medium);\n --thumb-size: calc(var(--sl-toggle-size-medium) + 4px);\n --width: calc(var(--height) * 2);\n\n font-size: var(--sl-input-font-size-medium);\n }\n\n :host([size='large']) {\n --height: var(--sl-toggle-size-large);\n --thumb-size: calc(var(--sl-toggle-size-large) + 4px);\n --width: calc(var(--height) * 2);\n\n font-size: var(--sl-input-font-size-large);\n }\n\n .switch {\n position: relative;\n display: inline-flex;\n align-items: center;\n font-family: var(--sl-input-font-family);\n font-size: inherit;\n font-weight: var(--sl-input-font-weight);\n color: var(--sl-input-label-color);\n vertical-align: middle;\n cursor: pointer;\n }\n\n .switch__control {\n flex: 0 0 auto;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--width);\n height: var(--height);\n background-color: var(--sl-color-neutral-400);\n border: solid var(--sl-input-border-width) var(--sl-color-neutral-400);\n border-radius: var(--height);\n transition:\n var(--sl-transition-fast) border-color,\n var(--sl-transition-fast) background-color;\n }\n\n .switch__control .switch__thumb {\n width: var(--thumb-size);\n height: var(--thumb-size);\n background-color: var(--sl-color-neutral-0);\n border-radius: 50%;\n border: solid var(--sl-input-border-width) var(--sl-color-neutral-400);\n translate: calc((var(--width) - var(--height)) / -2);\n transition:\n var(--sl-transition-fast) translate ease,\n var(--sl-transition-fast) background-color,\n var(--sl-transition-fast) border-color,\n var(--sl-transition-fast) box-shadow;\n }\n\n .switch__input {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n\n /* Hover */\n .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {\n background-color: var(--sl-color-neutral-400);\n border-color: var(--sl-color-neutral-400);\n }\n\n .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb {\n background-color: var(--sl-color-neutral-0);\n border-color: var(--sl-color-neutral-400);\n }\n\n /* Focus */\n .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {\n background-color: var(--sl-color-neutral-400);\n border-color: var(--sl-color-neutral-400);\n }\n\n .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {\n background-color: var(--sl-color-neutral-0);\n border-color: var(--sl-color-primary-600);\n outline: var(--sl-focus-ring);\n outline-offset: var(--sl-focus-ring-offset);\n }\n\n /* Checked */\n .switch--checked .switch__control {\n background-color: var(--sl-color-primary-600);\n border-color: var(--sl-color-primary-600);\n }\n\n .switch--checked .switch__control .switch__thumb {\n background-color: var(--sl-color-neutral-0);\n border-color: var(--sl-color-primary-600);\n translate: calc((var(--width) - var(--height)) / 2);\n }\n\n /* Checked + hover */\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover {\n background-color: var(--sl-color-primary-600);\n border-color: var(--sl-color-primary-600);\n }\n\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb {\n background-color: var(--sl-color-neutral-0);\n border-color: var(--sl-color-primary-600);\n }\n\n /* Checked + focus */\n .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {\n background-color: var(--sl-color-primary-600);\n border-color: var(--sl-color-primary-600);\n }\n\n .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {\n background-color: var(--sl-color-neutral-0);\n border-color: var(--sl-color-primary-600);\n outline: var(--sl-focus-ring);\n outline-offset: var(--sl-focus-ring-offset);\n }\n\n /* Disabled */\n .switch--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .switch__label {\n display: inline-block;\n line-height: var(--height);\n margin-inline-start: 0.5em;\n user-select: none;\n -webkit-user-select: none;\n }\n\n :host([required]) .switch__label::after {\n content: var(--sl-input-required-content);\n color: var(--sl-input-required-content-color);\n margin-inline-start: var(--sl-input-required-content-offset);\n }\n\n @media (forced-colors: active) {\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb,\n .switch--checked .switch__control .switch__thumb {\n background-color: ButtonText;\n }\n }\n`;\n\nexport {\n switch_styles_default\n};\n","import {\n switch_styles_default\n} from \"./chunk.EU44RQUN.js\";\nimport {\n defaultValue\n} from \"./chunk.GI7VDIWX.js\";\nimport {\n form_control_styles_default\n} from \"./chunk.SI4ACBFK.js\";\nimport {\n FormControlController\n} from \"./chunk.KWPBDQ6I.js\";\nimport {\n HasSlotController\n} from \"./chunk.NYIIDP5N.js\";\nimport {\n watch\n} from \"./chunk.2FB5TK5H.js\";\nimport {\n component_styles_default\n} from \"./chunk.TUVJKY7S.js\";\nimport {\n ShoelaceElement\n} from \"./chunk.SFSTXCXC.js\";\nimport {\n __decorateClass\n} from \"./chunk.IFDWM6P4.js\";\n\n// src/components/switch/switch.component.ts\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { html } from \"lit\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { property, query, state } from \"lit/decorators.js\";\nvar SlSwitch = class extends ShoelaceElement {\n constructor() {\n super(...arguments);\n this.formControlController = new FormControlController(this, {\n value: (control) => control.checked ? control.value || \"on\" : void 0,\n defaultValue: (control) => control.defaultChecked,\n setValue: (control, checked) => control.checked = checked\n });\n this.hasSlotController = new HasSlotController(this, \"help-text\");\n this.hasFocus = false;\n this.title = \"\";\n this.name = \"\";\n this.size = \"medium\";\n this.disabled = false;\n this.checked = false;\n this.defaultChecked = false;\n this.form = \"\";\n this.required = false;\n this.helpText = \"\";\n }\n /** Gets the validity state object */\n get validity() {\n return this.input.validity;\n }\n /** Gets the validation message */\n get validationMessage() {\n return this.input.validationMessage;\n }\n firstUpdated() {\n this.formControlController.updateValidity();\n }\n handleBlur() {\n this.hasFocus = false;\n this.emit(\"sl-blur\");\n }\n handleInput() {\n this.emit(\"sl-input\");\n }\n handleInvalid(event) {\n this.formControlController.setValidity(false);\n this.formControlController.emitInvalidEvent(event);\n }\n handleClick() {\n this.checked = !this.checked;\n this.emit(\"sl-change\");\n }\n handleFocus() {\n this.hasFocus = true;\n this.emit(\"sl-focus\");\n }\n handleKeyDown(event) {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n this.checked = false;\n this.emit(\"sl-change\");\n this.emit(\"sl-input\");\n }\n if (event.key === \"ArrowRight\") {\n event.preventDefault();\n this.checked = true;\n this.emit(\"sl-change\");\n this.emit(\"sl-input\");\n }\n }\n handleCheckedChange() {\n this.input.checked = this.checked;\n this.formControlController.updateValidity();\n }\n handleDisabledChange() {\n this.formControlController.setValidity(true);\n }\n /** Simulates a click on the switch. */\n click() {\n this.input.click();\n }\n /** Sets focus on the switch. */\n focus(options) {\n this.input.focus(options);\n }\n /** Removes focus from the switch. */\n blur() {\n this.input.blur();\n }\n /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */\n checkValidity() {\n return this.input.checkValidity();\n }\n /** Gets the associated form, if one exists. */\n getForm() {\n return this.formControlController.getForm();\n }\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n reportValidity() {\n return this.input.reportValidity();\n }\n /** Sets a custom validation message. Pass an empty string to restore validity. */\n setCustomValidity(message) {\n this.input.setCustomValidity(message);\n this.formControlController.updateValidity();\n }\n render() {\n const hasHelpTextSlot = this.hasSlotController.test(\"help-text\");\n const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;\n return html`\n <div\n class=${classMap({\n \"form-control\": true,\n \"form-control--small\": this.size === \"small\",\n \"form-control--medium\": this.size === \"medium\",\n \"form-control--large\": this.size === \"large\",\n \"form-control--has-help-text\": hasHelpText\n })}\n >\n <label\n part=\"base\"\n class=${classMap({\n switch: true,\n \"switch--checked\": this.checked,\n \"switch--disabled\": this.disabled,\n \"switch--focused\": this.hasFocus,\n \"switch--small\": this.size === \"small\",\n \"switch--medium\": this.size === \"medium\",\n \"switch--large\": this.size === \"large\"\n })}\n >\n <input\n class=\"switch__input\"\n type=\"checkbox\"\n title=${this.title}\n name=${this.name}\n value=${ifDefined(this.value)}\n .checked=${live(this.checked)}\n .disabled=${this.disabled}\n .required=${this.required}\n role=\"switch\"\n aria-checked=${this.checked ? \"true\" : \"false\"}\n aria-describedby=\"help-text\"\n @click=${this.handleClick}\n @input=${this.handleInput}\n @invalid=${this.handleInvalid}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n @keydown=${this.handleKeyDown}\n />\n\n <span part=\"control\" class=\"switch__control\">\n <span part=\"thumb\" class=\"switch__thumb\"></span>\n </span>\n\n <div part=\"label\" class=\"switch__label\">\n <slot></slot>\n </div>\n </label>\n\n <div\n aria-hidden=${hasHelpText ? \"false\" : \"true\"}\n class=\"form-control__help-text\"\n id=\"help-text\"\n part=\"form-control-help-text\"\n >\n <slot name=\"help-text\">${this.helpText}</slot>\n </div>\n </div>\n `;\n }\n};\nSlSwitch.styles = [component_styles_default, form_control_styles_default, switch_styles_default];\n__decorateClass([\n query('input[type=\"checkbox\"]')\n], SlSwitch.prototype, \"input\", 2);\n__decorateClass([\n state()\n], SlSwitch.prototype, \"hasFocus\", 2);\n__decorateClass([\n property()\n], SlSwitch.prototype, \"title\", 2);\n__decorateClass([\n property()\n], SlSwitch.prototype, \"name\", 2);\n__decorateClass([\n property()\n], SlSwitch.prototype, \"value\", 2);\n__decorateClass([\n property({ reflect: true })\n], SlSwitch.prototype, \"size\", 2);\n__decorateClass([\n property({ type: Boolean, reflect: true })\n], SlSwitch.prototype, \"disabled\", 2);\n__decorateClass([\n property({ type: Boolean, reflect: true })\n], SlSwitch.prototype, \"checked\", 2);\n__decorateClass([\n defaultValue(\"checked\")\n], SlSwitch.prototype, \"defaultChecked\", 2);\n__decorateClass([\n property({ reflect: true })\n], SlSwitch.prototype, \"form\", 2);\n__decorateClass([\n property({ type: Boolean, reflect: true })\n], SlSwitch.prototype, \"required\", 2);\n__decorateClass([\n property({ attribute: \"help-text\" })\n], SlSwitch.prototype, \"helpText\", 2);\n__decorateClass([\n watch(\"checked\", { waitUntilFirstUpdate: true })\n], SlSwitch.prototype, \"handleCheckedChange\", 1);\n__decorateClass([\n watch(\"disabled\", { waitUntilFirstUpdate: true })\n], SlSwitch.prototype, \"handleDisabledChange\", 1);\n\nexport {\n SlSwitch\n};\n","import {\n SlSwitch\n} from \"./chunk.S33XS33R.js\";\n\n// src/components/switch/switch.ts\nvar switch_default = SlSwitch;\nSlSwitch.define(\"sl-switch\");\n\nexport {\n switch_default\n};\n","@import '../../../node_modules/@shoelace-style/shoelace/dist/themes/light.css';\n\n:host {\n /* Definizione delle variabili per il nostro componente */\n --jump-switch-width: 36px;\n --jump-switch-height: 20px;\n --jump-switch-thumb-size: 14px;\n --jump-switch-thumb-color: var(--neutral-white, #ffffff);\n --jump-switch-active-color: var(--secondary-standard, #5e79ba);\n --jump-switch-inactive-color: var(--neutral-grey-disabled, #cbcbcb);\n --jump-switch-disabled-opacity: 0.5;\n --jump-switch-font-family: var(--ff-primary, 'Inter', sans-serif);\n --jump-switch-font-size: 16px;\n --jump-switch-font-weight: normal;\n --jump-switch-label-color: var(--neutral-black, #000000);\n\n display: flex;\n align-items: center;\n width: 100%;\n\n /* Stile diretto per Shoelace switch */\n sl-switch::part(base) {\n width: 100%;\n font-family: var(--jump-switch-font-family);\n font-size: var(--jump-switch-font-size);\n font-weight: var(--jump-switch-font-weight);\n color: var(--jump-switch-label-color);\n }\n\n sl-switch::part(control) {\n width: var(--jump-switch-width) !important;\n height: var(--jump-switch-height) !important;\n background-color: var(--jump-switch-inactive-color) !important;\n border-color: var(--jump-switch-inactive-color) !important;\n }\n\n sl-switch::part(thumb) {\n width: var(--jump-switch-thumb-size) !important;\n height: var(--jump-switch-thumb-size) !important;\n background-color: var(--jump-switch-thumb-color) !important;\n border-color: var(--jump-switch-thumb-color) !important;\n }\n\n sl-switch[checked]::part(control) {\n background-color: var(--jump-switch-active-color) !important;\n border-color: var(--jump-switch-active-color) !important;\n }\n\n sl-switch::part(label) {\n margin-left: 8px;\n }\n\n sl-switch[disabled] {\n opacity: var(--jump-switch-disabled-opacity);\n cursor: not-allowed;\n }\n\n /* Stile per il contatore */\n .count {\n margin-left: auto;\n color: var(--neutral-grey-secondary, #707070);\n font-size: 0.85em;\n }\n}\n","import { Component, Host, Prop, h, Event, EventEmitter, Watch, Method, State } from '@stencil/core';\nimport '@shoelace-style/shoelace/dist/components/switch/switch.js';\n\n/**\n * Componente switch per filtri con supporto per label e stato\n * @slot - Contenuto opzionale da mostrare accanto al switch (alternativo alla label)\n */\n@Component({\n tag: 'jump-filter-switch',\n styleUrl: 'jump-filter-switch.scss',\n shadow: true,\n})\nexport class JumpFilterSwitch {\n /** Il valore associato al switch */\n @Prop() value: string;\n\n /** La label da mostrare accanto al switch */\n @Prop() label: string;\n\n /** Nome identificativo del filtro, utilizzato negli eventi */\n @Prop() name: string = 'switch-filter';\n\n /** Stato del switch (acceso/spento) */\n @Prop({ reflect: true, mutable: true }) checked: boolean = false;\n\n /** Stato del switch (disabilitato) */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Stato interno per tenere traccia dei valori selezionati */\n @State() values: string[] = [];\n\n /**\n * Watch sulla proprietà checked per reagire ai cambiamenti esterni\n */\n @Watch('checked')\n checkedChanged(newValue: boolean, oldValue: boolean) {\n if (newValue !== oldValue) {\n // Aggiorna l'elemento sl-switch\n if (this.el) {\n this.el.checked = newValue;\n }\n\n // Aggiorna i valori\n this.updateValues();\n }\n }\n\n /** Riferimento all'elemento host */\n host: HTMLElement;\n\n /** Riferimento all'elemento sl-switch interno */\n el: any; // Usiamo any per evitare problemi di tipo con le proprietà specifiche di sl-switch\n\n componentDidLoad() {\n this.listenSLChange();\n // Inizializza i valori in base allo stato del checkbox\n this.updateValues();\n\n // Se è stato passato un valore di checked, applica lo stato all'elemento sl-switch\n if (this.el && this.checked) {\n this.el.checked = this.checked;\n }\n }\n\n /**\n * Aggiorna l'array dei valori in base allo stato del checkbox\n */\n private updateValues() {\n this.values = this.checked && this.value ? [this.value] : [];\n }\n\n /**\n * Ascolta gli eventi di cambio stato dal switch Shoelace\n */\n listenSLChange() {\n if (this.host) {\n this.host.addEventListener('sl-change', () => {\n // Ignora l'evento se lo switch è disabilitato\n if (this.disabled) {\n return;\n }\n\n this.checked = !this.checked;\n this.updateValues();\n\n // Evento specifico per il componente switch\n const switchEventData = {\n value: this.value,\n checked: this.checked\n };\n this.toggleCheckbox.emit(switchEventData);\n\n // Evento standard per il sistema di filtri\n const filterEventData = {\n name: this.name,\n values: this.values,\n checked: this.checked\n };\n this.toggleCheckboxFilterChange.emit(filterEventData);\n });\n }\n }\n\n /**\n * Metodo pubblico per impostare programmaticamente lo stato del switch\n * @param checked - Il nuovo stato del switch (true = acceso, false = spento)\n * @param emitEvent - Se emettere eventi di cambio stato (default: true)\n * @returns {Promise<boolean>} Il nuovo stato del switch\n */\n @Method()\n async setValue(checked: boolean, emitEvent: boolean = true): Promise<boolean> {\n // Se il component è disabilitato, non fare nulla\n if (this.disabled) {\n return this.checked;\n }\n\n // Salva il valore precedente per l'evento\n const oldValue = this.checked;\n\n // Imposta il nuovo valore\n this.checked = checked;\n\n // Aggiorna l'elemento sl-switch interno\n if (this.el) {\n this.el.checked = checked;\n }\n\n // Aggiorna l'array dei valori\n this.updateValues();\n\n // Emetti eventi se richiesto\n if (emitEvent && oldValue !== checked) {\n // Evento specifico per il componente switch\n const switchEventData = {\n value: this.value,\n checked: this.checked,\n programmatic: true\n };\n this.toggleCheckbox.emit(switchEventData);\n\n // Evento standard per il sistema di filtri\n const filterEventData = {\n name: this.name,\n values: this.values,\n checked: this.checked,\n programmatic: true\n };\n this.toggleCheckboxFilterChange.emit(filterEventData);\n\n // Evento specifico per cambio valore programmato\n this.valueChange.emit({\n value: this.value,\n checked: this.checked,\n oldChecked: oldValue\n });\n }\n\n return this.checked;\n }\n\n /**\n * Evento emesso quando cambia lo stato del switch\n */\n @Event({ eventName: 'jump-switch-change' }) toggleCheckbox: EventEmitter;\n @Event({ eventName: 'jump-filterchange' }) toggleCheckboxFilterChange: EventEmitter;\n /**\n * Evento emesso quando il valore viene cambiato programmaticamente\n */\n @Event({ eventName: 'jump-switch-value-change' }) valueChange: EventEmitter;\n\n /**\n * Metodo pubblico per verificare lo stato corrente del switch\n * @returns {boolean} Lo stato corrente del switch (true = acceso, false = spento)\n */\n @Method()\n async isChecked() {\n return this.checked;\n }\n\n /**\n * Metodo pubblico per ottenere i valori selezionati\n * @returns {string[]} Array contenente il valore se selezionato, altrimenti 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 {string} Il nome del filtro\n */\n @Method()\n async getName() {\n return this.name;\n }\n\n render() {\n return (\n <Host ref={(host: HTMLElement) => (this.host = host)}>\n {this.value && this.label && (\n <sl-switch\n value={this.value}\n ref={(el: any) => (this.el = el)}\n checked={this.checked}\n disabled={this.disabled}\n >\n {this.label}\n </sl-switch>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|