mantenimento-app 2.4.7 → 2.4.8

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
@@ -4918,8 +4918,10 @@ const defaultExpenseItems = [
4918
4918
  [tr("pdfAmountPerChild"), eur((Math.max(m.assegnoDa1a2, m.assegnoDa2a1)) / m.figli), "warn"]
4919
4919
  ];
4920
4920
 
4921
- if (benefitsInline) {
4922
- items.push([tr("calcCompBenefitsLabel"), benefitsInline, "warn"]);
4921
+ const kpiBenefitLines = getCompensativeBenefitRows(m, c1n(), c2n())
4922
+ .map((row) => `${escapeHtml(row.label)}: ${eur(row.amount)}`);
4923
+ if (kpiBenefitLines.length) {
4924
+ items.push([tr("calcCompBenefitsLabel"), kpiBenefitLines.join("<br />"), "warn", true]);
4923
4925
  }
4924
4926
 
4925
4927
  if (m.incomeMode === "cu") {
@@ -4932,13 +4934,20 @@ const defaultExpenseItems = [
4932
4934
  );
4933
4935
  }
4934
4936
 
4935
- items.forEach(([label, value, cls]) => {
4937
+ items.forEach(([label, value, cls, isHtml = false]) => {
4936
4938
  const el = document.createElement("div");
4937
4939
  el.className = "kpi-item";
4938
- if (label === tr("calcCompBenefitsLabel")) {
4940
+ const isBenefitsRow = label === tr("calcCompBenefitsLabel");
4941
+ if (isBenefitsRow) {
4939
4942
  el.classList.add("kpi-item--longtext");
4940
4943
  }
4941
- el.innerHTML = `<span>${label}</span><strong class="${cls}">${value}</strong>`;
4944
+ const safeLabel = escapeHtml(String(label || ""));
4945
+ const safeValue = isHtml ? String(value || "") : escapeHtml(String(value || ""));
4946
+ if (isBenefitsRow) {
4947
+ el.innerHTML = `<span>${safeLabel}</span><p class="kpi-longtext-value ${cls}">${safeValue}</p>`;
4948
+ } else {
4949
+ el.innerHTML = `<span>${safeLabel}</span><strong class="${cls}">${safeValue}</strong>`;
4950
+ }
4942
4951
  kpi.appendChild(el);
4943
4952
  });
4944
4953
  }
@@ -4918,8 +4918,10 @@ const defaultExpenseItems = [
4918
4918
  [tr("pdfAmountPerChild"), eur((Math.max(m.assegnoDa1a2, m.assegnoDa2a1)) / m.figli), "warn"]
4919
4919
  ];
4920
4920
 
4921
- if (benefitsInline) {
4922
- items.push([tr("calcCompBenefitsLabel"), benefitsInline, "warn"]);
4921
+ const kpiBenefitLines = getCompensativeBenefitRows(m, c1n(), c2n())
4922
+ .map((row) => `${escapeHtml(row.label)}: ${eur(row.amount)}`);
4923
+ if (kpiBenefitLines.length) {
4924
+ items.push([tr("calcCompBenefitsLabel"), kpiBenefitLines.join("<br />"), "warn", true]);
4923
4925
  }
4924
4926
 
4925
4927
  if (m.incomeMode === "cu") {
@@ -4932,13 +4934,20 @@ const defaultExpenseItems = [
4932
4934
  );
4933
4935
  }
4934
4936
 
4935
- items.forEach(([label, value, cls]) => {
4937
+ items.forEach(([label, value, cls, isHtml = false]) => {
4936
4938
  const el = document.createElement("div");
4937
4939
  el.className = "kpi-item";
4938
- if (label === tr("calcCompBenefitsLabel")) {
4940
+ const isBenefitsRow = label === tr("calcCompBenefitsLabel");
4941
+ if (isBenefitsRow) {
4939
4942
  el.classList.add("kpi-item--longtext");
4940
4943
  }
4941
- el.innerHTML = `<span>${label}</span><strong class="${cls}">${value}</strong>`;
4944
+ const safeLabel = escapeHtml(String(label || ""));
4945
+ const safeValue = isHtml ? String(value || "") : escapeHtml(String(value || ""));
4946
+ if (isBenefitsRow) {
4947
+ el.innerHTML = `<span>${safeLabel}</span><p class="kpi-longtext-value ${cls}">${safeValue}</p>`;
4948
+ } else {
4949
+ el.innerHTML = `<span>${safeLabel}</span><strong class="${cls}">${safeValue}</strong>`;
4950
+ }
4942
4951
  kpi.appendChild(el);
4943
4952
  });
4944
4953
  }
@@ -88,7 +88,7 @@
88
88
  ]
89
89
  }
90
90
  </script>
91
- <link rel="stylesheet" href="styles.css?v=2.4.7" />
91
+ <link rel="stylesheet" href="styles.css?v=2.4.8" />
92
92
  </head>
93
93
  <body>
94
94
  <div class="wrap">
@@ -630,7 +630,7 @@
630
630
  <script src="supabase.min.js"></script>
631
631
  <script src="fabric.min.js"></script>
632
632
  <script src="html2pdf.bundle.min.js"></script>
633
- <script src="app.js?v=2.4.7"></script>
633
+ <script src="app.js?v=2.4.8"></script>
634
634
  </body>
635
635
  </html>
636
636
 
@@ -1000,7 +1000,7 @@
1000
1000
  linear-gradient(180deg, #fafffe, #f2f8f7);
1001
1001
  padding: 14px;
1002
1002
  display: grid;
1003
- grid-template-columns: minmax(0, 1fr) minmax(180px, 2fr) minmax(0, 1fr);
1003
+ grid-template-columns: minmax(170px, 0.9fr) minmax(380px, 2.9fr) minmax(170px, 0.9fr);
1004
1004
  gap: 10px;
1005
1005
  align-items: center;
1006
1006
  box-shadow: 0 10px 18px rgba(27, 141, 127, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.65);
@@ -1039,7 +1039,9 @@
1039
1039
  min-height: 74px;
1040
1040
  display: grid;
1041
1041
  align-content: center;
1042
+ justify-items: center;
1042
1043
  gap: 4px;
1044
+ text-align: center;
1043
1045
  box-shadow: 0 2px 6px rgba(27, 141, 127, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.7);
1044
1046
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
1045
1047
  position: relative;
@@ -1081,7 +1083,7 @@
1081
1083
 
1082
1084
  .mortgage-split-side-right {
1083
1085
  box-shadow: 0 2px 6px rgba(27, 141, 127, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.7), inset -3px 0 0 #d89a35;
1084
- text-align: right;
1086
+ text-align: center;
1085
1087
  background: linear-gradient(135deg, #fef9f1 0%, #fdf5e8 100%);
1086
1088
  }
1087
1089
 
@@ -1097,6 +1099,7 @@
1097
1099
  overflow-wrap: anywhere;
1098
1100
  letter-spacing: 0.2px;
1099
1101
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
1102
+ text-align: center;
1100
1103
  }
1101
1104
 
1102
1105
  .mortgage-split-amount {
@@ -1109,6 +1112,7 @@
1109
1112
  -webkit-text-fill-color: transparent;
1110
1113
  background-clip: text;
1111
1114
  filter: drop-shadow(0 1px 2px rgba(27, 141, 127, 0.2));
1115
+ text-align: center;
1112
1116
  }
1113
1117
 
1114
1118
  .mortgage-split-side-right .mortgage-split-amount {
@@ -1120,7 +1124,7 @@
1120
1124
 
1121
1125
  .mortgage-split-range-wrap {
1122
1126
  position: relative;
1123
- padding: 20px 0 8px;
1127
+ padding: 30px 0 8px;
1124
1128
  --split-left: 50%;
1125
1129
  }
1126
1130
 
@@ -1231,7 +1235,7 @@
1231
1235
 
1232
1236
  .mortgage-split-center {
1233
1237
  position: absolute;
1234
- top: 2px;
1238
+ top: -14px;
1235
1239
  left: var(--split-left);
1236
1240
  transform: translateX(-50%);
1237
1241
  font-size: 0.92rem;
@@ -1246,6 +1250,8 @@
1246
1250
  transition: all 0.2s ease;
1247
1251
  letter-spacing: 0.2px;
1248
1252
  animation: split-center-breathe 2.6s ease-in-out infinite;
1253
+ z-index: 3;
1254
+ pointer-events: none;
1249
1255
  }
1250
1256
 
1251
1257
  @keyframes first-home-aurora {
@@ -2552,19 +2558,33 @@
2552
2558
  }
2553
2559
 
2554
2560
  .kpi-item--longtext {
2561
+ flex-direction: column;
2555
2562
  align-items: flex-start;
2563
+ gap: 5px;
2556
2564
  }
2557
2565
 
2558
- .kpi-item--longtext strong {
2566
+ .kpi-item--longtext span {
2567
+ width: 100%;
2568
+ flex: none;
2569
+ }
2570
+
2571
+ .kpi-longtext-value {
2572
+ margin: 0;
2573
+ width: 100%;
2559
2574
  white-space: normal;
2560
2575
  text-align: left;
2561
- font-size: 0.88rem;
2562
- line-height: 1.32;
2576
+ font-size: 0.95rem;
2577
+ font-weight: 700;
2578
+ line-height: 1.42;
2563
2579
  overflow-wrap: anywhere;
2564
2580
  word-break: break-word;
2565
- flex: 1;
2581
+ color: #9a5a00;
2566
2582
  }
2567
2583
 
2584
+ .kpi-longtext-value.ok { color: #0c6c52; }
2585
+ .kpi-longtext-value.warn { color: #9a5a00; }
2586
+ .kpi-longtext-value.bad { color: #b53c2f; }
2587
+
2568
2588
  .spieg-details {
2569
2589
  border: 1px solid #bed9d4;
2570
2590
  border-radius: 12px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mantenimento-app",
3
- "version": "2.4.7",
3
+ "version": "2.4.8",
4
4
  "description": "Frontend + backend architecture for the mantenimento calculator",
5
5
  "type": "commonjs",
6
6
  "main": "backend/calculate-model.js",