mantenimento-app 2.4.5 → 2.4.7

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/app.js CHANGED
@@ -289,7 +289,7 @@ const defaultExpenseItems = [
289
289
  firstHomeAssignedToHint: "Seleziona il coniuge a cui e ceduta la prima casa.",
290
290
  firstHomeAssignedToNone: "Nessuna cessione",
291
291
  firstHomeAssignedToSpouse: "Casa ceduta a {spouse}",
292
- firstHomeSplitLabel: "Quota mutuo a carico {spouse} (%)",
292
+ firstHomeSplitLabel: "Quota mutuo a carico",
293
293
  firstHomeSplitHint: "Percentuale della rata mutuo pagata da {spouse}. La quota dell'altro coniuge e complementare a 100%.",
294
294
  firstHomeSplitInfo: "Ripartizione mutuo: {spouse1} {p1}% · {spouse2} {p2}%",
295
295
  calcCompBenefitsLabel: "Benefici compensativi gia allocati",
@@ -651,7 +651,7 @@ const defaultExpenseItems = [
651
651
  firstHomeAssignedToHint: "Select which spouse receives assignment of the primary home.",
652
652
  firstHomeAssignedToNone: "No assignment",
653
653
  firstHomeAssignedToSpouse: "Home assigned to {spouse}",
654
- firstHomeSplitLabel: "Mortgage share paid by {spouse} (%)",
654
+ firstHomeSplitLabel: "Mortgage share allocation",
655
655
  firstHomeSplitHint: "Percentage of the monthly mortgage payment paid by {spouse}. The other spouse share is the complement to 100%.",
656
656
  firstHomeSplitInfo: "Mortgage split: {spouse1} {p1}% · {spouse2} {p2}%",
657
657
  calcCompBenefitsLabel: "Compensative benefits already allocated",
@@ -1290,7 +1290,7 @@ const defaultExpenseItems = [
1290
1290
  if (hintPrimaCasaMutuoImporto) hintPrimaCasaMutuoImporto.title = tr("firstHomeMortgageAmountHint");
1291
1291
  if (lblPrimaCasaAssegnataA) lblPrimaCasaAssegnataA.textContent = tr("firstHomeAssignedToLabel");
1292
1292
  if (hintPrimaCasaAssegnataA) hintPrimaCasaAssegnataA.title = tr("firstHomeAssignedToHint");
1293
- if (lblPrimaCasaMutuoPerc1) lblPrimaCasaMutuoPerc1.textContent = msg("firstHomeSplitLabel", { spouse: c1n() });
1293
+ if (lblPrimaCasaMutuoPerc1) lblPrimaCasaMutuoPerc1.textContent = tr("firstHomeSplitLabel");
1294
1294
  if (hintPrimaCasaMutuoPerc1) hintPrimaCasaMutuoPerc1.title = msg("firstHomeSplitHint", { spouse: c1n() });
1295
1295
  if (lblStraordAnn1) lblStraordAnn1.textContent = msg("extraAnnLabel1", { spouse: c1n(), currency: currentCurrency });
1296
1296
  if (lblStraordAnn2) lblStraordAnn2.textContent = msg("extraAnnLabel2", { spouse: c2n(), currency: currentCurrency });
@@ -3931,7 +3931,7 @@ const defaultExpenseItems = [
3931
3931
  const amount = Math.max(0, num("primaCasaMutuoImporto"));
3932
3932
  const quota1 = amount * (normalizedShare1 / 100);
3933
3933
  const quota2 = amount - quota1;
3934
- if (splitLabelEl) splitLabelEl.textContent = msg("firstHomeSplitLabel", { spouse: c1n() });
3934
+ if (splitLabelEl) splitLabelEl.textContent = tr("firstHomeSplitLabel");
3935
3935
  if (splitHintEl) splitHintEl.title = msg("firstHomeSplitHint", { spouse: c1n() });
3936
3936
  if (splitInfoEl) {
3937
3937
  splitInfoEl.textContent = msg("firstHomeSplitInfo", {
@@ -6469,6 +6469,19 @@ ${scenarioLab.length ? `
6469
6469
  }
6470
6470
  });
6471
6471
 
6472
+ const firstHomeShiftLeftBtn = document.getElementById("primaCasaMutuoShiftLeft");
6473
+ const firstHomeShiftRightBtn = document.getElementById("primaCasaMutuoShiftRight");
6474
+ const firstHomeShareInput = document.getElementById("primaCasaMutuoPerc1");
6475
+ const shiftFirstHomeShare = (delta) => {
6476
+ if (!firstHomeShareInput || firstHomeShareInput.disabled) return;
6477
+ const next = Math.min(100, Math.max(0, Number(firstHomeShareInput.value || 0) + delta));
6478
+ firstHomeShareInput.value = String(next);
6479
+ updateFirstHomeMortgageUi();
6480
+ renderAll();
6481
+ };
6482
+ if (firstHomeShiftLeftBtn) firstHomeShiftLeftBtn.addEventListener("click", () => shiftFirstHomeShare(-1));
6483
+ if (firstHomeShiftRightBtn) firstHomeShiftRightBtn.addEventListener("click", () => shiftFirstHomeShare(1));
6484
+
6472
6485
  document.getElementById("langSelect").addEventListener("change", (e) => {
6473
6486
  const next = String(e.target.value || "it").toLowerCase();
6474
6487
  currentLang = SUPPORTED_LANGS.includes(next) ? next : "it";
@@ -289,7 +289,7 @@ const defaultExpenseItems = [
289
289
  firstHomeAssignedToHint: "Seleziona il coniuge a cui e ceduta la prima casa.",
290
290
  firstHomeAssignedToNone: "Nessuna cessione",
291
291
  firstHomeAssignedToSpouse: "Casa ceduta a {spouse}",
292
- firstHomeSplitLabel: "Quota mutuo a carico {spouse} (%)",
292
+ firstHomeSplitLabel: "Quota mutuo a carico",
293
293
  firstHomeSplitHint: "Percentuale della rata mutuo pagata da {spouse}. La quota dell'altro coniuge e complementare a 100%.",
294
294
  firstHomeSplitInfo: "Ripartizione mutuo: {spouse1} {p1}% · {spouse2} {p2}%",
295
295
  calcCompBenefitsLabel: "Benefici compensativi gia allocati",
@@ -651,7 +651,7 @@ const defaultExpenseItems = [
651
651
  firstHomeAssignedToHint: "Select which spouse receives assignment of the primary home.",
652
652
  firstHomeAssignedToNone: "No assignment",
653
653
  firstHomeAssignedToSpouse: "Home assigned to {spouse}",
654
- firstHomeSplitLabel: "Mortgage share paid by {spouse} (%)",
654
+ firstHomeSplitLabel: "Mortgage share allocation",
655
655
  firstHomeSplitHint: "Percentage of the monthly mortgage payment paid by {spouse}. The other spouse share is the complement to 100%.",
656
656
  firstHomeSplitInfo: "Mortgage split: {spouse1} {p1}% · {spouse2} {p2}%",
657
657
  calcCompBenefitsLabel: "Compensative benefits already allocated",
@@ -1290,7 +1290,7 @@ const defaultExpenseItems = [
1290
1290
  if (hintPrimaCasaMutuoImporto) hintPrimaCasaMutuoImporto.title = tr("firstHomeMortgageAmountHint");
1291
1291
  if (lblPrimaCasaAssegnataA) lblPrimaCasaAssegnataA.textContent = tr("firstHomeAssignedToLabel");
1292
1292
  if (hintPrimaCasaAssegnataA) hintPrimaCasaAssegnataA.title = tr("firstHomeAssignedToHint");
1293
- if (lblPrimaCasaMutuoPerc1) lblPrimaCasaMutuoPerc1.textContent = msg("firstHomeSplitLabel", { spouse: c1n() });
1293
+ if (lblPrimaCasaMutuoPerc1) lblPrimaCasaMutuoPerc1.textContent = tr("firstHomeSplitLabel");
1294
1294
  if (hintPrimaCasaMutuoPerc1) hintPrimaCasaMutuoPerc1.title = msg("firstHomeSplitHint", { spouse: c1n() });
1295
1295
  if (lblStraordAnn1) lblStraordAnn1.textContent = msg("extraAnnLabel1", { spouse: c1n(), currency: currentCurrency });
1296
1296
  if (lblStraordAnn2) lblStraordAnn2.textContent = msg("extraAnnLabel2", { spouse: c2n(), currency: currentCurrency });
@@ -3931,7 +3931,7 @@ const defaultExpenseItems = [
3931
3931
  const amount = Math.max(0, num("primaCasaMutuoImporto"));
3932
3932
  const quota1 = amount * (normalizedShare1 / 100);
3933
3933
  const quota2 = amount - quota1;
3934
- if (splitLabelEl) splitLabelEl.textContent = msg("firstHomeSplitLabel", { spouse: c1n() });
3934
+ if (splitLabelEl) splitLabelEl.textContent = tr("firstHomeSplitLabel");
3935
3935
  if (splitHintEl) splitHintEl.title = msg("firstHomeSplitHint", { spouse: c1n() });
3936
3936
  if (splitInfoEl) {
3937
3937
  splitInfoEl.textContent = msg("firstHomeSplitInfo", {
@@ -6469,6 +6469,19 @@ ${scenarioLab.length ? `
6469
6469
  }
6470
6470
  });
6471
6471
 
6472
+ const firstHomeShiftLeftBtn = document.getElementById("primaCasaMutuoShiftLeft");
6473
+ const firstHomeShiftRightBtn = document.getElementById("primaCasaMutuoShiftRight");
6474
+ const firstHomeShareInput = document.getElementById("primaCasaMutuoPerc1");
6475
+ const shiftFirstHomeShare = (delta) => {
6476
+ if (!firstHomeShareInput || firstHomeShareInput.disabled) return;
6477
+ const next = Math.min(100, Math.max(0, Number(firstHomeShareInput.value || 0) + delta));
6478
+ firstHomeShareInput.value = String(next);
6479
+ updateFirstHomeMortgageUi();
6480
+ renderAll();
6481
+ };
6482
+ if (firstHomeShiftLeftBtn) firstHomeShiftLeftBtn.addEventListener("click", () => shiftFirstHomeShare(-1));
6483
+ if (firstHomeShiftRightBtn) firstHomeShiftRightBtn.addEventListener("click", () => shiftFirstHomeShare(1));
6484
+
6472
6485
  document.getElementById("langSelect").addEventListener("change", (e) => {
6473
6486
  const next = String(e.target.value || "it").toLowerCase();
6474
6487
  currentLang = SUPPORTED_LANGS.includes(next) ? next : "it";
@@ -88,7 +88,7 @@
88
88
  ]
89
89
  }
90
90
  </script>
91
- <link rel="stylesheet" href="styles.css?v=2.4.5" />
91
+ <link rel="stylesheet" href="styles.css?v=2.4.7" />
92
92
  </head>
93
93
  <body>
94
94
  <div class="wrap">
@@ -380,8 +380,8 @@
380
380
  </label>
381
381
  <input id="primaCasaMutuoImporto" type="number" min="0" step="50" value="0" />
382
382
  </div>
383
- <div class="field">
384
- <label for="primaCasaMutuoPerc1" class="label-row"><span id="lblPrimaCasaMutuoPerc1">Quota mutuo a carico Coniuge 1 (%)</span>
383
+ <div class="field first-home-split-field">
384
+ <label for="primaCasaMutuoPerc1" class="label-row"><span id="lblPrimaCasaMutuoPerc1">Quota mutuo a carico</span>
385
385
  <span class="hint" id="hintPrimaCasaMutuoPerc1" title="Percentuale della rata mutuo pagata da Coniuge 1. La quota dell'altro coniuge e complementare a 100%.">i</span>
386
386
  </label>
387
387
  <div class="mortgage-split-slider" id="primaCasaMutuoSliderWrap">
@@ -390,7 +390,11 @@
390
390
  <div class="mortgage-split-amount" id="primaCasaSplitLeftAmount">0 EUR</div>
391
391
  </div>
392
392
  <div class="mortgage-split-range-wrap">
393
- <input id="primaCasaMutuoPerc1" type="range" min="0" max="100" step="1" value="50" aria-label="Ripartizione quota mutuo" />
393
+ <div class="mortgage-split-range-controls">
394
+ <button id="primaCasaMutuoShiftLeft" class="mortgage-split-nudge" type="button" aria-label="Sposta quota verso sinistra" title="Sposta quota verso sinistra">&#9664;</button>
395
+ <input id="primaCasaMutuoPerc1" type="range" min="0" max="100" step="1" value="50" aria-label="Ripartizione quota mutuo" />
396
+ <button id="primaCasaMutuoShiftRight" class="mortgage-split-nudge" type="button" aria-label="Sposta quota verso destra" title="Sposta quota verso destra">&#9654;</button>
397
+ </div>
394
398
  <div class="mortgage-split-center" id="primaCasaSplitCenter">50% / 50%</div>
395
399
  </div>
396
400
  <div class="mortgage-split-side mortgage-split-side-right" id="primaCasaSplitRight">
@@ -626,7 +630,7 @@
626
630
  <script src="supabase.min.js"></script>
627
631
  <script src="fabric.min.js"></script>
628
632
  <script src="html2pdf.bundle.min.js"></script>
629
- <script src="app.js?v=2.4.5"></script>
633
+ <script src="app.js?v=2.4.7"></script>
630
634
  </body>
631
635
  </html>
632
636
 
@@ -945,6 +945,10 @@
945
945
  gap: 8px 10px;
946
946
  }
947
947
 
948
+ .extra-box-first-home .first-home-split-field {
949
+ grid-column: 1 / -1;
950
+ }
951
+
948
952
  .extra-box-first-home .field {
949
953
  border-radius: 12px;
950
954
  padding: 8px 9px 7px;
@@ -1032,7 +1036,7 @@
1032
1036
  border-radius: 14px;
1033
1037
  padding: 12px;
1034
1038
  background: linear-gradient(135deg, #ffffff 0%, #f5fbf9 100%);
1035
- min-height: 62px;
1039
+ min-height: 74px;
1036
1040
  display: grid;
1037
1041
  align-content: center;
1038
1042
  gap: 4px;
@@ -1087,16 +1091,16 @@
1087
1091
  }
1088
1092
 
1089
1093
  .mortgage-split-name {
1090
- font-size: 0.73rem;
1094
+ font-size: 0.92rem;
1091
1095
  font-weight: 800;
1092
1096
  color: #1a3a36;
1093
1097
  overflow-wrap: anywhere;
1094
- letter-spacing: 0.3px;
1098
+ letter-spacing: 0.2px;
1095
1099
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
1096
1100
  }
1097
1101
 
1098
1102
  .mortgage-split-amount {
1099
- font-size: 0.95rem;
1103
+ font-size: 1.28rem;
1100
1104
  font-weight: 900;
1101
1105
  color: #0b4440;
1102
1106
  letter-spacing: 0.3px;
@@ -1120,6 +1124,48 @@
1120
1124
  --split-left: 50%;
1121
1125
  }
1122
1126
 
1127
+ .mortgage-split-range-controls {
1128
+ display: grid;
1129
+ grid-template-columns: 42px minmax(0, 1fr) 42px;
1130
+ gap: 8px;
1131
+ align-items: center;
1132
+ }
1133
+
1134
+ .mortgage-split-nudge {
1135
+ height: 38px;
1136
+ width: 38px;
1137
+ padding: 0;
1138
+ display: inline-flex;
1139
+ align-items: center;
1140
+ justify-content: center;
1141
+ border-radius: 50%;
1142
+ border: 1.5px solid rgba(27, 141, 127, 0.3);
1143
+ background: radial-gradient(circle at 30% 30%, #ffffff 0%, #ecfaf6 44%, #dff4ef 100%);
1144
+ color: #0f6056;
1145
+ font-size: 17px;
1146
+ font-weight: 900;
1147
+ line-height: 1;
1148
+ cursor: pointer;
1149
+ box-shadow: 0 4px 10px rgba(17, 93, 84, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.9);
1150
+ transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
1151
+ }
1152
+
1153
+ .mortgage-split-nudge:hover {
1154
+ transform: translateY(-1px) scale(1.06);
1155
+ border-color: rgba(27, 141, 127, 0.44);
1156
+ box-shadow: 0 7px 16px rgba(17, 93, 84, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.92);
1157
+ }
1158
+
1159
+ .mortgage-split-nudge:active {
1160
+ transform: translateY(0) scale(0.98);
1161
+ }
1162
+
1163
+ .mortgage-split-slider.is-disabled .mortgage-split-nudge {
1164
+ opacity: 0.6;
1165
+ cursor: not-allowed;
1166
+ transform: none;
1167
+ }
1168
+
1123
1169
  .mortgage-split-range-wrap input[type="range"] {
1124
1170
  -webkit-appearance: none;
1125
1171
  appearance: none;
@@ -1188,13 +1234,13 @@
1188
1234
  top: 2px;
1189
1235
  left: var(--split-left);
1190
1236
  transform: translateX(-50%);
1191
- font-size: 0.73rem;
1237
+ font-size: 0.92rem;
1192
1238
  font-weight: 900;
1193
1239
  color: #0f544d;
1194
1240
  background: linear-gradient(135deg, #ffffff, #f5fbf9);
1195
1241
  border: 1.5px solid rgba(27, 141, 127, 0.2);
1196
1242
  border-radius: 999px;
1197
- padding: 2px 9px;
1243
+ padding: 4px 11px;
1198
1244
  white-space: nowrap;
1199
1245
  box-shadow: 0 2px 6px rgba(27, 141, 127, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.6);
1200
1246
  transition: all 0.2s ease;
@@ -1214,17 +1260,23 @@
1214
1260
 
1215
1261
  #primaCasaMutuoSplitInfo {
1216
1262
  margin-top: 7px;
1217
- font-size: 0.79rem;
1263
+ font-size: 0.95rem;
1218
1264
  font-weight: 700;
1219
1265
  color: #174e47;
1220
1266
  background: linear-gradient(90deg, rgba(22, 163, 150, 0.12), rgba(216, 154, 53, 0.12));
1221
1267
  border: 1px solid rgba(22, 163, 150, 0.14);
1222
1268
  border-radius: 999px;
1223
- padding: 4px 10px;
1269
+ padding: 7px 12px;
1224
1270
  display: inline-flex;
1225
1271
  align-items: center;
1226
1272
  gap: 4px;
1227
1273
  }
1274
+
1275
+ .first-home-split-field > .label-row {
1276
+ font-size: 1.1rem;
1277
+ font-weight: 800;
1278
+ color: #114b44;
1279
+ }
1228
1280
 
1229
1281
  .label-row {
1230
1282
  display: inline-flex;
@@ -2701,7 +2753,7 @@
2701
2753
  padding: 7px;
2702
2754
  }
2703
2755
 
2704
- .kpi-item strong { font-size: 1.05rem; font-weight: 700; white-space: nowrap; }
2756
+ .kpi-item:not(.kpi-item--longtext) strong { font-size: 1.05rem; font-weight: 700; white-space: nowrap; }
2705
2757
 
2706
2758
  .result-pill {
2707
2759
  border-radius: 14px;
@@ -3495,6 +3547,16 @@
3495
3547
  .mortgage-split-range-wrap {
3496
3548
  order: -1;
3497
3549
  }
3550
+
3551
+ .mortgage-split-range-controls {
3552
+ grid-template-columns: 34px minmax(0, 1fr) 34px;
3553
+ }
3554
+
3555
+ .mortgage-split-nudge {
3556
+ height: 32px;
3557
+ width: 32px;
3558
+ font-size: 14px;
3559
+ }
3498
3560
  .spieg-grid {
3499
3561
  grid-template-columns: 1fr;
3500
3562
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mantenimento-app",
3
- "version": "2.4.5",
3
+ "version": "2.4.7",
4
4
  "description": "Frontend + backend architecture for the mantenimento calculator",
5
5
  "type": "commonjs",
6
6
  "main": "backend/calculate-model.js",